[
  {
    "path": ".clang-format",
    "content": "---\nBasedOnStyle: LLVM\n\nIndentWidth: 4\n\n# 访问说明符(public、private等)的偏移\nAccessModifierOffset: -4\n\n# 允许短的块放在同一行(Always 总是将短块合并成一行，Empty 只合并空块)\nAllowShortBlocksOnASingleLine: Empty\n\n# 允许短的函数放在同一行: None, InlineOnly(定义在类中), Empty(空函数), Inline(定义在类中，空函数), All\nAllowShortFunctionsOnASingleLine: Empty\n\nAllowShortLambdasOnASingleLine: Empty\n\n# 总是在template声明后换行\nAlwaysBreakTemplateDeclarations: true\n\n# 禁用include重排序\nSortIncludes: false\n---\nLanguage: Cpp\n# Force pointers to the type for C++.\nDerivePointerAlignment: false\nPointerAlignment: Right\nColumnLimit: 120\n---\nLanguage: Proto\n# Don't format .proto files.\nDisableFormat: true"
  },
  {
    "path": ".github/workflows/cmake-single-platform.yml",
    "content": "# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.\n# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml\nname: Build On Windows\n\non:\n  push:\n    branches: [\"master\", \"dev\"]\n  pull_request:\n    branches: [\"master\"]\n  # 当创建标签时也触发此工作流\n  create:\n\nenv:\n  # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)\n  BUILD_TYPE: Release\n\njobs:\n  build-and-test:\n    # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.\n    # You can convert this to a matrix build if you need cross-platform coverage.\n    # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix\n    runs-on: windows-latest\n\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Setup anew (or from cache) vcpkg (and does not build any package)\n        uses:\n          lukka/run-vcpkg@v11 # Always specify the specific _version_ of the\n          # action you need, `v11` in this case to stay up\n          # to date with fixes on the v11 branch.\n        with:\n          doNotCache: false\n\n      - name: Configure CMake\n        # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.\n        # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type\n        run: cmake --preset=default -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}\n\n      - name: Build\n        # Build your program with the given configuration\n        run: |\n          cmake --build --preset=default --config ${{env.BUILD_TYPE}} --target SmartCharsetConverter\n          cmake --build --preset=default --config ${{env.BUILD_TYPE}} --target CoreUnitTest\n\n      - name: Test\n        # Execute tests defined by the CMake configuration.\n        # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail\n        run: ctest --preset=default -C ${{env.BUILD_TYPE}}\n\n      - name: Prepare to Release\n        # 只有在创建标签时才执行发布操作\n        if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags/')\n        run: |\n          cd ${{github.workspace}}/scripts\n          python extract_change_log.py --tag=${{github.ref_name}}\n          cd ${{github.workspace}}/build/src/SmartCharsetConverter/Release\n          mv SmartCharsetConverter.exe 'SmartCharsetConverter ${{github.ref_name}}.exe'\n          Compress-Archive -Path 'SmartCharsetConverter ${{github.ref_name}}.exe' -DestinationPath 'SmartCharsetConverter ${{github.ref_name}}.zip'\n\n      - name: Release\n        # 只有在创建标签时才执行发布操作\n        if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags/')\n        uses: softprops/action-gh-release@v2\n        with:\n          name: SmartCharsetConverter ${{github.ref_name}}\n          fail_on_unmatched_files: true\n          draft: true\n          body_path: ./build/CHANGELOG.txt\n          files: |\n            ./build/src/SmartCharsetConverter/Release/SmartCharsetConverter ${{github.ref_name}}.zip\n"
  },
  {
    "path": ".gitignore",
    "content": ".idea/\n.vscode/\noutput/\nbuild/\nvcpkg_installed/\n*.aps\n"
  },
  {
    "path": "CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.11)\n\n# C++17\nset(CMAKE_CXX_STANDARD 17)\n\nproject(SmartCharsetConverter)\n\n# 添加unicode宏\nadd_definitions(-DUNICODE -D_UNICODE)\n\nadd_compile_options(\"$<$<CXX_COMPILER_ID:MSVC>:/utf-8>\")\nadd_compile_options(-WX)\n\nif(MSVC)\n    add_compile_options(/MP)\n\n    set(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} /MT\")\n    set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} /MT\")\n\n    set(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE} /MT\")\n    set(CMAKE_CXX_FLAGS_RELEASE \"${CMAKE_CXX_FLAGS_RELEASE} /MT\")\n\n    set(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG} /MTd\")\n    set(CMAKE_CXX_FLAGS_DEBUG \"${CMAKE_CXX_FLAGS_DEBUG} /MTd\")\nendif()\n\n# =============================================\nadd_subdirectory(third_party)\nadd_subdirectory(src)\n\nenable_testing()\nadd_subdirectory(tests)\n"
  },
  {
    "path": "CMakePresets.json",
    "content": "{\n\t\"version\": 8,\n\t\"configurePresets\": [\n\t\t{\n\t\t\t\"name\": \"default\",\n\t\t\t\"binaryDir\": \"${sourceDir}/build\",\n\t\t\t\"cacheVariables\": {\n\t\t\t\t\"VCPKG_TARGET_TRIPLET\": \"x64-windows-static\",\n\t\t\t\t\"CMAKE_TOOLCHAIN_FILE\": \"$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake\"\n\t\t\t}\n\t\t}\n\t],\n\t\"buildPresets\": [\n\t\t{\n\t\t\t\"name\": \"default\",\n\t\t\t\"configurePreset\": \"default\"\n\t\t}\n\t],\n\t\"testPresets\": [\n\t\t{\n\t\t\t\"name\": \"default\",\n\t\t\t\"configurePreset\": \"default\",\n\t\t\t\"output\": {\n\t\t\t\t\"outputOnFailure\": true\n\t\t\t},\n\t\t\t\"execution\": {\n\t\t\t\t\"noTestsAction\": \"error\",\n\t\t\t\t\"stopOnFailure\": true\n\t\t\t}\n\t\t}\n\t]\n}"
  },
  {
    "path": "README-en.md",
    "content": "# SmartCharsetConverter\n\n![workflow](https://github.com/tomwillow/SmartCharsetConverter/actions/workflows/cmake-single-platform.yml/badge.svg)\n\n[English](README-en.md) / [Chinese](README.md)\n\nThis program is used to automatically detect the encoding of files and convert its encoding to UTF-8/UTF-8 BOM/GB18030 etc.\n\nFunction:\n\n- Batch conversion to UTF-8/UTF-8 BOM/GB18030, etc.\n- Convert line breaks to CRLF/LF/CR\n- Check whether characters are lost to ensure that the conversion process is reversible\n- Support command line (use $ ./SmartCharsetConverter --help for details)\n- Multi-language support (click the \"hammer\" button in the bottom right corner to switch languages)\n- Support Vietnamese charset(VNI/VPS/VISCII/TCVN3)（Currently unable to detect these charset. please use the \"No File Filter\" mode）\n\nSupported Platform:\n\n- Win10 x64\n- Win7 x64 (haven’t tried it yet)\n\n![img](snapshot/v0.8-english.png)\n\n# Download\n\n[https://github.com/tomwillow/SmartCharsetConverter/releases](https://github.com/tomwillow/SmartCharsetConverter/releases)\n\n# Special Advantage\n\nCharset detection is a well-known and difficult problem.\n\nTherefore, most of the charset convert programs are GBK->UTF-8, GBK->BIG5. In this case, you must know what encoding your text is in advance, otherwise it will be garbled. Moreover, text that has been converted once will be garbled if it is converted again.\n\nAfter comparing many charset detection libraries, I selected the modified version of uchardet used by Notepad3. This modified version of uchardet has been carefully tuned by the author of Notepad3, and its accuracy is higher than the original uchardet! I also used the charset detection function provided by the icu library, and combines the comprehensive judgment of uchardet+icu to give the detection result!\n\nAlthough it cannot be said that the character set detection is 100% correct, the accuracy rate is also very high! You will know exactly how high it is when you try it.\n\nPrecisely because the biggest problem of character set detection is solved, all the problems of the \"traditional transcoding program\" mentioned above do not exist in this program! It doesn’t matter what character set you originally used, just say what you want!\n\n# Version\n\nv0.1 Implements basic functions: can detect charset and convert\n\nv0.2 Add windows-1252 support. Add the option of \"No Filter Files\" and \"Smart File Detection\".\n\nv0.3 \"Add Folder\" can now remember the last selected path. The list box now supports dragging in files and folders.\n\nv0.4 Fix the bug \"Reason: ucnv error. code=15\". Added ISO-8859-1 support.\n\nv0.41 Fix the bug where only BOM text recognition is wrong. Now empty text will not report an error.\n\nv0.5 Now you can cancel midway when dragging a large number of files to the list box. Now you can click the Cancel button during the conversion.\n\nv0.51 Add multiple supported charset: Big5, SHIFT-JIS, etc.\n\nv0.6 Check if characters will be lost when converting.\n\nv0.61 Select \"No File Filter\" mode to forcely join files. Right-click items in the list box can select Original Encoding.\n\nv0.62 Support dragging files/folders to the program icon.\n\nv0.7 Support command line. Use $ ./SmartCharsetConverter --help to view the command line parameters.\n\nv0.71 Fix the bug that the command line not work.\n\nv0.72 solves the problem of getting stuck when adding large files (only the first 100KB of the file is detected).\nThe extension filter mode now supports more patterns (supports separation by `*.` `.` `space` `|`). Fixed other issues with extension filtering mode.\n\nv0.8 Rearrange the interface (thanks to [Carlos Sánchez](https://github.com/c-sanchez)).\nAdd configuration file, and changing settings will trigger the saving of configuration file.\nSupport multiple languages (built-in Simplified Chinese and English).\nAdd multi-language selection(to click \"hammer\" button - Language).\n\nv0.81 Add Spanish language pack support (thanks to [Carlos Sánchez](https://github.com/c-sanchez)).\n\nv0.82 Check if characters will be lost when specifying encoding manually.\n\nv0.9 Support multiple Vietnamese charset converting: VNI/VPS/VISICII/TCVN3\n\nv0.9.1 bugfix: fixed the error of \"ucnv error. code=11\" due to invalid trucated string piece.\n\nv0.9.2 Support Win7 x64 OS. Compiles into a single exe file.\n\nv0.9.3 [Issue 14]Change the Chinese character \"未知\" to \"Unknown\" when the charset is not detected.\nFix the issue where error characters during charset detection in \"no filtering\" mode cause an \"UCNV error,\" preventing files from being added.\n\n# Build\n\n1. Confirm the compilation environment: win10+ x64, Visual Studio 2019+, cmake.\n2. Install vcpkg and set correct environment variable VCPKG_ROOT.\n3. Execute config_on_win.bat to generate .sln.\n4. Open ./build/SmartCharsetConverter.sln.\n\n# Add language pack\n\n> Language packs only affect the interface of the program and have nothing to do with the functions of the program.\n\nIf you want to add a new language pack to this program, you can follow these steps:\n\n1. Find the xxx.json files under src/Resource/lang_embed.\n2. Copy the xxx.json file and modify its content. The new json file can be rename arbitrarily, because the program does not depend on the file name of the language file.\n\n> The xxx.json file must be UTF-8 encoding.\n\n3. Modify the `langId` field: Download the pdf from [[MS-LCID]: Windows Language Code Identifier (LCID) Reference](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f?redirectedfrom=MSDN), find the section `2.2 LCID Structure - Language ID (2 bytes)`, and find the Language ID corresponding to the target language. `For example: 0x409 corresponds to en-US, 0x804 corresponds to zh-CN. `Then convert hexadecimal to decimal and fill in the `langId` field. `For example, 0x409 is filled in with 1033, and 0x804 is filled with 2052`.\n   This Language ID is related to the user's operating system. If filled in correctly, the corresponding language file will be automatically loaded according to the operating system settings when the program starts (the prerequisite is that the language has not been set in the configuration file. If the language has been set in, the `language` field at the configuration file is preferred).\n4. Place your xxx.json language file in the `lang` directory of the directory where SmartCharsetConverter.exe is located (if it does not exist, create a new). The program will automatically check and load it when it starts.\n\n> Note: There are some language packages built into the program (located in `src/Resource/lang_embed`). If the `language` field of the language package in the lang directory is the same as one built-in language package, the external language package json file will be preferred.\n\nNow you can launch the program and see the results!\n\n> If you want to make your language pack built into the program, you can submit a pull request or contact the author (tomwillow@qq.com) to make it built-in.\n\n# TODO\n\n- Check the character set again before conversion to avoid conversion errors after the user changes the character set after loading.\n- Add \"Convert to xxx encoding\" to the right-click menu to enable manual converting of single/multiple files.\n- Add a refresh button.\n- Add maximize/minimize buttons, and flexibly control the size of ListView while resizing.\n- Add the main menu bar to display menu items such as \"Settings\", \"About\".\n- Replace the error MessageBox to a custom Dialog for displaying the complete error information and allow copy operation.\n\n# Reference\n\n[ICU](https://icu.unicode.org/)\n\n[WTL](https://sourceforge.net/projects/wtl)\n\n[uchardet](https://github.com/rizonesoft/Notepad3/tree/master/src/uchardet)\n\n# Thanks\n\nThanks to [Carlos Sánchez](https://github.com/c-sanchez) for providing the interface design and Spanish language pack.\n\n# E-mail\n\ntomwillow@qq.com\n\n# WeChat Group\n\nIf you have any questions or suggestions, please feel free to add the author on WeChat `tomwillow`. Note: \"SmartCharsetConverter\" is introduced into the group according to the guidelines.\n\nIf you think this project is good, please give it a star!\n"
  },
  {
    "path": "README.md",
    "content": "# 智能编码集转换器\n\n![workflow](https://github.com/tomwillow/SmartCharsetConverter/actions/workflows/cmake-single-platform.yml/badge.svg)\n\n[English](README-en.md) / [Chinese](README.md)\n\n本程序用于自动识别文件夹下所有文本文件，自动识别原编码（不必担心反复转码出错了），批量转换到 UTF-8 等字符集。\n\n功能：\n\n- 批量转 UTF-8/UTF-8 BOM/GB18030 等\n- 批量转 CRLF/LF/CR 换行符\n- 转换时会检查是否丢失字符，确保转换过程可逆\n- 支持命令行（使用 $ ./SmartCharsetConverter --help 查看）\n- 多语言支持（点击右下角“锤子”按钮切换语言）\n- 支持越南语字符集（VNI/VPS/VISCII/TCVN3）和其他字符集互转（目前还不能自动探测这几个字符集，请使用“不过滤”模式）\n\n运行要求：\n\n- Win10 x64\n- Win7 x64（理论上可以，没尝试）\n\n![img](snapshot/v0.8-chinese.png \"截图\")\n\n# 下载\n\n[https://github.com/tomwillow/SmartCharsetConverter/releases](https://github.com/tomwillow/SmartCharsetConverter/releases)\n\n# 特别优点\n\n字符集探测是著名的老大难问题，就是说，怎样在不知道字符编码的情况下，探测出文本是什么编码，什么字符集。这个问题很难。\n\n所以，你看到的绝大多数转字符集的程序，都是 GBK->UTF-8，GBK->BIG5，这种，必须要你提前知道你的文本是什么编码，否则就会乱码。而且，转过一次的文本，再转一次，也会乱码。\n\n我在对比了诸多字符集探测库之后，选定了 Notepad3 使用的魔改版 uchardet，这个魔改版 uchardet 经过 Notepad3 作者精心调教，精度比原版 uchardet 更高！并且又使用了 icu 库提供的字符集探测功能，结合 uchardet+icu 两者综合判断给出探测结果！\n\n虽然不能说做到百分百地把字符集探测正确，但正确率也是非常高的！具体多高你试试就知道了。\n\n也正因为解决了字符集探测这个最大的问题，所以上面提到的这些“传统转码程序”的问题，在本程序中通通都不存在！不用管你原来是什么字符集，你只说你要什么就行啦！\n\n# 版本记录\n\nv0.1 实现基本功能：可以探测字符集，转换字符集\n\nv0.2 增加 windows-1252 支持。文件现在可以选择“不过滤”和“智能识别”。\n\nv0.3 “添加文件夹”现在可以记住上一次选的路径了。现在列表框支持拖入文件和文件夹了。\n\nv0.4 修复“原因: ucnv 出错。code=15”的 bug。增加 ISO-8859-1 支持。\n\nv0.41 修复只有 BOM 的文本识别出错的 bug。现在空文本不会报错了。\n\nv0.5 现在拖动大量文件到列表框时可以中途取消了。现在转换中途可以点取消按钮了。\n\nv0.51 增加多个支持的字符集：Big5, SHIFT-JIS 等。\n\nv0.6 现在转换时会检查是否会丢失字符。\n\nv0.61 现在选择“不过滤”模式可以强行加入文件。并且，在列表框里右键-指定原编码 可以手动指定字符集。\n\nv0.62 现在支持拖拽文件/文件夹到程序图标上了。\n\nv0.7 支持命令行。使用 $ ./SmartCharsetConverter --help 查看命令行参数。\n\nv0.71 修复命令行用不了的 bug。\n\nv0.72 解决添加大文件会卡死的问题（只探测文件前 100KB）。\n后缀过滤模式现在支持更多的模式了（支持以 `*.` `.` `空格` `|`分隔）。修复后缀过滤模式的其他问题。\n\nv0.8 重新编排界面(感谢[Carlos Sánchez](https://github.com/c-sanchez))。\n增加配置文件，现在界面改动会保留在配置文件中了。\n支持多语言（内置简体中文和英文）。增加多语言选择。\n\nv0.81 增加西班牙语支持(感谢[Carlos Sánchez](https://github.com/c-sanchez))。\n\nv0.82 现在手动指定字符集会检查是否丢失字符。\n\nv0.9 支持多个越南语字符集的转换：VNI/VPS/VISICII/TCVN3\n\nv0.9.1 bugfix: 修复由于截取字符片段导致的\"ucnv error. code=11\"出错。\n\nv0.9.2 现在可以支持Win7 x64系统了。现在程序编译出来只有一个单exe文件了。\n\nv0.9.3 [Issue 14]未探测到字符集时显示的中文字符“未知”改成“Unknown”。\n解决“不过滤”模式下，探测字符集报错“UCNV出错”导致无法添加文件的问题。\n\n# 构建方法\n\n1. 确认编译环境：win10+ x64, Visual Studio 2019+, cmake。\n2. 安装 vcpkg，正确设置 VCPKG_ROOT 环境变量。\n3. 执行 config_on_win.bat 生成.sln。\n4. 打开 ./build/SmartCharsetConverter.sln。\n\n# 添加语言包\n\n> 语言包只影响程序的界面，和程序的功能无关。\n\n如果您想为本程序添加新的语言包，可以遵循以下步骤：\n\n1. 在 src/Resource/lang_embed 下找到 xxx.json 文件。\n2. 复制 xxx.json 文件并修改内容。文件名可以随意取，程序并不依赖语言文件的文件名。\n\n> xxx.json 文件必须是 utf-8 编码。\n\n3. 修改内容时注意 langId 字段，从[[MS-LCID]: Windows Language Code Identifier (LCID) Reference](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f?redirectedfrom=MSDN)处下载 pdf，翻阅至 `2.2  LCID Structure - Language ID (2 bytes)`一节，找到目标语言对应的 Language ID。`例如：0x409对应于en-US，0x804对应于zh-CN。`然后把 16 进制转换为 10 进制填入 langId 字段。`例如0x409则填入1033，0x804则填入2052`。\n   这个 Language ID 和操作系统设置有关，正确填写的话，程序启动时会根据操作系统设置自动加载对应的语言文件（前提条件是没有在程序中设置过语言，如果在程序中设置过语言，那么以设置的为准）。\n\n> 如果你不知道 langId 应该填什么，那么可以填 0。\n\n4. 把你的 xxx.json 语言文件放置在 SmartCharsetConverter.exe 所在目录的 lang 目录(如果没有则新建一个)下，程序启动时会自动检查并加载。\n\n> 注意：程序中内置了一些语言包（位于 `src/Resource/lang_embed`)，如果 lang 目录下的语言包的 language 字段和内置的某个语言包一样，那么程序在启动时将以 lang 目录下的语言包文件为准。\n\n现在你可以启动程序查看效果了！\n\n> 如果想要让程序内置你的语言包，可以提 pull requests 或者联系作者(tomwillow@qq.com)来给你内置。\n\n# TODO\n\n- 转换前再次检查一次字符集，已免出现加载后用户更改了字符集后转换出错的情况。\n- 右键菜单加入“转换到 xxx 编码”，以实现单个/多个文件手动转码。\n- 增加一个刷新按钮。\n- 添加最大化/最小化按钮，程序缩放时弹性控制 ListView 的大小。\n- 添加菜单栏以显示“设置”“关于”等菜单项。\n- 报错的 MessageBox 修改为自定义的 Dialog，以显示完整的报错信息，并且允许从中复制内容。\n\n# Reference\n\n[ICU](https://icu.unicode.org/)\n\n[WTL](https://sourceforge.net/projects/wtl)\n\n[uchardet](https://github.com/rizonesoft/Notepad3/tree/master/src/uchardet)\n\n# 致谢\n\n感谢[Carlos Sánchez](https://github.com/c-sanchez)提供的界面设计和西班牙语语言包。\n\n# E-mail\n\ntomwillow@qq.com\n\n# 微信交流群\n\n如果您在使用中有疑问，或者有意见建议，欢迎加作者微信 tomwillow。备注“智能编码集转换器”按照指引进群。\n\n如果您觉得此项目不错，请赏颗星吧！\n"
  },
  {
    "path": "config_on_win.bat",
    "content": "cmake --preset=default\npause"
  },
  {
    "path": "sample/expect_pass/[EUC-JP]readme.txt",
    "content": "School DaysΥե˴ޤޤƤư衦ʤwmv˥ݡȤץ\n\nưĶ\nMicrosoft .NET Framework Version 1.1ɬפǤ\n󥽡륢ץꥱǤ(ʹӤǤĤäΤǡ)\n\n\nSchool DaysΥե˴ޤޤƤư衦ʤꤵ줿ե\nǥ쥯ȥwmvեǥݡȤޤ\nϤե̾wmvإåˤեɣĤǺޤ\nư衦ʤϤ줾̡wmvեˤʤäƤͤǤ\nåץǡФƤ٥ݡȤľפȻפޤ\nưǧϡֽץ v1.05AפǹԤäƤޤ\n\nˡ\nsd_exp.exe [*.gpk]\n\n㡧\nsd_exp SCENE.GPK.010\n\n"
  },
  {
    "path": "sample/expect_pass/[gb18030]你还戴着这副眼镜.txt",
    "content": "\n---------------------------------------------\n鼮֮TXT\nַhttp://www.skyyi.cn/index.php\n[Ϊ]\n---------------------------------------------\nѣڿС˵ͬʱעⲻҪ۹ȣ\n\n\n       \n\n\n\n\n\n\n, һǴ¸绪ġ\n\n\n\nһдŸ, ǰ, ڷɻд, ˵, ϣһԶ¸绪, ̫౯ˡ\n\n\n\nһ˾ꡣ\n\n\n\nڹʶ, ǸŻˡ ˶ܺ, չһ,˵:ҵһܺõˡ˵:ǸΪʲô?\n˵仰ʱ, ΢Ц, , ֻ±ܾ\n\n\n\nûоܾ\n\n\n\n֪߲ûһŮ, ȻһͷԽȥ\n\n\n\nһ, ȥ, , :ûŮ?\n\n\n\nײ\n\n\n\n֧, ǲҪټ, ȥ߰ɡȻ˵\n\n\n\nһ֧, ᲻뿪\n\n\n\nѡߡ 쿪ʼ, ʥ, Ϧ, ˽, ˵, 򶼱µضȹ\n\n\n\nΪһ, ֻռ, ? ÿڶ, ˵Ҫ, ʼջǻصߡʼǲ뿪ǸʮŮѵġ\n\n\n\nͺˡ˵\n\n\n\nûܵ, 㲻Ҫ˵ʡ\n\n\n\nŮʼ֪Ĵ, 绰, ˵:ǲ뿪ҵġ\n\n\n\nеഺ> \nһ, ᵽԿ, ʹ໻ġ\n\n\n\nһ˽, ˵:һ, һҪ, ԺҲ㡣\n\n\n\nӦˡ\n\n\n\n˽, ڼֱʮʱûг֡˺ܶܶ,绰̨, :㲻ټҡ\n\n\n\nʮӺ, ҴҸ, ݺݵһ, ۾ѵ, һˡ\n\n˵:Ҳܸʲô, Ҳ뵢㡣\n\n\n\nڶ, ۾һµ۾, ȥһơ\n\n\n\nûٳ֪֡, ˶ϵʱ\n\n\n\nѹȥ, ¸绪̽Ҫõѡ\n\n\n\nһ֮, ص, ¿ʼ\n\n\n\nŬع, ϣ֪\n\n\n\nһ, ڽһǰһ۾\n\n\n\nҼĸһ?\n\n\n\nͷ\n\n\n\nû뵽Ȼ͵۾, ΨһĶ\n\n\n\n, ˵, ˡ\n\n\n\nҲ, ޸¸绪ĺѵĸ硣\n\n\n\nȥʥ, ¸绪,  Ծɴ͵Ǹ۾\n\n\n\n㻹⸱۾?\n\n\n\nͷ\n\n\n\nΪʲôȥ? Ҹ, ڲô۾˵\n\n\n\nû˽, Ͳܴ۾΢Ц˵\n\n\n\nò˵\n\n\n\nˡظ\n\n\n\nҽˡȻػش\n\n\n\nŶӦһ, ײ\n\n\n\n˵:ഺ--ҪԵȴ, ѵĵȴ, ʱ䲥Ū\n\n\n---------------------------------------------\n鼮֮TXT\nַhttp://www.skyyi.cn/index.php\n[Ϊ]\n---------------------------------------------\nѣڿС˵ͬʱעⲻҪ۹ȣ\n"
  },
  {
    "path": "sample/expect_pass/[utf-8].txt",
    "content": "Språk: Norsk\nΓλώσσα: Ελληνικά\nЯзык: Русский\n언어 : 한국어\n言語: 日本語\nLangage : Français\n"
  },
  {
    "path": "sample/not_pass_yet/[GB18030]DialogAnimation.h",
    "content": "#pragma once\n#include <vector>\n#include <Windows.h>\n#include \"..\\Common\\String.h\"\n\nclass TElement;\nnamespace DialogAnimation\n{\n\tenum enumListBoxItemType{ D, V, A };\n\tString GetTypeName(enumListBoxItemType type);\n\n\tenum enumListBoxItemValueType{ X, Y, PHI };\n\tString GetUnitName(enumListBoxItemType type, enumListBoxItemValueType value_type);\n\n\tstruct TListBoxItem\n\t{\n\t\tint id;\n\t\tint index_of_point;\n\t\tenumListBoxItemType type;//P,V,A\n\t\tenumListBoxItemValueType value_type;//X,Y,PHI\n\t\tString s;//Ŀ\n\t\tString sUnit;\n\t\tstd::vector<double> data;\n\t\tTElement *pElement;\n\t};\n\n\tINT_PTR CALLBACK DlgAnimationProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\n\n}"
  },
  {
    "path": "sample/not_pass_yet/[GB18030]LogRecord.h",
    "content": "#pragma once\n\n#include <TimeStamp.h>\n#include <tstring.h>\n\n#include <mutex>\n#include <sstream>\n\nclass LogRecord {\npublic:\n    static void SetLogFileName(std::tstring filename);\n    static void AddBuffer(std::tstring content);\n\n    void flush();\n\nprivate:\n    static std::tstring filename;\n    static std::mutex m;\n\n    static std::tstring buf;\n};\n\nextern LogRecord logRecord;\n\n// ָ\ninline LogRecord &operator<<(LogRecord &logRecord, void *p) {\n    logRecord.AddBuffer(std::to_tstring((INT_PTR)p));\n    return logRecord;\n}\n\n// \nLogRecord &operator<<(LogRecord &logRecord, HWND hWnd);\n\n// ʱ\nLogRecord &operator<<(LogRecord &logRecord, TimeStamp timeStamp);\n\n// ַ\ninline LogRecord &operator<<(LogRecord &logRecord, const wchar_t s[]) {\n    logRecord.AddBuffer(to_tstring(s));\n    return logRecord;\n}\n\n// ansiַ\ninline LogRecord &operator<<(LogRecord &logRecord, const char s[]) {\n    logRecord.AddBuffer(to_tstring(s));\n    return logRecord;\n}\n\ninline LogRecord &operator<<(LogRecord &logRecord, const std::tstring &s) {\n    logRecord.AddBuffer(s);\n    return logRecord;\n}\n\ntemplate <typename T> inline LogRecord &operator<<(LogRecord &logRecord, const T &t) {\n    logRecord.AddBuffer(std::to_tstring(t));\n    return logRecord;\n}\n\ninline LogRecord &operator<<(LogRecord &logRecord, LogRecord &(*func)(LogRecord &)) { return func(logRecord); }\n\ninline LogRecord &endl(LogRecord &logRecord) {\n    logRecord.AddBuffer(TEXT(\"\\r\\n\"));\n    logRecord.flush();\n    return logRecord;\n}\n\n#define LOG logRecord"
  },
  {
    "path": "sample/not_pass_yet/[GB18030]TBarTool_GB.cpp",
    "content": "#pragma once\n#include \"TBarTool.h\"\n\n#include \"..\\Control\\TTreeViewContent.h\"\n#include \"..\\Element\\TShape.h\"\n#include \"..\\Element\\TBar.h\"\n#include \"..\\Element\\TConstraintCoincide.h\"\n\nTBarTool::TBarTool()\n{\n\tmyElementType = ELEMENT_BAR;\n\n\tsType = TEXT(\"\");\n\tbCanBuildCoincide = true;\n}\n\n\nTBarTool::~TBarTool()\n{\n}\n\nTElement * TBarTool::AddIntoShape(TRealLine &RealLine)\n{\n\tRealLine.vecDpt.push_back(RealLine.GetRelativePointByIndex(0));\n\tRealLine.vecDpt.push_back(RealLine.GetRelativePointByIndex(1));\n\n\tRealLine.eType = myElementType;\n\treturn pShape->AddElement((TBar *)&RealLine);\n}\n\nvoid TBarTool::AddIntoTreeViewContent(TElement *Element, int id)\n{\n\tif (Element->eType == ELEMENT_REALLINE)\n\t{\n\t\tElement->eType = myElementType;\n\t\tTBar Bar;\n\t\tBar= *(TRealLine*)Element;\n\t\tpTreeViewContent->AddItem(&Bar, pShape->iNextId);\n\t}\n\telse\n\t\tTLineTool::AddIntoTreeViewContent(Element, id);\n}\n\n//void TBarTool::AddCoincide(TConstraintCoincide *pCoincide, int id, TConfiguration *pConfig)\n//{\n//\tAddIntoTreeViewContent(pCoincide, id);\n//\tpShape->AddElement(pCoincide);\n//}"
  },
  {
    "path": "sample/not_pass_yet/[GB18030]TDraw.h",
    "content": "#pragma once\n#include <vector>\n#include <Windows.h>\n\n#pragma  comment(lib, \"gdiplus.lib\")\n#include <comdef.h>\n#include <gdiplus.h>\n\n#include \"..\\Common\\DPOINT.h\"\n\nclass TConfiguration;\nclass TElement;\nclass TBar;\nclass TLine;\nclass TRealLine;\nclass TSlideway;\nclass TSlider;\nclass TFramePoint;\nclass TConstraintCoincide;\nclass TConstraintColinear;\nclass TPolylineBar;\nclass TDraw\n{\nprivate:\n\tULONG_PTR gdiplusStartupToken;\n\tstruct HSB\n\t{\n\t\tfloat H, S, B;\n\t};\npublic:\n\tTDraw();\n\t~TDraw();\n\tvoid TDraw::DrawLogo(HINSTANCE hInst, UINT nID, LPCTSTR sType, HDC hdc, const RECT &ClientRect);\n\tBOOL TDraw::ImageFromIDResource(HINSTANCE hInst, UINT nID, LPCTSTR sType, Gdiplus::Image *&pImg);\n\n\tstatic void TDraw::MoveByDelta(POINT apt[], int apt_num, long dx, long dy);\n\tstatic void TDraw::MoveByDelta(std::vector<POINT> &vecpt, long dx, long dy);\n\tstatic void TDraw::Move(POINT apt[], int apt_num, double angle, double dist);\n\tstatic void TDraw::MoveRect(RECT &rc, int left, int top);\n\tstatic void TDraw::Rotate(POINT apt[], int apt_num, int Ox, int Oy, double theta);\n\tstatic void TDraw::MirrorX(POINT apt[], int apt_num, int Oy);\n\tstatic void TDraw::GetBoundingBox(POINT apt[], int apt_num, RECT *rect, bool YPlusIsUP);\n\tstatic void TDraw::GetBoundingBox(std::vector<DPOINT> &vecdpt, RECT *rect);\n\tstatic void TDraw::GetBoundingBox(std::vector<POINT> &vecpt, RECT *rect);\n\tstatic double TDraw::Distance(DPOINT pt1, DPOINT pt2);\n\tstatic double TDraw::Distance(POINT pt1, POINT pt2);\n\tstatic double TDraw::DistanceScreen(const DPOINT &dpt1, const DPOINT &dpt2, const TConfiguration *pConfig);\n\tstatic DPOINT TDraw::GetAbsolute(const DPOINT &dpt, const DPOINT &Org, double angle);\n\tstatic void TDraw::GetAbsoluteReal(std::vector<DPOINT> &vecdptResult, const std::vector<DPOINT> &vecdpt, const DPOINT &Org, double angle);\n\tstatic void TDraw::GetAbsoluteScreen(std::vector<POINT> &vecptResult, const std::vector<DPOINT> &vecdpt, const DPOINT &Org, double angle, const TConfiguration *pConfig);\n\tstatic DPOINT TDraw::GetRelative(const DPOINT &dpt, const DPOINT &Org, double angle);\n\tstatic bool TDraw::GetIntersection(const POINT &ptL1Begin, const POINT &ptL1End, const POINT &ptL2Begin, const  POINT &ptL2End, POINT &ptIntersection);\n\tstatic bool TDraw::GetIntersection(const DPOINT &dptL1Begin, const DPOINT &dptL1End, const DPOINT &dptL2Begin, const  DPOINT &dptL2End, DPOINT &dptIntersection);\n\n\tstatic RECT TDraw::GetMarginRect(RECT rect, int margin);\n\tstatic void TDraw::SetMarginRect(RECT *rect, int margin);\n\tstatic RECT TDraw::GetMarginCtrlRect(const RECT &rect, int margin);\n\tstatic RECT TDraw::GetMarginRect(RECT rect, LONG margin_left, LONG margin_top, LONG margin_right, LONG margin_bottom);\n\tstatic POINT TDraw::GetCenter(const POINT &pt1,const POINT &pt2);\n\tstatic DPOINT TDraw::GetCenter(const DPOINT &pt1,const DPOINT &pt2);\n\tstatic bool TDraw::ShowConstraintCoincideDotLine(TElement *element, const TConfiguration *pConfig);\n\tstatic bool TDraw::ShowConstraintColinearDotLine(const TConstraintColinear *pColinear, POINT &ptCenter1, POINT &ptCenter2, const TConfiguration *pConfig);\n\n\tstatic COLORREF TDraw::GetBrighterColor(COLORREF cr);\n\n\tstatic void TDraw::DrawFramePoint(HDC hdc, TFramePoint *pFramePoint,const TConfiguration *Config);\n\tstatic void TDraw::DrawBar(HDC hdc, TBar *Bar,const TConfiguration *Config);\n\tstatic void TDraw::DrawBarSimple(HDC hdc, TBar *Bar, const TConfiguration *Config);\n\tstatic void TDraw::DrawBarTranslucent(HDC hdc, TBar *pBar, const TConfiguration *pConfig);\n\tstatic void TDraw::DrawBarTranslucent(HDC hdc, POINT &ptBegin, POINT &ptEnd, double angle, unsigned char alpha, LOGPEN logpen, const TConfiguration *pConfig);\n\tstatic void TDraw::DrawPolylineBar(HDC hdc, TPolylineBar *PolylineBar, const TConfiguration *pConfig);\n\tstatic void TDraw::DrawPolylineBarSimple(HDC hdc, TPolylineBar *pPolylineBar, const TConfiguration *pConfig);\n\tstatic void TDraw::DrawPolylineBarTranslucent(HDC hdc, TPolylineBar *pPolylineBar, const TConfiguration *pConfig);\n\tstatic void TDraw::DrawRealLine(HDC hdc, TRealLine &RealLine, const TConfiguration *Config);\n\tstatic void TDraw::DrawRealLine(HDC hdc, DPOINT ptBegin, DPOINT ptEnd, LOGPEN logpen,const TConfiguration *Config);\n\tstatic void TDraw::DrawSlideway(HDC hdc, TSlideway *Slidewayconst, const TConfiguration *Config);\n\tstatic void TDraw::DrawSlidewaySingle(HDC hdc, const LOGPEN &logpen, const DPOINT &dptBegin, const DPOINT &dptEnd, double dAngle, int ShadowQuadrant, int ShadowLength, const TConfiguration *pConfig);\n\tstatic void TDraw::DrawSlider(HDC hdc, TSlider *pSlider, const TConfiguration *pConfig);\n\tstatic void TDraw::DrawConstraintCoincide(HDC hdc, DPOINT dpt0, DPOINT dpt1,const LOGPEN &logpen, const TConfiguration *pConfig);\n\tstatic void TDraw::DrawConstraintCoincide(HDC hdc, TConstraintCoincide *pCoincide, const TConfiguration *pConfig);\n\tstatic void TDraw::DrawConstraintColinear_inner(HDC hdc, const POINT &pt1, const POINT &pt2,LOGPEN logpen, const TConfiguration *pConfig);\n\tstatic void TDraw::DrawConstraintColinear(HDC hdc, TConstraintColinear *pColinear, const TConfiguration *pConfig);\n\n\tstatic void TDraw::DrawArc(HDC hdc, const POINT &pt, int r, const POINT &pt1, const POINT &pt2, bool bAlwaysDrawAngleBetween);\n\tstatic void TDraw::DrawPie(HDC hdc, const POINT &pt, int r, const POINT &pt1, const POINT &pt2,bool bAlwaysDrawAngleBetween);\n\tstatic void TDraw::DrawPie(HDC hdc, const POINT &pt, int r, const POINT &pt1, const POINT &pt2, const LOGPEN &logpen, const COLORREF &crColor);\n\tstatic void TDraw::DrawRect(HDC hdc, const RECT &rect,const LOGPEN &logpen);\n\tstatic void TDraw::DrawRect(HDC hdc, const RECT &rect,const LOGPEN &logpen, COLORREF crBk);\n\tstatic void TDraw::DrawPickSquare(HDC hdc, POINT pt);\n\tstatic void TDraw::DrawLine(HDC hdc, POINT ptFirstPos, POINT ptSecondPos);\n\tstatic void TDraw::DrawLine(HDC hdc, POINT ptFirstPos, POINT ptSecondPos, const LOGPEN &logpen);\n\tstatic void TDraw::DrawLine(HDC hdc, TLine Line);\n\tstatic void TDraw::DrawPolyline(HDC hdc, const POINT *apt, int count, LOGPEN &logpen);\n\n\tstatic void TDraw::DrawCircle(HDC hdc, POINT pt, int r);\n\tstatic void TDraw::DrawCircle(HDC hdc, POINT pt, int r, LOGPEN logpen);\n\tstatic void TDraw::DrawCross(HDC hdc, POINT pt, int size, LOGPEN Style);\n\tstatic void TDraw::DrawArrow(HDC hdc, POINT ptBegin, POINT ptEnd, int length, int width);\n\tstatic void TDraw::DrawAxes(HDC hdc, int Ox, int Oy, COLORREF crColor);\n\n\tstatic void TDraw::CalcBarLineEndpoint(POINT &ptBegin, POINT &ptEnd, int distBegin, int distEnd);\n\tstatic void TDraw::CalcPolylineBarRgn(HRGN &hRgn, const std::vector<DPOINT> &vecDpt, DPOINT dpt, double angle, const TConfiguration *pConfig);\n\tstatic void TDraw::CalcPolylineBarRgn(HRGN &hRgn, TPolylineBar *pPolylineBar, const TConfiguration *pConfig);\n\tstatic void TDraw::CalcBarRectCoor(POINT ptResult[4], const POINT &ptBegin, const POINT &ptEnd, double angle, int width);\n\tstatic void TDraw::CalcSliderRectCoor(POINT aptResult[4], const POINT &pt, double angle, const TConfiguration *pConfig);\n\tstatic void TDraw::FillRect(HDC hdc, RECT *rect, COLORREF crColor);\n\tstatic void TDraw::DrawGrid(HDC hdc, const RECT &rect, POINT ptOrg, COLORREF crGridBig, COLORREF crGridSmall, const TConfiguration *pConfig);\n\n\tstatic void TDraw::DrawTips(HDC hdc, POINT &ptMouse,const RECT &rcLimited, const TCHAR text[], TConfiguration *pConfig);\n\tstatic void TDraw::DrawAdjustedText(HDC hdc, POINT &ptMouse, const RECT &rcLimited, const TCHAR text[], LONG dist, bool DrawBorder, TConfiguration *pConfig);\n\tstatic POINT TDraw::GetSystemFontSize(HDC hdc, const TCHAR text[]);\n\tstatic void TDraw::DrawSystemFontText(HDC hdc, const TCHAR text[], RECT &rect, COLORREF color, UINT format);\n\tstatic void TDraw::DrawSystemFontTextVertical(HDC hdc, const TCHAR text[], RECT &rect, COLORREF color, UINT format);\n\tstatic void TDraw::DrawTextAdvance(HDC hdc,const TCHAR text[], RECT *rect, long FontSize, int FontWeight, unsigned long color, const TCHAR FontName[], UINT format,int cEscapement=0,int cOrientation=0);\n\n\tstatic void TDraw::DrawSection(HDC hdc, int x1, int y1, int x2, int y2, int d, double angleDEG);\n\tstatic void TDraw::DrawSection(HDC hdc, POINT apt[], int apt_num, int d, double angleDEG);\n\tstatic double TDraw::GetAngleFromPointReal(DPOINT ptO, DPOINT pt);\n\tstatic double TDraw::GetAngleBetweenPointReal(const DPOINT &pt1, const DPOINT &ptO, const DPOINT &pt2);\n\tstatic double TDraw::GetAngleBetweenPointScreen(const POINT &pt1, const POINT &ptO, const POINT &pt2);\n\tstatic double TDraw::GetAngleFromPointScreen(POINT pt0, POINT pt);\n\tstatic void TDraw::ClientPosToScreen(HWND hWnd, POINT *pt);\n\tstatic int TDraw::DPOINT2POINTXLEN(double x1, double x2, double x_min, double x_max, const RECT &rect);\n\tstatic int TDraw::DPOINT2POINTYLEN(double y1, double y2, double y_min, double y_max, const RECT &rect);\n\tstatic int TDraw::DPOINT2POINTX(double x, double x_min, double x_max, const RECT &rect);\n\tstatic int TDraw::DPOINT2POINTY(double y, double y_min, double y_max, const RECT &rect);\n\tstatic POINT TDraw::DPOINT2POINT(DPOINT &dpt, double x_min, double x_max, double y_min, double y_max,const RECT &rect);\n\tstatic DPOINT TDraw::POINT2DPOINT(POINT &pt, double x_min, double x_max, double y_min, double y_max,const RECT &rect);\n\tstatic void TDraw::MakeRect(RECT &rcResult, double x_min, double x_max, double y_min, double y_max, const TConfiguration *pConfig);\n\tstatic void TDraw::GetCenter(POINT &ptResult, const RECT &rect);\n\n\t//ʰȡϵ\n\tstatic bool TDraw::PointInPolylineBar(POINT ptPos, TPolylineBar *pPolylineBar,const TConfiguration *pConfig);\n\tstatic bool TDraw::PointInFramePoint(POINT ptFramePoint, POINT pt, const TConfiguration *pConfig);\n\tstatic bool TDraw::PointInRgn(POINT *ptRgn, int RgnCount, POINT pt);\n\tstatic bool TDraw::PointInRealLine(POINT ptPos, TRealLine *pRealLine,const TConfiguration *pConfig);\n\tstatic bool TDraw::PointInSlider(POINT ptPos, TSlider *pSlider, const TConfiguration *pConfig);\n\tstatic bool TDraw::PointInRealLine(const POINT &ptPos,const POINT &ptBegin,const POINT &ptEnd, const TConfiguration *pConfig);\n\tstatic bool TDraw::PointInRealLine(const POINT &ptPos,const DPOINT &dptBegin,const DPOINT &dptEnd, const TConfiguration *pConfig);\n\tstatic int TDraw::PointInRealLineOrExtension(const DPOINT &dptPos, DPOINT &dptIntersection, const DPOINT dptBegin, const DPOINT dptEnd,const TConfiguration *pConfig);\n\tstatic bool TDraw::PickConstraintColinear(POINT ptPos, TConstraintColinear *pColinear,const TConfiguration *pConfig);\n\tstatic bool TDraw::PickConstraintCoincide(POINT ptPos, TElement *element,const TConfiguration *pConfig);\n\n\tstatic TDraw::HSB RGB2HSB(int rgbR, int rgbG, int rgbB);\n\tstatic COLORREF TDraw::HSB2RGB(float h, float s, float v);\n\n\t//\n\tstatic bool TDraw::CaptureWindowToFile(HWND hWnd, TCHAR szFileName[]);\n\tstatic void TDraw::GetGifPaletteByHwnd(HWND hWnd, unsigned char *&palette, int &color_num, int &depth);\n\tstatic unsigned char TDraw::GetIndexFromPalette(const UINT32 &data, const unsigned char *palette, const int &color_num);\n\tstatic void TDraw::Create8TreePal(HWND hWnd, unsigned char *&palette, int &color_num, int &depth);\n\n\tstatic unsigned char TDraw::GetIndexFromPalette(const UINT32 &data, const std::vector<unsigned int> &palette, const int &color_num);\n\tstatic unsigned char TDraw::GetIndexFromPalette_Slow(const UINT32 &data, const std::vector<unsigned int> &palette, const int &color_num);\n};\n\n"
  },
  {
    "path": "sample/not_pass_yet/[GB18030]TMenu.cpp",
    "content": "#include \"TMenu.h\"\n\nvoid PopupMenu(HWND hParent, int menu_id) {\n    //Ҽ˵\n    HMENU hMenu = LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(menu_id));\n    hMenu = GetSubMenu(hMenu, 0);\n    POINT pt;\n    GetCursorPos(&pt);\n\n    TrackPopupMenu(hMenu, TPM_RIGHTBUTTON, pt.x, pt.y, 0, hParent, NULL);\n}"
  },
  {
    "path": "sample/not_pass_yet/[GB18030]一个字.txt",
    "content": "\n"
  },
  {
    "path": "sample/not_pass_yet/[GB18030]澤野弘之.lrc",
    "content": "[ti:THE ANSWER]\n[ar:Ұ֮ ( Ҥ椭)]\n[al:86DƥåD ꥸʥ&#12539;ɥȥå]\n[by:]\n[offset:0]\n[00:00.00]THE ANSWER - Ұ֮ ( Ҥ椭)/Laco\n[00:25.18]Lyrics byBenjamin/mpi\n[00:31.11]Composed byHiroyuki Sawano\n[00:36.85]We've spent our lives in shadows\n[00:41.45]Good people\n[00:43.26]Off the radar\n[00:45.90]I see you now\n[00:48.06]As the pressure builds\n[00:50.06]The doubts I had looking back\n[00:53.79]I didn't understand your reason\n[00:56.06]You always asked me every season\n[00:58.28]When all the madness is all over\n[01:00.10]What is your answer\n[01:03.41]Where do we go\n[01:04.46]Don't need to know\n[01:05.73]Just keep flow\n[01:06.73]Can we go back\n[01:07.94]I'll cover you\n[01:08.93]You cover me\n[01:10.10]Pick it up\n[01:10.85]Keep your head\n[01:11.80]Pick it up\n[01:12.38]You talk to me\n[01:13.35]I talk to you\n[01:14.59]It's gon' be our Xanadu\n[01:16.88]Where do we go\n[01:18.04]Is it with you\n[01:19.47]Your answer\n[01:21.50]Yes they lied to us\n[01:23.61]But I don't wanna nap in the dirt\n[01:25.99]Yes they lied to us\n[01:27.91]We still got a lot of work\n[01:30.39]First we must beat the legion\n[01:32.66]Then show the world we're human\n[01:34.85]First we must beat the legion\n[01:36.81]Show the world we like it rough\n[01:41.98]So many dreams were shattered\n[01:46.39]You saved us when it mattered\n[01:50.88]We still can't see how this story ends\n[01:55.08]When shall you tell me your name\n[01:58.83]I didn't understand your reason\n[02:01.15]You always asked me every season\n[02:03.33]When all the madness is all over\n[02:05.27]What is your answer\n[02:08.52]Where do we go\n[02:09.49]Don't need to know\n[02:10.73]Just keep flow\n[02:11.72]Can we go back\n[02:12.96]I'll cover you\n[02:13.89]You cover me\n[02:15.15]Pick it up\n[02:15.93]Keep your head\n[02:16.86]Pick it up\n[02:17.47]You talk to me\n[02:18.53]I talk to you\n[02:19.54]It's gon' be our Xanadu\n[02:21.93]Where do we go\n[02:23.08]Is it with you\n[02:24.50]Your answer\n[02:26.48]Yes they lied to us\n[02:28.73]But I don't wanna nap in the dirt\n[02:31.05]Yes they lied to us\n[02:32.88]We still got a lot of work\n[02:35.45]First we must beat the legion\n[02:37.66]Then show the world we're human\n[02:39.89]First we must beat the legion\n[02:41.85]Show the world we like it rough\n[02:46.91]Enough\n[02:53.77]We're tough enough\n[02:55.69]Enough\n[03:02.65]Your answer\n[03:04.59]Where do we go\n[03:05.62]Don't need to know\n[03:06.71]Just keep flow\n[03:07.81]Can we go back\n[03:09.04]I'll cover you\n[03:10.06]You cover me\n[03:11.26]Pick it up\n[03:12.06]Keep your head\n[03:12.91]Pick it up\n[03:13.60]You talk to me\n[03:14.59]I talk to you\n[03:15.72]It's gon' be our Xanadu\n[03:18.03]Where do we go\n[03:19.14]Is it with you\n[03:20.60]Your answer\n[03:22.63]Yes they lied to us\n[03:24.75]But I don't wanna nap in the dirt\n[03:27.11]Yes they lied to us\n[03:28.99]We still got a lot of work\n[03:31.56]First we must beat the legion\n[03:33.73]Then show the world we're human\n[03:36.02]First we must beat the legion\n[03:37.93]Show the world we like it rough"
  },
  {
    "path": "sample/not_pass_yet/[GB18030]编译说明.txt",
    "content": "sdjfksdjfskjdfsd\nsdfjsdkfjsdkjf\ndskfsjdfklsjfd\n"
  },
  {
    "path": "sample/not_pass_yet/[GB18030]连杆.cpp",
    "content": ""
  },
  {
    "path": "sample/not_pass_yet/[UTF-8]CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.11)\n\n# C++17\nset(CMAKE_CXX_STANDARD 17)\n\nproject(SmartCharsetConverter)\n\n# 添加unicode宏\nadd_definitions(-DUNICODE -D_UNICODE)\n\nadd_compile_options(\"$<$<CXX_COMPILER_ID:MSVC>:/source-charset:utf-8>\")\n\nif(MSVC)\n    set(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} /MT\")\n    set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} /MT\")\n\n    set(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE} /MT\")\n    set(CMAKE_CXX_FLAGS_RELEASE \"${CMAKE_CXX_FLAGS_RELEASE} /MT\")\n\n    set(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG} /MTd\")\n    set(CMAKE_CXX_FLAGS_DEBUG \"${CMAKE_CXX_FLAGS_DEBUG} /MTd\")\nendif()\n\n# =============================================\nadd_subdirectory(third_party)\nadd_subdirectory(src)"
  },
  {
    "path": "sample/not_pass_yet/[UTF-8]TBarTool.cpp",
    "content": "#pragma once\n#include \"TBarTool.h\"\n\n#include \"..\\Control\\TTreeViewContent.h\"\n#include \"..\\Element\\TShape.h\"\n#include \"..\\Element\\TBar.h\"\n#include \"..\\Element\\TConstraintCoincide.h\"\n\nTBarTool::TBarTool()\n{\n\tmyElementType = ELEMENT_BAR;\n\n\tsType = TEXT(\"连杆\");\n\tbCanBuildCoincide = true;\n}\n\n\nTBarTool::~TBarTool()\n{\n}\n\nTElement * TBarTool::AddIntoShape(TRealLine &RealLine)\n{\n\tRealLine.vecDpt.push_back(RealLine.GetRelativePointByIndex(0));\n\tRealLine.vecDpt.push_back(RealLine.GetRelativePointByIndex(1));\n\n\tRealLine.eType = myElementType;\n\treturn pShape->AddElement((TBar *)&RealLine);\n}\n\nvoid TBarTool::AddIntoTreeViewContent(TElement *Element, int id)\n{\n\tif (Element->eType == ELEMENT_REALLINE)\n\t{\n\t\tElement->eType = myElementType;\n\t\tTBar Bar;\n\t\tBar= *(TRealLine*)Element;\n\t\tpTreeViewContent->AddItem(&Bar, pShape->iNextId);\n\t}\n\telse\n\t\tTLineTool::AddIntoTreeViewContent(Element, id);\n}\n\n//void TBarTool::AddCoincide(TConstraintCoincide *pCoincide, int id, TConfiguration *pConfig)\n//{\n//\tAddIntoTreeViewContent(pCoincide, id);\n//\tpShape->AddElement(pCoincide);\n//}"
  },
  {
    "path": "sample/not_pass_yet/[UTF-8]虚拟机环境.txt",
    "content": "换源\n\ngcc: build-essential\ncmake 3.16+\n\nvscode: c++ go cmake ssh-remote shell\n"
  },
  {
    "path": "sample/tcvn/demo1-tcvn.txt",
    "content": "msg_id\tpre_msg_id\tnext_msg_id\tmsg_info\n1\t0\t0\tNhm Gio Ch:  <enter/>    Cho cc h! Ti h Giang Bit Hc, ngng m i danh ca cc h t lu, nghe ni gio ch  git cht c ma ng Phng Bt Bi, trn chnh li Nht Nguyt Thn Gio, a t Gio Ch  thay tri hnh o dit tr i ma u, ti h tin rng Nhm gio ch v cng ci th, nht nh s a Nht Nguyt Thn Gio danh chn giang h.<enter/>   Ti h c bit trong Thng Thin Huyn Cnh c mt Vn Kim Trng, ngc ng chu bu rt nhiu, bit c Nhm gio ch  tng vo trong , v vy thnh mi gio ch cng ti h xng vo Vn Kim Trng, nu chng ta ng tm hip lc nht nh s m c Phong n, n lc  ngc ng chu bu gio ch c ly, ti h nht nh tun theo sp xp ca gio ch. Nu c gio ch tng tr  l nim vinh hnh ca ti h. <enter/>    mong sm c din kin gio ch! <enter/><enter/>                          <color=green>Giang Bit Hc<color>\n2\t0\t0\t<color=green>cc v ng o giang h: <color><enter/>    ti h Giang Bit Hc, gn y c mt vic v cng au u, mt mnh ti h th khng th lm c, v vy thnh mi v lm cao th gip sc, nu cc v nguyn cng ti h hon thnh vic ln, Giang Bit Hc cm kch v cng.  cc v c th n Phng Tng Ph tm ti h cng bn lun k sch. a t ng o giang h!   <enter/>                       <color=green> Giang Bit Hc <color>\n"
  },
  {
    "path": "sample/tcvn/demo1-utf8.txt",
    "content": "msg_id\tpre_msg_id\tnext_msg_id\tmsg_info\n1\t0\t0\tNhậm Giáo Chủ:  <enter/>    Chào các hạ! Tại hạ Giang Biệt Hạc, ngượng mộ đại danh của các hạ từ lâu, nghe nói giáo chủ đã giết chết ác ma Đông Phương Bất Bại, trấn chỉnh lại Nhật Nguyệt Thần Giáo, đa tạ Giáo Chủ  thay trời hành đạo diệt trừ đại ma đầu, tại hạ tin rằng Nhậm giáo chủ võ công cái thế, nhất định sẽ đưa Nhật Nguyệt Thần Giáo danh chấn giang hồ.<enter/>   Tại hạ được biết trong Thông Thiên Huyễn Cảnh có một Vạn Kiếm Trũng, ngọc ngà châu báu rất nhiều, biết được Nhậm giáo chủ đã từng vào trong đó, vì vậy thỉnh mời giáo chủ cùng tại hạ xông vào Vạn Kiếm Trũng, nếu chúng ta đồng tâm hiệp lực nhất định sẽ mở được Phong ấn, đến lúc đó ngọc ngà châu báu giáo chủ cứ lấy, tại hạ nhất định tuân theo sắp xếp của giáo chủ. Nếu được giáo chủ tương trợ đó là niềm vinh hạnh của tại hạ. <enter/>    mong sớm được diện kiến giáo chủ! <enter/><enter/>                          <color=green>Giang Biệt Hạc<color>\n2\t0\t0\t<color=green>các vị đồng đạo giang hồ: <color><enter/>    tại hạ Giang Biệt Hạc, gần đây có một việc vô cùng đau đầu, một mình tại hạ thì không thể làm được, vì vậy thỉnh mời võ lâm cao thủ giúp sức, nếu các vị nguyện cùng tại hạ hoàn thành việc lớn, Giang Biệt Hạc cảm kích vô cùng.  các vị có thể đến Phượng Tường Phủ tìm tại hạ cùng bàn luận kế sách. Đa tạ đồng đạo giang hồ!   <enter/>                       <color=green> Giang Biệt Hạc <color>\n"
  },
  {
    "path": "sample/uchardet_test_samples/ar/iso-8859-6.txt",
    "content": "-1256            \n       .    \n.        8859-6.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ar/utf-8.txt",
    "content": "ويندوز-1256 هي صفحة كود تستخدم في كتابة اللغة العربية عموماً وبعض اللغات الشبيهة\nالتي تستخدم نفس الأبجدية مثل الأردو والفارسية والكوردية. وذلك تحت نظام مايكروسوفت\nويندوز. صفحة الكود هذه لا تتوافق مع الأيزو 8859-6.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ar/windows-1256.txt",
    "content": "-1256            \n       .    \n.        8859-6.\n"
  },
  {
    "path": "sample/uchardet_test_samples/be/iso-8859-5.txt",
    "content": " (Marmota), ,   .\n\n   15  ,    .  -- .           ,      .           ,    ,        .   ,   ,   . \n"
  },
  {
    "path": "sample/uchardet_test_samples/be/utf-8.txt",
    "content": "Суркі (Marmota), сысуны, прадстаўнікі атраду грызуноў.\n\nНа Зямлі існуе 15 відаў суркоў, якія маюць агульнага продка. Прарадзіма суркоў — Амерыка. У той час як большасць жывёл рухалася з Еўразіі ў Амерыку, суркі з Амерыкі перабіраліся ў Азію. Розныя віды абасобіліся ў розных геаграфічных зонах і адрозніваюцца асаблівасцямі паводзін, але захавалі знешнюю падобнасць, неабходнасць упадаць у спячку і жыццё ў калоніях. Усе суркі траваядныя, жывуць у норах, маюць цёплае футра. \n"
  },
  {
    "path": "sample/uchardet_test_samples/be/windows-1251.txt",
    "content": " (Marmota), ,   .\n\n   15  ,    .   .         Ţ糳  ,      .           ,    ,        .   ,   ,   . \n"
  },
  {
    "path": "sample/uchardet_test_samples/bg/iso-8859-5.txt",
    "content": " (Marmota)   -      (Sciuridae),  14 ,     (Spermophilus citellus).\n\n    ,        .\n"
  },
  {
    "path": "sample/uchardet_test_samples/bg/utf-8.txt",
    "content": "Мармотите (Marmota) са бозайници - род гризачи от семейство катерицови (Sciuridae), включващ 14 вида, включващи групата на лалугерите (Spermophilus citellus).\n\nЗа разлика от родствената катерица, мармотът и лалугерът водят наземен начин на живот.\n"
  },
  {
    "path": "sample/uchardet_test_samples/bg/windows-1251.txt",
    "content": "Windows-1251  8- ()  ,     ,    ,   .\n\nWindows-1251  KOI8-R (    KOI8-U)   -  ISO 8859-5,     .        ,     .\n"
  },
  {
    "path": "sample/uchardet_test_samples/ca/iso-8859-1.txt",
    "content": "Les marmotes (Marmota) sn un gnere de mamfers de la famlia dels escirids.[1] Viuen a l'alta muntanya a l'hemisferi nord. Sn rosegadors de mida mitjana, una mica ms grans que els gats domstics, de potes curtes i cos ample que els proporcionen un aspecte fora rabassut.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ca/utf-8.txt",
    "content": "Les marmotes (Marmota) són un gènere de mamífers de la família dels esciúrids.[1] Viuen a l'alta muntanya a l'hemisferi nord. Són rosegadors de mida mitjana, una mica més grans que els gats domèstics, de potes curtes i cos ample que els proporcionen un aspecte força rabassut.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ca/windows-1252.txt",
    "content": "Les especials relacions econmiques es fonamenten en la llibertat de trnsit de mercaderies, treballadors i capitals, aix com en l'establiment d'una moneda nica, l'euro () per tots els estats membres (la denominada Eurozona).\n"
  },
  {
    "path": "sample/uchardet_test_samples/cs/ibm852.txt",
    "content": "Led堟ek n (Alcedo atthis) je prmrn 16,5 cm velk ptk z eledi\nled堟kovitch (Alcedinidae). Je velmi vrazn zbarven s oranovou spodinou a\nmodrm hbetem, kdly a temenem. Vraznm znakem je tak jeho npadn dlouh\nzapiatl zobk. Pro sv krsn zbarven je nazvn Ltajc drahokam.\n"
  },
  {
    "path": "sample/uchardet_test_samples/cs/iso-8859-2.txt",
    "content": "Ledek n (Alcedo atthis) je prmrn 16,5 cm velk ptk z eledi\nledkovitch (Alcedinidae). Je velmi vrazn zbarven s oranovou spodinou a\nmodrm hbetem, kdly a temenem. Vraznm znakem je tak jeho npadn dlouh\nzapiatl zobk. Pro sv krsn zbarven je nazvn Ltajc drahokam.\n"
  },
  {
    "path": "sample/uchardet_test_samples/cs/mac-centraleurope.txt",
    "content": "Ledˇek ޒn (Alcedo atthis) je prmrn 16,5 cm velk ptk z eledi\nledˇkovitch (Alcedinidae). Je velmi vrazn zbarven s oranovou spodinou a\nmodrm hbetem, kޒdly a temenem. Vraznm znakem je tak jeho npadn dlouh\nzapiatl zobk. Pro sv krsn zbarven je nazvn Ltajc drahokam.\n"
  },
  {
    "path": "sample/uchardet_test_samples/cs/utf-8.txt",
    "content": "Ledňáček říční (Alcedo atthis) je průměrně 16,5 cm velký pták z čeledi\nledňáčkovitých (Alcedinidae). Je velmi výrazně zbarvený s oranžovou spodinou a\nmodrým hřbetem, křídly a temenem. Výrazným znakem je také jeho nápadně dlouhý\nzašpičatělý zobák. Pro své krásné zbarvení je nazýván Létající drahokam.\n"
  },
  {
    "path": "sample/uchardet_test_samples/cs/windows-1250.txt",
    "content": "Ledek n (Alcedo atthis) je prmrn 16,5 cm velk ptk z eledi\nledkovitch (Alcedinidae). Je velmi vrazn zbarven s oranovou spodinou a\nmodrm hbetem, kdly a temenem. Vraznm znakem je tak jeho npadn dlouh\nzapiatl zobk. Pro sv krsn zbarven je nazvn Ltajc drahokam.\n"
  },
  {
    "path": "sample/uchardet_test_samples/da/ibm865.txt",
    "content": "Jimi Hendrix (1942-1970) var en amerikansk rockguitarist, sanger og sangskriver.\n\nHan begyndte at spille guitar, da han var femten r, og efter at have spillet med blandt andet Little Richard dannede han Jimi Hendrix Experience i slutningen af 1966. Denne gruppe fik snart hits med sange som \"Hey Joe\" og \"Purple Haze\", og med det tredje album, Electric Ladyland fra 1968, fik gruppen sit store gennembrud. Med flere markante optrdener p tidens store festivaler, heriblandt Woodstock, opnede han legendarisk status i rockmusikken, allerede mens han var i live.\n\nHendrix brugte sin elektriske guitar som elektronisk lydkilde og eksperimenterede med feedback og distortion med udgangspunkt i traditionel rock'n'roll og blues. Hans misbrug af alkohol og narkotika frte imidlertid til, at han delagde sig selv, og han dde som blot 27-rig efter indtagelse af sovepiller. \n"
  },
  {
    "path": "sample/uchardet_test_samples/da/iso-8859-1.txt",
    "content": "Dansk er et nord-germansk sprog af den stnordiske (kontinentale) gruppe, der\ntales af ca. seks millioner mennesker. Det er strkt pvirket af plattysk. Dansk\ntales ogs i Sydslesvig (i Flensborg ca. 20 %) samt p Frerne og Grnland [1].\nDansk er tt forbundet med norsk. Fra et sprogvidenskabeligt synspunkt kan den\nfremherskende form af norsk, bokml (og i endnu hjere grad riksml), betragtes\nsom dansk, i hvert fald hvad skriftsproget angr. Bde dansk, norsk og svensk er\nskandinaviske sprog og minder meget om hinanden.\n"
  },
  {
    "path": "sample/uchardet_test_samples/da/iso-8859-15.txt",
    "content": "Eurosymbolet eller eurotegnet () anvendes som valutasymbol for mntenheden\neuro. Symbolsk kombinerer det et E eller et grsk epsilon med de to parallelle\nstreger, man ofte ser i valutasymboler.\n\nDet vides ikke med sikkerhed, hvem eurosymbolet blev designet af. Nogle medier\nhvder, det blev skabt af tidligere designer ved EF Arthur Eisenmenger, mens\nandre pstr, det blev skabt af en lille gruppe ledet af Alain Billiet. Muligvis\ner ingen af disse forklaringer korrekte, da Den Paneuropiske Union udsendte en\n'1 euro'-medalje i 1972, hvorp man kan se et symbol, der i hj grad ligner det\nnuvrende eurosymbol.\n"
  },
  {
    "path": "sample/uchardet_test_samples/da/utf-8.txt",
    "content": "Eurosymbolet eller eurotegnet (€) anvendes som valutasymbol for møntenheden\neuro. Symbolsk kombinerer det et E eller et græsk epsilon med de to parallelle\nstreger, man ofte ser i valutasymboler.\n\nDet vides ikke med sikkerhed, hvem eurosymbolet blev designet af. Nogle medier\nhævder, det blev skabt af tidligere designer ved EF Arthur Eisenmenger, mens\nandre påstår, det blev skabt af en lille gruppe ledet af Alain Billiet. Muligvis\ner ingen af disse forklaringer korrekte, da Den Paneuropæiske Union udsendte en\n'1 euro'-medalje i 1972, hvorpå man kan se et symbol, der i høj grad ligner det\nnuværende eurosymbol.\n"
  },
  {
    "path": "sample/uchardet_test_samples/da/windows-1252.txt",
    "content": "Eurosymbolet eller eurotegnet () anvendes som valutasymbol for mntenheden\neuro. Symbolsk kombinerer det et E eller et grsk epsilon med de to parallelle\nstreger, man ofte ser i valutasymboler.\n\nDet vides ikke med sikkerhed, hvem eurosymbolet blev designet af. Nogle medier\nhvder, det blev skabt af tidligere designer ved EF Arthur Eisenmenger, mens\nandre pstr, det blev skabt af en lille gruppe ledet af Alain Billiet. Muligvis\ner ingen af disse forklaringer korrekte, da Den Paneuropiske Union udsendte en\n'1 euro'-medalje i 1972, hvorp man kan se et symbol, der i hj grad ligner det\nnuvrende eurosymbol.\n"
  },
  {
    "path": "sample/uchardet_test_samples/de/iso-8859-1.txt",
    "content": "ISO 8859-1, genauer ISO/IEC 8859-1, auch bekannt als Latin-1, ist ein von der\nISO zuletzt 1998 aktualisierter Standard fr die Informationstechnik zur\nZeichenkodierung mit acht Bit und der erste Teil der Normenfamilie ISO/IEC 8859.\n\nDie mit sieben Bit kodierbaren Zeichen entsprechen US-ASCII mit fhrendem\nNullbit. Zustzlich zu den 95 darstellbaren ASCII-Zeichen (2016-7E16) kodiert\nISO 8859-1 96 weitere (A016-FF16), also insgesamt 191 von theoretisch mglichen\n256 (= 28). Den Positionen 0016-1F16 und 7F16-9F16 sind in ISO/IEC 8859 und\ndamit ISO/IEC 8859-1 keine Zeichen zugewiesen. Die von der IANA definierte\nBezeichnung ISO-8859-1 (mit Bindestrich) steht fr die Kombination der Zeichen\ndieser Norm mit nicht darstellbaren Steuerzeichen gem ISO/IEC 6429.\n"
  },
  {
    "path": "sample/uchardet_test_samples/de/utf-8.txt",
    "content": "Berlin (Zum Anhören bitte klicken!Abspielen [bɛɐ̯ˈliːn]) ist Hauptstadt und als Land eine parlamentarische Republik und ein teilsouveräner Gliedstaat der Bundesrepublik Deutschland.[14] Die Stadt ist mit rund 3,7 Millionen Einwohnern die bevölkerungsreichste und mit 892 Quadratkilometern die flächengrößte Gemeinde Deutschlands und die einwohnerstärkste Stadt der Europäischen Union.[4] In der Agglomeration Berlin leben knapp 4,7 Millionen Einwohner, in der Metropolregion Berlin/Brandenburg gut sechs Millionen. Der Stadtstaat besteht aus zwölf Berliner Bezirken. Neben den Flüssen Spree und Havel befinden sich im Stadtgebiet kleinere Fließgewässer sowie zahlreiche Seen und Wälder.\n\nIm Jahr 1237 erstmals urkundlich erwähnt, war die Stadt in der Geschichte Berlins Residenz- und Hauptstadt der Mark Brandenburg, des Königreichs Preußen und Deutschlands. Nach dem Ende des Zweiten Weltkriegs unterlag die Stadt 1945 dem Viermächte-Status: Ost-Berlin hatte ab 1949 die Funktion als Hauptstadt der Deutschen Demokratischen Republik, während West-Berlin sich eng an die alte Bundesrepublik Deutschland anschloss. Mit dem Fall der Berliner Mauer 1989 und der deutschen Wiedervereinigung im Jahr 1990 wuchsen die beiden Stadthälften wieder zusammen und Berlin erhielt seine Rolle als gesamtdeutsche Hauptstadt zurück. Seit 1999 ist die Stadt Sitz der Bundesregierung, des Bundespräsidenten, des Bundestages, des Bundesrates sowie der Bundesministerien und zahlreicher Botschaften. \n"
  },
  {
    "path": "sample/uchardet_test_samples/de/windows-1252.txt",
    "content": "ISO 8859-1, genauer ISO/IEC 8859-1, auch bekannt als Latin-1, ist ein von der\nISO zuletzt 1998 aktualisierter Standard fr die Informationstechnik zur\nZeichenkodierung mit acht Bit und der erste Teil der Normenfamilie ISO/IEC 8859.\n\nDie mit sieben Bit kodierbaren Zeichen entsprechen US-ASCII mit fhrendem\nNullbit. Zustzlich zu den 95 darstellbaren ASCII-Zeichen (20167E16) kodiert\nISO 8859-1 96 weitere (A016FF16), also insgesamt 191 von theoretisch mglichen\n256 (= 28). Den Positionen 00161F16 und 7F169F16 sind in ISO/IEC 8859 und\ndamit ISO/IEC 8859-1 keine Zeichen zugewiesen. Die von der IANA definierte\nBezeichnung ISO-8859-1 (mit Bindestrich) steht fr die Kombination der Zeichen\ndieser Norm mit nicht darstellbaren Steuerzeichen gem ISO/IEC 6429.\n"
  },
  {
    "path": "sample/uchardet_test_samples/el/cp737.txt",
    "content": " 櫘 夘 ⤦ ࡫ 磜  ⩩ 回  ⤦ Marmota,  餫     樜 .  ᭦ 回  夘    婫 ᫦  .\n"
  },
  {
    "path": "sample/uchardet_test_samples/el/iso-8859-7.txt",
    "content": "           ISO 8859-7,    ,   8-  ,    ISO 8859.                  .\n\n    1987          ELOT 928,    1986.            2003,    ,      .\n"
  },
  {
    "path": "sample/uchardet_test_samples/el/utf-8.txt",
    "content": "Το UTF-8 (8-bit Unicode Transformation Format) είναι ένα μη-απωλεστικό σχήμα κωδικοποίησης χαρακτήρων μεταβλητού μήκους για το πρότυπο Unicode που δημιουργήθηκε από τους Ken Thompson και Rob Pike. Χρησιμοποιεί ομάδες από byte για να αναπαραστήσει τα κωδικά σημεία του Unicode. Είναι ιδιαίτερα χρήσιμο για μετάδοση δεδομένων σε 8bit συστήματα ηλεκτρονικού ταχυδρομείου.\n\nΣυγκεκριμένα χρησιμοποιεί ένα μέχρι τέσσερα byte ανά χαρακτήρα ανάλογα με το σύμβολο και το κωδικό του σημείο. Για παράδειγμα χρειάζεται μόνο ένα byte του UTF-8 για την κωδικοποίηση των 128 ASCII χαρακτήρες στο διάστημα του Unicode U+0000 μέχρι U+007F.\n"
  },
  {
    "path": "sample/uchardet_test_samples/el/windows-1253.txt",
    "content": "Windows-1253\n\n          Windows-1253.                ( Windows-1253)    \"A2\".             (       ),    ,      .\n\n \n"
  },
  {
    "path": "sample/uchardet_test_samples/en/ascii.txt",
    "content": "This is an ASCII TEST.\nWe still want uchardet to detect it as ASCII, even with the presence of\nan escape character: \u001b\nOr with the HZ encoding escape sequence: ~{\n"
  },
  {
    "path": "sample/uchardet_test_samples/en/utf-8.txt",
    "content": "Europe covers about 10,180,000 km² (3,930,000 sq mi), or 2% of the Earth's surface (6.8% of land area), making it the second smallest continent (using the seven-continent model). Politically, Europe is divided into about fifty sovereign states, of which Russia is the largest and most populous, spanning 39% of the continent and comprising 15% of its population. Europe had a total population of about 746 million (about 10% of the world population) in 2018.[2][3] The European climate is largely affected by warm Atlantic currents that temper winters and summers on much of the continent, even at latitudes along which the climate in Asia and North America is severe. Further from the sea, seasonal differences are more noticeable than close to the coast.\n"
  },
  {
    "path": "sample/uchardet_test_samples/eo/iso-8859-3.txt",
    "content": "Esperanto (origine Lingvo Internacia) estas la plej disvastigita internacia\nplanlingvo.[3] La nomo venas de la kanomo \"Dr-o Esperanto\", sub kiu la juda\nkuracisto Ludoviko Lazaro Zamenhofo en la jaro 1887 publikigis la bazon de la\nlingvo. La unua versio, la rusa, ricevis la cenzuran permeson disvastii en la\n26-a de julio; i tiun daton oni konsideras la naskitago de Esperanto[4][5]. Li\nintencis krei facile lerneblan netralan lingvon, tagan por uzo en la\ninternacia komunikado, tamen ne anstataigi aliajn, naciajn lingvojn.\n"
  },
  {
    "path": "sample/uchardet_test_samples/eo/utf-8.txt",
    "content": "Esperanto, origine la Lingvo Internacia,[4] estas la plej disvastiĝinta internacia planlingvo.[5] En 1887 Esperanton parolis nur manpleno da homoj; Esperanto havis unu el la plej malgrandaj lingvo-komunumoj de la mondo. Ĝi funkciis dekomence kiel lingvo de alternativa komunikado kaj de arta kreipovo[6]. En 2012, la lingvo fariĝis la 64-a tradukebla per Google Translate[7]; En 2016, la lingvo fariĝis tradukebla per Yandex Translate[8]; laŭ 2016, Esperanto aperis en listoj de lingvoj plej lernataj[9] kaj konataj en Hungarujo[10]. La nomo de la lingvo venas de la kaŝnomo “D-ro Esperanto„ sub kiu la juda kuracisto Ludoviko Lazaro Zamenhofo en la jaro 1887 publikigis la bazon de la lingvo. La unua versio, la rusa, ricevis la cenzuran permeson disvastiĝi en la 26-a de julio; ĉi tiun daton oni konsideras la naskiĝtago de Esperanto[11][12]. Li celis kaj sukcesis krei facile lerneblan neŭtralan lingvon, taŭgan por uzo en la internacia komunikado; la celo tamen ne estas anstataŭigi aliajn, naciajn lingvojn.\n"
  },
  {
    "path": "sample/uchardet_test_samples/es/iso-8859-1.txt",
    "content": "El precio medio de la vivienda nueva es de 2212 EUR/m2, segn datos de la Sociedad\nde Tasacin a 31 de diciembre de 2012.156 El precio de la vivienda, sin embargo,\nvara ostensiblemente en funcin de las comunidades autnomas y las capitales de\nprovincia, encontrndose la de mayor valor en Catalua (3146 EUR/m), y en\ncontraposicin las de Extremadura y Murcia (1271 EUR/m)\n"
  },
  {
    "path": "sample/uchardet_test_samples/es/iso-8859-15.txt",
    "content": "El precio medio de la vivienda nueva es de 2212 /m2, segn datos de la Sociedad\nde Tasacin a 31 de diciembre de 2012.156 El precio de la vivienda, sin embargo,\nvara ostensiblemente en funcin de las comunidades autnomas y las capitales de\nprovincia, encontrndose la de mayor valor en Catalua (3146 /m), y en\ncontraposicin las de Extremadura y Murcia (1271 /m)\n"
  },
  {
    "path": "sample/uchardet_test_samples/es/utf-8.txt",
    "content": "El precio medio de la vivienda nueva es de 2212 €/m2, según datos de la Sociedad\nde Tasación a 31 de diciembre de 2012.156 El precio de la vivienda, sin embargo,\nvaría ostensiblemente en función de las comunidades autónomas y las capitales de\nprovincia, encontrándose la de mayor valor en Cataluña (3146 €/m²), y en\ncontraposición las de Extremadura y Murcia (1271 €/m²)\n"
  },
  {
    "path": "sample/uchardet_test_samples/es/windows-1252.txt",
    "content": "El precio medio de la vivienda nueva es de 2212 /m2, segn datos de la Sociedad\nde Tasacin a 31 de diciembre de 2012.156 El precio de la vivienda, sin embargo,\nvara ostensiblemente en funcin de las comunidades autnomas y las capitales de\nprovincia, encontrndose la de mayor valor en Catalua (3146 /m), y en\ncontraposicin las de Extremadura y Murcia (1271 /m)\n"
  },
  {
    "path": "sample/uchardet_test_samples/et/iso-8859-13.txt",
    "content": "Anton Pavlovit Tehhov oli vene nite- ja novellikirjanik ning praktiseeriv arst.\n\nTehhov on eelkige tuntud oma novellide poolest. Tema jutustuste tavaliseks\ntegevuspaigaks olid vene vikeasulad ja need ksitlesid hingeksildust, raisatud\nnne jms. Tuntud on ka tema pshholoogilised nidendid, kus valitseb kurb ja\nlootusetu meeleolu.\n"
  },
  {
    "path": "sample/uchardet_test_samples/et/iso-8859-15.txt",
    "content": "Anton Pavlovit Tehhov oli vene nite- ja novellikirjanik ning praktiseeriv arst.\n\nTehhov on eelkige tuntud oma novellide poolest. Tema jutustuste tavaliseks\ntegevuspaigaks olid vene vikeasulad ja need ksitlesid hingeksildust, raisatud\nnne jms. Tuntud on ka tema pshholoogilised nidendid, kus valitseb kurb ja\nlootusetu meeleolu.\n"
  },
  {
    "path": "sample/uchardet_test_samples/et/iso-8859-4.txt",
    "content": "Anton Pavlovit Tehhov oli vene nite- ja novellikirjanik ning praktiseeriv arst.\n\nTehhov on eelkige tuntud oma novellide poolest. Tema jutustuste tavaliseks\ntegevuspaigaks olid vene vikeasulad ja need ksitlesid hingeksildust, raisatud\nnne jms. Tuntud on ka tema pshholoogilised nidendid, kus valitseb kurb ja\nlootusetu meeleolu.\n"
  },
  {
    "path": "sample/uchardet_test_samples/et/utf-8.txt",
    "content": "Anton Pavlovitš Tšehhov oli vene näite- ja novellikirjanik ning praktiseeriv arst.\n\nTšehhov on eelkõige tuntud oma novellide poolest. Tema jutustuste tavaliseks\ntegevuspaigaks olid vene väikeasulad ja need käsitlesid hingeüksildust, raisatud\nõnne jms. Tuntud on ka tema psühholoogilised näidendid, kus valitseb kurb ja\nlootusetu meeleolu.\n"
  },
  {
    "path": "sample/uchardet_test_samples/et/windows-1252.txt",
    "content": "Anton Pavlovit Tehhov oli vene nite- ja novellikirjanik ning praktiseeriv arst.\n\nTehhov on eelkige tuntud oma novellide poolest. Tema jutustuste tavaliseks\ntegevuspaigaks olid vene vikeasulad ja need ksitlesid hingeksildust, raisatud\nnne jms. Tuntud on ka tema pshholoogilised nidendid, kus valitseb kurb ja\nlootusetu meeleolu.\n"
  },
  {
    "path": "sample/uchardet_test_samples/et/windows-1257.txt",
    "content": "Anton Pavlovit Tehhov oli vene nite- ja novellikirjanik ning praktiseeriv arst.\n\nTehhov on eelkige tuntud oma novellide poolest. Tema jutustuste tavaliseks\ntegevuspaigaks olid vene vikeasulad ja need ksitlesid hingeksildust, raisatud\nnne jms. Tuntud on ka tema pshholoogilised nidendid, kus valitseb kurb ja\nlootusetu meeleolu.\n"
  },
  {
    "path": "sample/uchardet_test_samples/fi/iso-8859-1.txt",
    "content": "Termi science fiction on amerikkalaisen tieteislehtien toimittajan Hugo\nGernsbackin keksim. Suomessa termin tieteiskirjallisuus loi tohtori Eino\nKauppinen 1950-luvun alkupuolella.\nTieteiskirjallisuudelle on laadittu erilaisia mritelmi. Tieteiskirjallisuuden\nrajat eivt ole yksiselitteisen selket. Tieteiskirjallisuus lhenee monia\nkirjallisuudenlajeja, erityisesti kauhu- ja fantasiakirjallisuutta. Nill\nkolmella lajilla onkin yhteiset juuret 1800-lukua edeltvss ei-realistisessa\nkirjallisuudessa.\n"
  },
  {
    "path": "sample/uchardet_test_samples/fi/utf-8.txt",
    "content": "Termi science fiction on amerikkalaisen tieteislehtien toimittajan Hugo\nGernsbackin keksimä. Suomessa termin tieteiskirjallisuus loi tohtori Eino\nKauppinen 1950-luvun alkupuolella.\nTieteiskirjallisuudelle on laadittu erilaisia määritelmiä. Tieteiskirjallisuuden\nrajat eivät ole yksiselitteisen selkeät. Tieteiskirjallisuus lähenee monia\nkirjallisuudenlajeja, erityisesti kauhu- ja fantasiakirjallisuutta. Näillä\nkolmella lajilla onkin yhteiset juuret 1800-lukua edeltävässä ei-realistisessa\nkirjallisuudessa.\n"
  },
  {
    "path": "sample/uchardet_test_samples/fr/iso-8859-1.txt",
    "content": "La norme ISO 8859-1, dont le nom complet est ISO/CEI 8859-1, et qui est souvent appele Latin-1 ou Europe occidentale, forme la premire partie de la norme internationale ISO/CEI 8859, qui est une norme de l'Organisation internationale de normalisation pour le codage des caractres en informatique.\n\nElle dfinit ce qu'elle appelle l'alphabet latin numro 1, qui consiste en 191 caractres de l'alphabet latin, chacun d'entre eux tant cod par un octet (soit 8 bits). ISO 8859-1 reprend le codage des caractres imprimables d'US-ASCII.\n\nDans les pays occidentaux, cette norme tait utilise par de nombreux systmes d'exploitation, dont UNIX, Windows ou AmigaOS. Elle a donn lieu  quelques extensions et adaptations, dont Windows-1252 et ISO 8859-15. La distinction entre ASCII, ISO 8859-1, ISO 8859-15, Windows-1252 et MacRoman est une source de confusion parmi les dveloppeurs de programmes informatiques. Le Multinational Character Set cr par Digital Equipment Corporation pour le terminal informatique VT220 est considr comme  la fois l'anctre de l'ISO 8859-1 et de l'Unicode2. Aujourd'hui, son utilisation tend  dcrotre au profit de l'Unicode.\n"
  },
  {
    "path": "sample/uchardet_test_samples/fr/iso-8859-15.txt",
    "content": "L'uf de volaille est un produit agricole servant d'ingrdient entrant dans la\ncomposition de nombreux plats, dans de nombreuses cultures gastronomiques du\nmonde.\n\nLe plus utilis est l'uf de poule, mais les ufs d'autres oiseaux sont aussi\nconsomms : caille, cane, oie, autruche, etc. Les ufs de poissons, comme le\ncaviar, ou de certains reptiles, comme ceux de l'iguane vert, sont galement\nutiliss dans l'alimentation humaine. Cependant, leur utilisation est trs\ndiffrente de celle des ufs de volaille.\n\nLes ufs utiliss en cuisine ne sont gnralement pas fconds du fait de leur\nprovenance d'levages industriels o les coqs sont absents. Fconds ou non, ils\nsont utiliss  l'tat frais si moins de vingt-huit jours se sont couls aprs\nla ponte, selon les normes administratives franaises. Dans les usages\nculinaires asiatiques, les ufs sont parfois consomms couvs, comme le balut,\nou mis  fermenter pendant plusieurs semaines, comme l'uf de cent ans.\n"
  },
  {
    "path": "sample/uchardet_test_samples/fr/utf-8.txt",
    "content": "UTF-8 (abréviation de l’anglais Universal Character Set Transformation Format -\n8 bits) est un codage de caractères informatiques conçu pour coder l’ensemble\ndes caractères du « répertoire universel de caractères codés », initialement\ndéveloppé par l’ISO dans la norme internationale ISO/CEI 10646, aujourd’hui\ntotalement compatible avec le standard Unicode, en restant compatible avec la\nnorme ASCII limitée à l’anglais de base (et quelques autres langues beaucoup\nmoins fréquentes), mais très largement répandue depuis des décennies.\n\nL’UTF-8 est utilisé par 82,2 % des sites web en décembre 20141. De par sa\nnature, UTF-8 est d’un usage de plus en plus courant sur Internet, et dans les\nsystèmes devant échanger de l'information. Il s’agit également du codage le plus\nutilisé dans les systèmes GNU, Linux et compatibles pour gérer le plus\nsimplement possible des textes et leurs traductions dans tous les systèmes\nd’écritures et tous les alphabets du monde.\n"
  },
  {
    "path": "sample/uchardet_test_samples/fr/windows-1252.txt",
    "content": "Luf de volaille est un produit agricole servant d'ingrdient entrant dans la\ncomposition de nombreux plats, dans de nombreuses cultures gastronomiques du\nmonde.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ga/iso-8859-1.txt",
    "content": "Ag seo tarma seoltireachta a bhaineann le longa adhmaid agus le bid.\n\nN bhodh de cheangal idir ire agus tortha eile ach na longa, agus t ire\nfin ln de lochanna agus d'aibhneacha. Fgann seo go bhfuil an teanga breac le\ntarmaocht seoltireachta agus loingseoireachta agus cuid di tugtha isteach n\nLochlainnis agus n mBarla tr lonnaitheoir n iasacht.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ga/utf-8.txt",
    "content": "Ag seo téarmaí seoltóireachta a bhaineann le longa adhmaid agus le báid.\n\nNí bhíodh de cheangal idir Éire agus tíortha eile ach na longa, agus tá Éire\nféin lán de lochanna agus d’aibhneacha. Fágann seo go bhfuil an teanga breac le\ntéarmaíocht seoltóireachta agus loingseoireachta agus cuid di tugtha isteach ón\nLochlainnis agus ón mBéarla trí lonnaitheoirí ón iasacht.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ga/windows-1252.txt",
    "content": "Ag seo tarma seoltireachta a bhaineann le longa adhmaid agus le bid.\n\nN bhodh de cheangal idir ire agus tortha eile ach na longa, agus t ire\nfin ln de lochanna agus daibhneacha. Fgann seo go bhfuil an teanga breac le\ntarmaocht seoltireachta agus loingseoireachta agus cuid di tugtha isteach n\nLochlainnis agus n mBarla tr lonnaitheoir n iasacht.\n"
  },
  {
    "path": "sample/uchardet_test_samples/he/ibm862.logical.txt",
    "content": "     (: Two Treatises of Government)   -    ' ,    -1689.[1]     ().            \"\".             ,                    .          ,      .\n"
  },
  {
    "path": "sample/uchardet_test_samples/he/ibm862.visual.txt",
    "content": ".      ,          .                    ,             .\"\"            .)(     ]1[.9861-    , \\'    -   )tnemnrevoG fo sesitaerT owT :(     \n"
  },
  {
    "path": "sample/uchardet_test_samples/he/iso-8859-8.txt",
    "content": "  ISO 8859 ,   , :\n 0xA0  0xBF   ,  ,   .\n"
  },
  {
    "path": "sample/uchardet_test_samples/he/utf-8.txt",
    "content": "(ראשי תיבות של 8‎-bit Unicode Transformation Format או 8‎-bit UCS Transformation Format) הוא קידוד תווים באורך משתנה ליוניקוד, שנוצר על ידי רוב פייק וקן תומפסון. ניתן לקודד בו כל תו המצוי בתקן יוניקוד על ידי שימוש באחד עד ארבעה בתים, תלוי בתו. הקידוד ב-UTF-8 מעניק את כל יתרונות השימוש בקידוד ליוניקוד ומוסיף עליהם, בין היתר, גם חיסכון בזיכרון, עמידות בפני איבוד או השחתת בתים ותאימות לאחור ל-ASCII. ה-IETF מעדיף בבירור את UTF-8 ומחייב כל פרוטוקול אינטרנט לתמוך בו, וכן קונסורציום הדואר האלקטרוני, ה-IMC, ממליץ שכל תוכנת דואר אלקטרוני תוכל להציג וליצור דואר באמצעות UTF-8.\n\n\n"
  },
  {
    "path": "sample/uchardet_test_samples/he/windows-1255.txt",
    "content": "   ,   -,      ,           .\n"
  },
  {
    "path": "sample/uchardet_test_samples/hi/utf-8.txt",
    "content": "ग्लेशियर नेशनल पार्क (अंग्रेज़ी: Glacier National Park; उच्चा.: ग्लेशियर नेशनल पार्क) अमेरिकी राष्ट्रीय उद्यान है, जो कि कनाडा-संयुक्त राज्य अमेरिका की सीमा पर स्थित है। उद्यान संयुक्त राज्य के उत्तर-पश्चिमी मोंटाना राज्य में स्थित है और कनाडा की ओर अल्बर्टा और ब्रिटिश कोलम्बिया प्रांतों से सटा हुआ है। उद्यान दस लाख एकड़ (4,000 किमी2) से अधिक क्षेत्र में फैला हुआ है और इसमें दो पर्वत श्रृंखला (रॉकी पर्वत की उप-श्रेणियाँ), 130 से अधिक नामित झीलें, 1,000 से अधिक विभिन्न पौधों की प्रजातियां और सैकड़ों वन्यजीवों की प्रजातियां शामिल हैं। इस विशाल प्राचीन पारिस्थितिकी तंत्र को जो कि 16,000 वर्ग मील (41,000 किमी2) में शामिल संरक्षित भूमि का भाग है, \"क्राउन ऑफ़ द कॉन्टिनेंट इकोसिस्टम\" के रूप में संदर्भित किया गया है।[1]\n\nग्लेशियर नेशनल पार्क में लगभग सभी मूल स्थानीय पादप और जीव-जन्तु प्रजातियां हैं। बड़े स्तनधारी जैसे कि भूरा भालू, मूस, और पहाड़ी बकरियों के साथ-साथ दुर्लभ या लुप्तप्राय प्रजातियां जैसे कि वूल्वरिन और कनाडाई लिनेक्स, उद्यान में निवास करते हैं। यहां से पक्षियों की सैकड़ों प्रजातियां, एक दर्जन से अधिक मछलियों की प्रजातियां और कुछ सरीसृप और उभयचर प्रजातियों को प्रलेखित किया गया है। उद्यान में प्रेरी से टुंड्रा तक कई पारिस्थितिकी तंत्र हैं। उद्यान के दक्षिण-पश्चिम हिस्से में पश्चिमी रेडेकार्डर और हेमलॉक के जंगल पाये जाते हैं। उद्यान के जंगलों में आग लगना आम है। 1964 को छोड़कर उद्यान में हर साल आग लगती है। 1936 में 64 बार आग लगी थी जो कि रिकॉर्ड में सबसे अधिक है।[2][3] 2003 में लगी छह आग ने लगभग 136,000 एकड़ (550 किमी2), उद्यान के 13% से अधिक हिस्से को जला डाला था।[4] \n"
  },
  {
    "path": "sample/uchardet_test_samples/hr/ibm852.txt",
    "content": "Brekinja (lat. Sorbus torminalis) je bjelogorina vrsta drvea iz porodice\nRosaceae.\nPrirodno je rasprostranjena u zapadnoj, srednjoj i junoj Europi, sjevernoj\nAfrici, Krimu, Maloj Aziji, Kavkazu i Transkavkaziji.\n"
  },
  {
    "path": "sample/uchardet_test_samples/hr/iso-8859-13.txt",
    "content": "Brekinja (lat. Sorbus torminalis) je bjelogorina vrsta drvea iz porodice\nRosaceae.\nPrirodno je rasprostranjena u zapadnoj, srednjoj i junoj Europi, sjevernoj\nAfrici, Krimu, Maloj Aziji, Kavkazu i Transkavkaziji.\n"
  },
  {
    "path": "sample/uchardet_test_samples/hr/iso-8859-16.txt",
    "content": "Brekinja (lat. Sorbus torminalis) je bjelogorina vrsta drvea iz porodice\nRosaceae.\nPrirodno je rasprostranjena u zapadnoj, srednjoj i junoj Europi, sjevernoj\nAfrici, Krimu, Maloj Aziji, Kavkazu i Transkavkaziji.\n"
  },
  {
    "path": "sample/uchardet_test_samples/hr/iso-8859-2.txt",
    "content": "Brekinja (lat. Sorbus torminalis) je bjelogorina vrsta drvea iz porodice\nRosaceae.\nPrirodno je rasprostranjena u zapadnoj, srednjoj i junoj Europi, sjevernoj\nAfrici, Krimu, Maloj Aziji, Kavkazu i Transkavkaziji.\n"
  },
  {
    "path": "sample/uchardet_test_samples/hr/mac-centraleurope.txt",
    "content": "Brekinja (lat. Sorbus torminalis) je bjelogorina vrsta drvea iz porodice\nRosaceae.\nPrirodno je rasprostranjena u zapadnoj, srednjoj i junoj Europi, sjevernoj\nAfrici, Krimu, Maloj Aziji, Kavkazu i Transkavkaziji.\n"
  },
  {
    "path": "sample/uchardet_test_samples/hr/utf-8.txt",
    "content": "Brekinja (lat. Sorbus torminalis) je bjelogorična vrsta drveća iz porodice\nRosaceae.\nPrirodno je rasprostranjena u zapadnoj, srednjoj i južnoj Europi, sjevernoj\nAfrici, Krimu, Maloj Aziji, Kavkazu i Transkavkaziji.\n"
  },
  {
    "path": "sample/uchardet_test_samples/hr/windows-1250.txt",
    "content": "Brekinja (lat. Sorbus torminalis) je bjelogorina vrsta drvea iz porodice\nRosaceae.\nPrirodno je rasprostranjena u zapadnoj, srednjoj i junoj Europi, sjevernoj\nAfrici, Krimu, Maloj Aziji, Kavkazu i Transkavkaziji.\n"
  },
  {
    "path": "sample/uchardet_test_samples/hu/iso-8859-2.txt",
    "content": "Az ISO 8859-2 (hivatalosan ISO/IEC 8859-2, rviden s nem hivatalosan Latin-2) az ISO/IEC 8859-es karakterkdolsi szabvny msodik rsze. Az ISO ltal kettes szm latin bcnek nevezett 191 karakter mindegyiknek egybjtos (nyolcbites) kdjt adja meg. A 191 karakter kztt minden magyar kezetes bet megtallhat (a sok ms kszletbl hinyz  s  is).\n\nAz ISO_8859-2:1987 (mime rvidtsbl ismertebb nevn ISO-8859-2 (az \"ISO\" utn ktjellel)) az IANA-nak erre a szabvnyra pl karakterkszletnek neve, melyben a C0 (0x00-0x1F) s a C1 (0x80-0x9F) rsz az ISO/IEC 6429-ben meghatrozott vezrlkdokat tartalmazza. Az ISO/IEC 6429-ben s 2022-ben megadott escape szekvencikat nem hasznlja. Tovbbi ismert nevei: ISO_8859-2, latin2, l2 s csISOLatin2.\n"
  },
  {
    "path": "sample/uchardet_test_samples/hu/utf-8.txt",
    "content": "Giacomo Puccini (Lucca, 1858. december 22. – Brüsszel, 1924. november 29.) a 20. század egyik legnépszerűbb olasz operaszerzője. Műveiben főként az emberi érzésekre összpontosított: kis örömök, mindennapi kis események, nagy szenvedélyek és érzelmek jelennek meg, többnyire egzotikus környezetben. Hősei hétköznapi emberek. A Bohémélet tüdőbajos Mimije, az elhagyott Pillangókisasszony, az öngyilkos Tosca mind a szerelem áldozatai, akik végül az életükkel fizetnek.\n\nPuccini operái többnyire tragikus befejezésű darabok. A Nyugat lánya és a Gianni Schicchi című vígopera cselekménye azonban boldog véget ér; tragikus fordulata után az utolsó mű, a Turandot is.\n"
  },
  {
    "path": "sample/uchardet_test_samples/hu/windows-1250.txt",
    "content": "Jellemz r az els sztagra es hangsly (ebben a finnugor nyelvek s a szlovk nyelv hasonltanak hozz), a magnhangz-harmnia (barnulsotokrl  zldlsetekrl), valamint a magnhangz-hosszsg s a hangsly egymstl fggetlen volta (amely szinte egyedliknt lehetv teszi az antik Idmrtkes versels alkalmazst). Hangrendszerre ezenkvl a lgy mssalhangzk (ny, ty, gy), az aspirlatlan zrhangok (h nlkl ejtett p, t, k, szemben pldul a germn nyelvekkel) s a palatlis magnhangzk eltti kemny mssalhangzk jelenlte jellemz (azaz lehetsges ne, ti stb. hangkapcsolat, nye, tyi helyett; szemben pldul az orosszal). Nincsenek benne valdi diftongusok (mint pldul a finnben vagy nmetben) s reduklt, vagyis elnyelt magnhangzk (mint pldul az angolban, nmetben). A specilis magyar a hang (mely a svdben s a perzsban is megvan) nehzsget okozhat a nyelvnket tanulknak.\n"
  },
  {
    "path": "sample/uchardet_test_samples/it/iso-8859-1.txt",
    "content": "L'architettura longobarda  costituita dall'insieme delle opere architettoniche\nrealizzate in Italia durante il regno dei Longobardi (568-774), con residuale\npermanenza nell'Italia meridionale fino al X-XI secolo (Langobardia Minor), e\ncommissionate dai re e dai duchi longobardi.\nL'attivit architettonica sviluppata in Langobardia Maior  andata in gran parte\nperduta, per lo pi a causa di successive ricostruzioni degli edifici sacri e\nprofani eretti tra VII e VIII secolo. A parte il Tempietto longobardo di\nCividale del Friuli, rimasto in gran parte intatto, gli edifici civili e\nreligiosi di Pavia, Monza o altre localit sono stati ampiamente rimaneggiati\nnei secoli seguenti. Ancora integre rimangono cos soltanto poche architetture,\no perch inglobate negli ampliamenti successivi - come la chiesa di San\nSalvatore a Brescia) -, o perch periferiche e di modeste dimensioni - come la\nchiesa di Santa Maria foris portas a Castelseprio. Testimonianze maggiormente\nfedeli alla forma originale si ritrovano, invece, nella Langobardia Minor: a\nBenevento si conservano la chiesa di Santa Sofia, un ampio tratto delle Mura e\nla Rocca dei Rettori, unici esempi superstiti di architettura militare\nlongobarda, mentre altre testimonianze si sono conservate in centri minori del\nducato beneventano e a Spoleto.\n"
  },
  {
    "path": "sample/uchardet_test_samples/it/utf-8.txt",
    "content": "L'architettura longobarda è costituita dall'insieme delle opere architettoniche\nrealizzate in Italia durante il regno dei Longobardi (568-774), con residuale\npermanenza nell'Italia meridionale fino al X-XI secolo (Langobardia Minor), e\ncommissionate dai re e dai duchi longobardi.\nL'attività architettonica sviluppata in Langobardia Maior è andata in gran parte\nperduta, per lo più a causa di successive ricostruzioni degli edifici sacri e\nprofani eretti tra VII e VIII secolo. A parte il Tempietto longobardo di\nCividale del Friuli, rimasto in gran parte intatto, gli edifici civili e\nreligiosi di Pavia, Monza o altre località sono stati ampiamente rimaneggiati\nnei secoli seguenti. Ancora integre rimangono così soltanto poche architetture,\no perché inglobate negli ampliamenti successivi - come la chiesa di San\nSalvatore a Brescia) -, o perché periferiche e di modeste dimensioni - come la\nchiesa di Santa Maria foris portas a Castelseprio. Testimonianze maggiormente\nfedeli alla forma originale si ritrovano, invece, nella Langobardia Minor: a\nBenevento si conservano la chiesa di Santa Sofia, un ampio tratto delle Mura e\nla Rocca dei Rettori, unici esempi superstiti di architettura militare\nlongobarda, mentre altre testimonianze si sono conservate in centri minori del\nducato beneventano e a Spoleto.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ja/euc-jp.txt",
    "content": "Extended Unix Code(EUC)ϡUNIXǤ褯Ȥʸɤ沽Ǥ롣\n\n    ܸEUC\n        JIS X 0208١ (EUC-JP)\n        JIS X 0213١ (EUC-JIS-2004)\n    ڹEUC (EUC-KR)\n    λEUC (EUC-CN)\n    λEUC (EUC-TW)\n\nʤɤ롣\n"
  },
  {
    "path": "sample/uchardet_test_samples/ja/iso-2022-jp.txt",
    "content": "ISO/IEC 2022\u001b$B!J5l>N\u001b(B ISO 2022\u001b$B!K$O!\"\u001b(B\n\n    \u001b$BJ8;z=89g$r\u001b(B7\u001b$B%S%C%HId9f$^$?$O\u001b(B8\u001b$B%S%C%HId9f$GI=8=$9$k$?$a$N5;=Q!\"$*$h$S\u001b(B\n    \u001b$BJ#?t$NJ8;z=89g$rC10l$NJ8;zId9f2=J}<0$K4^$a$k5;=Q\u001b(B\n\n\u001b$B$r5,Dj$9$k\u001b(BISO\u001b$B5,3J$G$\"$k!#\u001b(BJIS\u001b$B$NBP1~5,3J$O\u001b(BJIS X 0202 \u001b$B!V>pJs5;=Q\u001b(B-\u001b$BJ8;zId9f$N9=B$5Z$S3HD%K!!W\u001b(B[1]\u001b$B!#\u001b(BEcma International\u001b$B$NBP1~5,3J$O\u001b(BECMA-35\u001b$B!#\u001b(B\n\nISO/IEC 2022 \u001b$B$NId9f2=J}<0$O!\"0lHL$K!\"\u001b(B1\u001b$BJ8;z$K\u001b(B1\u001b$B%P%$%H$+\u001b(B2\u001b$B%P%$%H0J>e$r;H$&2DJQD9$NJ8;zId9f2=J}<0$G$\"$k!#$$$/$D$+$NId9f2=I=8=$,\u001b(BISO/IEC 2022\u001b$B$N5!9=$r;H$C$F$$$k!#$?$H$($P!\"\u001b(BISO-2022-JP\u001b$B$OF|K\\8l$G9-$/;H$o$l$F$$$kId9f2=I=8=$G$\"$j!\"$$$o$f$k!V\u001b(BJIS\u001b$B%3!<%I!W$H$$$&$N$b$3$l$r;X$9$3$H$,0lHLE*$G$\"$k!#\u001b(B\n"
  },
  {
    "path": "sample/uchardet_test_samples/ja/shift_jis.txt",
    "content": "{{{{{{{{{{{{{{{{{{{\n"
  },
  {
    "path": "sample/uchardet_test_samples/ja/utf-8.txt",
    "content": "UTF-8（ユーティーエフはち、ユーティーエフエイト）はISO/IEC 10646 (UCS) とUnicodeで使える8ビット符号単位の文字符号化形式及び文字符号化スキーム。\n\n正式名称は、ISO/IEC 10646では “UCS Transformation Format 8”、Unicodeでは “Unicode Transformation Format-8” という。両者はISO/IEC 10646とUnicodeのコード重複範囲で互換性がある。RFCにも仕様がある[1]。\n\n2バイト目以降に「/」などのASCII文字が現れないように工夫されていることから、UTF-FSS (File System Safe) ともいわれる。旧名称はUTF-2。\n\nデータ交換方式、ファイル形式として、一般的にUTF-8は使われる傾向にある。\n\n当初は、ベル研究所においてPlan 9で用いるエンコードとして、ロブ・パイクによる設計指針のもと、ケン・トンプソンによって考案された\n"
  },
  {
    "path": "sample/uchardet_test_samples/ka/georgian-academy.txt",
    "content": " (. Marmota)     .   15  .    .     .         ,  ,    .\n"
  },
  {
    "path": "sample/uchardet_test_samples/ka/georgian-ps.txt",
    "content": " (. Marmota)     .   15  .    .     .         ,  ,    .\n"
  },
  {
    "path": "sample/uchardet_test_samples/ka/utf-8.txt",
    "content": "ვირზაზუნა (ლათ. Marmota) — ძუძუმწოვრების გვარი მღრღნელების რიგისა. მსოფლიოში ვირზაზუნათა 15 სახეობაა ცნობილი. მათ სამშობლოდ ამერიკა ითვლება. ვირზაზუნები ძალიან განსხვავდებიან სხვა ძუძუმწოვრებისაგან. იმ დროს როდესაც ცხოველები აზიიდან და ევროპიდან ამერიკისაკენ მიემართებოდნენ, ვირზაზუნები პირიქით, ამერიკიდან გავრცელდნენ მთელ მსოფლიოში.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ko/iso-2022-kr.txt",
    "content": "\u001b$)CISO/IEC 2022\u000e4B\u000f\n\n    \u000e9.@Z\u000f \u000eA}GU@;\u000f 7\u000e:qF.\u000f \u000e:NH#\u000f \u000e6G4B\u000f 8\u000e:qF.\u000f \u000e:NH#7N\u000f \u000eG%GvGO1b\u000f \u000e@'GQ\u000f \u000e1b<z\u000f\n    \u000e5Q\u000f \u000e@L;s@G\u000f \u000e9.@Z\u000f \u000eA}GU@;\u000f \u000eGO3*@G\u000f \u000e9.@Z\u000f \u000e:NH#H-\u000f \u000e9f=D@87N\u000f \u000e8p5N\u000f \u000eG%GvGO4B\u000f \u000e1b<z\u000f\n\n\u000e@;\u000f \u000e1TA$GO4B\u000f ISO \u000eG%AX@L4Y\u000f.\n\nISO/IEC 2022\u000e@G\u000f \u000e:NH#H-\u000f \u000e9f=D@:\u000f \u000eEk;s\u000f \u000e9.@Z\u000f \u000eGO3*?!\u000f 1\u000e9Y@LF.3*\u000f 2\u000e9Y@LF.\u000f \u000e@L;s@;\u000f \u000e>24B\u000f \u000e0!:/\u000f \u000e9.@Z\u000f \u000e:NH#H-\u000f \u000e9f=D@L8g\u000f \u000eGQ19>n@G\u000f \u000e0f?l\u000f EUC-KR\u000e@L\u000f \u000e@L\u000f \u000e:NH#H-\u000f \u000e9f=D@;\u000f \u000e;g?kGQ4Y\u000f.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ko/johab.txt",
    "content": "eie ѩ }  ii  ee qa[1] ei xAe } 14 ѩ 10  24i aa qea. \"aui  ia\" Ai a A׷ ee  aa ia aa 1443e wAaa 1446e e͡ava. {iaa {e aaa qaa { , , i  A eA aa A q颅a b xea. qAe } 17A ѩ 11  28aa A 4i  Ae 24e ea. e 壥  幢 aáAe w a, Aa ɥ Ae aa᷁  a Ȃava. 壥Ae i(Xhi)a ea.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ko/uhc.smi",
    "content": "<SAMI>\n<HEAD>\n<TITLE>EUC-KR.smi</TITLE>\n<STYLE TYPE=\"text/css\">\n</STYLE>\n</HEAD>\n<BODY>\n<SYNC Start=0000><P>EUC-KR\n<SYNC Start=1000><P>EUC-KR KS X 1001 KS X 1003 ϴ 8Ʈ  ڵ, EUC ̸ ǥ ѱ ϼ ڵ̱   ϼ̶ Ҹ.\n<SYNC Start=2000><P>EUC-KR ڵ   ȴ.\n<SYNC Start=3000><P>128  Ʈ KS X 1003 Ѵ.\n<SYNC Start=4000><P>128 ũų  Ʈ KS X 1001 Ѵ.  ڴ   128  ڵ尪 Ͽ 2Ʈ ǥȴ.\n<SYNC Start=5000><P> KS X 1001 40-27  \"\" ڴ EUC-KR C0 A7 Ʈ  ǥȴ.\n<SYNC Start=6000><P>KS X 1001 ѱ ä ڸ Ͽ ԰  տ Ե  ѱ ǥϴ Ȯ  , κ    EUC-KR  ʰ  CP949  ٸ  Ͽ KS X 1001 ٱ  ѱ ǥѴ.\n</BODY>\n</SAMI>\n"
  },
  {
    "path": "sample/uchardet_test_samples/ko/utf-8.txt",
    "content": "UTF-8은 유니코드를 위한 가변 길이 문자 인코딩 방식 중 하나로, 켄 톰프슨과 롭 파이크가 만들었다. 본래는 FSS-UTF(File System Safe UCS/Unicode Transformation Format)라는 이름으로 제안되었다.\n\nUTF-8 인코딩은 유니코드 한 문자를 나타내기 위해 1바이트에서 4바이트까지를 사용한다. 예를 들어서, U+0000부터 U+007F 범위에 있는 ASCII 문자들은 UTF-8에서 1바이트만으로 표시된다. 4바이트로 표현되는 문자는 모두 기본 다국어 평면(BMP) 바깥의 유니코드 문자이며, 거의 사용되지 않는다. UTF-16과 UTF-8 중 어느 인코딩이 더 적은 바이트를 사용하는지는 문자열에서 사용된 코드 포인트에 따라 달라지며, 실제로 DEFLATE와 같은 일반적인 압축 알고리즘을 사용할 경우 이 차이는 무시할 수 있을 정도이다. 이러한 압축 알고리즘을 사용하기 힘들고 크기가 중요할 경우 유니코드 표준 압축 방식을 대신 사용할 수 있다.\n"
  },
  {
    "path": "sample/uchardet_test_samples/lt/iso-8859-10.txt",
    "content": "Vincentas van Gogas (ol. Vincent van Gogh, 1853 m. kovo 30 d. Grot Zunderte,\nNyderlandai - 1890 m. liepos 29 d. Overe prie Uazos, Pranczija) - oland\ntapytojas ir grafikas, postimpresionistas.\n"
  },
  {
    "path": "sample/uchardet_test_samples/lt/iso-8859-13.txt",
    "content": "Vincentas van Gogas (ol. Vincent van Gogh, 1853 m. kovo 30 d. Grot Zunderte,\nNyderlandai - 1890 m. liepos 29 d. Overe prie Uazos, Pranczija) - oland\ntapytojas ir grafikas, postimpresionistas.\n"
  },
  {
    "path": "sample/uchardet_test_samples/lt/iso-8859-4.txt",
    "content": "Vincentas van Gogas (ol. Vincent van Gogh, 1853 m. kovo 30 d. Grot Zunderte,\nNyderlandai - 1890 m. liepos 29 d. Overe prie Uazos, Pranczija) - oland\ntapytojas ir grafikas, postimpresionistas.\n"
  },
  {
    "path": "sample/uchardet_test_samples/lt/utf-8.txt",
    "content": "Vincentas van Gogas (ol. Vincent van Gogh, 1853 m. kovo 30 d. Grot Zunderte,\nNyderlandai – 1890 m. liepos 29 d. Overe prie Uazos, Prancūzija) – olandų\ntapytojas ir grafikas, postimpresionistas.\n"
  },
  {
    "path": "sample/uchardet_test_samples/lv/iso-8859-10.txt",
    "content": "Vinsents Villems van Gogs (nderlandieu: Vincent Willem van Gogh, dzimis 1853.\ngada 30. mart, miris 1890. gada 29. jlij) bija nderlandieu gleznotjs,\npostimpresionisma prstvis. Kopum van Gogs radja vairk nek 2000 darbu, to\nskait 900 gleznu un 1100 zmjumu un skiu. Savus slavenkos darbus vi radja\npdjo divu dzves gadu laik. Tiek uzskatts, ka van Gogs btiski ir ietekmjis\n20. gadsimta mkslu, tostarp ekspresionismu un fovismu.\n"
  },
  {
    "path": "sample/uchardet_test_samples/lv/iso-8859-13.txt",
    "content": "Vinsents Villems van Gogs (nderlandieu: Vincent Willem van Gogh, dzimis 1853.\ngada 30. mart, miris 1890. gada 29. jlij) bija nderlandieu gleznotjs,\npostimpresionisma prstvis. Kopum van Gogs radja vairk nek 2000 darbu, to\nskait 900 gleznu un 1100 zmjumu un skiu. Savus slavenkos darbus vi radja\npdjo divu dzves gadu laik. Tiek uzskatts, ka van Gogs btiski ir ietekmjis\n20. gadsimta mkslu, tostarp ekspresionismu un fovismu.\n"
  },
  {
    "path": "sample/uchardet_test_samples/lv/iso-8859-4.txt",
    "content": "Vinsents Villems van Gogs (nderlandieu: Vincent Willem van Gogh, dzimis 1853.\ngada 30. mart, miris 1890. gada 29. jlij) bija nderlandieu gleznotjs,\npostimpresionisma prstvis. Kopum van Gogs radja vairk nek 2000 darbu, to\nskait 900 gleznu un 1100 zmjumu un skiu. Savus slavenkos darbus vi radja\npdjo divu dzves gadu laik. Tiek uzskatts, ka van Gogs btiski ir ietekmjis\n20. gadsimta mkslu, tostarp ekspresionismu un fovismu.\n"
  },
  {
    "path": "sample/uchardet_test_samples/lv/utf-8.txt",
    "content": "Vinsents Villems van Gogs (nīderlandiešu: Vincent Willem van Gogh, dzimis 1853.\ngada 30. martā, miris 1890. gada 29. jūlijā) bija nīderlandiešu gleznotājs,\npostimpresionisma pārstāvis. Kopumā van Gogs radīja vairāk nekā 2000 darbu, to\nskaitā 900 gleznu un 1100 zīmējumu un skiču. Savus slavenākos darbus viņš radīja\npēdējo divu dzīves gadu laikā. Tiek uzskatīts, ka van Gogs būtiski ir ietekmējis\n20. gadsimta mākslu, tostarp ekspresionismu un fovismu.\n"
  },
  {
    "path": "sample/uchardet_test_samples/mk/ibm855.txt",
    "content": "Ԡ з Ʒ   ֎ Ԡ 렒 Ԡ Ҩ堢з  ԷƠ ШԠ ب Ơ ֦ᨦԷ Է  Ҩ Ԡ Ҡ.  Ԡ ؠ ֬Ш ֎ ԨԷ Է  Ҡ ֎ . ՠ  Ơ ҨƠ  Ҡ   ԷԠ ШԠ ب  禠 Ш  Ԩ  Ҩ堠  Ʒ Ԡ. 먖 Ԡ ֨Ơ  Է Рᠠ Ԡ  Է (. Ơ) з Է Ҡ   ( Ҡ Ʒ). 淨    禠 먖ؠ  Ҩ Ԡ Ҡ. ѠԷ Է ᠠ  Էᠠ  Ơ  ԠԠ ب   ֦ Ơ Ԡ 렒. Ԡ Ԡ Ԡ  Ҩ Ԡ Ш  려.\n"
  },
  {
    "path": "sample/uchardet_test_samples/mk/iso-8859-5.txt",
    "content": "                    .           .                     .          (. )      (  ).          .                .         .\n"
  },
  {
    "path": "sample/uchardet_test_samples/mk/utf-8.txt",
    "content": "Хибернација или зимски сон е состојба на успорување на метаболизмот и ниска телесна температура кај одредени животни за време на зимата. Во хибернатори спаѓаат поголем број крзнени животни и мал број цицачи. На цицачите како мечката само малку им е снижена телесната температура се будат лесно и не се сметаат за вистински хибернатори. Повеќето хибернатори доека се активни складираат храна во засолништата (пр. верверичка) или резервни масти во телото (во масното ткиво). Тие можат да се разбудат повеќепати за време на зимата. Ладнокрвните животни мораат да хибернираат таму каде што надворешната температура се спушта под точка на смрзнување. Еднакво на хибернација за време на лето е естивација.\n"
  },
  {
    "path": "sample/uchardet_test_samples/mk/windows-1251.txt",
    "content": "                    .           .                     .          (. )      (  ).          .                .         .\n"
  },
  {
    "path": "sample/uchardet_test_samples/mt/iso-8859-3.txt",
    "content": "Il-Malti huwa l-ilsien nazzjonali tar-Repubblika ta' Malta. Huwa l-ilsien uffijali flimkien mal-Ingli; kif ukoll wieed mill-ilsna uffijali tal-Unjoni Ewropea. Dan l-ilsien gandu sisien u gerq semitiku, ta' djalett Garbi li ej mit-Tramuntana tal-Afrika, galekk qatt ma kellu rabta mill-qrib mal-Garbi Klassiku. Ida tul i-minijiet, minabba proess tal-Latinizzazzjoni ta' Malta, bdew delin bosta elementi lingwistii mill-Isqalli, djalett ta' art li wkoll gaddiet minn mien ta' akma Garbija. Wara l-Isqalli beda dieel ukoll it-Taljan, fuq kollox fi-mien tad-dala tal-Kavallieri tal-Ordni ta' San wann sa meta l-Ingli a post it-Taljan bala l-ilsien uffijali fil-Kostituzzjoni Kolonjali tal-1934. Il-Malti huwa l-ilsien wadieni ta' gajn semitika li jinkiteb b'ittri Latini. L-alfabett Malti magmul minn 30 ittra (24 konsonanti u 6 vokali) li jidhru f'din l-ordni:\n"
  },
  {
    "path": "sample/uchardet_test_samples/mt/utf-8.txt",
    "content": "Franza (Franċiż:France), uffiċjalment ir-Repubblika Franċiża (Franċiż:\nRépublique française), hi pajjiż fl-Ewropa tal-Punent. Il-belt belt kapitali\ntagħha hi Pariġi. Hi membru tal-Unjoni Ewropea. Franza hi maqsuma f'22 régions\nli huma suddiviżi f' départements.\n"
  },
  {
    "path": "sample/uchardet_test_samples/no/ibm865.txt",
    "content": "Pangramer brukes som ren underholdning; som skriveeksempel for prve p\nhndskrift; som hjelpemiddel til  vise en font; eller som huskeregel for \nraskt teste tegnsettet i teknisk utstyr som behandler eller viser bokstaver.\n\n\nSr golfer med klle vant sexquiz p wc i hjemby.\nHvdingens kjre squaw fr litt pizza i Mexico by.\nVr kjre my i cape vde banjo, whist og quiz i taxifila.\nIQ-ls WC-boms uten hrsel skjrer god pizza p xylofon.\nVr kjre zulu-my vde banjo, whist og quickstep fra taxi.\nEtter quiz og whist m Jo bre fakkellys p vr srgende cox.\nTaxisjfren quizet bedre om calypso, watt og klr p hjemveien.\nVr sre Zulu fra badeya spilte jo whist og quickstep i min taxi.\nDu t ca fire wienerplser og tok taxi hjem fra byen med re fra quizen.\nJeg begynte  fortre en sandwich mens jeg kjrte taxi p vei til quiz.\nQuisling var ein klppar til  spela jazz p xylofon, men lrte seg aldri  spela cembalo fr han drog til Washington.\nHvdingens kjre squaw fr litt pizza i Mexico by.\n"
  },
  {
    "path": "sample/uchardet_test_samples/no/iso-8859-1.txt",
    "content": "Pangramer brukes som ren underholdning; som skriveeksempel for prve p\nhndskrift; som hjelpemiddel til  vise en font; eller som huskeregel for \nraskt teste tegnsettet i teknisk utstyr som behandler eller viser bokstaver.\n\n\nSr golfer med klle vant sexquiz p wc i hjemby.\nHvdingens kjre squaw fr litt pizza i Mexico by.\nVr kjre my i cape vde banjo, whist og quiz i taxifila.\nIQ-ls WC-boms uten hrsel skjrer god pizza p xylofon.\nVr kjre zulu-my vde banjo, whist og quickstep fra taxi.\nEtter quiz og whist m Jo bre fakkellys p vr srgende cox.\nTaxisjfren quizet bedre om calypso, watt og klr p hjemveien.\nVr sre Zulu fra badeya spilte jo whist og quickstep i min taxi.\nDu t ca fire wienerplser og tok taxi hjem fra byen med re fra quizen.\nJeg begynte  fortre en sandwich mens jeg kjrte taxi p vei til quiz.\nQuisling var ein klppar til  spela jazz p xylofon, men lrte seg aldri  spela cembalo fr han drog til Washington.\nHvdingens kjre squaw fr litt pizza i Mexico by.\n\nEt sted, cirka  inn i John Greens siste roman, Skilpadder hele veien ned,\nbegynte jeg og romanens forteller, Aza Holmes,  grte helt samtidig\n"
  },
  {
    "path": "sample/uchardet_test_samples/no/iso-8859-15.txt",
    "content": "Pangramer brukes som ren underholdning; som skriveeksempel for prve p\nhndskrift; som hjelpemiddel til  vise en font; eller som huskeregel for \nraskt teste tegnsettet i teknisk utstyr som behandler eller viser bokstaver.\n\n\nSr golfer med klle vant sexquiz p wc i hjemby.\nHvdingens kjre squaw fr litt pizza i Mexico by.\nVr kjre my i cape vde banjo, whist og quiz i taxifila.\nIQ-ls WC-boms uten hrsel skjrer god pizza p xylofon.\nVr kjre zulu-my vde banjo, whist og quickstep fra taxi.\nEtter quiz og whist m Jo bre fakkellys p vr srgende cox.\nTaxisjfren quizet bedre om calypso, watt og klr p hjemveien.\nVr sre Zulu fra badeya spilte jo whist og quickstep i min taxi.\nDu t ca fire wienerplser og tok taxi hjem fra byen med re fra quizen.\nJeg begynte  fortre en sandwich mens jeg kjrte taxi p vei til quiz.\nQuisling var ein klppar til  spela jazz p xylofon, men lrte seg aldri  spela cembalo fr han drog til Washington.\nHvdingens kjre squaw fr litt pizza i Mexico by.\n\nEuro (symbol: ) er den Den europeiske unions myntenhet. Den\ner innfrt i 19 av unionens 27 medlemsland (kjent som eurosonen) og i fire\nmikrostater og noen andre land og omrder.\n"
  },
  {
    "path": "sample/uchardet_test_samples/no/utf-8.txt",
    "content": "Pangramer brukes som ren underholdning; som skriveeksempel for prøve på\nhåndskrift; som hjelpemiddel til å vise en font; eller som huskeregel for å\nraskt teste tegnsettet i teknisk utstyr som behandler eller viser bokstaver.\n\n\nSær golfer med kølle vant sexquiz på wc i hjemby.\nHøvdingens kjære squaw får litt pizza i Mexico by.\nVår kjære møy i cape øvde banjo, whist og quiz i taxifila.\nIQ-løs WC-boms uten hørsel skjærer god pizza på xylofon.\nVår kjære zulu-møy øvde banjo, whist og quickstep fra taxi.\nEtter quiz og whist må Jo bære fakkellys på vår sørgående cox.\nTaxisjåføren quizet bedre om calypso, watt og klær på hjemveien.\nVår sære Zulu fra badeøya spilte jo whist og quickstep i min taxi.\nDu åt ca fire wienerpølser og tok taxi hjem fra byen med ære fra quizen.\nJeg begynte å fortære en sandwich mens jeg kjørte taxi på vei til quiz.\nQuisling var ein kløppar til å spela jazz på xylofon, men lærte seg aldri å spela cembalo før han drog til Washington.\nHøvdingens kjære squaw får litt pizza i Mexico by.\n\nEt sted, cirka ¾ inn i John Greens siste roman, Skilpadder hele veien ned,\nbegynte jeg og romanens forteller, Aza Holmes, å gråte helt samtidig\n"
  },
  {
    "path": "sample/uchardet_test_samples/no/windows-1252.txt",
    "content": "Pangramer brukes som ren underholdning; som skriveeksempel for prve p\nhndskrift; som hjelpemiddel til  vise en font; eller som huskeregel for \nraskt teste tegnsettet i teknisk utstyr som behandler eller viser bokstaver.\n\n\nSr golfer med klle vant sexquiz p wc i hjemby.\nHvdingens kjre squaw fr litt pizza i Mexico by.\nVr kjre my i cape vde banjo, whist og quiz i taxifila.\nIQ-ls WC-boms uten hrsel skjrer god pizza p xylofon.\nVr kjre zulu-my vde banjo, whist og quickstep fra taxi.\nEtter quiz og whist m Jo bre fakkellys p vr srgende cox.\nTaxisjfren quizet bedre om calypso, watt og klr p hjemveien.\nVr sre Zulu fra badeya spilte jo whist og quickstep i min taxi.\nDu t ca fire wienerplser og tok taxi hjem fra byen med re fra quizen.\nJeg begynte  fortre en sandwich mens jeg kjrte taxi p vei til quiz.\nQuisling var ein klppar til  spela jazz p xylofon, men lrte seg aldri  spela cembalo fr han drog til Washington.\nHvdingens kjre squaw fr litt pizza i Mexico by.\n\nEuro (symbol:   valutakode: EUR) er den Den europeiske unions myntenhet. Den\ner innfrt i 19 av unionens 27 medlemsland (kjent som eurosonen) og i fire\nmikrostater og noen andre land og omrder.\n"
  },
  {
    "path": "sample/uchardet_test_samples/pl/ibm852.txt",
    "content": "Zofia (Sonka) Holszaska herbu Hippocentaurus (ur. ok. 1405, zm. 21 wrzenia 1461 w Krakowie)\nksiniczka litewska, krlowa Polski, od 1422 roku czwarta i ostatnia ona Wadysawa II\nJagiey.\n"
  },
  {
    "path": "sample/uchardet_test_samples/pl/iso-8859-13.txt",
    "content": "Zofia (Sonka) Holszaska herbu Hippocentaurus (ur. ok. 1405, zm. 21 wrzenia 1461 w Krakowie)\nksiniczka litewska, krlowa Polski, od 1422 roku czwarta i ostatnia ona Wadysawa II\nJagiey.\n"
  },
  {
    "path": "sample/uchardet_test_samples/pl/iso-8859-16.txt",
    "content": "Zofia (Sonka) Holszaska herbu Hippocentaurus (ur. ok. 1405, zm. 21 wrzenia 1461 w Krakowie)\nksiniczka litewska, krlowa Polski, od 1422 roku czwarta i ostatnia ona Wadysawa II\nJagiey.\n"
  },
  {
    "path": "sample/uchardet_test_samples/pl/iso-8859-2.txt",
    "content": "Zofia (Sonka) Holszaska herbu Hippocentaurus (ur. ok. 1405, zm. 21 wrzenia 1461 w Krakowie)\nksiniczka litewska, krlowa Polski, od 1422 roku czwarta i ostatnia ona Wadysawa II\nJagiey.\n"
  },
  {
    "path": "sample/uchardet_test_samples/pl/mac-centraleurope.txt",
    "content": "Zofia (Sonka) Holszaska herbu Hippocentaurus (ur. ok. 1405, zm. 21 wrzenia 1461 w Krakowie)\nksiniczka litewska, krlowa Polski, od 1422 roku czwarta i ostatnia ona Wadysawa II\nJagiey.\n"
  },
  {
    "path": "sample/uchardet_test_samples/pl/utf-8.txt",
    "content": "Zofia (Sonka) Holszańska herbu Hippocentaurus (ur. ok. 1405, zm. 21 września 1461 w Krakowie)\nksiężniczka litewska, królowa Polski, od 1422 roku czwarta i ostatnia żona Władysława II\nJagiełły.\n"
  },
  {
    "path": "sample/uchardet_test_samples/pl/windows-1250.txt",
    "content": "Zofia (Sonka) Holszaska herbu Hippocentaurus (ur. ok. 1405, zm. 21 wrzenia 1461 w Krakowie)\nksiniczka litewska, krlowa Polski, od 1422 roku czwarta i ostatnia ona Wadysawa II\nJagiey.\n"
  },
  {
    "path": "sample/uchardet_test_samples/pt/iso-8859-1.txt",
    "content": "Albertossauro (Albertosaurus sp., que significa \"lagarto de Alberta\" no Canad),\nfoi um gnero de dinossauro carnvoro e bpede presente no fim do perodo\nCretceo. Media cerca de 8 a 9 metros de comprimento, 3 metros de altura e\npesava menos de 2 toneladas. O Albertossauro viveu na Amrica do Norte e foi\ndescoberto no ano de 1884 por Joseph Burr Tyrrell em Alberta, no Canad, local\nao qual deve seu nome.\n"
  },
  {
    "path": "sample/uchardet_test_samples/pt/utf-8.txt",
    "content": "Albertossauro (Albertosaurus sp., que significa \"lagarto de Alberta\" no Canadá),\nfoi um género de dinossauro carnívoro e bípede presente no fim do período\nCretáceo. Media cerca de 8 a 9 metros de comprimento, 3 metros de altura e\npesava menos de 2 toneladas. O Albertossauro viveu na América do Norte e foi\ndescoberto no ano de 1884 por Joseph Burr Tyrrell em Alberta, no Canadá, local\nao qual deve seu nome.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ro/ibm852.txt",
    "content": "Danemarca (n danez Sunet Danmark), oficial Regatul Danemarcei (n\ndanez Sunet Kongeriget Danmark), este un stat suveran din\nEuropa de Nord, avnd si dou tri constituente de peste mri, care fac parte\nintegrant din regat: Insulele Feroe n Atlanticul de Nord si Groenlanda n\nAmerica de Nord. Danemarca propriu-zis[a] este cea mai de sud dintre trile\nnordice, aflat la sud-vest de Suedia si la sud de Norvegia, nvecinndu-se la\nsud cu Germania. Tara const dintr-o peninsul mare, Iutlanda, si mai multe\ninsule, dintre care cele mai mari sunt Zealand, Funen, Lolland, Falster si\nBornholm, precum si sute de insulite denumite n general ,,Arhipelagul Danez\".\n"
  },
  {
    "path": "sample/uchardet_test_samples/ro/iso-8859-16.txt",
    "content": "Danemarca (n danez Sunet Danmark), oficial Regatul Danemarcei (n\ndanez Sunet Kongeriget Danmark), este un stat suveran din\nEuropa de Nord, avnd i dou ri constituente de peste mri, care fac parte\nintegrant din regat: Insulele Feroe n Atlanticul de Nord i Groenlanda n\nAmerica de Nord. Danemarca propriu-zis[a] este cea mai de sud dintre rile\nnordice, aflat la sud-vest de Suedia i la sud de Norvegia, nvecinndu-se la\nsud cu Germania. ara const dintr-o peninsul mare, Iutlanda, i mai multe\ninsule, dintre care cele mai mari sunt Zealand, Funen, Lolland, Falster i\nBornholm, precum i sute de insulie denumite n general Arhipelagul Danez.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ro/utf-8.txt",
    "content": "Danemarca (în daneză Sunet Danmark), oficial Regatul Danemarcei (în\ndaneză Sunet Kongeriget Danmark), este un stat suveran din\nEuropa de Nord, având și două țări constituente de peste mări, care fac parte\nintegrantă din regat: Insulele Feroe în Atlanticul de Nord și Groenlanda în\nAmerica de Nord. Danemarca propriu-zisă[a] este cea mai de sud dintre țările\nnordice, aflată la sud-vest de Suedia și la sud de Norvegia, învecinându-se la\nsud cu Germania. Țara constă dintr-o peninsulă mare, Iutlanda, și mai multe\ninsule, dintre care cele mai mari sunt Zealand, Funen, Lolland, Falster și\nBornholm, precum și sute de insulițe denumite în general „Arhipelagul Danez”.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ro/windows-1250.txt",
    "content": "Danemarca (n danez Sunet Danmark), oficial Regatul Danemarcei (n\ndanez Sunet Kongeriget Danmark), este un stat suveran din\nEuropa de Nord, avnd si dou tri constituente de peste mri, care fac parte\nintegrant din regat: Insulele Feroe n Atlanticul de Nord si Groenlanda n\nAmerica de Nord. Danemarca propriu-zis[a] este cea mai de sud dintre trile\nnordice, aflat la sud-vest de Suedia si la sud de Norvegia, nvecinndu-se la\nsud cu Germania. Tara const dintr-o peninsul mare, Iutlanda, si mai multe\ninsule, dintre care cele mai mari sunt Zealand, Funen, Lolland, Falster si\nBornholm, precum si sute de insulite denumite n general Arhipelagul Danez.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ru/ibm855.txt",
    "content": "CP855 -- ƷзƠ ֦ Է  MS-DOS  ֦֢  بᠤ . М    Ԡ ISO 8859-5.\n\nը֬  Р  ᢷ, ӠƨԷ  Ь᷷,   㷷 Ԩ Р.\n\nݨ Ԡ ֽ֦ 堢з ؠ  ASCII. Р ֦ ҷ ֢Ԡ Ԡ ֦   Է֦.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ru/ibm866.txt",
    "content": "<<ୠ⨢ ஢>> (<<ୠ⨢ ஢ >>) -- ᭮ \nCP437  ࠭,   ᯥ᪨ ய᪨ ᨬ  ன\n   ਫ, ⠢ ᥢ᪨ ᨬ ஭묨.\n⥫쭮,     ணࠬ, ᯮ  ࠡ ⥪⮢\n,  ⠪ ᯥ稢 ᯮ짮   ᨬ ਫ.\n\n᪨ ⢮  ਠ⮢ ୠ⨢ ஢,  \nࠧ  ⮫쪮  0xF0 -- 0xFF (240--255). ᯮ짮\nᥢ 䨪-ᠬ, ᠢ訥 ᨬ 묨\nணࠬ⠬, ࠭    १ । \n業.\n"
  },
  {
    "path": "sample/uchardet_test_samples/ru/iso-8859-5.txt",
    "content": "ISO 8859-5 \n8-        ISO-8859   .\nISO 8859-5     \" \" (     ,    ).\n"
  },
  {
    "path": "sample/uchardet_test_samples/ru/koi8-r.txt",
    "content": "-8 (  , 8 ), KOI8 -   ,   ASCII.      .         Unix-     ,    2010 ,   ,    .\n"
  },
  {
    "path": "sample/uchardet_test_samples/ru/mac-cyrillic.txt",
    "content": " MacCyrillic     ǌ.\n\n       \n     ;  , \n  ,     ( ),\n,    .\n\n    ()   \nASCII.         .\n"
  },
  {
    "path": "sample/uchardet_test_samples/ru/utf-8.txt",
    "content": "Сурки образуют отчётливо выраженную группу из 14 или 15 видов (статус лесостепного сурка как отдельного вида является предметом обсуждения), в рамках семейства беличьих. Это относительно крупные, весом в несколько килограммов, животные, обитающие в открытых ландшафтах, в сооружаемых самостоятельно норах. Прародина сурков — Северная Америка, откуда они распространились через Берингию в Азию, и дальше — в Европу. В Евразии большинство исследователей выделяет 8 видов сурков: три или четыре вида, объединяемых в группу bobak (степной сурок, лесостепной сурок, серый сурок и монгольский сурок), населяющие широкую полосу степей и гор от Украины на западе до северо-западного Китая на востоке, единственный чисто европейский вид — альпийский сурок, три вида гор Центральной Азии — сурок Мензбира, длиннохвостый, или красный сурок и гималайский сурок и обособленный северо-восточный вид — черношапочный сурок. Разные виды сурков обособились в различных географических зонах и отличаются друг от друга особенностями поведения, но сохранили внешнее сходство и необходимость впадать в зимнюю спячку. Все сурки травоядны, селятся в норах, имеют тёплый мех и почти все живут колониями. Различаются равнинные сурки (байбаки) и сурки горные, живущие в суровых условиях альпийских гор, куда летнее тепло приходит поздно, а зима является рано. Сурки встречают свистом восход солнца[3]. Сурки иногда храпят[3].\n"
  },
  {
    "path": "sample/uchardet_test_samples/ru/windows-1251.txt",
    "content": "Windows-1251\n   ,   8-      Microsoft Windows.    .     ,      Windows  19901991 .   ,     Microsoft.           ( ,      ).\n\nWindows-1251     8-   (  CP866, KOI8-R  ISO 8859-5)    ,        (   );         : , , ,   .\n"
  },
  {
    "path": "sample/uchardet_test_samples/sk/ibm852.txt",
    "content": "Jupiter je piata planta v porad od Slnka, najvia a najhmotnejia planta\nnaej slnenej sstavy. Je pomenovan po rmskom bohovi Jupiterovi. Symbolom\nplanty je tylizovan znzornenie Jupiterovho boskho blesku.\n"
  },
  {
    "path": "sample/uchardet_test_samples/sk/iso-8859-2.txt",
    "content": "Jupiter je piata planta v porad od Slnka, najvia a najhmotnejia planta\nnaej slnenej sstavy. Je pomenovan po rmskom bohovi Jupiterovi. Symbolom\nplanty je tylizovan znzornenie Jupiterovho boskho blesku.\n"
  },
  {
    "path": "sample/uchardet_test_samples/sk/mac-centraleurope.txt",
    "content": "Jupiter je piata planta v porad od Slnka, najvia a najhmotnejia planta\nnaej slnenej sstavy. Je pomenovan po rmskom bohovi Jupiterovi. Symbolom\nplanty je tylizovan znzornenie Jupiterovho boskho blesku.\n"
  },
  {
    "path": "sample/uchardet_test_samples/sk/utf-8.txt",
    "content": "Jupiter je piata planéta v poradí od Slnka, najväčšia a najhmotnejšia planéta\nnašej slnečnej sústavy. Je pomenovaný po rímskom bohovi Jupiterovi. Symbolom\nplanéty je štylizované znázornenie Jupiterovho božského blesku.\n"
  },
  {
    "path": "sample/uchardet_test_samples/sk/windows-1250.txt",
    "content": "Jupiter je piata planta v porad od Slnka, najvia a najhmotnejia planta\nnaej slnenej sstavy. Je pomenovan po rmskom bohovi Jupiterovi. Symbolom\nplanty je tylizovan znzornenie Jupiterovho boskho blesku.\n"
  },
  {
    "path": "sample/uchardet_test_samples/sl/ibm852.txt",
    "content": "Naseljvi plant je planet ali naravni satelit (redkeje tudi asteroid[1]), ki je\nzmoen razviti in ohranjati ivljenje.\n\nKer je obstoj nezemeljskega ivljenja trenutno negotov, je raziskovanje\nnaseljivih planetov v glavnem ekstrapolacija razmer na Zemlji in znailnosti\nSonca in celotnega Osonja, ki govorijo v prid razvitju ivljenja. e posebej so\npomembni faktorji, ki so ohranili zapletene, mnogoceline organizme in ne le\npreprosta, enocelina iva bitja, mikroorganizme. Raziskovanje in teorija v tej\nsmeri je del planetologije in razvijajoe astrobiologije.\n"
  },
  {
    "path": "sample/uchardet_test_samples/sl/iso-8859-16.txt",
    "content": "Naseljvi plant je planet ali naravni satelit (redkeje tudi asteroid[1]), ki je\nzmoen razviti in ohranjati ivljenje.\n\nKer je obstoj nezemeljskega ivljenja trenutno negotov, je raziskovanje\nnaseljivih planetov v glavnem ekstrapolacija razmer na Zemlji in znailnosti\nSonca in celotnega Osonja, ki govorijo v prid razvitju ivljenja. e posebej so\npomembni faktorji, ki so ohranili zapletene, mnogoceline organizme in ne le\npreprosta, enocelina iva bitja, mikroorganizme. Raziskovanje in teorija v tej\nsmeri je del planetologije in razvijajoe astrobiologije.\n"
  },
  {
    "path": "sample/uchardet_test_samples/sl/iso-8859-2.txt",
    "content": "Naseljvi plant je planet ali naravni satelit (redkeje tudi asteroid[1]), ki je\nzmoen razviti in ohranjati ivljenje.\n\nKer je obstoj nezemeljskega ivljenja trenutno negotov, je raziskovanje\nnaseljivih planetov v glavnem ekstrapolacija razmer na Zemlji in znailnosti\nSonca in celotnega Osonja, ki govorijo v prid razvitju ivljenja. e posebej so\npomembni faktorji, ki so ohranili zapletene, mnogoceline organizme in ne le\npreprosta, enocelina iva bitja, mikroorganizme. Raziskovanje in teorija v tej\nsmeri je del planetologije in razvijajoe astrobiologije.\n"
  },
  {
    "path": "sample/uchardet_test_samples/sl/mac-centraleurope.txt",
    "content": "Naseljvi plant je planet ali naravni satelit (redkeje tudi asteroid[1]), ki je\nzmoen razviti in ohranjati ivljenje.\n\nKer je obstoj nezemeljskega ivljenja trenutno negotov, je raziskovanje\nnaseljivih planetov v glavnem ekstrapolacija razmer na Zemlji in znailnosti\nSonca in celotnega Osonja, ki govorijo v prid razvitju ivljenja. e posebej so\npomembni faktorji, ki so ohranili zapletene, mnogoceline organizme in ne le\npreprosta, enocelina iva bitja, mikroorganizme. Raziskovanje in teorija v tej\nsmeri je del planetologije in razvijajoe astrobiologije.\n"
  },
  {
    "path": "sample/uchardet_test_samples/sl/utf-8.txt",
    "content": "Naseljívi planét je planet ali naravni satelit (redkeje tudi asteroid[1]), ki je\nzmožen razviti in ohranjati življenje.\n\nKer je obstoj nezemeljskega življenja trenutno negotov, je raziskovanje\nnaseljivih planetov v glavnem ekstrapolacija razmer na Zemlji in značilnosti\nSonca in celotnega Osončja, ki govorijo v prid razvitju življenja. Še posebej so\npomembni faktorji, ki so ohranili zapletene, mnogocelične organizme in ne le\npreprosta, enocelična živa bitja, mikroorganizme. Raziskovanje in teorija v tej\nsmeri je del planetologije in razvijajoče astrobiologije.\n"
  },
  {
    "path": "sample/uchardet_test_samples/sl/windows-1250.txt",
    "content": "Naseljvi plant je planet ali naravni satelit (redkeje tudi asteroid[1]), ki je\nzmoen razviti in ohranjati ivljenje.\n\nKer je obstoj nezemeljskega ivljenja trenutno negotov, je raziskovanje\nnaseljivih planetov v glavnem ekstrapolacija razmer na Zemlji in znailnosti\nSonca in celotnega Osonja, ki govorijo v prid razvitju ivljenja. e posebej so\npomembni faktorji, ki so ohranili zapletene, mnogoceline organizme in ne le\npreprosta, enocelina iva bitja, mikroorganizme. Raziskovanje in teorija v tej\nsmeri je del planetologije in razvijajoe astrobiologije.\n"
  },
  {
    "path": "sample/uchardet_test_samples/sr/iso-8859-5.txt",
    "content": "     ,        .      ,  .     ,      .  ,    ,                .                ,      .          .     ,        .[2]\n"
  },
  {
    "path": "sample/uchardet_test_samples/sr/utf-8.txt",
    "content": "Мрмот је дугачак отприлике педесет сантиметара, заједно с репом који сам износи двадесет сантиметара. Тежак је четири до пет килограма, ретко више. Има прекрасно крзно сивкасте боје, које на светлости добија златносмеђе преливе. Као мишеви, зечеви и остали глодари, мрмот има секутиће који непрестано расту па мора често нешто да глође да би их трошио. На предњим ногама има четири прста наоружана повијеним канџама помоћу којих животиња узима траву и гранчице, приноси храну устима и копа земљу. На задњим ногама има пет прстију с прилично кратким канџама. Мрмот има веома оштар вид, а уши му хватају сваки и најслабији звук.[2]\n"
  },
  {
    "path": "sample/uchardet_test_samples/sr/windows-1251.txt",
    "content": "     ,        .      ,  .     ,      .  ,    ,                .                ,      .          .     ,        .[2]\n"
  },
  {
    "path": "sample/uchardet_test_samples/sv/iso-8859-1.txt",
    "content": "Mlle r en ttort p Kullahalvn i Brunnby socken i Hgans kommun, Skne ln.\n\nSamhllet var frn brjan ett fiskelge, men kom att spela en stor roll i den\nframvxande turismen i Sverige i slutet av 1800-talet. Till detta bidrog - och\nbidrar - Mlles naturskna lge invid resunds norra utlopp, med Kullaberg som\nbakgrund. Gemensamhetsbad fr mn och kvinnor introducerades i Ransvik i brjan\nav 1900-talet. Storhetstiden som turistort intrffade strax fre frsta\nvrldskriget, men ven under mellankrigstiden var turiststrmmarna stora.\nFortfarande r Mlle en populr turistort med en tredubbling av invnarantalet\nunder sommarmnaderna.\n"
  },
  {
    "path": "sample/uchardet_test_samples/sv/utf-8.txt",
    "content": "Mölle är en tätort på Kullahalvön i Brunnby socken i Höganäs kommun, Skåne län.\n\nSamhället var från början ett fiskeläge, men kom att spela en stor roll i den\nframväxande turismen i Sverige i slutet av 1800-talet. Till detta bidrog – och\nbidrar – Mölles natursköna läge invid Öresunds norra utlopp, med Kullaberg som\nbakgrund. Gemensamhetsbad för män och kvinnor introducerades i Ransvik i början\nav 1900-talet. Storhetstiden som turistort inträffade strax före första\nvärldskriget, men även under mellankrigstiden var turistströmmarna stora.\nFortfarande är Mölle en populär turistort med en tredubbling av invånarantalet\nunder sommarmånaderna.\n"
  },
  {
    "path": "sample/uchardet_test_samples/sv/windows-1252.txt",
    "content": "Mlle r en ttort p Kullahalvn i Brunnby socken i Hgans kommun, Skne ln.\n\nSamhllet var frn brjan ett fiskelge, men kom att spela en stor roll i den\nframvxande turismen i Sverige i slutet av 1800-talet. Till detta bidrog  och\nbidrar  Mlles naturskna lge invid resunds norra utlopp, med Kullaberg som\nbakgrund. Gemensamhetsbad fr mn och kvinnor introducerades i Ransvik i brjan\nav 1900-talet. Storhetstiden som turistort intrffade strax fre frsta\nvrldskriget, men ven under mellankrigstiden var turiststrmmarna stora.\nFortfarande r Mlle en populr turistort med en tredubbling av invnarantalet\nunder sommarmnaderna.\n"
  },
  {
    "path": "sample/uchardet_test_samples/th/iso-8859-11.txt",
    "content": "TIS-620\n\nҵðҹԵѳصˡ 620-2533, ͡.620-2533, ͷѡѹ TIS-620 繪شѡҵðҹصˡͧ ժ Ѻѡ·Ѻ\n\n TIS-620 ´ ISO-8859-11 ҡ ᵡҧѹ§ ISO-8859-11 ˹ A0  \"äẺѴ\" (no-break space) ǹ TIS-620 ʧǹ˹ A0  ˹  \n"
  },
  {
    "path": "sample/uchardet_test_samples/th/tis-620.txt",
    "content": "TIS-620\n\nҵðҹԵѳصˡ 620-2533, ͡.620-2533, ͷѡѹ TIS-620 繪شѡҵðҹصˡͧ ժ Ѻѡ·Ѻ\n\n TIS-620 ´ ISO-8859-11 ҡ ᵡҧѹ§ ISO-8859-11 ˹ A0  \"äẺѴ\" (no-break space) ǹ TIS-620 ʧǹ˹ A0  ˹  \n"
  },
  {
    "path": "sample/uchardet_test_samples/th/utf-8.txt",
    "content": "ยูนิโคด (อังกฤษ: Unicode) คือมาตรฐานอุตสาหกรรมที่ช่วยให้คอมพิวเตอร์แสดงผลและจัดการข้อความธรรมดาที่ใช้ในระบบการเขียนของภาษาส่วนใหญ่ในโลกได้อย่างสอดคล้องกัน ยูนิโคดประกอบด้วยรายการอักขระที่แสดงผลได้มากกว่า 100,000 ตัว พัฒนาต่อยอดมาจากมาตรฐานชุดอักขระสากล (Universal Character Set: UCS) และมีการตีพิมพ์ลงในหนังสือ The Unicode Standard เป็นแผนผังรหัสเพื่อใช้เป็นรายการอ้างอิง นอกจากนั้นยังมีการอธิบายวิธีการที่ใช้เข้ารหัสและการนำเสนอมาตรฐานของการเข้ารหัสอักขระอีกจำนวนหนึ่ง การเรียงลำดับอักษร กฎเกณฑ์ของการรวมและการแยกอักขระ รวมไปถึงลำดับการแสดงผลของอักขระสองทิศทาง (เช่นอักษรอาหรับหรืออักษรฮีบรูที่เขียนจากขวาไปซ้าย)\n"
  },
  {
    "path": "sample/uchardet_test_samples/tr/iso-8859-3.txt",
    "content": "Trke, Trk dili ya da Trkiye Trkesi, batda Balkanlar'dan balayp douda\nHazar Denizi sahasna kadar konuulan Altay dillerinden biridir. Ya, en eski\nhesaplara gre 8500 olan Trke, bugn yaayan Dnya dilleri arasnda en eski\nyazl belgelere sahip olan dildir. Bu belgeler, ivi yazl Smerce\ntabletlerdeki alnt kelimelerdir.[12] Trk yaz dilleri iinde Ouz sahas yaz\ndillerinden Osmanl Trkesinin devamn oluturur. Bata Trkiye olmak zere\neski Osmanl mparatorluu corafyasnda konuulan Trke, dnyada en fazla\nkonuulan 5. dildir. Trke sondan eklemeli bir dildir.[13] Bundan tr\nkullanlan herhangi bir eylem zerinden istenildii kadar szck\ntretilebilir.[14] Trkiye Trkesi bu ynnden dolay dier Trk dilleriyle\nortak ya da ayrk bulunan onlarca eke sahiptir.[15] Trke ok geni\nkullanmyla birlikte zengin bir dil olmasnn yan sra, genel itibaryla\n\"zne-nesne-yklem\" biimindeki cmle kuruluuna sahiptir.\n"
  },
  {
    "path": "sample/uchardet_test_samples/tr/iso-8859-9.txt",
    "content": "Trke, Trk dili ya da Trkiye Trkesi, batda Balkanlar'dan balayp douda\nHazar Denizi sahasna kadar konuulan Altay dillerinden biridir. Ya, en eski\nhesaplara gre 8500 olan Trke, bugn yaayan Dnya dilleri arasnda en eski\nyazl belgelere sahip olan dildir. Bu belgeler, ivi yazl Smerce\ntabletlerdeki alnt kelimelerdir.[12] Trk yaz dilleri iinde Ouz sahas yaz\ndillerinden Osmanl Trkesinin devamn oluturur. Bata Trkiye olmak zere\neski Osmanl mparatorluu corafyasnda konuulan Trke, dnyada en fazla\nkonuulan 5. dildir. Trke sondan eklemeli bir dildir.[13] Bundan tr\nkullanlan herhangi bir eylem zerinden istenildii kadar szck\ntretilebilir.[14] Trkiye Trkesi bu ynnden dolay dier Trk dilleriyle\nortak ya da ayrk bulunan onlarca eke sahiptir.[15] Trke ok geni\nkullanmyla birlikte zengin bir dil olmasnn yan sra, genel itibaryla\n\"zne-nesne-yklem\" biimindeki cmle kuruluuna sahiptir.\n"
  },
  {
    "path": "sample/uchardet_test_samples/tr/utf-8.txt",
    "content": "Türkiye, resmî adıyla Türkiye Cumhuriyeti, topraklarının büyük bölümü Anadolu'da, küçük bir bölümü ise Balkan Yarımadası'nın güneydoğu uzantısı olan Trakya'da yer alan ülke. Kuzeybatıda Bulgaristan, batıda Yunanistan, kuzeydoğuda Gürcistan, doğuda Ermenistan, İran ve Azerbaycan'ın ekslav toprağı Nahçıvan, güneydoğuda ise Irak ve Suriye komşusudur. Güneyini Kıbrıs adası ve Akdeniz. Batısını Ege Denizi ve kuzeyini Karadeniz çevreler. Marmara Denizi ise İstanbul Boğazı ve Çanakkale Boğazı ile birlikte Anadolu'yu Trakya'dan yani Asya'yı Avrupa'dan ayırır. Türkiye, Avrupa ve Asya'nın kavşak noktasında yer alması sayesinde önemli bir jeostratejik güce sahiptir.\n"
  },
  {
    "path": "sample/uchardet_test_samples/uk/utf-8.txt",
    "content": "Бабак[1][2], байбак[1], бобак[3] (Marmota Blumenbach, 1779) — рід гризунів родини вивіркових (Sciuridae) поширених в Євразії та Північній Америці. Бабаки в основному їдять зелень і багато видів трав, ягід, лишайники, мохи, коріння і квіти. Як правило, живуть у норах і перебувають у сплячці впродовж зими. Більшість бабаків дуже соціальні. У залежності від виду, довжина голови й тіла становить від 30 до 60 сантиметрів, довжина хвоста — від 10 до 25 см, вага становить від 3 до 7 кілограмів[4].\n"
  },
  {
    "path": "sample/uchardet_test_samples/uk/windows-1251.txt",
    "content": "[1][2], [1], [3] (Marmota Blumenbach, 1779)     (Sciuridae)   糿  ϳ .         , , , ,   .  ,         .    .    ,       30  60 ,     10  25 ,    3  7 [4].\n"
  },
  {
    "path": "sample/uchardet_test_samples/vi/utf-8.txt",
    "content": "Chữ Quốc ngữ là hệ chữ viết thống nhất chính thức hiện nay của tiếng Việt, sử\ndụng ký tự La Tinh, dựa trên các bảng chữ cái của nhóm ngôn ngữ Rôman,[1] đặc\nbiệt là bảng chữ cái Bồ Đào Nha,[2] với các dấu phụ chủ yếu từ bảng chữ cái Hy\nLạp.\n"
  },
  {
    "path": "sample/uchardet_test_samples/vi/viscii.txt",
    "content": "Ch Quc ng l h ch vit thng nht chnh thc hin nay ca ting Vit, s\ndng k t La Tinh, da trn cc bng ch ci ca nhm ngn ng Rman,[1] c\nbit l bng ch ci B o Nha,[2] vi cc du ph ch yu t bng ch ci Hy\nLp.\n"
  },
  {
    "path": "sample/uchardet_test_samples/vi/windows-1258.txt",
    "content": "Ch Quc ng l h ch vit thng nht chnh thc hin nay cua ting Vit, s\ndung ky t La Tinh, da trn cc bang ch ci cua nhm ngn ng Rman,[1] c\nbit l bang ch ci B o Nha,[2] vi cc du phu chu yu t bang ch ci Hy\nLap.\n"
  },
  {
    "path": "sample/uchardet_test_samples/zh/big5.txt",
    "content": "c餤c餤c餤c餤c餤c餤c餤c餤c餤c餤c餤c餤c餤c餤c餤c餤c餤"
  },
  {
    "path": "sample/uchardet_test_samples/zh/euc-tw.txt",
    "content": "EUC-TWҳƺġCNS 11643??ƺEUC-TWŷ\n"
  },
  {
    "path": "sample/uchardet_test_samples/zh/gb18030.txt",
    "content": "ļļļļļļļļļļ"
  },
  {
    "path": "sample/uchardet_test_samples/zh/utf-8.txt",
    "content": "汉字漢字統一編碼萬國碼\n"
  },
  {
    "path": "scripts/extract_change_log.py",
    "content": "import argparse\nimport os\nimport re\nimport sys\n\n# 设置 Python 的默认编码为 utf-8\nos.environ['PYTHONIOENCODING'] = 'utf-8'\n\nif hasattr(sys.stdout, 'reconfigure'):\n    sys.stdout.reconfigure(encoding='utf-8')  # this works\nelse:\n    import io\n    sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')\n\nSELF_DIR = os.path.split(os.path.realpath(__file__))[0].replace(\"\\\\\", \"/\")\nSELF_BASENAME = os.path.split(os.path.realpath(__file__))[1]\nREPO_DIR = os.path.abspath(f\"{SELF_DIR}/..\").replace(\"\\\\\", \"/\")\n\nCHANGE_LOG_FILENAME = f\"{REPO_DIR}/build/CHANGELOG.txt\"\nREADME_FILENAME_CN = f\"{REPO_DIR}/README.md\"\nREADME_FILENAME_EN = f\"{REPO_DIR}/README-en.md\"\nVERSION_START_STR_CN = \"# 版本记录\"\nVERSION_START_STR_EN = \"# Version\"\n\ndef ParseArguments() -> argparse.Namespace:\n    parser = argparse.ArgumentParser()\n    parser.add_argument(\"--tag\", required=True)\n    args = parser.parse_args()\n    print(f\"[{SELF_BASENAME}] args: {args}\")\n    return args\n\ndef SearchTag(filename: str, tag: str, versionStartStr: str) -> str:\n    with open(filename, \"r\", encoding=\"utf-8\") as f:\n        lines = f.readlines()\n    pos = 0\n    found = False\n    for i in range(len(lines)):\n        line = lines[i]\n        if line.find(versionStartStr) != -1:\n            pos = i\n            found = True\n            break\n    if not found:\n        raise RuntimeError(f\"version start string \\\"{versionStartStr}\\\" not found at {filename}\")\n    \n    found = False\n    for i in range(pos, len(lines)):\n        line = lines[i]\n        if line.startswith(tag):\n            pos = i\n            found = True\n            break\n    if not found:\n        raise RuntimeError(f\"tag \\\"{tag}\\\" not found at {filename}\")\n    \n    ret = [line.strip()]\n    pos += 1\n    for i in range(pos, len(lines)):\n        line = lines[i]\n        if line == \"\\n\" or line == \"\\r\\n\":\n            break\n        if re.match(r\"v\\d+\\.\\d+.*\", line):\n            break\n        ret.append(line.strip())\n    return \"\\n\".join(ret)\n\n\ndef main(args: argparse.Namespace):\n    cnContent = SearchTag(README_FILENAME_CN, args.tag, VERSION_START_STR_CN)\n    enContent = SearchTag(README_FILENAME_EN, args.tag, VERSION_START_STR_EN)\n\n    changeLog = \"\"\n    changeLog += cnContent\n    changeLog += \"\\n\"\n    changeLog += enContent\n    print(f\"[{SELF_BASENAME}] CHANGELOG.txt:\")\n    print(\"=\" * 30)\n    print(changeLog)\n    print(\"=\" * 30)\n    with open(CHANGE_LOG_FILENAME, \"w\", encoding=\"utf-8\") as f:\n        f.write(changeLog)\n\nif __name__ == \"__main__\":\n    args = ParseArguments()\n    main(args)\n"
  },
  {
    "path": "src/CMakeLists.txt",
    "content": "add_subdirectory(Common)\nadd_subdirectory(Control)\nadd_subdirectory(Core)\nadd_subdirectory(Translator)\nadd_subdirectory(SmartCharsetConverter)\nadd_subdirectory(SmartCharsetConverter-imgui)\n"
  },
  {
    "path": "src/Common/CMakeLists.txt",
    "content": "# ==============================\nfile(GLOB_RECURSE SRC_CODE\n\t*.h\n\t*.cpp\n\t)\n\nadd_library(Common STATIC ${SRC_CODE})\n"
  },
  {
    "path": "src/Common/CommandLineParser.cpp",
    "content": "#include \"CommandLineParser.h\"\n#include \"tstring.h\"\n\nstd::vector<std::string> GetCommandLineArgs() {\n    std::vector<std::string> args;\n    LPWSTR *szArglist;\n    int nArgs;\n    int i;\n\n    szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);\n    if (NULL == szArglist) {\n        throw std::runtime_error(\"CommandLineToArgvW failed\");\n    }\n\n    for (i = 0; i < nArgs; i++) {\n        args.push_back(to_utf8(szArglist[i]));\n    }\n\n    // Free memory allocated for CommandLineToArgvW arguments.\n    LocalFree(szArglist);\n\n    return args;\n}\n"
  },
  {
    "path": "src/Common/CommandLineParser.h",
    "content": "#pragma once\n\n#include <Windows.h>\n\n#include <iostream>\n#include <vector>\n#include <string>\n\nstd::vector<std::string> GetCommandLineArgs();\n"
  },
  {
    "path": "src/Common/ConsoleSettings.cpp",
    "content": "#include \"ConsoleSettings.h\"\n\n#include <cassert>\n\nvoid SetConsoleColor(ConsoleColor color) noexcept {\n    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);\n    assert(hConsole);\n    BOOL ok = SetConsoleTextAttribute(hConsole, static_cast<WORD>(color));\n    assert(ok);\n    HANDLE hConsoleErr = GetStdHandle(STD_ERROR_HANDLE);\n    assert(hConsoleErr);\n    ok = SetConsoleTextAttribute(hConsoleErr, static_cast<WORD>(color));\n    assert(ok);\n}\n"
  },
  {
    "path": "src/Common/ConsoleSettings.h",
    "content": "#pragma once\n\n#include <Windows.h>\n\nenum class ConsoleColor { GREEN = 10, BLUE = 11, RED = 12, PINK = 13, YELLOW = 14, WHITE = 15 };\n\nvoid SetConsoleColor(ConsoleColor color = ConsoleColor::WHITE) noexcept;"
  },
  {
    "path": "src/Common/ErrorFunction.cpp",
    "content": "#include \"ErrorFunction.h\"\n\nusing namespace std;\n\n// 根据错误码返回对应的错误信息\nstd::tstring GetLastErrorString(DWORD errorCode) {\n    TCHAR *lpMsgBuf = nullptr;\n\n    FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,\n                  errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (TCHAR *)&lpMsgBuf, 0, NULL);\n\n    tstring ret(lpMsgBuf);\n\n    LocalFree(lpMsgBuf);\n    return ret;\n}"
  },
  {
    "path": "src/Common/ErrorFunction.h",
    "content": "#pragma once\n\n#include \"tstring.h\"\n\n// 根据错误码返回对应的错误信息\nstd::tstring GetLastErrorString(DWORD errorCode);\n"
  },
  {
    "path": "src/Common/FileFunction.cpp",
    "content": "#define _CRT_SECURE_NO_WARNINGS\n#include \"FileFunction.h\"\n\n#include <algorithm>\n#include <tchar.h>\n#include <memory>\n#include <assert.h>\n\n#include <commdlg.h>\n\n#include <Shlobj.h>   //选择文件夹对话框\n#include <shellapi.h> //CommandLineToArgvW\n#pragma comment(lib, \"Shell32.lib\")\n\n#undef max\n#undef min\n\nusing namespace std;\n\n// 文件对话框 存储文件列表字符串的缓冲长度。MAX_PATH是肯定不够的，选几个就超出了。\n// 据说nMaxFile虽然是DWORD类型，但只用了前2个字节，所以这里设成int16_t最大值\nconst int TFileDialog_BUF_SIZE = 32767;\n\nstd::unique_ptr<TCHAR[]> ToTCHARArray(const std::tstring &s) {\n    auto size = s.size();\n    unique_ptr<TCHAR[]> ret(new TCHAR[size + 1]);\n    memcpy(ret.get(), s.data(), size * sizeof(TCHAR));\n    ret[size] = TEXT('\\0');\n    return ret;\n}\n\nTFileDialog::TFileDialog(HWND hwndOwner) {\n    // Initialize OPENFILENAME\n    ZeroMemory(&ofn, sizeof(OPENFILENAME));\n    ofn.lStructSize = sizeof(OPENFILENAME);\n    ofn.hwndOwner = hwndOwner;\n\n    result = unique_ptr<TCHAR[]>(new TCHAR[TFileDialog_BUF_SIZE]);\n    result[0] = TEXT('\\0');\n    ofn.lpstrFile = result.get();\n    ofn.nMaxFile = TFileDialog_BUF_SIZE;\n\n    ofn.nFilterIndex = 1;\n    ofn.lpstrInitialDir = NULL;\n}\n\nTFileDialog::TFileDialog(HWND hwndOwner, std::vector<std::pair<std::tstring, std::tstring>> vecFilter, bool multiSelect)\n    : TFileDialog(hwndOwner) {\n    SetFilter(vecFilter);\n\n    ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;\n    if (multiSelect) {\n        ofn.Flags |= OFN_ALLOWMULTISELECT;\n    }\n}\n\nvoid TFileDialog::SetFilter(std::vector<std::pair<std::tstring, std::tstring>> vecFilter) {\n    // lpstrFilter格式：TEXT(\"机构设计文件(*.lml)\\0*.lml\\0\\0\")\n    std::tstring ret;\n    for (auto &pr : vecFilter) {\n        auto &name = pr.first;\n        auto &reg = pr.second;\n        ret += name + TEXT('\\0') + reg + TEXT('\\0');\n    }\n    ret += TEXT('\\0');\n\n    filter = ToTCHARArray(ret);\n\n    ofn.lpstrFilter = filter.get(); // 两个\\0表示结束\n}\n\nvoid TFileDialog::SetTitle(const std::tstring &title) {\n    this->title = ToTCHARArray(title);\n    ofn.lpstrTitle = this->title.get();\n}\n\nbool TFileDialog::Open() {\n    TCHAR originDir[1024];\n    GetCurrentDirectory(1024, originDir);\n    bool ok = ::GetOpenFileName(&ofn);\n    if (!ok) {\n        auto err = CommDlgExtendedError();\n\n        if (err == 0x3003) // FNERR_BUFFERTOOSMALL\n        {\n            throw runtime_error(\"文件选太多。少选一点试试。\");\n        }\n    }\n\n    SetCurrentDirectory(originDir);\n    return ok;\n}\n\nstd::vector<std::tstring> TFileDialog::GetResult() const {\n    // 如果没结果，返回空\n    if (ofn.lpstrFile[0] == TEXT('\\0')) {\n        return {};\n    }\n\n    // 如果是单选\n    if ((ofn.Flags & OFN_ALLOWMULTISELECT) == 0) {\n        return {ofn.lpstrFile};\n    }\n\n    // 如果是多选\n    std::vector<std::tstring> ans;\n    tstring dir, temp;\n    auto p = ofn.lpstrFile;\n    int state = 0;\n    for (DWORD i = 0; i < ofn.nMaxFile; ++i) {\n        auto c = p[i];\n        switch (state) {\n        case 0: // 状态0：第一次遇到\\0之前\n            if (c == TEXT('\\0')) {\n                ans.push_back(temp);\n                temp.clear();\n                state = 1;\n            } else {\n                temp += c;\n            }\n            break;\n        case 1: // 状态1：中途的字符\n            if (c == TEXT('\\0')) {\n                goto end;\n            } else {\n                temp += c;\n                state = 2;\n\n                dir = ans[0];\n                ans.pop_back();\n            }\n            break;\n        case 2:                  // 状态2：中途已遇到\\0\n            if (c == TEXT('\\0')) // 再次遇到\\0，结束\n            {\n                ans.push_back(dir + TEXT('\\\\') + temp);\n                temp.clear();\n                state = 3;\n            } else {\n                temp += c;\n            }\n            break;\n        case 3:\n            if (c == TEXT('\\0')) {\n                goto end;\n            } else {\n                temp += c;\n                state = 2;\n            }\n            break;\n        }\n    }\nend:\n\n    return ans;\n}\n\nvoid TFileDialog::SetResult(const std::tstring &s) {\n    result = ToTCHARArray(s);\n    ofn.lpstrFile = result.get();\n}\n\nbool TFileDialog::Save() {\n    ofn.Flags = OFN_PATHMUSTEXIST;\n\n    // 设为空可以自动加上选择的后缀名，否则无论选什么后缀，\n    // 只要没有输入.txt这种，都是无后缀\n    ofn.lpstrDefExt = TEXT(\"\");\n\n    return ::GetSaveFileName(&ofn);\n}\n\nTFolderBrowser::TFolderBrowser(HWND hwndOwner, std::tstring title) : hWndOwner(hwndOwner), title(title) {}\n\nbool TFolderBrowser::Open(std::tstring &fileName) {\n    assert(hWndOwner);\n    auto BrowserCallbackProc = [](HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData) -> int {\n        if (uMsg == BFFM_INITIALIZED) {\n            SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData);\n        }\n        return 0;\n    };\n\n    TCHAR szBuffer[MAX_PATH] = {0};\n\n    BROWSEINFO bi = {0};\n    bi.hwndOwner = hWndOwner;\n    bi.pszDisplayName = szBuffer; // 接收文件夹的缓冲区\n    bi.lpszTitle = title.c_str(); // 标题\n    bi.ulFlags = BIF_NEWDIALOGSTYLE;\n\n    // 使用回调传入初始路径\n    bi.lParam = (LPARAM)fileName.c_str();\n    bi.lpfn = (BFFCALLBACK)BrowserCallbackProc;\n\n    LPITEMIDLIST idl = SHBrowseForFolder(&bi);\n    bool ret = SHGetPathFromIDList(idl, szBuffer);\n    if (ret)\n        fileName = szBuffer;\n    return ret;\n}\n\n// 传入index=1则得到传入文件名\n// 失败返回空串\n#ifdef UNICODE\nstd::wstring GetCommandLineByIndex(int index) {\n    int nArgs;\n    LPWSTR *szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);\n    if (szArglist && nArgs >= index + 1) {\n        return szArglist[index];\n    }\n    return L\"\";\n}\n#else\nstd::string GetCommandLineByIndex(int index) {\n    int nArgs;\n    LPWSTR *szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);\n    if (szArglist && nArgs >= index + 1) {\n        return szArglist[index];\n    }\n    return L\"\";\n}\n\n#endif\n\nbool GetFileExists(const std::string filename) {\n    WIN32_FIND_DATA FindFileData;\n    HANDLE hFind;\n\n    hFind = FindFirstFileW(utf8_to_wstring(filename).c_str(), &FindFileData);\n\n    if (hFind == INVALID_HANDLE_VALUE) {\n        return false;\n    } else {\n        if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {\n            // is folder\n            FindClose(hFind);\n            return false;\n        } else {\n            FindClose(hFind);\n            return true;\n        }\n    }\n}\n\nvector<tstring> SplitPath(const std::tstring &s) {\n    vector<tstring> ret;\n    auto slash = s.find_last_of(TEXT(\"/\\\\\")); // 找最后一个正斜杠或者反斜杠位置\n\n    if (slash != tstring::npos) // 存在\n    {\n        ret.push_back(s.substr(0, slash));             // 得到纯路径\n        auto vec = SplitFileName(s.substr(slash + 1)); // 分割文件名\n        ret.insert(ret.end(), vec.begin(), vec.end());\n    } else {\n        ret.push_back(TEXT(\"\"));\n        auto vec = SplitFileName(s);\n        ret.insert(ret.end(), vec.begin(), vec.end());\n    }\n    return ret;\n}\n\nvector<tstring> SplitFileName(const std::tstring &s) {\n    auto dot = s.find_last_of(TEXT('.')); // 从后寻找.\n    if (dot != tstring::npos)\n        return {s.substr(0, dot), s.substr(dot)};\n    else\n        return {s, TEXT(\"\")};\n}\n\nstd::string GetNameAndExt(std::string s) noexcept {\n    string ret;\n    auto slash = s.find_last_of(\"/\\\\\"); // 从后寻找正反斜杠\n    if (slash != string::npos) {\n        ret = s.substr(slash + 1);\n    } else {\n        ret = s;\n    }\n    return ret;\n}\n\n// e.g. ext=\"txt\"\ntstring ChangeExtend(tstring fileName, tstring ext) {\n    auto slash_pos = fileName.find_last_of('\\\\');\n    auto dot_pos = fileName.find_last_of('.');\n    if (dot_pos == tstring::npos ||\n        (slash_pos != tstring::npos && dot_pos < slash_pos)) // e.g. \"Name\" \"dir.dir\\file.ext\"\n    {\n        return fileName + TEXT('.') + ext;\n    }\n    return fileName.substr(0, dot_pos) + TEXT('.') + ext;\n}\n\nstd::string GetExtend(std::string fileName) {\n    auto slash_pos = fileName.find_last_of('\\\\');\n    auto dot_pos = fileName.find_last_of('.');\n    if (dot_pos == string::npos || (slash_pos != string::npos && dot_pos < slash_pos)) // e.g. \"Name\" \"dir.dir\\file\"\n    {\n        return \"\";\n    }\n    return fileName.substr(dot_pos + 1);\n}\n\n// 取得文件大小，不改变读写位置\nuint64_t GetFileSize(FILE *fp) {\n    long long origin_pos = _ftelli64(fp);\n    _fseeki64(fp, 0LL, SEEK_END);\n    long long ret = _ftelli64(fp);\n    _fseeki64(fp, origin_pos, SEEK_SET);\n    return ret;\n}\n\nuint64_t GetFileSize(std::string fileName) {\n    std::wstring wfilename = utf8_to_wstring(fileName);\n    FILE *fp = _wfopen(wfilename.c_str(), L\"rb\");\n    if (fp == nullptr) {\n        throw file_io_error(string(\"\\\"\") + fileName + \"\\\" can't open.\", fileName);\n    }\n    uint64_t sz = GetFileSize(fp);\n    fclose(fp);\n    return sz;\n}\n\nstd::string FileSizeToHumanString(uint64_t fileSize) {\n    double d;\n    char buf[64];\n    if (fileSize >= GB) {\n        d = fileSize / (double)GB;\n        sprintf(buf, \"%.2f GB\", d);\n    } else {\n        if (fileSize >= MB) {\n            d = fileSize / (double)MB;\n            sprintf(buf, \"%.2f MB\", d);\n        } else if (fileSize >= KB) {\n            d = fileSize / (double)KB;\n            sprintf(buf, \"%.2f KB\", d);\n        } else {\n            d = static_cast<double>(fileSize);\n            sprintf(buf, \"%.0f B\", d);\n        }\n    }\n\n    return buf;\n}\n\nstd::tuple<std::unique_ptr<char[]>, uint64_t> ReadFileToBuffer(std::string fileName, uint64_t limitSize) {\n    uint64_t bufSize = GetFileSize(fileName);\n\n    if (limitSize != 0) {\n        bufSize = std::min(bufSize, limitSize);\n    }\n\n    unique_ptr<char[]> buf = make_unique<char[]>(bufSize);\n\n    // 如果是空文件，就不用读了\n    if (bufSize == 0) {\n        return make_tuple(std::move(buf), bufSize);\n    }\n\n    std::wstring wfilename = utf8_to_wstring(fileName);\n    FILE *fp = _wfopen(wfilename.c_str(), TEXT(\"rb\"));\n    if (fp == nullptr)\n        throw file_io_error(string(\"\\\"\") + fileName + \"\\\" can't open.\", fileName);\n    auto ret = fread(buf.get(), bufSize, 1, fp);\n    if (ret < 1) {\n        fclose(fp);\n        throw file_io_error(string(\"\\\"\") + fileName + \"\\\" can't read.\", fileName);\n    }\n    fclose(fp);\n\n    return make_tuple(std::move(buf), bufSize);\n}\n\nvoid WriteFileFromBuffer(std::string fileName, const char buf[], uint64_t bufSize) {\n    std::wstring wfilename = utf8_to_wstring(fileName);\n    FILE *fp = _wfopen(wfilename.c_str(), TEXT(\"wb\"));\n    if (fp == nullptr)\n        throw file_io_error(string(\"\\\"\") + fileName + \"\\\" can't open.\", fileName);\n    auto ret = fwrite(buf, bufSize, 1, fp);\n    if (ret < 1) {\n        fclose(fp);\n        throw file_io_error(string(\"\\\"\") + fileName + \"\\\" can't write.\", fileName);\n    }\n    fclose(fp);\n}\n\nvoid WriteDetailFile(HWND hWnd, std::tstring filename, std::function<void(std::tofstream &ofs)> fnWrite) {\n    TFileDialog fileDialog(hWnd, {{TEXT(\"txt\"), TEXT(\"*.txt\")}});\n    fileDialog.SetResult(filename);\n    if (fileDialog.Save()) {\n        tofstream ofs(filename);\n\n        if (ofs.fail()) {\n            tstring errInfo = TEXT(\"写入\") + filename + TEXT(\"失败。可能是文件正在被占用或者没有权限。\");\n            ::MessageBox(hWnd, errInfo.c_str(), TEXT(\"出错\"), MB_OK | MB_ICONERROR);\n            return;\n        }\n\n        fnWrite(ofs);\n        ofs.close();\n\n        tstring info = filename + TEXT(\"已写入。\");\n        ::MessageBox(hWnd, info.c_str(), TEXT(\"提示\"), MB_OK | MB_ICONINFORMATION);\n    }\n}\n\n// 失败抛出file_io_error类型自定义异常\nvoid findFiles(std::vector<std::string> &ret, std::string lpPath, std::vector<std::string> dotextNames,\n               bool enterSubFolder) {\n    string szFile;\n    WIN32_FIND_DATA FindFileData;\n\n    string szFind = lpPath + \"\\\\*\";\n\n    HANDLE hFind = ::FindFirstFileW(utf8_to_wstring(szFind).c_str(), &FindFileData);\n\n    if (INVALID_HANDLE_VALUE == hFind) {\n        throw file_io_error(\"Invalid folder:\" + szFind, szFind);\n        return;\n    }\n\n    do {\n        if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {\n            // 是目录\n            if (FindFileData.cFileName[0] != TEXT('.')) // 不是以.开头的目录\n            {\n                if (enterSubFolder) {\n                    // 进入子目录\n                    szFile = lpPath + \"\\\\\" + to_utf8(FindFileData.cFileName);\n                    findFiles(ret, szFile, dotextNames, enterSubFolder);\n                }\n            }\n        } else {\n            // 是文件\n            std::string filePath = lpPath + \"\\\\\" + to_utf8(FindFileData.cFileName);\n            if (dotextNames.empty()) {\n                ret.push_back(filePath);\n            } else {\n                string filename(tolower(to_utf8(FindFileData.cFileName)));\n                for (auto &dotext : dotextNames) {\n                    if (filename.substr(filename.length() - dotext.length(), dotext.length()) ==\n                        dotext) // 文件名后n位和扩展名相同\n                    {\n                        ret.push_back(filePath);\n                    }\n                }\n            }\n            //        if ( szFile.empty() )\n            //        {\n            ////szFile为空，为当前目录\n            //            std::string filePath = szFile+FindFileData.cFileName;\n            //            file_lists.push_back(filePath);\n            //        }\n            //        else\n            //        {\n            ////非当前目录，输出全路径\n            //            std::string filePath = lpPath+\"\\\\\"+FindFileData.cFileName;\n            //            file_lists.push_back(filePath);\n            //        }\n        }\n\n    } while (::FindNextFile(hFind, &FindFileData));\n\n    ::FindClose(hFind);\n}\n\n// 失败抛出file_io_error类型自定义异常\nstd::vector<std::string> TraversalAllFileNames(std::string lpPath, std::vector<std::string> dotextNames,\n                                               bool enterSubFolder) {\n    std::vector<std::string> file_lists;\n    findFiles(file_lists, lpPath, dotextNames, enterSubFolder);\n    return file_lists;\n}"
  },
  {
    "path": "src/Common/FileFunction.h",
    "content": "#pragma once\n\n#include \"tstring.h\"\n#include <vector>\n#include <fstream>\n#include <functional>\n#include <Windows.h>\n#include <commdlg.h> // OPENFILENAME\n\nclass TFileDialog {\nprivate:\n    OPENFILENAME ofn;\n    std::unique_ptr<TCHAR[]> title;\n    std::unique_ptr<TCHAR[]> result;\n    std::unique_ptr<TCHAR[]> filter;\n\npublic:\n    TFileDialog() = delete;\n    TFileDialog(const TFileDialog &) = delete;\n    TFileDialog(HWND hwndOwner);\n\n    // 示例：m_hWnd, {{\"txt文本文件\",\"*.txt\"}}\n    TFileDialog(HWND hwndOwner, std::vector<std::pair<std::tstring, std::tstring>> vecFilter, bool multiSelect = false);\n\n    void SetFilter(std::vector<std::pair<std::tstring, std::tstring>> vecFilter);\n\n    void SetTitle(const std::tstring &title);\n\n    void SetResult(const std::tstring &s);\n\n    std::vector<std::tstring> GetResult() const;\n\n    bool Open();\n\n    bool Save();\n};\n\nclass TFolderBrowser {\npublic:\n    TFolderBrowser(HWND hwndOwner, std::tstring title = TEXT(\"请选择一个文件夹\"));\n\n    // fileName用于赋予初始路径，若用户点了取消，将不会对值产生影响\n    bool Open(std::tstring &fileName);\n\nprivate:\n    std::tstring title;\n    HWND hWndOwner;\n};\n\n// 自定义的文件IO异常。继承自runtime_error\nclass file_io_error : public std::runtime_error {\npublic:\n    std::string _filename;\n    file_io_error(std::string s, std::string filename) : std::runtime_error(s), _filename(filename) {}\n    const std::string &filename() {\n        return _filename;\n    }\n};\n\nconst uint64_t KB = 1024;\nconst uint64_t MB = KB * KB;\nconst uint64_t GB = MB * MB;\n\n// 传入index=1则得到传入文件名\n// 失败返回空串\nstd::wstring GetCommandLineByIndex(int index);\n\n// 判断文件是否存在\nbool GetFileExists(const std::string filename);\n\n// 分割完整路径为 {路径，文件名不带后缀，.后缀}\nstd::vector<std::tstring> SplitPath(const std::tstring &s);\n\n// 从[文件名+后缀]的字符串中分割出 { 文件名不带后缀，.后缀 }\nstd::vector<std::tstring> SplitFileName(const std::tstring &s);\n\n// 从完整路径得到 文件名+后缀，若本身不含正反斜杠，则返回自身\nstd::string GetNameAndExt(std::string s) noexcept;\n\n// e.g. ext=\"txt\"\nstd::tstring ChangeExtend(std::tstring fileName, std::tstring ext);\n\n// e.g. ext=\"txt\"\nstd::string GetExtend(std::string fileName);\n\n// 取得文件大小，不改变读写位置\nuint64_t GetFileSize(FILE *fp);\n\n// 取得文件大小\n// 失败抛出file_io_error类型自定义异常\nuint64_t GetFileSize(std::string fileName);\n\nstd::string FileSizeToHumanString(uint64_t fileSize);\n\n/*\n * @brief 给定文件名，读取到一个buffer\n * @limitSize 限制大小。为0代表读完。不为0的话，最大读取limitSize大小。\n * @exception file_io_error 失败抛出异常\n */\nstd::tuple<std::unique_ptr<char[]>, uint64_t> ReadFileToBuffer(std::string fileName, uint64_t limitSize = 0);\n\n// 失败抛出file_io_error类型自定义异常\nvoid WriteFileFromBuffer(std::string fileName, const char buf[], uint64_t bufSize);\n\n// 弹出文件对话框，然后按照给定文件名写入一个文本文件\n// 传入的filename会在文件对话框中显示为默认文件名\n//  fnWrite中定义要写入的内容，不需要进行打开关闭操作\n// 写入成功或者失败均会弹出对话框提示\nvoid WriteDetailFile(HWND hWnd, std::tstring filename, std::function<void(std::tofstream &ofs)> fnWrite);\n\n// 失败抛出file_io_error类型自定义异常\nstd::vector<std::string> TraversalAllFileNames(std::string lpPath, std::vector<std::string> dotextNames = {},\n                                               bool enterSubFolder = true);"
  },
  {
    "path": "src/Common/ResourceLoader.cpp",
    "content": "#include \"ResourceLoader.h\"\n\n#include <Windows.h>\n\n#include <cassert>\n\nstd::vector<char> LoadCustomFileFromResource(int id, const std::wstring &resourceType) {\n\n    HRSRC hResource = FindResourceW(NULL, MAKEINTRESOURCE(id), resourceType.c_str());\n    // 处理资源未找到的情况\n    assert(hResource);\n\n    HGLOBAL hResData = LoadResource(NULL, hResource);\n    // 处理资源加载失败的情况\n    assert(hResData);\n\n    DWORD dwResSize = SizeofResource(NULL, hResource);\n    // 处理资源大小为0的情况\n    assert(dwResSize);\n\n    LPBYTE lpResData = (LPBYTE)LockResource(hResData);\n    // 处理资源锁定失败的情况\n    assert(lpResData);\n\n    std::vector<char> ret(dwResSize);\n    memcpy(ret.data(), lpResData, dwResSize);\n\n    return ret;\n}"
  },
  {
    "path": "src/Common/ResourceLoader.h",
    "content": "#pragma once\n\n#include <vector>\n#include <string>\n\nstd::vector<char> LoadCustomFileFromResource(int id, const std::wstring &resourceType);"
  },
  {
    "path": "src/Common/SingleApplication.h",
    "content": "#pragma once\n\n#include <tstring.h>\n\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#include <Windows.h>\n\n/*\n防多开类\n\n用法：\nSingleApplication single;\nif (single.IsRunning(TEXT(\"AppTitle\")))\n{\n        throw runtime_error(\"只能同时运行一个实例！\");\n}\n\n*/\nclass SingleApplication {\npublic:\n    ~SingleApplication() { ReleaseMutex(mutex); }\n\n    bool IsRunning(const std::tstring &mutex_name) {\n        mutex = OpenMutex(MUTEX_ALL_ACCESS, 0, mutex_name.c_str());\n        if (nullptr == mutex) {\n            mutex = CreateMutex(0, 0, mutex_name.c_str());\n            return false;\n        } else {\n            return true;\n        }\n    }\n\nprivate:\n    HANDLE mutex;\n};"
  },
  {
    "path": "src/Common/ThreadPool/SafeQueue.h",
    "content": "#pragma once\n\n#include <queue>\n#include <mutex>\n#include <optional>\n\ntemplate <typename T> class SafeQueue {\npublic:\n    SafeQueue() {}\n\n    bool empty() const {\n        std::scoped_lock<std::mutex> sl(m);\n        return q.empty();\n    }\n\n    std::size_t size() const {\n        std::scoped_lock<std::mutex> sl(m);\n        return q.size();\n    }\n\n    template <typename U> void enqueue(U &&t) {\n        std::scoped_lock<std::mutex> sl(m);\n        q.push(std::forward<U>(t));\n    }\n\n    std::optional<T> dequeue() {\n        std::scoped_lock<std::mutex> sl(m);\n        if (q.empty()) {\n            return {};\n        }\n        T t = std::move(q.front());\n        q.pop();\n        return t;\n    }\n\nprivate:\n    std::queue<T> q;\n    mutable std::mutex m;\n};"
  },
  {
    "path": "src/Common/ThreadPool/ThreadPool.h",
    "content": "#pragma once\n\n#include \"SafeQueue.h\"\n\n#include <vector>\n#include <thread>\n#include <mutex>\n#include <condition_variable>\n#include <functional>\n#include <future>\n\n#undef min\n#undef max\n\nclass ThreadPool {\npublic:\n    ThreadPool() : doStop(false) {\n        int workerNums = std::max(1, static_cast<int>(std::thread::hardware_concurrency()) - 1);\n        for (int i = 0; i < workerNums; i++) {\n            vecth.push_back(std::thread(&ThreadPool::workLoop, this));\n        }\n    }\n\n    ~ThreadPool() {\n        {\n            std::scoped_lock sl(m);\n            doStop = true;\n        }\n\n        cv.notify_all();\n\n        for (auto &th : vecth) {\n            th.join();\n        }\n    }\n\n    template <typename F, typename... Args>\n    auto submit(F &&fn, Args &&...args) -> std::future<decltype(fn(args...))> {\n        std::function<decltype(fn(args...))()> func = std::bind(std::forward<F>(fn), std::forward<Args>(args)...);\n\n        auto taskPtr = std::make_shared<std::packaged_task<decltype(fn(args...))()>>(func);\n\n        std::function<void()> wrapper = [taskPtr]() { (*taskPtr)(); };\n\n        q.enqueue(std::move(wrapper));\n\n        cv.notify_one();\n\n        return taskPtr->get_future();\n    }\n\nprivate:\n    std::vector<std::thread> vecth;\n    bool doStop;\n\n    SafeQueue<std::function<void()>> q;\n\n    std::mutex m;\n    std::condition_variable cv;\n\n    void workLoop() {\n        while (1) {\n            std::unique_lock ul(m);\n            while (!doStop && q.empty()) {\n                cv.wait(ul);\n            }\n\n            if (doStop)\n                return;\n\n            auto t = q.dequeue();\n\n            ul.unlock();\n\n            if (!t.has_value())\n                continue;\n\n            auto fn = t.value();\n            fn();\n        }\n    }\n};"
  },
  {
    "path": "src/Common/TimeStamp.cpp",
    "content": "#define _CRT_SECURE_NO_WARNINGS\n#include \"TimeStamp.h\"\n\n#include <cassert>\n\nusing namespace std;\n\n#define TICKS_PER_SECOND 10000000\n#define EPOCH_DIFFERENCE 11644473600LL\n\n// Windows时间从1601-01-01T00：00：00Z开始。离UNIX/Linux时间(1970-01-01T00：00：00Z)还有11644473600秒。Windows时间为100纳秒。\n// 因此，从UNIX时间获得秒的函数如下所示\ntime_t convertWindowsTimeToUnixTime(long long input) {\n    long long temp;\n    temp = input / TICKS_PER_SECOND; // convert from 100ns intervals to seconds;\n    temp = temp - EPOCH_DIFFERENCE;  // subtract number of seconds between epochs\n    return (time_t)temp;\n}\n\nTimeStamp::TimeStamp() : tp(selected_clock::now()) {}\n\nTimeStamp::TimeStamp(std::chrono::time_point<selected_clock> tp) : tp(tp) {}\n\nTimeStamp::TimeStamp(time_t t) {\n    tp = selected_clock::from_time_t(t);\n    // assert(selected_clock::to_time_t(tp) == t);\n}\n\nTimeStamp::TimeStamp(FILETIME fileTime) {\n    time_t t = convertWindowsTimeToUnixTime(*((long long *)&fileTime));\n    tp = selected_clock::from_time_t(t);\n}\n\nbool TimeStamp::operator<(const TimeStamp &other) const {\n    return tp.time_since_epoch().count() < other.tp.time_since_epoch().count();\n}\n\nbool TimeStamp::operator<=(const TimeStamp &other) const {\n    return tp.time_since_epoch().count() <= other.tp.time_since_epoch().count();\n}\n\nbool TimeStamp::operator>(const TimeStamp &other) const {\n    return tp.time_since_epoch().count() > other.tp.time_since_epoch().count();\n}\n\nbool TimeStamp::operator>=(const TimeStamp &other) const {\n    return tp.time_since_epoch().count() >= other.tp.time_since_epoch().count();\n}\n\nTimeStamp TimeStamp::operator+(const std::chrono::milliseconds &dura) const { return tp + dura; }\n\nTimeStamp::selected_clock::time_point TimeStamp::Raw() const { return tp; }\n\nstd::tstring TimeStamp::ToTString() const {\n    const int bufSize = 64;\n    char buf[bufSize];\n\n    auto t = selected_clock::to_time_t(tp);\n    tm tempTM;\n    errno_t err = LOCALTIME_R(&tempTM, &t);\n    strftime(buf, bufSize, \"%Y-%m-%d %H:%M:%S\", &tempTM);\n    return to_tstring(buf);\n}\n\nTimeStamp TimeStamp::now() { return TimeStamp(); }"
  },
  {
    "path": "src/Common/TimeStamp.h",
    "content": "#pragma once\n\n#include \"tstring.h\"\n\n#include <chrono>\n\n#ifdef WIN32\n#define LOCALTIME_R(pTM, pTimeT) localtime_s(pTM, pTimeT)\n#else\n#define LOCALTIME_R(tm, ti) localtime_r(ti, tm)\n#endif\n// #define localtime static_assert(\"localtime is not thread-safe. considering LOCALTIME_R\")\n\ntemplate <typename T>\nclass TimeDuration {\npublic:\n    TimeDuration() {}\n\nprivate:\n    std::chrono::duration<T> d;\n};\n\nclass TimeStamp {\npublic:\n    using selected_clock = std::chrono::system_clock;\n\n    TimeStamp();\n    TimeStamp(std::chrono::time_point<selected_clock> tp);\n    TimeStamp(time_t t);\n    TimeStamp(FILETIME fileTime);\n    bool operator<(const TimeStamp &other) const;\n    bool operator<=(const TimeStamp &other) const;\n    bool operator>(const TimeStamp &other) const;\n    bool operator>=(const TimeStamp &other) const;\n    TimeStamp operator+(const std::chrono::milliseconds &dura) const;\n\n    selected_clock::time_point Raw() const;\n\n    std::tstring ToTString() const;\n\n    static TimeStamp now();\n\nprivate:\n    selected_clock::time_point tp;\n};"
  },
  {
    "path": "src/Common/noncopyable.h",
    "content": "#pragma once\n\nnamespace Zhongmao {\n\nclass noncopyable {\npublic:\n    noncopyable(const noncopyable &) = delete;\n    void operator=(const noncopyable &) = delete;\n\nprotected:\n    noncopyable() = default;\n    ~noncopyable() = default;\n};\n\n} // namespace Zhongmao"
  },
  {
    "path": "src/Common/tstring.cpp",
    "content": "#include \"tstring.h\"\n\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#include <Windows.h>\n#include <algorithm>\n#include <iostream>\n#include <memory>\n#include <cassert>\n\nusing namespace std;\n\nstd::wstring string_to_wstring(const std::string &str) {\n    LPCSTR pszSrc = str.c_str();\n    int nLen = MultiByteToWideChar(CP_ACP, 0, pszSrc, -1, NULL, 0);\n    if (nLen == 0)\n        return std::wstring(L\"\");\n\n    wchar_t *pwszDst = new wchar_t[nLen];\n    if (!pwszDst)\n        return std::wstring(L\"\");\n\n    MultiByteToWideChar(CP_ACP, 0, pszSrc, -1, pwszDst, nLen);\n    std::wstring wstr(pwszDst);\n    delete[] pwszDst;\n    pwszDst = NULL;\n\n    return wstr;\n}\n\nvoid MyWideCharToMultiByte(const wchar_t *wsrc, int wsrcSize, std::unique_ptr<char[]> &dest, int &destSize,\n                           UINT codePage) {\n    // 取得大小\n    destSize = WideCharToMultiByte(codePage, 0, wsrc, wsrcSize, NULL, 0, NULL, NULL);\n    if (destSize == 0) // 大小为0或者失败，返回空串\n    {\n        dest.reset(nullptr);\n        return;\n    }\n\n    // 分配空间\n    dest.reset(new char[destSize]);\n\n    // 进行转换\n    WideCharToMultiByte(codePage, 0, wsrc, wsrcSize, dest.get(), destSize, NULL, NULL);\n}\n\nvoid MyMultiByteToWideChar(const char *src, int srcSize, std::unique_ptr<wchar_t[]> &dest, int &destSize,\n                           UINT codePage) {\n    // 取得大小\n    destSize = MultiByteToWideChar(codePage, 0, src, srcSize, NULL, 0);\n    if (destSize == 0) // 大小为0或者失败，返回空串\n    {\n        dest.reset(nullptr);\n        return;\n    }\n\n    // 分配空间\n    dest.reset(new wchar_t[destSize]);\n\n    // 进行转换\n    MultiByteToWideChar(codePage, 0, src, srcSize, dest.get(), destSize);\n}\n\nstd::string wstring_to_string(const std::wstring &wstr) {\n    // 取得大小\n    int nLen = WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), -1, NULL, 0, NULL, NULL);\n    if (nLen == 0) // 大小为0或者失败，返回空串\n        return std::string(\"\");\n\n    // 分配空间\n    unique_ptr<char[]> buf = unique_ptr<char[]>(new char[nLen]);\n\n    // 进行转换\n    nLen = WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), -1, buf.get(), nLen, NULL, NULL);\n    if (nLen == 0) // 大小为0或者失败，返回空串\n        return std::string(\"\");\n\n    return std::string(buf.get());\n}\n\nstd::string to_string(const std::wstring &ws) {\n    return wstring_to_string(ws);\n}\n\nstd::wstring to_wstring(const std::string &s) {\n    return string_to_wstring(s);\n}\n\nstd::wstring to_wstring(const std::wstring &s) {\n    return s;\n}\n\nstd::string to_utf8(const std::wstring &wstr) {\n    // 取得大小\n    int nLen = WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), -1, NULL, 0, NULL, NULL);\n    if (nLen == 0) // 大小为0或者失败，返回空串\n        return std::string(\"\");\n\n    // 分配空间\n    unique_ptr<char[]> buf = unique_ptr<char[]>(new char[nLen]);\n\n    // 进行转换\n    nLen = WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), -1, buf.get(), nLen, NULL, NULL);\n    if (nLen == 0) // 大小为0或者失败，返回空串\n        return std::string(\"\");\n\n    return std::string(buf.get());\n}\n\nstd::string to_utf8(const std::u16string &wstr) {\n#if WIN32\n    const std::wstring &w = reinterpret_cast<const std::wstring &>(wstr);\n    return to_utf8(w);\n#endif\n}\n\nstd::string ansi_to_utf8(const std::string &str) {\n    int nwLen = MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, NULL, 0);\n    unique_ptr<wchar_t[]> pwBuf(new wchar_t[nwLen]);\n    MultiByteToWideChar(CP_ACP, 0, str.c_str(), static_cast<int>(str.length()), pwBuf.get(), nwLen);\n\n    int nLen = WideCharToMultiByte(CP_UTF8, 0, pwBuf.get(), -1, NULL, NULL, NULL, NULL);\n    unique_ptr<char[]> pBuf(new char[nLen]);\n    WideCharToMultiByte(CP_UTF8, 0, pwBuf.get(), nwLen, pBuf.get(), nLen, NULL, NULL);\n\n    return string(pBuf.get());\n}\n\nstd::vector<std::string> to_utf8(const std::vector<std::wstring> &wstrs) {\n    std::vector<std::string> ret;\n    for (const auto &wstr : wstrs) {\n        ret.push_back(to_utf8(wstr));\n    }\n    return ret;\n}\n\nstd::string utf8_to_string(const std::string &str) {\n    int nwLen = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, NULL, 0);\n    wchar_t *pwBuf = new wchar_t[nwLen + 1];\n    memset(pwBuf, 0, nwLen * 2 + 2);\n    MultiByteToWideChar(CP_UTF8, 0, str.c_str(), static_cast<int>(str.length()), pwBuf, nwLen);\n\n    int nLen = WideCharToMultiByte(CP_ACP, 0, pwBuf, -1, NULL, NULL, NULL, NULL);\n    char *pBuf = new char[nLen + 1];\n    memset(pBuf, 0, nLen + 1);\n    WideCharToMultiByte(CP_ACP, 0, pwBuf, nwLen, pBuf, nLen, NULL, NULL);\n\n    std::string ret = pBuf;\n    delete[] pBuf;\n    delete[] pwBuf;\n\n    return ret;\n}\n\nstd::wstring utf8_to_wstring(const std::string &str) {\n    int nwLen = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, NULL, 0);\n    std::wstring ret(nwLen - 1, L'\\0'); // -1是为了排除掉上一步预计算时添加的尾后0的长度\n    MultiByteToWideChar(CP_UTF8, 0, str.c_str(), static_cast<int>(str.size()), ret.data(), nwLen);\n\n    return ret;\n}\n\nstd::string to_hex(char c) noexcept {\n    std::string ret;\n    auto to_hex_in_16 = [](char n) noexcept -> char {\n        if (!(n >= 0 && n <= 15)) {\n            assert(0);\n        }\n        if (n >= 0 && n <= 9) {\n            return n + '0';\n        } else {\n            return (n - 10) + 'A';\n        }\n    };\n    ret += to_hex_in_16(static_cast<unsigned char>(c) >> 4); // high 4 bits\n    ret += to_hex_in_16(c & 0b00001111);                     // low 4 bits\n    return ret;\n}\n\n// 未测试\nvoid FixEndLine(std::tstring &s) {\n    tstring temp;\n    tstring::size_type cur = 0;\n    while (1) {\n        auto lf = s.find_first_of(TEXT('\\n'), cur);\n        if (lf == tstring::npos) {\n            temp += s.substr(cur);\n            break;\n        } else if (lf > cur && s[lf - 1] == TEXT('\\r')) {\n            temp += s.substr(cur, (lf + 1) - cur);\n            cur = lf + 1;\n        } else {\n            temp += s.substr(cur, lf - cur);\n            cur = lf + 1;\n        }\n    }\n    s = temp;\n}\n\nstd::string to_hex(const char *buf, int bufSize) {\n    constexpr int len = 4;\n    std::string hex;\n    char temp[len];\n    for (int i = 0; i < bufSize; ++i) {\n        _snprintf_s(temp, len, \"%02X \", (unsigned char)(buf[i]));\n        hex += temp;\n    }\n    return hex;\n}\n\nstd::string to_hex(std::string s) {\n    constexpr int len = 4;\n    std::string hex;\n    char temp[len];\n    for (char c : s) {\n        _snprintf_s(temp, len, \"%02X \", (unsigned char)c);\n        hex += temp;\n    }\n    return hex;\n}\n\nstd::wstring to_hex(std::wstring s) {\n    std::wstring hex;\n    wchar_t temp[5];\n    for (auto c : s) {\n        _snwprintf_s(temp, 5, 5, L\"%04X\", c);\n        hex += temp;\n    }\n    return hex;\n}\n\n// https://stackoverflow.com/questions/6089231/getting-std-ifstream-to-handle-lf-cr-and-crlf\nstd::tistream &safeGetline(std::tistream &is, std::tstring &t) {\n    t.clear();\n\n    // The characters in the stream are read one-by-one using a std::streambuf.\n    // That is faster than reading them one-by-one using the std::istream.\n    // Code that uses streambuf this way must be guarded by a sentry object.\n    // The sentry object performs various tasks,\n    // such as thread synchronization and updating the stream state.\n\n    std::tistream::sentry se(is, true);\n    std::tstreambuf *sb = is.rdbuf();\n\n    for (;;) {\n        TCHAR c = sb->sbumpc();\n        switch (c) {\n        case TEXT('\\n'):\n            return is;\n        case TEXT('\\r'):\n            if (sb->sgetc() == '\\n')\n                sb->sbumpc();\n            return is;\n        case std::tstreambuf::traits_type::eof():\n            // Also handle the case when the last line has no line ending\n            if (t.empty())\n                is.setstate(std::tios::eofbit);\n            return is;\n        default:\n            t += c;\n        }\n    }\n}\n\nstd::vector<std::string_view> Split(std::string_view s, const std::string &dep) noexcept {\n    std::vector<std::string_view> ans;\n    string::size_type beg = 0;\n    while (1) {\n        // beg:  \"\"->npos \" a\"->1 \"a\"->0\n        beg = s.find_first_not_of(dep);\n        if (beg == string::npos) {\n            // s == \"\"\n            break;\n        }\n        s = s.substr(beg);\n\n        // end:  \"a \"->1 \"a\"->npos\n        auto end = s.find_first_of(dep);\n        if (end == string::npos) {\n            ans.push_back(s);\n            break;\n        }\n        ans.push_back(s.substr(0, end));\n        s = s.substr(end);\n    }\n    return ans;\n}"
  },
  {
    "path": "src/Common/tstring.h",
    "content": "#pragma once\n#include <string>\n\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#include <windows.h> //TEXT macro\n#include <tchar.h>\n\n#include <memory>\n#include <vector>\n#include <algorithm>\n\n#ifdef _UNICODE\n\n#define tstring wstring\n\n#define tstring_view wstring_view\n\n#define tios wios\n\n#define tistream wistream\n\n#define tostream wostream\n\n#define tifstream wifstream\n\n#define tofstream wofstream\n\n#define tstringstream wstringstream\n\n#define tistringstream wistringstream\n\n#define tostringstream wostringstream\n\n#define tstreambuf wstreambuf\n\n#define tcout wcout\n\n#define to_tstring to_wstring\n\n#define to_tstring_from_utf8 utf8_to_wstring\n\n#else\n\n#define tstring string\n\n#define tstring_view string_view\n\n#define tios ios\n\n#define tistream istream\n\n#define tostream ostream\n\n#define tifstream ifstream\n\n#define tofstream ofstream\n\n#define tstringstream stringstream\n\n#define tistringstream istringstream\n\n#define tostringstream ostringstream\n\n#define tstreambuf streambuf\n\n#define tcout cout\n\n#define to_tstring to_string\n\n#define to_tstring_from_utf8 utf8_to_string\n\n#endif\n\nvoid MyWideCharToMultiByte(const wchar_t *wsrc, int wsrcSize, std::unique_ptr<char[]> &dest, int &destSize,\n                           UINT codePage = CP_ACP);\nvoid MyMultiByteToWideChar(const char *src, int srcSize, std::unique_ptr<wchar_t[]> &dest, int &destSize,\n                           UINT codePage = CP_ACP);\n\nstd::wstring string_to_wstring(const std::string &str);\nstd::string wstring_to_string(const std::wstring &wstr);\n\nstd::string to_string(const std::wstring &ws);\n\nstd::wstring to_wstring(const std::string &s);\nstd::wstring to_wstring(const std::wstring &s);\n\ntemplate <typename T>\nstd::enable_if_t<std::is_same_v<T, std::string> || std::is_same_v<T, std::wstring>, T> tolower(const T &s) noexcept {\n    using C = T::value_type;\n    T ret{s};\n    std::for_each(ret.begin(), ret.end(), [](C &c) {\n        c = tolower(c);\n    });\n    return ret;\n}\n\nstd::string to_utf8(const std::wstring &wstr);\nstd::string to_utf8(const std::u16string &wstr);\nstd::string ansi_to_utf8(const std::string &str);\nstd::vector<std::string> to_utf8(const std::vector<std::wstring> &wstrs);\n\nstd::string utf8_to_string(const std::string &str);\nstd::wstring utf8_to_wstring(const std::string &str);\n\nstd::string to_hex(char c) noexcept;\n\nstd::string to_hex(const char *buf, int bufSize);\nstd::string to_hex(std::string s);\nstd::wstring to_hex(std::wstring s);\n\nstd::tistream &safeGetline(std::tistream &is, std::tstring &t);\n\n/**\n * 切分字符串。\n * dep填入分隔符，可以支持多种分隔符。例如\"\\n\\t\"。\n */\nstd::vector<std::string_view> Split(std::string_view s, const std::string &dep) noexcept;\n"
  },
  {
    "path": "src/Control/CMakeLists.txt",
    "content": "# ==============================\nfile(GLOB_RECURSE SRC_CODE\n\t*.h\n\t*.cpp\n\t)\n\nadd_library(Control STATIC ${SRC_CODE})\n\n# 添加include目录\ntarget_include_directories(Control PUBLIC\n\t..\n\t${PROJECT_SOURCE_DIR}/third_party/WTL/include\n)\n"
  },
  {
    "path": "src/Control/ControlStyle.h",
    "content": "#pragma once\n#if defined _M_IX86\n#pragma comment(                                                                                                       \\\n    linker,                                                                                                            \\\n    \"/manifestdependency:\\\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\\\"\")\n#elif defined _M_X64\n#pragma comment(                                                                                                       \\\n    linker,                                                                                                            \\\n    \"/manifestdependency:\\\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\\\"\")\n#else\n#pragma comment(                                                                                                       \\\n    linker,                                                                                                            \\\n    \"/manifestdependency:\\\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\\\"\")\n#endif\n\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#include <Windows.h>\n#include <CommCtrl.h>\n#pragma comment(lib, \"comctl32.lib\")\n\n// 高dpi支持（此法只能在Win7 SP1及以上系统调用，否则报错找不到dll）\n//#include <ShellScalingAPI.h>\n//#pragma comment(lib,\"Shcore.lib\")\n\n#ifndef DPI_ENUMS_DECLARED\n\ntypedef enum PROCESS_DPI_AWARENESS {\n    PROCESS_DPI_UNAWARE = 0,\n    PROCESS_SYSTEM_DPI_AWARE = 1,\n    PROCESS_PER_MONITOR_DPI_AWARE = 2\n} PROCESS_DPI_AWARENESS;\n\ntypedef enum MONITOR_DPI_TYPE {\n    MDT_EFFECTIVE_DPI = 0,\n    MDT_ANGULAR_DPI = 1,\n    MDT_RAW_DPI = 2,\n    MDT_DEFAULT = MDT_EFFECTIVE_DPI\n} MONITOR_DPI_TYPE;\n\n#define DPI_ENUMS_DECLARED\n#endif\n\n// 启用高DPI适配。若在Win7 SP1以下系统，找不到函数时，则不做处理\ninline void SupportHighDPI() {\n    HMODULE hHighDpi = LoadLibrary(TEXT(\"SHCore.dll\"));\n    if (hHighDpi) {\n        typedef HRESULT(__stdcall * FuncSetHighDpi)(PROCESS_DPI_AWARENESS);\n        FuncSetHighDpi fnSetHighDpi = (FuncSetHighDpi)GetProcAddress(hHighDpi, \"SetProcessDpiAwareness\");\n        if (fnSetHighDpi) {\n            fnSetHighDpi(PROCESS_PER_MONITOR_DPI_AWARE);\n        }\n        FreeLibrary(hHighDpi);\n    }\n}"
  },
  {
    "path": "src/Control/TListView.cpp",
    "content": "#include \"TListView.h\"\n\n#include <stdexcept>\n#include <cassert>\n\nusing namespace std;\n\nstd::vector<int> TListView::GetSelectedItems() const {\n    std::vector<int> ans;\n    int iPos = -1;\n    while (1) {\n        // Get the next selected item\n        iPos = GetNextItem(iPos, LVNI_SELECTED);\n        if (iPos == -1)\n            break;\n\n        ans.push_back(iPos);\n    }\n    return ans;\n}\n\nstd::tstring TListView::GetItemText(int nItem, int nSubItem) const {\n    assert(::IsWindow(this->m_hWnd));\n\n    tstring ans;\n    LVITEM lvi = {};\n    lvi.iSubItem = nSubItem;\n\n    for (int nLen = 256;; nLen *= 2) {\n        ans.resize(nLen);\n\n        lvi.cchTextMax = nLen;\n        lvi.pszText = ans.data();\n        int nRes = (int)::SendMessage(this->m_hWnd, LVM_GETITEMTEXT, (WPARAM)nItem, (LPARAM)&lvi);\n        if (nRes < nLen - 1) {\n            ans.resize(nRes);\n            break;\n        }\n    }\n\n    return ans;\n}\n\nvoid TListView::SetColumnText(int col, const std::tstring &s) noexcept {\n    std::tstring buf(s);\n    buf.push_back(TEXT('\\0'));\n    LVCOLUMN lvColumn;\n    lvColumn.mask = LVCF_TEXT;\n    lvColumn.iSubItem = col;\n    lvColumn.pszText = buf.data();\n    SetColumn(col, &lvColumn);\n}\n"
  },
  {
    "path": "src/Control/TListView.h",
    "content": "#pragma once\n\n#include <Common/tstring.h>\n\n#include <atlbase.h> // 基本的ATL类\n#include <atlwin.h>  // ATL窗口类\n#include <atlapp.h>  // WTL 主框架窗口类\n#include <atlctrls.h>\n#include <atlcrack.h> // WTL 增强的消息宏\n\n#include <vector>\n\nclass TListView : public CWindowImpl<TListView, CListViewCtrl> {\npublic:\n    BEGIN_MSG_MAP_EX(TListView)\n    MESSAGE_HANDLER(WM_DROPFILES, OnDropFiles)\n    END_MSG_MAP()\n\n    void SetColumnText(int col, const std::tstring &s) noexcept;\n\n    std::vector<int> GetSelectedItems() const;\n\n    std::tstring GetItemText(int nItem, int nSubItem) const;\n\n    LRESULT OnDropFiles(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) {\n        SendMessage(GetParent(), uMsg, wParam, lParam);\n        return 0;\n    }\n};"
  },
  {
    "path": "src/Control/TMenu.cpp",
    "content": "#include \"TMenu.h\"\n\n#include <cassert>\n\nTMenu::TMenu() noexcept {\n    hMenu = CreateMenu();\n}\n\nvoid TMenu::SetItemEnable(int itemId, bool enabled) noexcept {\n    int lastStatus = EnableMenuItem(hMenu, itemId, enabled ? MF_ENABLED : MF_DISABLED);\n    assert(lastStatus >= 0);\n}\n\nTMenu &TMenu::SetItemToBeContainer(int itemId) noexcept {\n    assert(children.find(itemId) == children.end());\n\n    TMenu child;\n\n    MENUITEMINFO menuItemInfo = {0};\n    menuItemInfo.cbSize = sizeof(MENUITEMINFO);\n    menuItemInfo.fMask = MIIM_SUBMENU;\n    menuItemInfo.hSubMenu = child.hMenu;\n\n    BOOL ok = SetMenuItemInfo(hMenu, itemId, FALSE, &menuItemInfo);\n    assert(ok);\n\n    children.insert({itemId, child});\n    return children[itemId];\n}\n\nvoid TMenu::AppendItem(int id, const std::wstring &s) noexcept {\n    BOOL ok = AppendMenu(hMenu, MF_STRING, id, s.c_str());\n    assert(ok);\n}\n\nvoid TMenu::InsertItem(int posId, int newItemid, const std::wstring &s) noexcept {\n    HMENU hMenuPopup = CreateMenu();\n\n    MENUITEMINFO menuItemInfo = {0};\n    menuItemInfo.cbSize = sizeof(MENUITEMINFO);\n    menuItemInfo.wID = newItemid;\n    menuItemInfo.fMask = MIIM_ID | MIIM_STRING | MIIM_SUBMENU;\n    menuItemInfo.cch = static_cast<UINT>(s.length() + 1);\n    menuItemInfo.dwTypeData = const_cast<wchar_t *>(s.c_str());\n    menuItemInfo.hSubMenu = hMenu;\n\n    BOOL ok = InsertMenuItem(hMenu, posId, FALSE, &menuItemInfo);\n    assert(ok);\n}\n\nstd::wstring TMenu::GetItemTextByPosition(int pos) noexcept {\n    return GetItemTextByPositionOrId(true, pos);\n}\n\nstd::wstring TMenu::GetItemTextById(int id) noexcept {\n    return GetItemTextByPositionOrId(false, id);\n}\n\nvoid TMenu::SetItemTextByPosition(int pos, const std::wstring &s) noexcept {\n    SetItemTextByPositionOrId(true, pos, s);\n}\n\nvoid TMenu::SetItemTextById(int id, const std::wstring &s) noexcept {\n    SetItemTextByPositionOrId(false, id, s);\n}\n\nvoid TMenu::SetItemTextByPositionOrId(bool byPosition, int posOrId, const std::wstring &s) noexcept {\n    std::wstring ws(s);\n    ws.push_back(L'\\0');\n\n    MENUITEMINFO menuItemInfo = {0};\n\n    menuItemInfo.cbSize = sizeof(MENUITEMINFO);\n    menuItemInfo.fMask = MIIM_STRING;\n    menuItemInfo.cch = static_cast<UINT>(ws.size());\n    menuItemInfo.dwTypeData = const_cast<wchar_t *>(ws.data());\n    BOOL ok = SetMenuItemInfo(hMenu, posOrId, byPosition, &menuItemInfo);\n    assert(ok);\n}\n\nTMenu &TMenu::GetChild(int itemId) {\n    return children.at(itemId);\n}\n\nstd::wstring TMenu::GetItemTextByPositionOrId(bool byPosition, int posOrId) noexcept {\n    MENUITEMINFO menuItemInfo = {0};\n\n    // 第一次，先拿到cch，即文本长度\n    menuItemInfo.cbSize = sizeof(MENUITEMINFO);\n    menuItemInfo.fMask = MIIM_STRING;\n    BOOL ok = GetMenuItemInfo(hMenu, posOrId, byPosition, &menuItemInfo);\n    assert(ok);\n\n    // 增加长度，以容纳尾后0\n    menuItemInfo.cch++;\n    std::wstring ws(menuItemInfo.cch, L'\\0');\n\n    // 把字符串指针指向ws，让系统往ws里写内容\n    menuItemInfo.dwTypeData = const_cast<wchar_t *>(ws.data());\n    ok = GetMenuItemInfo(hMenu, posOrId, byPosition, &menuItemInfo);\n    assert(ok);\n    return ws;\n}\n\nTPopupMenu::TPopupMenu(int menuId) noexcept {\n    hRoot = LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(menuId));\n    assert(hRoot);\n    hMenu = GetSubMenu(hRoot, 0);\n    assert(hMenu);\n}\n\nvoid TPopupMenu::Popup(HWND hParent) noexcept {\n    POINT pt;\n    GetCursorPos(&pt);\n\n    BOOL ok = TrackPopupMenu(hMenu, TPM_RIGHTBUTTON, pt.x, pt.y, 0, hParent, NULL);\n    assert(ok);\n}"
  },
  {
    "path": "src/Control/TMenu.h",
    "content": "#pragma once\n\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#include <Windows.h>\n\n#include <string>\n#include <map>\n\nclass TMenu {\npublic:\n    TMenu() noexcept;\n    virtual ~TMenu() = default;\n\n    void SetItemEnable(int itemId, bool enabled = true) noexcept;\n\n    TMenu &SetItemToBeContainer(int itemId) noexcept;\n\n    void AppendItem(int id, const std::wstring &s) noexcept;\n\n    void InsertItem(int posId, int newItemid, const std::wstring &s) noexcept;\n\n    std::wstring GetItemTextByPosition(int pos) noexcept;\n    std::wstring GetItemTextById(int id) noexcept;\n\n    void SetItemTextByPosition(int pos, const std::wstring &s) noexcept;\n    void SetItemTextById(int id, const std::wstring &s) noexcept;\n\n    TMenu &GetChild(int itemId);\n\nprotected:\n    HMENU hMenu;\n    std::map<int, TMenu> children;\n\n    std::wstring GetItemTextByPositionOrId(bool byPosition, int posOrId) noexcept;\n\n    void SetItemTextByPositionOrId(bool byPosition, int posOrId, const std::wstring &s) noexcept;\n};\n\nclass TPopupMenu : public TMenu {\npublic:\n    TPopupMenu(int menuId) noexcept;\n\n    void Popup(HWND hParent) noexcept;\n\nprivate:\n    HMENU hRoot;\n};"
  },
  {
    "path": "src/Core/CMakeLists.txt",
    "content": "# =============================================\nfind_package(nlohmann_json CONFIG REQUIRED)\n\n# 添加icu库\nfind_package(ICU REQUIRED\n\tCOMPONENTS uc dt in io data\n)\n\nfind_package(fmt CONFIG REQUIRED)\n\n# === Core ====================================\nfile(GLOB CORE_CODE\n\t*.h\n\t*.cpp\n)\n\nadd_library(Core STATIC ${CORE_CODE})\n\ntarget_include_directories(Core PRIVATE\n\t${PROJECT_SOURCE_DIR}/third_party/uchardet/uchardet/src\n)\n\ntarget_link_libraries(Core PUBLIC\n\tCommon\n\tnlohmann_json::nlohmann_json\n\tlibuchardet_static\n\tICU::uc\n\tICU::in\n\tICU::data\n\tced\n\tfmt::fmt\n) # 添加include目录\ntarget_include_directories(Core PUBLIC\n\t..\n)\n"
  },
  {
    "path": "src/Core/CharsetCode.cpp",
    "content": "#include \"CharsetCode.h\"\n\n// standard\n#include <stdexcept>\n\nstruct MyCharset {\n    std::string viewName; // the name shown on interface\n    std::string icuName;  // the name used by icu\n    std::unordered_set<std::string>\n        icuNames; // if icu detected these charset names, map all of them to be the main charset\n    ConvertEngine convertEngine;\n};\n\n// 字符集code到名称的映射表\nconst std::unordered_map<CharsetCode, MyCharset> charsetCodeMap = {\n    // CharsetCode枚举值, viewName显示名称, icuName, 可能的别名\n    {CharsetCode::UNKNOWN, MyCharset{u8\"Unknown\", \"-\", {}, ConvertEngine::ICU}},\n    {CharsetCode::EMPTY, MyCharset{u8\"-\", \"-\", {}, ConvertEngine::ICU}},\n    {CharsetCode::NOT_SUPPORTED, MyCharset{u8\"Not Supported\", \"-\", {}, ConvertEngine::ICU}},\n    {CharsetCode::UTF8, MyCharset{u8\"UTF-8\", \"UTF-8\", {\"ASCII\", \"ANSI\", \"UTF8\"}, ConvertEngine::ICU}},\n    {CharsetCode::UTF8BOM, MyCharset{u8\"UTF-8 BOM\", \"UTF-8\", {}, ConvertEngine::ICU}},\n    {CharsetCode::GB18030, MyCharset{u8\"GB18030\", \"GB18030\", {\"GB\"}, ConvertEngine::ICU}},\n\n    {CharsetCode::UTF16LE, MyCharset{u8\"UTF-16LE\", \"UTF-16LE\", {}, ConvertEngine::ICU}},\n    {CharsetCode::UTF16LEBOM, MyCharset{u8\"UTF-16LE BOM\", \"UTF-16LE\", {\"utf-16\"}, ConvertEngine::ICU}},\n    {CharsetCode::UTF16BE, MyCharset{u8\"UTF-16BE\", \"UTF-16BE\", {}, ConvertEngine::ICU}},\n    {CharsetCode::UTF16BEBOM, MyCharset{u8\"UTF-16BE BOM\", \"UTF-16BE\", {}, ConvertEngine::ICU}},\n    {CharsetCode::UTF32LE, MyCharset{u8\"UTF-32LE\", \"UTF-32LE\", {}, ConvertEngine::ICU}},\n    {CharsetCode::UTF32LEBOM, MyCharset{u8\"UTF-32LE BOM\", \"UTF-32LE\", {\"utf-32\"}, ConvertEngine::ICU}},\n    {CharsetCode::UTF32BE, MyCharset{u8\"UTF-32BE\", \"UTF-32BE\", {}, ConvertEngine::ICU}},\n    {CharsetCode::UTF32BEBOM, MyCharset{u8\"UTF-32BE BOM\", \"UTF-32BE\", {}, ConvertEngine::ICU}},\n    {CharsetCode::BIG5, MyCharset{u8\"BIG5\", \"Big5\", {\"Big5\"}, ConvertEngine::ICU}},\n    {CharsetCode::SHIFT_JIS, MyCharset{u8\"SHIFT-JIS\", \"SHIFT-JIS\", {\"SHIFT_JIS\"}, ConvertEngine::ICU}},\n\n    {CharsetCode::EUC_JP, MyCharset{u8\"EUC-JP\", \"EUC-JP\", {\"EUC-JP\"}, ConvertEngine::ICU}},\n    {CharsetCode::EUC_TW, MyCharset{u8\"EUC-TW\", \"EUC-TW\", {\"EUC-TW\"}, ConvertEngine::ICU}},\n\n    {CharsetCode::WINDOWS_1250, MyCharset{u8\"WINDOWS-1250\", \"WINDOWS-1250\", {}, ConvertEngine::ICU}},\n    {CharsetCode::WINDOWS_1251, MyCharset{u8\"WINDOWS-1251\", \"WINDOWS-1251\", {}, ConvertEngine::ICU}},\n    {CharsetCode::WINDOWS_1252, MyCharset{u8\"WINDOWS-1252\", \"WINDOWS-1252\", {}, ConvertEngine::ICU}},\n    {CharsetCode::WINDOWS_1253, MyCharset{u8\"WINDOWS-1253\", \"WINDOWS-1253\", {}, ConvertEngine::ICU}},\n    {CharsetCode::WINDOWS_1254, MyCharset{u8\"WINDOWS-1254\", \"WINDOWS-1254\", {}, ConvertEngine::ICU}},\n    {CharsetCode::WINDOWS_1255, MyCharset{u8\"WINDOWS-1255\", \"WINDOWS-1255\", {}, ConvertEngine::ICU}},\n    {CharsetCode::WINDOWS_1256, MyCharset{u8\"WINDOWS-1256\", \"WINDOWS-1256\", {}, ConvertEngine::ICU}},\n    {CharsetCode::WINDOWS_1257, MyCharset{u8\"WINDOWS-1257\", \"WINDOWS-1257\", {}, ConvertEngine::ICU}},\n    {CharsetCode::WINDOWS_1258, MyCharset{u8\"WINDOWS-1258\", \"WINDOWS-1258\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_8859_1, MyCharset{u8\"ISO-8859-1\", \"ISO-8859-1\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_8859_2, MyCharset{u8\"ISO-8859-2\", \"ISO-8859-2\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_8859_3, MyCharset{u8\"ISO-8859-3\", \"ISO-8859-3\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_8859_4, MyCharset{u8\"ISO-8859-4\", \"ISO-8859-4\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_8859_5, MyCharset{u8\"ISO-8859-5\", \"ISO-8859-5\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_8859_6, MyCharset{u8\"ISO-8859-6\", \"ISO-8859-6\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_8859_7, MyCharset{u8\"ISO-8859-7\", \"ISO-8859-7\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_8859_8, MyCharset{u8\"ISO-8859-8\", \"ISO-8859-8\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_8859_9, MyCharset{u8\"ISO-8859-9\", \"ISO-8859-9\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_8859_10, MyCharset{u8\"ISO-8859-10\", \"ISO-8859-10\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_8859_11, MyCharset{u8\"ISO-8859-11\", \"ISO-8859-11\", {}, ConvertEngine::ICU}},\n    //{CharsetCode::ISO_8859_12, MyCharset{u8\"ISO-8859-12\", \"ISO-8859-12\", {}, ConvertEngine::ICU}},   // no this\n    // charset due to history reason\n    {CharsetCode::ISO_8859_13, MyCharset{u8\"ISO-8859-13\", \"ISO-8859-13\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_8859_14, MyCharset{u8\"ISO-8859-14\", \"ISO-8859-14\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_8859_15, MyCharset{u8\"ISO-8859-15\", \"ISO-8859-15\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_8859_16, MyCharset{u8\"ISO-8859-16\", \"ISO-8859-16\", {\"latin-10\"}, ConvertEngine::NO_ENGINE}},\n    {CharsetCode::ISO_2022_JP, MyCharset{u8\"ISO-2022-jp\", \"ISO-2022-jp\", {}, ConvertEngine::ICU}},\n    {CharsetCode::ISO_2022_KR, MyCharset{u8\"ISO-2022-kr\", \"ISO-2022-kr\", {}, ConvertEngine::ICU}},\n\n    {CharsetCode::IBM852, MyCharset{u8\"ibm852\", \"ibm852\", {}, ConvertEngine::ICU}},\n    {CharsetCode::IBM855, MyCharset{u8\"ibm855\", \"ibm855\", {}, ConvertEngine::ICU}},\n    {CharsetCode::IBM865, MyCharset{u8\"ibm865\", \"ibm865\", {}, ConvertEngine::ICU}},\n    {CharsetCode::IBM862_LOGICAL, MyCharset{u8\"ibm862.logical\", \"ibm862.logical\", {}, ConvertEngine::NO_ENGINE}},\n    {CharsetCode::IBM862_VISUAL, MyCharset{u8\"ibm862.visual\", \"ibm862.visual\", {}, ConvertEngine::NO_ENGINE}},\n    {CharsetCode::IBM866, MyCharset{u8\"ibm866\", \"ibm866\", {}, ConvertEngine::ICU}},\n\n    {CharsetCode::CP737, MyCharset{u8\"CP737\", \"CP737\", {}, ConvertEngine::ICU}},\n\n    {CharsetCode::MAC_CENTRALEUROPE, MyCharset{u8\"Central Europe(Mac)\", \"mac-centraleurope\", {}, ConvertEngine::ICU}},\n    {CharsetCode::MAC_CYRILLIC, MyCharset{u8\"Mac Cyrillic\", \"mac-cyrillic\", {}, ConvertEngine::ICU}},\n\n    {CharsetCode::VNI, MyCharset{u8\"VNI\", \"\", {}, ConvertEngine::SELF_VIETNAMESE_CONVERTER}},\n    {CharsetCode::VPS, MyCharset{u8\"VPS\", \"\", {}, ConvertEngine::SELF_VIETNAMESE_CONVERTER}},\n    {CharsetCode::VISCII, MyCharset{u8\"VISCII\", \"\", {}, ConvertEngine::SELF_VIETNAMESE_CONVERTER}},\n    {CharsetCode::TCVN3, MyCharset{u8\"TCVN3\", \"\", {}, ConvertEngine::SELF_VIETNAMESE_CONVERTER}},\n\n    {CharsetCode::GEORGIAN_ACADEMY, MyCharset{u8\"georgian-academy\", \"georgian-academy\", {}, ConvertEngine::NO_ENGINE}},\n    {CharsetCode::GEORGIAN_PS, MyCharset{u8\"georgian-ps\", \"georgian-ps\", {}, ConvertEngine::NO_ENGINE}},\n    {CharsetCode::JOHAB, MyCharset{u8\"JOHAB\", \"JOHAB\", {}, ConvertEngine::NO_ENGINE}},\n    {CharsetCode::UHC, MyCharset{u8\"UHC\", \"UHC\", {}, ConvertEngine::NO_ENGINE}},\n    {CharsetCode::KOI8_R, MyCharset{u8\"koi8-r\", \"koi8-r\", {}, ConvertEngine::NO_ENGINE}},\n    {CharsetCode::TIS_620, MyCharset{u8\"tis-620\", \"tis-620\", {}, ConvertEngine::NO_ENGINE}},\n};\n\nstd::string ToViewCharsetName(CharsetCode code) noexcept {\n    return charsetCodeMap.at(code).viewName;\n}\n\nCharsetCode ToCharsetCode(const std::string &name) {\n    // 查找name是否有吻合的viewName\n    auto it =\n        std::find_if(charsetCodeMap.begin(), charsetCodeMap.end(), [&](const std::pair<CharsetCode, MyCharset> &pr) {\n            return tolower(pr.second.viewName) == tolower(name);\n        });\n    if (it != charsetCodeMap.end()) {\n        return it->first;\n    }\n\n    // 查找name是否有吻合的icuName\n    it = std::find_if(charsetCodeMap.begin(), charsetCodeMap.end(), [&](const std::pair<CharsetCode, MyCharset> &pr) {\n        return tolower(pr.second.icuName) == tolower(name);\n    });\n    if (it != charsetCodeMap.end()) {\n        return it->first;\n    }\n\n    // 查找name是否有吻合的icuNames\n    for (auto &pr : charsetCodeMap) {\n        for (auto &icuName : pr.second.icuNames) {\n            if (tolower(icuName) == tolower(name)) {\n                return pr.first;\n            }\n        }\n    }\n    throw std::runtime_error(\"unsupported: \" + name);\n}\n\nstd::string ToICUCharsetName(CharsetCode code) noexcept {\n    return charsetCodeMap.at(code).icuName;\n}\n\nbool HasBom(CharsetCode code) {\n    switch (code) {\n    case CharsetCode::UTF8BOM:\n    case CharsetCode::UTF16LEBOM:\n    case CharsetCode::UTF16BEBOM:\n        return true;\n    }\n    return false;\n}\n\nconst char *GetBomData(CharsetCode code) {\n    switch (code) {\n    case CharsetCode::UTF8BOM:\n        return UTF8BOM_DATA;\n    case CharsetCode::UTF16LEBOM:\n        return UTF16LEBOM_DATA;\n    case CharsetCode::UTF16BEBOM:\n        return UTF16BEBOM_DATA;\n    }\n    return nullptr;\n}\n\nint BomSize(CharsetCode code) {\n    switch (code) {\n    case CharsetCode::UTF8BOM:\n        return sizeof(UTF8BOM_DATA);\n    case CharsetCode::UTF16LEBOM:\n        return sizeof(UTF16LEBOM_DATA);\n    case CharsetCode::UTF16BEBOM:\n        return sizeof(UTF16BEBOM_DATA);\n    }\n    return 0;\n}\n\nCharsetCode CheckBom(char *buf, int bufSize) {\n    if (bufSize >= sizeof(UTF8BOM_DATA) && memcmp(buf, UTF8BOM_DATA, sizeof(UTF8BOM_DATA)) == 0) {\n        return CharsetCode::UTF8BOM;\n    }\n    if (bufSize >= sizeof(UTF16LEBOM_DATA) && memcmp(buf, UTF16LEBOM_DATA, sizeof(UTF16LEBOM_DATA)) == 0) {\n        return CharsetCode::UTF8BOM;\n    }\n    if (bufSize >= sizeof(UTF16BEBOM_DATA) && memcmp(buf, UTF16BEBOM_DATA, sizeof(UTF16BEBOM_DATA)) == 0) {\n        return CharsetCode::UTF8BOM;\n    }\n    if (bufSize >= sizeof(UTF32LEBOM_DATA) && memcmp(buf, UTF32LEBOM_DATA, sizeof(UTF32LEBOM_DATA)) == 0) {\n        return CharsetCode::UTF8BOM;\n    }\n    if (bufSize >= sizeof(UTF32BEBOM_DATA) && memcmp(buf, UTF32BEBOM_DATA, sizeof(UTF32BEBOM_DATA)) == 0) {\n        return CharsetCode::UTF8BOM;\n    }\n    return CharsetCode::UNKNOWN;\n}\n\nConvertEngine GetConvertEngine(CharsetCode code) noexcept {\n    return charsetCodeMap.at(code).convertEngine;\n}\n"
  },
  {
    "path": "src/Core/CharsetCode.h",
    "content": "#pragma once\n\n#include <Common/tstring.h>\n\n// standard lib\n#include <unordered_set>\n#include <unordered_map>\n\nenum class CharsetCode {\n    UNKNOWN,\n    EMPTY,\n    NOT_SUPPORTED,\n\n    //\n    UTF8, // this line's order should not be changed. see DialogMain.cpp line 142: for (int icode =\n          // static_cast<int>(CharsetCode::UTF8), i = 0;\n    UTF8BOM,\n\n    UTF16BE,\n    UTF16BEBOM,\n    UTF16LE,\n    UTF16LEBOM,\n    UTF32BE,\n    UTF32BEBOM,\n    UTF32LE,\n    UTF32LEBOM,\n\n    GB18030,\n    BIG5,\n    SHIFT_JIS,\n\n    EUC_JP,\n    EUC_TW,\n\n    WINDOWS_1250,\n    WINDOWS_1251,\n    WINDOWS_1252,\n    WINDOWS_1253,\n    WINDOWS_1254,\n    WINDOWS_1255,\n    WINDOWS_1256,\n    WINDOWS_1257,\n    WINDOWS_1258, // Vietnamese\n    ISO_8859_1,\n    ISO_8859_2,\n    ISO_8859_3,\n    ISO_8859_4,\n    ISO_8859_5,\n    ISO_8859_6,\n    ISO_8859_7,\n    ISO_8859_8,\n    ISO_8859_9,\n    ISO_8859_10,\n    ISO_8859_11,\n    // ISO_8859_12,  // no this charset due to history reason\n    ISO_8859_13,\n    ISO_8859_14,\n    ISO_8859_15,\n    ISO_8859_16,\n    ISO_2022_JP,\n    ISO_2022_KR,\n\n    IBM852,\n    IBM855,\n    IBM865,\n    IBM862_LOGICAL,\n    IBM862_VISUAL,\n    IBM866,\n\n    CP737,\n\n    MAC_CENTRALEUROPE,\n    MAC_CYRILLIC,\n\n    VNI,    // Vietnamese\n    VPS,    // Vietnamese\n    VISCII, // Vietnamese\n    TCVN3,  // Vietnamese\n\n    GEORGIAN_ACADEMY,\n    GEORGIAN_PS,\n    JOHAB,\n    UHC,\n    KOI8_R,\n    TIS_620,\n\n    CHARSET_CODE_END\n\n    // 添加字符集需要同步修改：charsetCodeMap\n};\n\nenum class ConvertEngine {\n    ICU,\n    SELF_VIETNAMESE_CONVERTER,\n    NO_ENGINE,\n\n    END,\n};\n\nstd::string ToViewCharsetName(CharsetCode code) noexcept;\n\n/**\n * 编码集名字转CharsetCode\n * @exception runtime_error 未识别的字符串\n */\n//\nCharsetCode ToCharsetCode(const std::string &name);\n\nstd::string ToICUCharsetName(CharsetCode code) noexcept;\n\n// bom串\nconst char UTF8BOM_DATA[] = {'\\xEF', '\\xBB', '\\xBF'};\nconst char UTF16LEBOM_DATA[] = {'\\xFF', '\\xFE'};\nconst char UTF16BEBOM_DATA[] = {'\\xFE', '\\xFF'};\nconst char UTF32LEBOM_DATA[] = {'\\xFF', '\\xFE', '\\x0', '\\x0'};\nconst char UTF32BEBOM_DATA[] = {'\\xFE', '\\xFF', '\\x0', '\\x0'};\n\nbool HasBom(CharsetCode code);\nconst char *GetBomData(CharsetCode code);\nint BomSize(CharsetCode code);\n\n/**\n * @brief 返回buf的开头是否符合某种BOM，如果都不符合返回UNKNOWN\n */\nCharsetCode CheckBom(char *buf, int bufSize);\n\nConvertEngine GetConvertEngine(CharsetCode code) noexcept;\n"
  },
  {
    "path": "src/Core/Config.cpp",
    "content": "#include \"Config.h\"\n\nstd::unordered_set<CharsetCode> Configuration::normalCharset = {CharsetCode::UTF8, CharsetCode::UTF8BOM,\n                                                                CharsetCode::GB18030};\n"
  },
  {
    "path": "src/Core/Config.h",
    "content": "#pragma once\n\n// self\n#include \"CharsetCode.h\"\n#include \"LineBreaks.h\"\n\n#include <Common/tstring.h>\n\n// third party\n#include <nlohmann/json.hpp>\n\n// standard lib\n#include <unordered_set>\n\n/**\n * @brief 配置信息\n */\nstruct Configuration {\n    enum class FilterMode : int { NO_FILTER, SMART, ONLY_SOME_EXTANT };\n    enum class OutputTarget { ORIGIN, TO_DIR };\n    static std::unordered_set<CharsetCode> normalCharset;\n\n    FilterMode filterMode;\n    OutputTarget outputTarget;\n    std::string includeRule = u8\"h hpp c cpp cxx txt\";\n    std::string excludeRule;\n    std::string outputDir;\n    CharsetCode outputCharset;\n    bool enableConvertLineBreaks;\n    LineBreaks lineBreak;\n    std::string language;\n    // if member variables is added, it must be synchronized at NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE below.\n\n    Configuration()\n        : filterMode(FilterMode::SMART), outputTarget(OutputTarget::ORIGIN), outputCharset(CharsetCode::UTF8),\n          lineBreak(LineBreaks::CRLF), enableConvertLineBreaks(false) {}\n\n    static bool IsNormalCharset(CharsetCode charset) {\n        return normalCharset.find(charset) != normalCharset.end();\n    }\n};\n\nNLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Configuration, filterMode, outputTarget, includeRule, excludeRule, outputDir,\n                                   outputCharset, enableConvertLineBreaks, lineBreak, language)"
  },
  {
    "path": "src/Core/Core.cpp",
    "content": "#include \"Core.h\"\n\n#include \"Detect.h\"\n#include \"UCNVHelper.h\"\n#include \"Exceptions.h\"\n\n#include <Common/FileFunction.h>\n\n#include <unicode/ucnv.h>\n#include <unicode/ucsdet.h>\n#include <compact_enc_det/compact_enc_det.h>\n\n#include <stdexcept>\n#include <algorithm>\n#include <iostream>\n\nusing namespace std;\n\nconstexpr uint64_t tryReadSize = 100Ui64 * KB;\n\nconstexpr uint64_t MAX_STRING_PIECE_LENGTH = 64;\n\nstd::u16string Decode(std::string_view src, CharsetCode code) {\n    if (code == CharsetCode::EMPTY) {\n        return {};\n    }\n\n    switch (GetConvertEngine(code)) {\n    case ConvertEngine::SELF_VIETNAMESE_CONVERTER: {\n        viet::Init();\n        return viet::ConvertToUtf16LE(src, CharsetCodeToVietEncoding(code));\n    }\n    case ConvertEngine::ICU: {\n        // 从code转换到icu的字符集名称\n        auto icuCharsetName = ToICUCharsetName(code);\n\n        UErrorCode err = U_ZERO_ERROR;\n\n        // 打开转换器\n        unique_ptr<UConverter, function<void(UConverter *)>> conv(ucnv_open(icuCharsetName.c_str(), &err),\n                                                                  [](UConverter *p) {\n                                                                      ucnv_close(p);\n                                                                  });\n        DealWithUCNVError(err);\n\n        std::size_t cap = src.size() + 1;\n        std::u16string target(cap, u'\\u0000');\n\n        ucnv_setToUCallBack(conv.get(), UCNV_TO_U_CALLBACK_STOP, NULL, NULL, NULL, &err);\n        DealWithUCNVError(err);\n\n        if (cap > std::numeric_limits<uint32_t>::max()) {\n            throw MyRuntimeError(MessageId::STRING_LENGTH_OUT_OF_LIMIT);\n        }\n\n        if (src.size() > std::numeric_limits<uint32_t>::max()) {\n            throw MyRuntimeError(MessageId::STRING_LENGTH_OUT_OF_LIMIT);\n        }\n\n        // 解码\n        int retLen = ucnv_toUChars(conv.get(), target.data(), static_cast<uint32_t>(cap), src.data(),\n                                   static_cast<uint32_t>(src.size()), &err);\n        target.resize(retLen);\n\n        int corruptedDataPieceSize = static_cast<int>(std::min(32ull, src.size() - retLen));\n        // if there is corrupted data at src.data(), err will be U_ILLEGAL_CHAR_FOUND(12).\n        // TODO: at this case, maybe prompt user to decide how to deal with.\n        // current we just throw a clear error message.\n        if (err == U_ILLEGAL_CHAR_FOUND) {\n            throw IllegalCharFoundError(code, retLen, std::string(src.substr(retLen, corruptedDataPieceSize)));\n        }\n        if (err == U_INVALID_CHAR_FOUND) {\n            throw InvalidCharFoundError(code, retLen, std::string(src.substr(retLen, corruptedDataPieceSize)));\n        }\n\n        DealWithUCNVError(err);\n\n        return target;\n    }\n    case ConvertEngine::NO_ENGINE:\n        throw CharsetNotSupportedError(code);\n    default:\n        assert(0);\n    }\n    return u\"internal error\";\n}\n\nstd::u16string DecodeToLimitBytes(std::string_view src, uint64_t maxInputBytes, CharsetCode code) {\n    std::u16string output;\n\n    std::size_t use_bytes = std::min(maxInputBytes, src.size());\n    while (use_bytes > 0) {\n        try {\n            output = Decode(std::string_view(src.data(), use_bytes), code);\n            break;\n        } catch (const TruncatedCharFoundError &err) {\n            (err);\n            if (use_bytes != src.size()) {\n                use_bytes--;\n                continue;\n            }\n            throw;\n        }\n    }\n    return output;\n}\n\n// below copied from https://github.com/unicode-org/icu/blob/main/icu4c/source/samples/ucnv/flagcb.c\n\n/* The structure of a FromU Flag context.\n   (conceivably there could be a ToU Flag Context) */\nstruct FromUFLAGContext {\n    UConverterFromUCallback subCallback;\n    const void *subContext;\n    std::vector<UChar32> unassigned; // 是否出现了不能转换的字符\n    FromUFLAGContext() : subCallback(nullptr), subContext(nullptr) {}\n};\n\n/**\n * the actual callback\n */\nU_CAPI void U_EXPORT2 flagCB_fromU(const void *context, UConverterFromUnicodeArgs *fromUArgs, const UChar *codeUnits,\n                                   int32_t length, UChar32 codePoint, UConverterCallbackReason reason,\n                                   UErrorCode *err) {\n    /* First step - based on the reason code, take action */\n    FromUFLAGContext *ctx = reinterpret_cast<FromUFLAGContext *>(const_cast<void *>(context));\n\n    if (reason == UCNV_UNASSIGNED) { /* whatever set should be trapped here */\n        if (ctx->unassigned.size() < 32)\n            ctx->unassigned.push_back(codePoint);\n    }\n\n    if (reason == UCNV_CLONE) {\n        /* The following is the recommended way to implement UCNV_CLONE\n           in a callback. */\n        UConverterFromUCallback saveCallback;\n        const void *saveContext;\n        UErrorCode subErr = U_ZERO_ERROR;\n\n        FromUFLAGContext *cloned = nullptr;\n        *cloned = *ctx;\n\n        /* We need to get the sub CB to handle cloning,\n         * so we have to set up the following, temporarily:\n         *\n         *   - Set the callback+context to the sub of this (flag) cb\n         *   - preserve the current cb+context, it could be anything\n         *\n         *   Before:\n         *      CNV  ->   FLAG ->  subcb -> ...\n         *\n         *   After:\n         *      CNV  ->   subcb -> ...\n         *\n         *    The chain from 'something' on is saved, and will be restored\n         *   at the end of this block.\n         *\n         */\n\n        ucnv_setFromUCallBack(fromUArgs->converter, cloned->subCallback, cloned->subContext, &saveCallback,\n                              &saveContext, &subErr);\n\n        if (cloned->subCallback != NULL) {\n            /* Now, call the sub callback if present */\n            cloned->subCallback(cloned->subContext, fromUArgs, codeUnits, length, codePoint, reason, err);\n        }\n\n        ucnv_setFromUCallBack(fromUArgs->converter, saveCallback, /* Us */\n                              cloned,                             /* new context */\n                              &cloned->subCallback,               /* IMPORTANT! Accept any change in CB or context */\n                              &cloned->subContext, &subErr);\n\n        if (U_FAILURE(subErr)) {\n            *err = subErr;\n        }\n    }\n\n    /* process other reasons here if need be */\n\n    /* Always call the subCallback if present */\n    if (ctx->subCallback != NULL && reason != UCNV_CLONE) {\n        ctx->subCallback(ctx->subContext, fromUArgs, codeUnits, length, codePoint, reason, err);\n    }\n\n    /* cleanup - free the memory AFTER calling the sub CB */\n    if (reason == UCNV_CLOSE) {\n        delete context;\n    }\n}\n\nstd::string Encode(std::u16string_view src, CharsetCode targetCode) {\n    switch (GetConvertEngine(targetCode)) {\n    case ConvertEngine::SELF_VIETNAMESE_CONVERTER: {\n        viet::Init();\n        return viet::ConvertFromUtf16LE(src, CharsetCodeToVietEncoding(targetCode));\n    }\n    case ConvertEngine::ICU: {\n        // 从code转换到icu的字符集名称\n        auto icuCharsetName = ToICUCharsetName(targetCode);\n\n        UErrorCode err = U_ZERO_ERROR;\n\n        // 打开转换器\n        unique_ptr<UConverter, function<void(UConverter *)>> conv(ucnv_open(icuCharsetName.c_str(), &err),\n                                                                  [](UConverter *p) {\n                                                                      ucnv_close(p);\n                                                                  });\n        DealWithUCNVError(err);\n\n        if (src.size() >= std::numeric_limits<int32_t>::max() / sizeof(UChar) - 1) {\n            throw MyRuntimeError(MessageId::STRING_LENGTH_OUT_OF_LIMIT);\n        }\n\n        int32_t destCap = static_cast<int32_t>((src.size() + 1lu) * sizeof(UChar));\n        std::string target(destCap, '\\0');\n\n        FromUFLAGContext *context = new FromUFLAGContext; // 由回调函数管理生命期\n\n        /* Set our special callback */\n        ucnv_setFromUCallBack(conv.get(), flagCB_fromU, context, &(context->subCallback), &(context->subContext), &err);\n        DealWithUCNVError(err);\n\n        // 编码\n        int retLen;\n        while (1) {\n            err = U_ZERO_ERROR;\n            retLen =\n                ucnv_fromUChars(conv.get(), target.data(), destCap, src.data(), static_cast<int32_t>(src.size()), &err);\n            if (err == U_BUFFER_OVERFLOW_ERROR || err == U_STRING_NOT_TERMINATED_WARNING) {\n                destCap = retLen + 6; // 增加一个尾后0的大小：utf-8 单个字符最大占用字节数\n                target.resize(destCap);\n                continue;\n            }\n            DealWithUCNVError(err);\n            if (err == U_ZERO_ERROR) {\n                target.resize(retLen);\n                break;\n            }\n        }\n\n        // 如果存在不能转换的字符，那么抛出异常\n        if (!context->unassigned.empty()) {\n            context->unassigned.push_back(0);\n            UChar32 *s = context->unassigned.data();\n\n            // UTF32LE -> UTF16LE\n            std::u16string temp =\n                Decode(std::string_view(reinterpret_cast<char *>(s), (context->unassigned.size() - 1) * 4),\n                       CharsetCode::UTF32LE);\n\n            // UTF16LE -> UTF8\n            std::string ret = Encode(temp, CharsetCode::UTF8);\n\n            throw UnassignedCharError(ret);\n        }\n\n        return target;\n    }\n    case ConvertEngine::NO_ENGINE:\n        throw CharsetNotSupportedError(targetCode);\n    default:\n        assert(0);\n    }\n    return u8\"internal error\";\n}\n\nstd::string Convert(std::string_view src, ConvertParam inputParam) {\n    // 根据原编码得到Unicode字符串\n    std::u16string buf = Decode(src, inputParam.originCode);\n\n    // 如果需要转换换行符\n    if (inputParam.doConvertLineBreaks) {\n        ChangeLineBreaks(buf, inputParam.targetLineBreak);\n    }\n\n    // 转到目标编码\n    return Encode(buf, inputParam.targetCode);\n}\n\nviet::Encoding CharsetCodeToVietEncoding(CharsetCode code) noexcept {\n    return viet::to_encoding(ToViewCharsetName(code));\n}\n\nCore::Core(std::string configFileName, CoreInitOption opt) : configFileName(configFileName), opt(opt) {\n    // 读ini\n    ReadConfigFromFile();\n\n    // 初始化uchardet\n    det = unique_ptr<uchardet, std::function<void(uchardet *)>>(uchardet_new(), [](uchardet *det) {\n        uchardet_delete(det);\n    });\n\n#ifndef NDEBUG\n    // =================================\n    // ==== will detect memory leak ====\n    // UErrorCode err;\n    // UEnumeration *allNames = ucnv_openAllNames(&err);\n    // while (1) {\n    //    auto name = uenum_next(allNames, nullptr, &err);\n    //    if (name == nullptr) {\n    //        break;\n    //    }\n    //}\n    // ================================\n#endif\n}\n\nconst Configuration &Core::GetConfig() const noexcept {\n    return config;\n}\n\nConfiguration &Core::GetConfigRef() noexcept {\n    return config;\n}\n\nconst std::unique_ptr<uchardet, std::function<void(uchardet *)>> &Core::GetUCharDet() const {\n    return det;\n}\n\nvoid Core::SetFilterMode(Configuration::FilterMode mode) {\n    config.filterMode = mode;\n    WriteConfigToFile();\n}\n\nvoid Core::SetFilterRule(const std::string &rule) {\n    config.includeRule = rule;\n    WriteConfigToFile();\n}\n\nvoid Core::SetOutputTarget(Configuration::OutputTarget outputTarget) {\n    config.outputTarget = outputTarget;\n    WriteConfigToFile();\n}\n\nvoid Core::SetOutputDir(const std::string &outputDir) {\n    config.outputDir = outputDir;\n    WriteConfigToFile();\n}\n\nvoid Core::SetOutputCharset(CharsetCode outputCharset) {\n    config.outputCharset = outputCharset;\n    WriteConfigToFile();\n}\n\nvoid Core::SetLineBreaks(LineBreaks lineBreak) {\n    config.lineBreak = lineBreak;\n    WriteConfigToFile();\n}\n\nvoid Core::SetLanguage(const std::string &language) noexcept {\n    config.language = language;\n    WriteConfigToFile();\n}\n\nvoid Core::SetEnableConvertLineBreak(bool enableLineBreaks) {\n    config.enableConvertLineBreaks = enableLineBreaks;\n    WriteConfigToFile();\n}\n\nvoid RemoveASCII(std::vector<char> &data) noexcept {\n    auto itor = std::stable_partition(data.begin(), data.end(), [](char c) {\n        return (c & 0b10000000);\n    });\n\n    data.erase(itor, data.end());\n}\n\nCore::AddItemResult Core::AddItem(const std::string &filename, const std::unordered_set<std::string> &filterDotExts) {\n    // 如果是只包括指定后缀的模式，且文件后缀不符合，则忽略掉，且不提示\n    if (GetConfig().filterMode == Configuration::FilterMode::ONLY_SOME_EXTANT) {\n        auto ext = GetExtend(filename);\n        auto dotExt = \".\" + tolower(ext);\n\n        if (filterDotExts.find(dotExt) == filterDotExts.end()) {\n            return {};\n        }\n    }\n\n    // 如果重复了\n    if (listFileNames.find(filename) != listFileNames.end()) {\n        throw MyRuntimeError(MessageId::ADD_REDUNDANTLY);\n    }\n\n    // 读入文件，只读入部分。因为读入大文件会占用太长时间。\n    auto [buf, bufSize] = ReadFileToBuffer(filename, tryReadSize);\n\n    // 识别字符集\n    auto charsetCode = DetectEncoding(det.get(), buf.get(), bufSize);\n\n    std::u16string content;\n\n    switch (charsetCode) {\n    case CharsetCode::EMPTY:\n        break;\n\n    // 如果没有识别出编码集\n    case (CharsetCode::UNKNOWN): {\n        switch (GetConfig().filterMode) {\n        // 如果是智能模式或者后缀模式，不添加这个文件，但要抛出异常，让UI弹出提示\n        case Configuration::FilterMode::SMART:\n        case Configuration::FilterMode::ONLY_SOME_EXTANT:\n            throw io_error_ignore();\n        // 如果是不过滤模式\n        case Configuration::FilterMode::NO_FILTER: {\n            // 强行添加\n\n            auto fileSize = GetFileSize(filename);\n\n            // 成功添加\n            listFileNames.insert(filename);\n\n            return AddItemResult{false, fileSize, charsetCode, LineBreaks::UNKNOWN, {}};\n        }\n        default:\n            assert(0);\n        }\n        break;\n    }\n    default:\n        // 根据uchardet得出的字符集解码\n        content = DecodeToLimitBytes(std::string_view(buf.get(), bufSize), MAX_STRING_PIECE_LENGTH, charsetCode);\n    }\n\n    auto fileSize = GetFileSize(filename);\n\n    auto charsetName = ToViewCharsetName(charsetCode);\n\n    // 重新读入整个文件，因为之前只读入了部分，换行符可能判断不彻底\n    if (bufSize < fileSize) {\n        std::tie(buf, bufSize) = ReadFileToBuffer(filename);\n    }\n\n    std::u16string wholeUtfStr;\n    try {\n        wholeUtfStr = Decode(std::string_view(buf.get(), bufSize), charsetCode);\n    } catch (const IllegalCharFoundError &err) {\n        (err);\n        // if current is NO-FILTER mode, treat it as UNKOWN charset\n        if (GetConfig().filterMode != Configuration::FilterMode::NO_FILTER) {\n            throw;\n        }\n        listFileNames.insert(filename);\n        return AddItemResult{false, fileSize, CharsetCode::UNKNOWN, LineBreaks::UNKNOWN, {}};\n    }\n\n    // 检查换行符\n    auto lineBreak = GetLineBreaks(wholeUtfStr.data(), wholeUtfStr.size());\n\n    // 到达这里不会再抛异常了\n\n    // 成功添加\n    listFileNames.insert(filename);\n\n    return AddItemResult{false, fileSize, charsetCode, lineBreak, content};\n}\n\nvoid Core::SpecifyItemCharset(int index, const std::string &filename, CharsetCode charsetCode) {\n    assert(listFileNames.find(filename) != listFileNames.end());\n\n    // 读入文件，只读入部分。因为读入大文件会占用太长时间。\n    auto [buf, bufSize] = ReadFileToBuffer(filename, tryReadSize);\n\n    auto fileSize = GetFileSize(filename);\n    auto fileSizeStr = FileSizeToHumanString(fileSize);\n\n    auto charsetName = ToViewCharsetName(charsetCode);\n\n    // 重新读入整个文件，因为之前只读入了部分，换行符可能判断不彻底\n    if (bufSize < fileSize) {\n        std::tie(buf, bufSize) = ReadFileToBuffer(filename);\n    }\n    auto wholeUtfStr = Decode(std::string_view(buf.get(), bufSize), charsetCode);\n    auto lineBreak = GetLineBreaks(wholeUtfStr.data(), wholeUtfStr.size());\n\n    auto lineBreakStr = LineBreaksToViewName(lineBreak);\n\n    // 到达这里不会再抛异常了\n\n    // 通知UI新增条目\n    auto stringPiece = DecodeToLimitBytes(std::string_view(buf.get(), bufSize), MAX_STRING_PIECE_LENGTH, charsetCode);\n    opt.fnUIUpdateItem(index, filename, fileSizeStr, charsetName, lineBreakStr, stringPiece);\n}\n\nvoid Core::RemoveItem(const std::string &filename) {\n    listFileNames.erase(filename);\n}\n\nvoid Core::Clear() {\n    listFileNames.clear();\n}\n\nCore::ConvertFileResult Core::Convert(const std::string &inputFilename, CharsetCode originCode,\n                                      LineBreaks originLineBreak, TranslatorBase *translator) noexcept {\n    CharsetCode targetCode = config.outputCharset;\n\n    ConvertFileResult ret;\n    try {\n        ret.outputFileName = inputFilename;\n        ret.targetLineBreaks = originLineBreak;\n        ret.outputFileSize = GetFileSize(inputFilename);\n\n        // 计算目标文件名\n        if (GetConfig().outputTarget != Configuration::OutputTarget::ORIGIN) {\n            // 纯文件名\n            auto pureFileName = GetNameAndExt(ret.outputFileName);\n\n            ret.outputFileName = GetConfig().outputDir + \"\\\\\" + pureFileName;\n        }\n\n        // 原编码集\n        if (originCode == CharsetCode::UNKNOWN) {\n            throw MyRuntimeError(MessageId::NO_DETECTED_ENCODING);\n        }\n\n        // 返回原字符集和目标字符集的条件为不需要转换的情形\n        auto CharsetNeedNotConvert = [&]() -> bool {\n            // 原编码和目标编码一样\n            if (originCode == targetCode)\n                return true;\n\n            // 原来是空文件，且目标编码不需要写入BOM\n            if (originCode == CharsetCode::EMPTY && !HasBom(targetCode))\n                return true;\n            return false;\n        };\n\n        // 判断不需要转换的条件，或者是需要复制的情形，直接不转换或者复制\n        // 返回true则不需要实际转换了\n        auto CheckNothingOrCopy = [&]() -> bool {\n            if (CharsetNeedNotConvert() &&\n                // 不转换换行符，或者新换行符和原来的换行符一样\n                (GetConfig().enableConvertLineBreaks == false || GetConfig().lineBreak == originLineBreak)) {\n                // 那么只需要考虑是否原位转换，原位转换的话什么也不做，否则复制过去\n\n                // 如果不是原位置转换，复制过去\n                if (GetConfig().outputTarget == Configuration::OutputTarget::TO_DIR) {\n                    bool ok = CopyFileW(utf8_to_wstring(inputFilename).c_str(),\n                                        utf8_to_wstring(ret.outputFileName).c_str(), false);\n                    if (!ok) {\n                        throw FileIOError(MessageId::FAILED_TO_WRITE_FILE, ret.outputFileName);\n                    }\n                }\n\n                // 原位转换，什么也不做\n                return true;\n            }\n\n            return false;\n        };\n\n        do {\n            if (CheckNothingOrCopy())\n                break;\n\n            // 前后编码不一样\n            auto filesize = GetFileSize(inputFilename);\n\n            // 暂时不做分块转换 TODO\n\n            {\n                // 读二进制\n                auto [raw, rawSize] = ReadFileToBuffer(inputFilename);\n\n                if (rawSize >= std::numeric_limits<int>::max()) {\n                    throw MyRuntimeError(MessageId::FILE_SIZE_OUT_OF_LIMIT);\n                }\n\n                // 根据BOM偏移\n                const char *rawStart = raw.get();\n\n                // 如果需要抹掉BOM，则把起始位置设置到BOM之后，确保UChar[]不带BOM\n                if (HasBom(originCode) && !HasBom(targetCode)) {\n                    auto bomSize = BomSize(originCode);\n                    rawStart += bomSize;\n                    rawSize -= bomSize;\n                }\n\n                ConvertParam param;\n                param.originCode = originCode;\n                param.targetCode = targetCode;\n                param.doConvertLineBreaks =\n                    GetConfig().enableConvertLineBreaks && GetConfig().lineBreak != originLineBreak;\n                param.targetLineBreak = GetConfig().lineBreak;\n\n                // 转到目标编码\n                std::string outputBuf = ::Convert(std::string_view(rawStart, rawSize), param);\n\n                if (param.doConvertLineBreaks) {\n                    ret.targetLineBreaks = param.targetLineBreak;\n                }\n\n                ret.outputFileSize = 0;\n\n                // 写入文件\n                FILE *fp = nullptr;\n                errno_t err = _wfopen_s(&fp, utf8_to_wstring(ret.outputFileName).c_str(), L\"wb\");\n                if (err == EACCES) {\n                    throw FileIOError(MessageId::NO_PERMISSION, ret.outputFileName);\n                }\n                if (fp == nullptr) {\n                    throw FileIOError(MessageId::FAILED_TO_OPEN_FILE, ret.outputFileName);\n                }\n                unique_ptr<FILE, function<void(FILE *)>> upFile(fp, [](FILE *fp) {\n                    fclose(fp);\n                });\n\n                // 如果需要额外加上BOM，先写入BOM\n                if (!HasBom(originCode) && HasBom(targetCode)) {\n                    auto bomData = GetBomData(targetCode);\n\n                    // 写入BOM\n                    size_t wrote = fwrite(bomData, BomSize(targetCode), 1, fp);\n                    ret.outputFileSize += BomSize(targetCode);\n                    if (wrote != 1) {\n                        throw FileIOError(MessageId::FAILED_TO_WRITE_FILE, ret.outputFileName);\n                    }\n                }\n\n                // 写入正文\n                size_t wrote = fwrite(outputBuf.data(), outputBuf.size(), 1, fp);\n                ret.outputFileSize += outputBuf.size();\n                if (outputBuf.size() != 0 && wrote != 1) {\n                    throw FileIOError(MessageId::FAILED_TO_WRITE_FILE, ret.outputFileName);\n                }\n            }\n\n        } while (0);\n\n    } catch (const MyRuntimeError &err) {\n        // 这个文件失败了\n        if (translator) {\n            ret.errInfo = err.ToLocalString(translator);\n        } else {\n            ret.errInfo = err.what();\n        }\n    }\n\n    // 这个文件成功了\n    return ret;\n}\n\nvoid Core::ReadConfigFromFile() {\n    if (!GetFileExists(configFileName)) {\n        return;\n    }\n\n    auto [buf, bufSize] = ReadFileToBuffer(configFileName);\n\n    nlohmann::json j = nlohmann::json::parse(std::string_view(buf.get(), bufSize));\n    from_json(j, config);\n}\n\nvoid Core::WriteConfigToFile() {\n    nlohmann::json j;\n    to_json(j, config);\n\n    std::string jsonStr = j.dump(4);\n    WriteFileFromBuffer(configFileName, jsonStr.data(), jsonStr.size());\n}\n\n// UINT Configuration::ToWinCodePage(OutputCharset charset)\n//{\n//\tswitch (charset)\n//\t{\n//\tcase OutputCharset::UTF8:\n//\t\treturn CP_UTF8;\n//\tcase OutputCharset::GB18030:\n//\t\treturn CP_GB18030;\n//\t}\n//}\n"
  },
  {
    "path": "src/Core/Core.h",
    "content": "#pragma once\n\n// self\n#include \"CharsetCode.h\"\n#include \"LineBreaks.h\"\n#include \"Config.h\"\n#include \"Vietnamese.h\"\n#include \"Exceptions.h\"\n\n#include <Common/tstring.h>\n\n// third-party lib\n#include <uchardet.h>\n#include <unicode/ucnv.h>\n\n// standard lib\n#include <string>\n#include <memory>\n#include <functional>\n#include <unordered_set>\n#include <thread>\n#include <stdexcept>\n#include <optional>\n\n#undef min\n#undef max\n\n/**\n * @brief 根据code的字符集解码字符串为unicode\n * @return u16string(UTF-16LE)\n * @exception UCNVError ucnv出错。code\n */\nstd::u16string Decode(std::string_view src, CharsetCode code);\n\n/**\n * 根据code的字符集解码字符串为unicode。\n * 为了只输出部分解码结果，输入一个最大输入bytes数量的限制。\n * @param maxInputBytes 最大输入bytes数量。src的长度如果大于maxInputBytes，只有maxInputBytes数量的数据会送去解码。\n * @return u16string(UTF-16LE)\n * @exception UCNVError ucnv出错。code\n */\nstd::u16string DecodeToLimitBytes(std::string_view src, uint64_t maxInputBytes, CharsetCode code);\n\n/**\n * @brief 把unicode串编码为指定字符集\n * @param src u16string(UTF-16LE)\n * @return std::string CAUTION: this string is only as a container of char[] with the charset of targetCode.\n *          NOT mean its charset is ASCII or ANSI or others.\n * @exception viet::ConvertError\n * @exception UnassignedCharError 出现了不能转换的字符\n * @exception std::runtime_error ucnv出错\n */\nstd::string Encode(std::u16string_view src, CharsetCode targetCode);\n\nstruct ConvertParam {\n    CharsetCode originCode;\n    CharsetCode targetCode;\n    bool doConvertLineBreaks;\n    LineBreaks targetLineBreak; // target line break. if doConvertLineBreaks is false, this variable will be ignored.\n};\n\n/**\n * Convert encoding.\n * @exception viet::ConvertError\n * @exception UnassignedCharError 出现了不能转换的字符\n * @exception std::runtime_error ucnv出错\n */\nstd::string Convert(std::string_view src, ConvertParam inputParam);\n\nviet::Encoding CharsetCodeToVietEncoding(CharsetCode code) noexcept;\n\nstruct CoreInitOption {\n\n    std::function<void(int index, std::string filename, std::string fileSizeStr, std::string charsetStr,\n                       std::string lineBreakStr, std::u16string textPiece)>\n        fnUIUpdateItem = [](int index, std::string filename, std::string fileSizeStr, std::string charsetStr,\n                            std::string lineBreakStr, std::u16string textPiece) {};\n};\n\nclass Core {\npublic:\n    Core(std::string configFileName, CoreInitOption opt);\n\n    const Configuration &GetConfig() const noexcept;\n\n    Configuration &GetConfigRef() noexcept;\n\n    const std::unique_ptr<uchardet, std::function<void(uchardet *)>> &GetUCharDet() const;\n\n    void SetFilterMode(Configuration::FilterMode mode);\n    void SetFilterRule(const std::string &rule);\n\n    void SetOutputTarget(Configuration::OutputTarget outputTarget);\n    void SetOutputDir(const std::string &outputDir);\n    void SetOutputCharset(CharsetCode outputCharset);\n    void SetEnableConvertLineBreak(bool enableLineBreaks);\n    void SetLineBreaks(LineBreaks lineBreak);\n    void SetLanguage(const std::string &language) noexcept;\n\n    void WriteConfigToFile();\n\n    struct AddItemResult {\n        bool isIgnore = true; // 是否应该忽略掉\n        uint64_t filesize;\n        CharsetCode srcCharset;\n        LineBreaks srcLineBreak;\n        std::u16string strPiece;\n    };\n\n    /**\n     * 加入一个文件到列表。\n     * @exception runtime_error 重复添加\n     * @exception file_io_error 读文件失败\n     * @exception runtime_error ucnv出错。code\n     * @exception io_error_ignore 按照配置忽略掉这个文件\n     */\n    [[nodiscard]] AddItemResult AddItem(const std::string &filename,\n                                        const std::unordered_set<std::string> &filterDotExts);\n\n    /**\n     * 指定文件的字符集。\n     * @exception file_io_error 读文件失败\n     * @exception runtime_error ucnv出错。code\n     */\n    void SpecifyItemCharset(int index, const std::string &filename, CharsetCode code);\n\n    void RemoveItem(const std::string &filename);\n\n    void Clear();\n\n    struct ConvertFileResult {\n        std::string outputFileName;\n        std::optional<std::string> errInfo;\n        LineBreaks targetLineBreaks;\n        std::size_t outputFileSize;\n    };\n\n    /**\n     * @brief 转换一个文件。\n     * @return <输出文件的文件名, 出错信息>\n     */\n    ConvertFileResult Convert(const std::string &inputFilename, CharsetCode originCode, LineBreaks originLineBreak,\n                              TranslatorBase *translator = nullptr) noexcept;\n\nprivate:\n    std::string configFileName;\n    CoreInitOption opt;\n    Configuration config;\n    std::unique_ptr<uchardet, std::function<void(uchardet *)>> det;\n\n    std::unordered_set<std::string> listFileNames; // 当前列表中的文件\n\n    void ReadConfigFromFile();\n};\n"
  },
  {
    "path": "src/Core/Detect.cpp",
    "content": "#include \"Core.h\"\n\n#include \"UCNVHelper.h\"\n\n#include <unicode/ucnv.h>\n#include <unicode/ucsdet.h>\n#include <compact_enc_det/compact_enc_det.h>\n\n#include <stdexcept>\n#include <algorithm>\n#include <iostream>\n\nusing namespace std;\n\nstd::tuple<std::string, int> DetectByUCharDet(uchardet *det, const char *buf, std::size_t bufSize) {\n    // 用uchardet判定字符集\n    uchardet_reset(det);\n    int ret = uchardet_handle_data(det, buf, bufSize);\n    switch (ret) {\n    case HANDLE_DATA_RESULT_NEED_MORE_DATA:\n    case HANDLE_DATA_RESULT_DETECTED:\n        break;\n    case HANDLE_DATA_RESULT_ERROR:\n        throw runtime_error(\"uchardet fail\");\n    }\n\n    uchardet_data_end(det);\n\n    // 得到uchardet的识别结果\n    string charset = uchardet_get_charset(det);\n\n    float confidence = uchardet_get_confidence(det);\n\n    return {charset, static_cast<int>(confidence * 100)};\n}\n\nstd::tuple<std::string, int> DetectByUCSDet(const char *buf, int32_t bufSize) {\n    UErrorCode status = U_ZERO_ERROR;\n    auto csd =\n        std::unique_ptr<UCharsetDetector, void (*)(UCharsetDetector *)>(ucsdet_open(&status), [](UCharsetDetector *p) {\n            ucsdet_close(p);\n        });\n    DealWithUCNVError(status);\n\n    ucsdet_setText(csd.get(), buf, bufSize, &status);\n    DealWithUCNVError(status);\n\n    const UCharsetMatch *ucm = ucsdet_detect(csd.get(), &status);\n    if (status == U_INVALID_CHAR_FOUND) {\n        // if this error code occurred while detecting, one possible situation is that input is a binary file.\n        // we just return unknown as result.\n        return {\"unknown\", 0};\n    }\n    DealWithUCNVError(status);\n\n    int32_t confidence = ucsdet_getConfidence(ucm, &status);\n    DealWithUCNVError(status);\n\n    const char *name = ucsdet_getName(ucm, &status);\n    DealWithUCNVError(status);\n\n    return {name, confidence};\n}\n\nstd::unordered_set<CharsetCode> DetectByMine(std::string_view src) {\n    std::unordered_set<CharsetCode> ret;\n    for (int i = static_cast<int>(CharsetCode::UTF8); i <= static_cast<int>(CharsetCode::ISO_8859_1); ++i) {\n        CharsetCode tryCode = static_cast<CharsetCode>(i);\n\n        try {\n            auto temp = Decode(src, tryCode);\n\n            Encode(temp, tryCode);\n\n            ret.insert(tryCode);\n        } catch (...) {}\n    }\n    return ret;\n}\n\nstd::tuple<CharsetCode, bool> DetectByCED(const char *buf, int len) {\n    int bytes_consumed;\n    bool is_reliable;\n    Encoding encoding = CompactEncDet::DetectEncoding(buf, len, nullptr, // URL hint\n                                                      nullptr,           // HTTP hint\n                                                      nullptr,           // Meta hint\n                                                      UNKNOWN_ENCODING, UNKNOWN_LANGUAGE, CompactEncDet::WEB_CORPUS,\n                                                      false, // Include 7-bit encodings?\n                                                      &bytes_consumed, &is_reliable);\n\n    // 如果认为是二进制文件，那么取信它\n    if (encoding == Encoding::BINARYENC) {\n        return {CharsetCode::UNKNOWN, true};\n    }\n\n    // 这里如果CED识别出的名字在CharsetCode中没有定义，将抛出异常\n    CharsetCode code;\n    try {\n        code = ToCharsetCode(EncodingName(encoding));\n\n    } catch (const std::runtime_error &err) {\n        (err);\n        if (is_reliable) {\n            throw;\n        }\n        return {CharsetCode::UNKNOWN, true};\n    }\n    return {code, is_reliable};\n}\n\nCharsetCode ToCharsetCodeFinal(CharsetCode inputCode, const char *buf, std::size_t bufSize) {\n    switch (inputCode) {\n    case CharsetCode::UTF8:\n        // 区分有无BOM\n        if (bufSize >= sizeof(UTF8BOM_DATA) && memcmp(buf, UTF8BOM_DATA, sizeof(UTF8BOM_DATA)) == 0) {\n            return CharsetCode::UTF8BOM;\n        }\n        return inputCode;\n    case CharsetCode::UTF16BE:\n        // 区分有无BOM\n        if (bufSize >= sizeof(UTF16BEBOM_DATA) && memcmp(buf, UTF16BEBOM_DATA, sizeof(UTF16BEBOM_DATA)) == 0) {\n            return CharsetCode::UTF16BEBOM;\n        }\n        return inputCode;\n    case CharsetCode::UTF16LE:\n        // 区分有无BOM\n        if (bufSize >= sizeof(UTF16LEBOM_DATA) && memcmp(buf, UTF16LEBOM_DATA, sizeof(UTF16LEBOM_DATA)) == 0) {\n            return CharsetCode::UTF16LEBOM;\n        }\n        return inputCode;\n    case CharsetCode::UTF32BE:\n        // 区分有无BOM\n        if (bufSize >= sizeof(UTF32BEBOM_DATA) && memcmp(buf, UTF32BEBOM_DATA, sizeof(UTF32BEBOM_DATA)) == 0) {\n            return CharsetCode::UTF32BEBOM;\n        }\n        return inputCode;\n    case CharsetCode::UTF32LE:\n        // 区分有无BOM\n        if (bufSize >= sizeof(UTF32LEBOM_DATA) && memcmp(buf, UTF32LEBOM_DATA, sizeof(UTF32LEBOM_DATA)) == 0) {\n            return CharsetCode::UTF32LEBOM;\n        }\n        return inputCode;\n    }\n    return inputCode;\n}\n\nCharsetCode DetectEncodingPlain(uchardet *det, const char *buf, std::size_t bufSize, int times) {\n    if (bufSize == 0) {\n        return CharsetCode::EMPTY;\n    }\n\n    if (bufSize > std::numeric_limits<int32_t>::max()) {\n        throw MyRuntimeError(MessageId::STRING_LENGTH_OUT_OF_LIMIT);\n    }\n\n    auto [ucsdetResult, ucsdetConfidence] = DetectByUCSDet(buf, static_cast<int32_t>(bufSize));\n\n    if (ucsdetConfidence >= 95 && ucsdetResult.find(\"UTF\") != string::npos) {\n        // ucsdet如果判定为UTF-8/UTF-16BE|LE等，那么相信它\n        return ToCharsetCodeFinal(ToCharsetCode(ucsdetResult), buf, bufSize);\n    }\n\n    auto [uchardetResult, uchardetConfidence] = DetectByUCharDet(det, buf, bufSize);\n    if (uchardetConfidence >= 95) {\n        // uchardet如果有95及以上的信心，那么直接相信它\n        return ToCharsetCodeFinal(ToCharsetCode(uchardetResult), buf, bufSize);\n    }\n\n    // ucsdet和uchardet都没把握\n    return CharsetCode::UNKNOWN;\n\n    /*\n    // update: CED的探测结果不稳定，而且可能出现识别出错但reliable==true的情况，\n    //          暂时先不用CED了。\n\n    auto [cedResult, reliable] = DetectByCED(buf, bufSize);\n    if (reliable) {\n        return cedResult;\n    }\n\n    if (times > 0) {\n        // 第2次尝试失败，认命了\n        return CharsetCode::UNKNOWN;\n    }\n\n    // 裁掉ASCII，再战！\n    std::vector<char> data(bufSize);\n    std::memcpy(data.data(), buf, bufSize);\n\n    RemoveASCII(data);\n    return DetectEncodingPlain(data.data(), data.size(), 1);\n\n    */\n}\n\nCharsetCode DetectEncoding(uchardet *det, const char *buf, std::size_t bufSize) {\n    return DetectEncodingPlain(det, buf, bufSize, 0);\n}"
  },
  {
    "path": "src/Core/Detect.h",
    "content": "#pragma once\n\n// self\n#include \"CharsetCode.h\"\n\n// third-party lib\n#include <uchardet.h>\n\n// standard lib\n#include <string>\n\nstd::tuple<std::string, int> DetectByUCharDet(uchardet *det, const char *buf, std::size_t bufSize);\n\n/**\n * @param bufSize 受ucsdet限制只能接受int32_t\n */\nstd::tuple<std::string, int> DetectByUCSDet(const char *buf, int32_t bufSize);\n\n/**\n * @exception runtime_error 如果CED中定义的名称在CharsetCode中没有定义，将抛出异常\n */\nstd::tuple<CharsetCode, bool> DetectByCED(const char *buf, int len);\n\nCharsetCode ToCharsetCodeFinal(std::string charsetStr, const char *buf, std::size_t bufSize);\n\n/**\n * 探测编码集。\n * return 探测出的编码集，根据探测出的编码集解码出的Unicode文本片段(最大64bytes)，文本片段长度\n * @exception file_io_error 读文件失败\n * @exception runtime_error ucnv出错。code\n */\nCharsetCode DetectEncodingPlain(uchardet *det, const char *buf, std::size_t bufSize, int times);\n\n/**\n * 探测编码集。\n * return 探测出的编码集，根据探测出的编码集解码出的Unicode文本片段(最大64bytes)，文本片段长度\n * @exception file_io_error 读文件失败\n * @exception runtime_error ucnv出错。code\n */\nCharsetCode DetectEncoding(uchardet *det, const char *buf, std::size_t bufSize);\n"
  },
  {
    "path": "src/Core/Exceptions.cpp",
    "content": "#include \"Exceptions.h\""
  },
  {
    "path": "src/Core/Exceptions.h",
    "content": "#pragma once\n\n#include \"Vietnamese.h\"\n#include \"CharsetCode.h\"\n#include \"Messages.h\"\n\n#include <Common/tstring.h>\n\n#include <fmt/format.h>\n#include <unicode/utypes.h>\n\n#include <stdexcept>\n\nclass MyRuntimeError : public std::runtime_error {\npublic:\n    MyRuntimeError(MessageId mid)\n        : std::runtime_error(MessageIdToBasicString(mid)), mid(mid), errMsg(MessageIdToBasicString(mid)) {\n#ifndef NDEBUG\n        assert(errMsg.find(\"{\") == std::string::npos);\n#endif\n    }\n\n    MyRuntimeError(MessageId mid, const std::string errMsg) : std::runtime_error(errMsg), mid(mid), errMsg(errMsg) {}\n\n    virtual const std::string ToLocalString(TranslatorBase *translator) const noexcept {\n        return translator->MessageIdToString(mid);\n    }\n\nprotected:\n    MessageId mid;\n    const std::string errMsg;\n};\n\n/**\n * 不可分配字符错误\n * 用于转换时出现不能转换到指定编码的情形。\n * err.what()方法会返回不能转换的字符组成的字符串(utf-8编码)。\n */\nclass UnassignedCharError : public MyRuntimeError {\npublic:\n    UnassignedCharError(const std::string &unassignedChars) noexcept\n        : MyRuntimeError(MessageId::WILL_LOST_CHARACTERS,\n                         fmt::format(MessageIdToBasicString(MessageId::WILL_LOST_CHARACTERS), unassignedChars)),\n          unassignedChars(unassignedChars) {}\n\n    virtual const std::string ToLocalString(TranslatorBase *translator) const noexcept {\n        return fmt::format(translator->MessageIdToString(mid), unassignedChars);\n    }\n\n    const std::string GetUnassignedChar() const noexcept {\n        return unassignedChars;\n    }\n\nprivate:\n    std::string unassignedChars;\n};\n\nclass io_error_ignore : public std::runtime_error {\npublic:\n    io_error_ignore() : runtime_error(\"ignored\") {}\n};\n\nclass UCNVError : public MyRuntimeError {\npublic:\n    UCNVError(int errCode) noexcept\n        : MyRuntimeError(MessageId::UCNV_ERROR, fmt::format(MessageIdToBasicString(MessageId::UCNV_ERROR), errCode)),\n          errCode(errCode) {}\n\n    virtual const std::string ToLocalString(TranslatorBase *translator) const noexcept {\n        return fmt::format(translator->MessageIdToString(mid), errCode);\n    }\n\nprivate:\n    int errCode;\n};\n\nclass TruncatedCharFoundError : public UCNVError {\npublic:\n    TruncatedCharFoundError() : UCNVError(U_TRUNCATED_CHAR_FOUND) {}\n\n    virtual const std::string ToLocalString(TranslatorBase *translator) const noexcept {\n        return fmt::format(translator->MessageIdToString(MessageId::TRUNCATED_CHAR_FOUND));\n    }\n};\n\nclass IllegalCharFoundError : public UCNVError {\npublic:\n    IllegalCharFoundError(CharsetCode decodeAs, std::size_t position, std::string corruptedDataPiece) noexcept\n        : UCNVError(U_ILLEGAL_CHAR_FOUND), decodeAs(decodeAs), position(position),\n          corruptedDataPiece(corruptedDataPiece) {}\n\n    virtual const std::string ToLocalString(TranslatorBase *translator) const noexcept {\n        return fmt::format(translator->MessageIdToString(MessageId::CORRUPTED_DATA), ToViewCharsetName(decodeAs),\n                           position, 32, to_hex(corruptedDataPiece));\n    }\n\nprivate:\n    CharsetCode decodeAs;\n    std::size_t position;\n    std::string corruptedDataPiece; // the data at corrupted position, at least 32 bytes\n};\n\nusing InvalidCharFoundError = IllegalCharFoundError;\n\nclass CharsetNotSupportedError : public MyRuntimeError {\npublic:\n    CharsetNotSupportedError(CharsetCode targetCode)\n        : MyRuntimeError(\n              MessageId::CANNOT_CONVERT_CHARSET,\n              fmt::format(MessageIdToBasicString(MessageId::CANNOT_CONVERT_CHARSET), ToViewCharsetName(targetCode))),\n          targetCode(targetCode) {}\n\n    virtual const std::string ToLocalString(TranslatorBase *translator) const noexcept {\n        return fmt::format(translator->MessageIdToString(mid), ToViewCharsetName(targetCode));\n    }\n\nprivate:\n    CharsetCode targetCode;\n};\n\nclass ConvertError : public MyRuntimeError {\npublic:\n    ConvertError(std::string content, std::size_t position, viet::Encoding srcEncoding,\n                 viet::Encoding destEncoding) noexcept\n        : MyRuntimeError(MessageId::VIETNAMESE_CONVERT_ERROR,\n                         fmt::format(MessageIdToBasicString(MessageId::VIETNAMESE_CONVERT_ERROR),\n                                     to_string(srcEncoding), to_string(srcEncoding), position, content)),\n          content(content), position(position), srcEncoding(srcEncoding), destEncoding(destEncoding) {}\n\n    virtual const std::string ToLocalString(TranslatorBase *translator) const noexcept {\n        return fmt::format(translator->MessageIdToString(mid), to_string(srcEncoding), to_string(srcEncoding), position,\n                           content);\n    }\n\nprivate:\n    viet::Encoding srcEncoding;\n    viet::Encoding destEncoding;\n    std::size_t position;\n    std::string content;\n};\n\nclass FileIOError : public MyRuntimeError {\npublic:\n    FileIOError(MessageId mid, const std::string &filename) noexcept\n        : MyRuntimeError(mid, fmt::format(MessageIdToBasicString(mid), filename)), filename(filename) {\n        assert(mid == MessageId::FAILED_TO_WRITE_FILE || mid == MessageId::FILE_SIZE_OUT_OF_LIMIT ||\n               mid == MessageId::FAILED_TO_OPEN_FILE || mid == MessageId::NO_PERMISSION);\n    }\n\n    virtual const std::string ToLocalString(TranslatorBase *translator) const noexcept {\n        return fmt::format(translator->MessageIdToString(mid), filename);\n    }\n\nprivate:\n    std::string filename;\n};"
  },
  {
    "path": "src/Core/LineBreaks.cpp",
    "content": "#include \"LineBreaks.h\"\n#include \"Exceptions.h\"\n\n#include <stdexcept>\n\n// LineBreaks类型到字符串的映射表\nconst doublemap<LineBreaks, std::string> lineBreaksMap = {\n    {LineBreaks::CRLF, u8\"CRLF\"}, {LineBreaks::LF, u8\"LF\"},          {LineBreaks::CR, u8\"CR\"},\n    {LineBreaks::EMPTY, u8\"\"},    {LineBreaks::MIX, u8\"N/A(Mixed)\"}, {LineBreaks::UNKNOWN, u8\"Unknown\"}};\n\nstd::string LineBreaksToViewName(LineBreaks linebreaks) noexcept {\n    return lineBreaksMap.at(linebreaks);\n}\n\nLineBreaks ViewNameToLineBreaks(std::string viewName) noexcept {\n    return lineBreaksMap.at(viewName);\n}\n\nLineBreaks GetLineBreaks(const UChar *buf, std::size_t len) {\n    LineBreaks ans = LineBreaks::EMPTY;\n    for (std::size_t i = 0; i < len;) {\n        const UChar &c = buf[i];\n        if (c == UChar(u'\\r')) {\n            // \\r\\n\n            if (i < len && buf[i + 1] == UChar(u'\\n')) {\n                if (ans == LineBreaks::EMPTY) {\n                    ans = LineBreaks::CRLF;\n                } else {\n                    if (ans != LineBreaks::CRLF) {\n                        ans = LineBreaks::MIX;\n                        return ans;\n                    }\n                }\n                i += 2;\n                continue;\n            }\n\n            // \\r\n            if (ans == LineBreaks::EMPTY) {\n                ans = LineBreaks::CR;\n            } else {\n                if (ans != LineBreaks::CR) {\n                    ans = LineBreaks::MIX;\n                    return ans;\n                }\n            }\n            i++;\n            continue;\n        }\n\n        // \\n\n        if (c == UChar(u'\\n')) {\n            if (ans == LineBreaks::EMPTY) {\n                ans = LineBreaks::LF;\n            } else {\n                if (ans != LineBreaks::LF) {\n                    ans = LineBreaks::MIX;\n                    return ans;\n                }\n            }\n            i++;\n            continue;\n        }\n\n        i++;\n    }\n    return ans;\n}\n\nvoid ChangeLineBreaks(std::u16string &str, LineBreaks targetLineBreak) {\n    std::vector<UChar> out;\n    std::size_t len = str.size();\n    out.reserve(len);\n\n    std::vector<UChar> lineBreak;\n    switch (targetLineBreak) {\n    case LineBreaks::CRLF:\n        lineBreak = {u'\\r', u'\\n'};\n        break;\n    case LineBreaks::LF:\n        lineBreak = {u'\\n'};\n        break;\n    case LineBreaks::CR:\n        lineBreak = {u'\\r'};\n        break;\n    }\n\n    for (int i = 0; i < len;) {\n        UChar c = str[i];\n        if (c == UChar(u'\\r')) {\n            // \\r\\n\n            if (i < len && str[i + 1] == UChar(u'\\n')) {\n                out.insert(out.end(), lineBreak.begin(), lineBreak.end());\n                i += 2;\n                continue;\n            }\n\n            // \\r\n            out.insert(out.end(), lineBreak.begin(), lineBreak.end());\n            i++;\n            continue;\n        }\n\n        if (c == UChar(u'\\n')) {\n            out.insert(out.end(), lineBreak.begin(), lineBreak.end());\n            i++;\n            continue;\n        }\n\n        out.push_back(c);\n        i++;\n    }\n\n    if (out.size() >= std::numeric_limits<int>::max()) {\n        throw MyRuntimeError(MessageId::STRING_LENGTH_OUT_OF_LIMIT);\n    }\n\n    str.resize(out.size());\n    memcpy(str.data(), out.data(), out.size() * sizeof(UChar));\n    return;\n}"
  },
  {
    "path": "src/Core/LineBreaks.h",
    "content": "#pragma once\n\n// self\n#include \"doublemap.h\"\n\n#include <Common/tstring.h>\n\n// third-party lib\n#include <unicode/ucnv.h>\n\n#undef min\n#undef max\n\nenum class LineBreaks { CRLF, LF, CR, EMPTY, MIX, UNKNOWN };\n\nstd::string LineBreaksToViewName(LineBreaks linebreaks) noexcept;\n\nLineBreaks ViewNameToLineBreaks(std::string viewName) noexcept;\n\n// 识别换行符\nLineBreaks GetLineBreaks(const UChar *buf, std::size_t len);\n\n// 变更换行符\nvoid ChangeLineBreaks(std::u16string &str, LineBreaks targetLineBreak);\n"
  },
  {
    "path": "src/Core/Messages.cpp",
    "content": "#include \"Messages.h\"\n"
  },
  {
    "path": "src/Core/Messages.h",
    "content": "#pragma once\n\n#include \"TranslatorBase.h\"\n\n#include <cassert>\n\nenum class MessageId {\n    BEGIN = 0,\n    WILL_LOST_CHARACTERS,       // \"Some characters will be lost when converting to the target encoding: {}\"\n    INVALID_CHARACTERS,         // \"Content contains invalid characters\"\n    UCNV_ERROR,                 // \"UCNV error. error code: {}\"\n    VIETNAMESE_CONVERT_ERROR,   // \"[{}->{}] convert error at position: {} with content: {}\"\n    TRUNCATED_CHAR_FOUND,       // \"Truncated char found\"\n    ADD_REDUNDANTLY,            // \"Duplicate addition\"\n    NO_DETECTED_ENCODING,       // \"No encoding detected\"\n    FAILED_TO_WRITE_FILE,       // \"Write failed: {}\"\n    FILE_SIZE_OUT_OF_LIMIT,     // \"File size exceeds limit: {}\"\n    STRING_LENGTH_OUT_OF_LIMIT, // \"String length exceeds limit\"\n    FAILED_TO_OPEN_FILE,        // \"Failed to open file: {}\"\n    CORRUPTED_DATA,         // \"Corrupted data found while decode as {}. position: {} content(in hex, shown {} bytes at\n                            // most): {}\"\n    CANNOT_CONVERT_CHARSET, // \"Conversion to the {} charset is not supported\"\n    NO_PERMISSION,          // \"No permission. Tip: The file might be read-only: {}\"\n    END,\n};\n\nstatic_assert(static_cast<int>(MessageId::END) < 100);\n\ninline std::string MessageIdToBasicString(MessageId mid) noexcept {\n    switch (mid) {\n    case MessageId::WILL_LOST_CHARACTERS:\n        return \"Some characters will be lost when converting to the target encoding: {}\";\n    case MessageId::INVALID_CHARACTERS:\n        return \"Content contains invalid characters\";\n    case MessageId::UCNV_ERROR:\n        return \"UCNV error. error code: {}\";\n    case MessageId::VIETNAMESE_CONVERT_ERROR:\n        return \"[{}->{}] convert error at position: {} with content: {}\";\n    case MessageId::TRUNCATED_CHAR_FOUND:\n        return \"Truncated char found\";\n    case MessageId::ADD_REDUNDANTLY:\n        return \"Duplicate addition\";\n    case MessageId::NO_DETECTED_ENCODING:\n        return \"No encoding detected\";\n    case MessageId::FAILED_TO_WRITE_FILE:\n        return \"Write failed: {}\";\n    case MessageId::FILE_SIZE_OUT_OF_LIMIT:\n        return \"File size exceeds limit: {}\";\n    case MessageId::STRING_LENGTH_OUT_OF_LIMIT:\n        return \"String length exceeds limit\";\n    case MessageId::FAILED_TO_OPEN_FILE:\n        return \"Failed to open file: {}\";\n    case MessageId::CORRUPTED_DATA:\n        return \"Corrupted data found while decode as {}. position: {} content(in hex, shown {} bytes at most): \"\n               \"{}\";\n    case MessageId::CANNOT_CONVERT_CHARSET:\n        return \"Conversion to the {} charset is not supported\";\n    case MessageId::NO_PERMISSION:\n        return \"No permission. Tip: The file might be read-only: {}\";\n    default:\n        assert(0);\n    }\n    return \"internal error\";\n}\n"
  },
  {
    "path": "src/Core/TranslatorBase.h",
    "content": "#pragma once\n\n#include <string>\n\nenum class MessageId;\nclass TranslatorBase {\npublic:\n    virtual std::string MessageIdToString(MessageId mid) const noexcept = 0;\n};"
  },
  {
    "path": "src/Core/UCNVHelper.cpp",
    "content": "#include \"UCNVHelper.h\"\n#include \"Exceptions.h\"\n\nvoid DealWithUCNVError(UErrorCode err) {\n    switch (err) {\n    case U_ZERO_ERROR:\n        break;\n    case U_AMBIGUOUS_ALIAS_WARNING: // windows-1252 时会出这个，暂时忽略\n        break;\n    // FIXME\n    // case U_INVALID_CHAR_FOUND:\n    //    throw UnassignedCharError(errStr);\n    // case U_ILLEGAL_CHAR_FOUND:\n    //    throw UnassignedCharError(errStr);\n    default:\n        throw UCNVError(err);\n        break;\n    }\n}"
  },
  {
    "path": "src/Core/UCNVHelper.h",
    "content": "#pragma once\n\n// self\n\n// third-party lib\n#include <unicode/ucnv.h>\n\n// standard lib\n#include <stdexcept>\n\n/*\n * @exception UCNVError ucnv出错。code\n */\nvoid DealWithUCNVError(UErrorCode err);"
  },
  {
    "path": "src/Core/Vietnamese.cpp",
    "content": "#include \"Vietnamese.h\"\n#include \"Exceptions.h\"\n\n#include \"Common/tstring.h\"\n\n#include <unordered_map>\n#include <cassert>\n\nnamespace viet {\n\nnamespace internal {\n\nconst std::array<std::string, TABLE_LENGTH> utf8Table = {\n    \"\\xc3\\x80\",     \"\\xc3\\x81\",     \"\\xc3\\x82\",     \"\\xc3\\x83\",     \"\\xc3\\x88\",     \"\\xc3\\x89\",     \"\\xc3\\x8a\",\n    \"\\xc3\\x8c\",     \"\\xc3\\x8d\",     \"\\xc3\\x92\",     \"\\xc3\\x93\",     \"\\xc3\\x94\",     \"\\xc3\\x95\",     \"\\xc3\\x99\",\n    \"\\xc3\\x9a\",     \"\\xc3\\x9d\",     \"\\xc3\\xa0\",     \"\\xc3\\xa1\",     \"\\xc3\\xa2\",     \"\\xc3\\xa3\",     \"\\xc3\\xa8\",\n    \"\\xc3\\xa9\",     \"\\xc3\\xaa\",     \"\\xc3\\xac\",     \"\\xc3\\xad\",     \"\\xc3\\xb2\",     \"\\xc3\\xb3\",     \"\\xc3\\xb4\",\n    \"\\xc3\\xb5\",     \"\\xc3\\xb9\",     \"\\xc3\\xba\",     \"\\xc3\\xbd\",     \"\\xc4\\x82\",     \"\\xc4\\x83\",     \"\\xc4\\x90\",\n    \"\\xc4\\x91\",     \"\\xc4\\xa8\",     \"\\xc4\\xa9\",     \"\\xc5\\xa8\",     \"\\xc5\\xa9\",     \"\\xc6\\xa0\",     \"\\xc6\\xa1\",\n    \"\\xc6\\xaf\",     \"\\xc6\\xb0\",     \"\\xe1\\xba\\xa0\", \"\\xe1\\xba\\xa1\", \"\\xe1\\xba\\xa2\", \"\\xe1\\xba\\xa3\", \"\\xe1\\xba\\xa4\",\n    \"\\xe1\\xba\\xa5\", \"\\xe1\\xba\\xa6\", \"\\xe1\\xba\\xa7\", \"\\xe1\\xba\\xa8\", \"\\xe1\\xba\\xa9\", \"\\xe1\\xba\\xaa\", \"\\xe1\\xba\\xab\",\n    \"\\xe1\\xba\\xac\", \"\\xe1\\xba\\xad\", \"\\xe1\\xba\\xae\", \"\\xe1\\xba\\xaf\", \"\\xe1\\xba\\xb0\", \"\\xe1\\xba\\xb1\", \"\\xe1\\xba\\xb2\",\n    \"\\xe1\\xba\\xb3\", \"\\xe1\\xba\\xb4\", \"\\xe1\\xba\\xb5\", \"\\xe1\\xba\\xb6\", \"\\xe1\\xba\\xb7\", \"\\xe1\\xba\\xb8\", \"\\xe1\\xba\\xb9\",\n    \"\\xe1\\xba\\xba\", \"\\xe1\\xba\\xbb\", \"\\xe1\\xba\\xbc\", \"\\xe1\\xba\\xbd\", \"\\xe1\\xba\\xbe\", \"\\xe1\\xba\\xbf\", \"\\xe1\\xbb\\x80\",\n    \"\\xe1\\xbb\\x81\", \"\\xe1\\xbb\\x82\", \"\\xe1\\xbb\\x83\", \"\\xe1\\xbb\\x84\", \"\\xe1\\xbb\\x85\", \"\\xe1\\xbb\\x86\", \"\\xe1\\xbb\\x87\",\n    \"\\xe1\\xbb\\x88\", \"\\xe1\\xbb\\x89\", \"\\xe1\\xbb\\x8a\", \"\\xe1\\xbb\\x8b\", \"\\xe1\\xbb\\x8c\", \"\\xe1\\xbb\\x8d\", \"\\xe1\\xbb\\x8e\",\n    \"\\xe1\\xbb\\x8f\", \"\\xe1\\xbb\\x90\", \"\\xe1\\xbb\\x91\", \"\\xe1\\xbb\\x92\", \"\\xe1\\xbb\\x93\", \"\\xe1\\xbb\\x94\", \"\\xe1\\xbb\\x95\",\n    \"\\xe1\\xbb\\x96\", \"\\xe1\\xbb\\x97\", \"\\xe1\\xbb\\x98\", \"\\xe1\\xbb\\x99\", \"\\xe1\\xbb\\x9a\", \"\\xe1\\xbb\\x9b\", \"\\xe1\\xbb\\x9c\",\n    \"\\xe1\\xbb\\x9d\", \"\\xe1\\xbb\\x9e\", \"\\xe1\\xbb\\x9f\", \"\\xe1\\xbb\\xa0\", \"\\xe1\\xbb\\xa1\", \"\\xe1\\xbb\\xa2\", \"\\xe1\\xbb\\xa3\",\n    \"\\xe1\\xbb\\xa4\", \"\\xe1\\xbb\\xa5\", \"\\xe1\\xbb\\xa6\", \"\\xe1\\xbb\\xa7\", \"\\xe1\\xbb\\xa8\", \"\\xe1\\xbb\\xa9\", \"\\xe1\\xbb\\xaa\",\n    \"\\xe1\\xbb\\xab\", \"\\xe1\\xbb\\xac\", \"\\xe1\\xbb\\xad\", \"\\xe1\\xbb\\xae\", \"\\xe1\\xbb\\xaf\", \"\\xe1\\xbb\\xb0\", \"\\xe1\\xbb\\xb1\",\n    \"\\xe1\\xbb\\xb2\", \"\\xe1\\xbb\\xb3\", \"\\xe1\\xbb\\xb4\", \"\\xe1\\xbb\\xb5\", \"\\xe1\\xbb\\xb6\", \"\\xe1\\xbb\\xb7\", \"\\xe1\\xbb\\xb8\",\n    \"\\xe1\\xbb\\xb9\",\n};\n\nconst std::array<std::u16string, TABLE_LENGTH> utf16LETable = {\n    u\"\\u00C0\", u\"\\u00C1\", u\"\\u00C2\", u\"\\u00C3\", u\"\\u00C8\", u\"\\u00C9\", u\"\\u00CA\", u\"\\u00CC\", u\"\\u00CD\", u\"\\u00D2\",\n    u\"\\u00D3\", u\"\\u00D4\", u\"\\u00D5\", u\"\\u00D9\", u\"\\u00DA\", u\"\\u00DD\", u\"\\u00E0\", u\"\\u00E1\", u\"\\u00E2\", u\"\\u00E3\",\n    u\"\\u00E8\", u\"\\u00E9\", u\"\\u00EA\", u\"\\u00EC\", u\"\\u00ED\", u\"\\u00F2\", u\"\\u00F3\", u\"\\u00F4\", u\"\\u00F5\", u\"\\u00F9\",\n    u\"\\u00FA\", u\"\\u00FD\", u\"\\u0102\", u\"\\u0103\", u\"\\u0110\", u\"\\u0111\", u\"\\u0128\", u\"\\u0129\", u\"\\u0168\", u\"\\u0169\",\n    u\"\\u01A0\", u\"\\u01A1\", u\"\\u01AF\", u\"\\u01B0\", u\"\\u1EA0\", u\"\\u1EA1\", u\"\\u1EA2\", u\"\\u1EA3\", u\"\\u1EA4\", u\"\\u1EA5\",\n    u\"\\u1EA6\", u\"\\u1EA7\", u\"\\u1EA8\", u\"\\u1EA9\", u\"\\u1EAA\", u\"\\u1EAB\", u\"\\u1EAC\", u\"\\u1EAD\", u\"\\u1EAE\", u\"\\u1EAF\",\n    u\"\\u1EB0\", u\"\\u1EB1\", u\"\\u1EB2\", u\"\\u1EB3\", u\"\\u1EB4\", u\"\\u1EB5\", u\"\\u1EB6\", u\"\\u1EB7\", u\"\\u1EB8\", u\"\\u1EB9\",\n    u\"\\u1EBA\", u\"\\u1EBB\", u\"\\u1EBC\", u\"\\u1EBD\", u\"\\u1EBE\", u\"\\u1EBF\", u\"\\u1EC0\", u\"\\u1EC1\", u\"\\u1EC2\", u\"\\u1EC3\",\n    u\"\\u1EC4\", u\"\\u1EC5\", u\"\\u1EC6\", u\"\\u1EC7\", u\"\\u1EC8\", u\"\\u1EC9\", u\"\\u1ECA\", u\"\\u1ECB\", u\"\\u1ECC\", u\"\\u1ECD\",\n    u\"\\u1ECE\", u\"\\u1ECF\", u\"\\u1ED0\", u\"\\u1ED1\", u\"\\u1ED2\", u\"\\u1ED3\", u\"\\u1ED4\", u\"\\u1ED5\", u\"\\u1ED6\", u\"\\u1ED7\",\n    u\"\\u1ED8\", u\"\\u1ED9\", u\"\\u1EDA\", u\"\\u1EDB\", u\"\\u1EDC\", u\"\\u1EDD\", u\"\\u1EDE\", u\"\\u1EDF\", u\"\\u1EE0\", u\"\\u1EE1\",\n    u\"\\u1EE2\", u\"\\u1EE3\", u\"\\u1EE4\", u\"\\u1EE5\", u\"\\u1EE6\", u\"\\u1EE7\", u\"\\u1EE8\", u\"\\u1EE9\", u\"\\u1EEA\", u\"\\u1EEB\",\n    u\"\\u1EEC\", u\"\\u1EED\", u\"\\u1EEE\", u\"\\u1EEF\", u\"\\u1EF0\", u\"\\u1EF1\", u\"\\u1EF2\", u\"\\u1EF3\", u\"\\u1EF4\", u\"\\u1EF5\",\n    u\"\\u1EF6\", u\"\\u1EF7\", u\"\\u1EF8\", u\"\\u1EF9\",\n};\n\n// overlapped with ASCII\nconst std::array<std::string, internal::TABLE_LENGTH> vniTable = {\n    \"\\x41\\xD8\", \"\\x41\\xD9\", \"\\x41\\xC2\", \"\\x41\\xD5\", \"\\x45\\xD8\", \"\\x45\\xD9\", \"\\x45\\xC2\", \"\\xCC\",     \"\\xCD\",\n    \"\\x4F\\xD8\", \"\\x4F\\xD9\", \"\\x4F\\xC2\", \"\\x4F\\xD5\", \"\\x55\\xD8\", \"\\x55\\xD9\", \"\\x59\\xD9\", \"\\x61\\xF8\", \"\\x61\\xF9\",\n    \"\\x61\\xE2\", \"\\x61\\xF5\", \"\\x65\\xF8\", \"\\x65\\xF9\", \"\\x65\\xE2\", \"\\xEC\",     \"\\xED\",     \"\\x6F\\xF8\", \"\\x6F\\xF9\",\n    \"\\x6F\\xE2\", \"\\x6F\\xF5\", \"\\x75\\xF8\", \"\\x75\\xF9\", \"\\x79\\xF9\", \"\\x41\\xCA\", \"\\x61\\xEA\", \"\\xD1\",     \"\\xF1\",\n    \"\\xD3\",     \"\\xF3\",     \"\\x55\\xD5\", \"\\x75\\xF5\", \"\\xD4\",     \"\\xF4\",     \"\\xD6\",     \"\\xF6\",     \"\\x41\\xCF\",\n    \"\\x61\\xEF\", \"\\x41\\xDB\", \"\\x61\\xFB\", \"\\x41\\xC1\", \"\\x61\\xE1\", \"\\x41\\xC0\", \"\\x61\\xE0\", \"\\x41\\xC5\", \"\\x61\\xE5\",\n    \"\\x41\\xC3\", \"\\x61\\xE3\", \"\\x41\\xC4\", \"\\x61\\xE4\", \"\\x41\\xC9\", \"\\x61\\xE9\", \"\\x41\\xC8\", \"\\x61\\xE8\", \"\\x41\\xDA\",\n    \"\\x61\\xFA\", \"\\x41\\xDC\", \"\\x61\\xFC\", \"\\x41\\xCB\", \"\\x61\\xEB\", \"\\x45\\xCF\", \"\\x65\\xEF\", \"\\x45\\xDB\", \"\\x65\\xFB\",\n    \"\\x45\\xD5\", \"\\x65\\xF5\", \"\\x45\\xC1\", \"\\x65\\xE1\", \"\\x45\\xC0\", \"\\x65\\xE0\", \"\\x45\\xC5\", \"\\x65\\xE5\", \"\\x45\\xC3\",\n    \"\\x65\\xE3\", \"\\x45\\xC4\", \"\\x65\\xE4\", \"\\xC6\",     \"\\xE6\",     \"\\xD2\",     \"\\xF2\",     \"\\x4F\\xCF\", \"\\x6F\\xEF\",\n    \"\\x4F\\xDB\", \"\\x6F\\xFB\", \"\\x4F\\xC1\", \"\\x6F\\xE1\", \"\\x4F\\xC0\", \"\\x6F\\xE0\", \"\\x4F\\xC5\", \"\\x6F\\xE5\", \"\\x4F\\xC3\",\n    \"\\x6F\\xE3\", \"\\x4F\\xC4\", \"\\x6F\\xE4\", \"\\xD4\\xD9\", \"\\xF4\\xF9\", \"\\xD4\\xD8\", \"\\xF4\\xF8\", \"\\xD4\\xDB\", \"\\xF4\\xFB\",\n    \"\\xD4\\xD5\", \"\\xF4\\xF5\", \"\\xD4\\xCF\", \"\\xF4\\xEF\", \"\\x55\\xCF\", \"\\x75\\xEF\", \"\\x55\\xDB\", \"\\x75\\xFB\", \"\\xD6\\xD9\",\n    \"\\xF6\\xF9\", \"\\xD6\\xD8\", \"\\xF6\\xF8\", \"\\xD6\\xDB\", \"\\xF6\\xFB\", \"\\xD6\\xD5\", \"\\xF6\\xF5\", \"\\xD6\\xCF\", \"\\xF6\\xEF\",\n    \"\\x59\\xD8\", \"\\x79\\xF8\", \"\\xCE\",     \"\\xEE\",     \"\\x59\\xDB\", \"\\x79\\xFB\", \"\\x59\\xD5\", \"\\x79\\xF5\",\n};\n\n// overlapped with ASCII\nconst std::array<char, internal::TABLE_LENGTH> vpsTable = {\n    '\\x80', '\\xC1', '\\xC2', '\\x82', '\\xD7', '\\xC9', '\\xCA', '\\xB5', '\\xB4', '\\xBC', '\\xB9', '\\xD4', '\\xBE', '\\xA8',\n    '\\xDA', '\\xDD', '\\xE0', '\\xE1', '\\xE2', '\\xE3', '\\xE8', '\\xE9', '\\xEA', '\\xEC', '\\xED', '\\xF2', '\\xF3', '\\xF4',\n    '\\xF5', '\\xF9', '\\xFA', '\\x9A', '\\x88', '\\xE6', '\\xF1', '\\xC7', '\\xB8', '\\xEF', '\\xAC', '\\xDB', '\\xF7', '\\xD6',\n    '\\xD0', '\\xDC', '\\x2',  '\\xE5', '\\x81', '\\xE4', '\\x83', '\\xC3', '\\x84', '\\xC0', '\\x85', '\\xC4', '\\x1C', '\\xC5',\n    '\\x3',  '\\xC6', '\\x8D', '\\xA1', '\\x8E', '\\xA2', '\\x8F', '\\xA3', '\\xF0', '\\xA4', '\\x4',  '\\xA5', '\\x5',  '\\xCB',\n    '\\xDE', '\\xC8', '\\xFE', '\\xEB', '\\x90', '\\x89', '\\x93', '\\x8A', '\\x94', '\\x8B', '\\x95', '\\xCD', '\\x6',  '\\x8C',\n    '\\xB7', '\\xCC', '\\x10', '\\xCE', '\\x11', '\\x86', '\\xBD', '\\xD5', '\\x96', '\\xD3', '\\x97', '\\xD2', '\\x98', '\\xB0',\n    '\\x99', '\\x87', '\\x12', '\\xB6', '\\x9D', '\\xA7', '\\x9E', '\\xA9', '\\x9F', '\\xAA', '\\xA6', '\\xAB', '\\x13', '\\xAE',\n    '\\x14', '\\xF8', '\\xD1', '\\xFB', '\\xAD', '\\xD9', '\\xAF', '\\xD8', '\\xB1', '\\xBA', '\\x1D', '\\xBB', '\\x15', '\\xBF',\n    '\\xB2', '\\xFF', '\\x19', '\\x9C', '\\xFD', '\\x9B', '\\xB3', '\\xCF',\n};\n\n// overlapped with ASCII\nconst std::array<char, internal::TABLE_LENGTH> visciiTable = {\n    '\\xC0', '\\xC1', '\\xC2', '\\xC3', '\\xC8', '\\xC9', '\\xCA', '\\xCC', '\\xCD', '\\xD2', '\\xD3', '\\xD4', '\\xA0', '\\xD9',\n    '\\xDA', '\\xDD', '\\xE0', '\\xE1', '\\xE2', '\\xE3', '\\xE8', '\\xE9', '\\xEA', '\\xEC', '\\xED', '\\xF2', '\\xF3', '\\xF4',\n    '\\xF5', '\\xF9', '\\xFA', '\\xFD', '\\xC5', '\\xE5', '\\xD0', '\\xF0', '\\xCE', '\\xEE', '\\x9D', '\\xFB', '\\xB4', '\\xBD',\n    '\\xBF', '\\xDF', '\\x80', '\\xD5', '\\xC4', '\\xE4', '\\x84', '\\xA4', '\\x85', '\\xA5', '\\x86', '\\xA6', '\\x6',  '\\xE7',\n    '\\x87', '\\xA7', '\\x81', '\\xA1', '\\x82', '\\xA2', '\\x2',  '\\xC6', '\\x5',  '\\xC7', '\\x83', '\\xA3', '\\x89', '\\xA9',\n    '\\xCB', '\\xEB', '\\x88', '\\xA8', '\\x8A', '\\xAA', '\\x8B', '\\xAB', '\\x8C', '\\xAC', '\\x8D', '\\xAD', '\\x8E', '\\xAE',\n    '\\x9B', '\\xEF', '\\x98', '\\xB8', '\\x9A', '\\xF7', '\\x99', '\\xF6', '\\x8F', '\\xAF', '\\x90', '\\xB0', '\\x91', '\\xB1',\n    '\\x92', '\\xB2', '\\x93', '\\xB5', '\\x95', '\\xBE', '\\x96', '\\xB6', '\\x97', '\\xB7', '\\xB3', '\\xDE', '\\x94', '\\xFE',\n    '\\x9E', '\\xF8', '\\x9C', '\\xFC', '\\xBA', '\\xD1', '\\xBB', '\\xD7', '\\xBC', '\\xD8', '\\xFF', '\\xE6', '\\xB9', '\\xF1',\n    '\\x9F', '\\xCF', '\\x1E', '\\xDC', '\\x14', '\\xD6', '\\x19', '\\xDB',\n};\n\n// NOTICE: TCVN3 is not double-byte, but due to the nature of its encoding, capital letters (vowels) are mapped to a\n// separate, capital font that is similar to the normal, lowercase one. As such, the hex code and character\n// representation of TCVN3 capital letters in the table is not correct—it is shown here for the purpose of illustration.\n// Users must take this peculiarity into account when converting files in TCVN3 format to Unicode; some post-conversion\n// editing is necessary.\nconst std::array<std::string, TABLE_LENGTH> tcvn3Table = {\n    \"\\x41\\xB5\", \"\\x41\\xB8\", \"\\xA2\",     \"\\x41\\xB7\", \"\\x45\\xCC\", \"\\x45\\xD0\", \"\\xA3\",     \"\\x49\\xD7\", \"\\x49\\xDD\",\n    \"\\x4F\\xDF\", \"\\x4F\\xE3\", \"\\xA4\",     \"\\x4F\\xE2\", \"\\x55\\xEF\", \"\\x55\\xF3\", \"\\x59\\xFD\", \"\\xB5\",     \"\\xB8\",\n    \"\\xA9\",     \"\\xB7\",     \"\\xCC\",     \"\\xD0\",     \"\\xAA\",     \"\\xD7\",     \"\\xDD\",     \"\\xDF\",     \"\\xE3\",\n    \"\\xAB\",     \"\\xE2\",     \"\\xEF\",     \"\\xF3\",     \"\\xFD\",     \"\\xA1\",     \"\\xA8\",     \"\\xA7\",     \"\\xAE\",\n    \"\\x49\\xDC\", \"\\xDC\",     \"\\x55\\xF2\", \"\\xF2\",     \"\\xA5\",     \"\\xAC\",     \"\\xA6\",     \"\\xAD\",     \"\\x41\\xB9\",\n    \"\\xB9\",     \"\\x41\\xB6\", \"\\xB6\",     \"\\xA2\\xCA\", \"\\xCA\",     \"\\xA2\\xC7\", \"\\xC7\",     \"\\xA2\\xC8\", \"\\xC8\",\n    \"\\xA2\\xC9\", \"\\xC9\",     \"\\xA2\\xCB\", \"\\xCB\",     \"\\xA1\\xBE\", \"\\xBE\",     \"\\xA1\\xBB\", \"\\xBB\",     \"\\xA1\\xBC\",\n    \"\\xBC\",     \"\\xA1\\xBD\", \"\\xBD\",     \"\\xA1\\xC6\", \"\\xC6\",     \"\\x45\\xD1\", \"\\xD1\",     \"\\x45\\xCE\", \"\\xCE\",\n    \"\\x45\\xCF\", \"\\xCF\",     \"\\xA3\\xD5\", \"\\xD5\",     \"\\xA3\\xD2\", \"\\xD2\",     \"\\xA3\\xD3\", \"\\xD3\",     \"\\xA3\\xD4\",\n    \"\\xD4\",     \"\\xA3\\xD6\", \"\\xD6\",     \"\\x49\\xD8\", \"\\xD8\",     \"\\x49\\xDE\", \"\\xDE\",     \"\\x4F\\xE4\", \"\\xE4\",\n    \"\\x4F\\xE1\", \"\\xE1\",     \"\\xA4\\xE8\", \"\\xE8\",     \"\\xA4\\xE5\", \"\\xE5\",     \"\\xA4\\xE6\", \"\\xE6\",     \"\\xA4\\xE7\",\n    \"\\xE7\",     \"\\xA4\\xE9\", \"\\xE9\",     \"\\xA5\\xED\", \"\\xED\",     \"\\xA5\\xEA\", \"\\xEA\",     \"\\xA5\\xEB\", \"\\xEB\",\n    \"\\xA5\\xEC\", \"\\xEC\",     \"\\xA5\\xEE\", \"\\xEE\",     \"\\x55\\xF4\", \"\\xF4\",     \"\\x55\\xF1\", \"\\xF1\",     \"\\xA6\\xF8\",\n    \"\\xF8\",     \"\\xA6\\xF5\", \"\\xF5\",     \"\\xA6\\xF6\", \"\\xF6\",     \"\\xA6\\xF7\", \"\\xF7\",     \"\\xA6\\xF9\", \"\\xF9\",\n    \"\\x59\\xFA\", \"\\xFA\",     \"\\x59\\xFE\", \"\\xFE\",     \"\\x59\\xFB\", \"\\xFB\",     \"\\x59\\xFC\", \"\\xFC\",\n};\n\nconst std::array<std::string, internal::TABLE_LENGTH> descriptionTable = {\n    \"LATIN CAPITAL LETTER A WITH GRAVE\",\n    \"LATIN CAPITAL LETTER A WITH ACUTE\",\n    \"LATIN CAPITAL LETTER A WITH CIRCUMFLEX\",\n    \"LATIN CAPITAL LETTER A WITH TILDE\",\n    \"LATIN CAPITAL LETTER E WITH GRAVE\",\n    \"LATIN CAPITAL LETTER E WITH ACUTE\",\n    \"LATIN CAPITAL LETTER E WITH CIRCUMFLEX\",\n    \"LATIN CAPITAL LETTER I WITH GRAVE\",\n    \"LATIN CAPITAL LETTER I WITH ACUTE\",\n    \"LATIN CAPITAL LETTER O WITH GRAVE\",\n    \"LATIN CAPITAL LETTER O WITH ACUTE\",\n    \"LATIN CAPITAL LETTER O WITH CIRCUMFLEX\",\n    \"LATIN CAPITAL LETTER O WITH TILDE\",\n    \"LATIN CAPITAL LETTER U WITH GRAVE\",\n    \"LATIN CAPITAL LETTER U WITH ACUTE\",\n    \"LATIN CAPITAL LETTER Y WITH ACUTE\",\n    \"LATIN SMALL LETTER A WITH GRAVE\",\n    \"LATIN SMALL LETTER A WITH ACUTE\",\n    \"LATIN SMALL LETTER A WITH CIRCUMFLEX\",\n    \"LATIN SMALL LETTER A WITH TILDE\",\n    \"LATIN SMALL LETTER E WITH GRAVE\",\n    \"LATIN SMALL LETTER E WITH ACUTE\",\n    \"LATIN SMALL LETTER E WITH CIRCUMFLEX\",\n    \"LATIN SMALL LETTER I WITH GRAVE\",\n    \"LATIN SMALL LETTER I WITH ACUTE\",\n    \"LATIN SMALL LETTER O WITH GRAVE\",\n    \"LATIN SMALL LETTER O WITH ACUTE\",\n    \"LATIN SMALL LETTER O WITH CIRCUMFLEX\",\n    \"LATIN SMALL LETTER O WITH TILDE\",\n    \"LATIN SMALL LETTER U WITH GRAVE\",\n    \"LATIN SMALL LETTER U WITH ACUTE\",\n    \"LATIN SMALL LETTER Y WITH ACUTE\",\n    \"LATIN CAPITAL LETTER A WITH BREVE\",\n    \"LATIN SMALL LETTER A WITH BREVE\",\n    \"LATIN CAPITAL LETTER D WITH STROKE\",\n    \"LATIN SMALL LETTER D WITH STROKE\",\n    \"LATIN CAPITAL LETTER I WITH TILDE\",\n    \"LATIN SMALL LETTER I WITH TILDE\",\n    \"LATIN CAPITAL LETTER U WITH TILDE\",\n    \"LATIN SMALL LETTER U WITH TILDE\",\n    \"LATIN CAPITAL LETTER O WITH HORN\",\n    \"LATIN SMALL LETTER O WITH HORN\",\n    \"LATIN CAPITAL LETTER U WITH HORN\",\n    \"LATIN SMALL LETTER U WITH HORN\",\n    \"LATIN CAPITAL LETTER A WITH DOT BELOW\",\n    \"LATIN SMALL LETTER A WITH DOT BELOW\",\n    \"LATIN CAPITAL LETTER A WITH HOOK ABOVE\",\n    \"LATIN SMALL LETTER A WITH HOOK ABOVE\",\n    \"LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE\",\n    \"LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE\",\n    \"LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE\",\n    \"LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE\",\n    \"LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE\",\n    \"LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE\",\n    \"LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE\",\n    \"LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE\",\n    \"LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW\",\n    \"LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW\",\n    \"LATIN CAPITAL LETTER A WITH BREVE AND ACUTE\",\n    \"LATIN SMALL LETTER A WITH BREVE AND ACUTE\",\n    \"LATIN CAPITAL LETTER A WITH BREVE AND GRAVE\",\n    \"LATIN SMALL LETTER A WITH BREVE AND GRAVE\",\n    \"LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE\",\n    \"LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE\",\n    \"LATIN CAPITAL LETTER A WITH BREVE AND TILDE\",\n    \"LATIN SMALL LETTER A WITH BREVE AND TILDE\",\n    \"LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW\",\n    \"LATIN SMALL LETTER A WITH BREVE AND DOT BELOW\",\n    \"LATIN CAPITAL LETTER E WITH DOT BELOW\",\n    \"LATIN SMALL LETTER E WITH DOT BELOW\",\n    \"LATIN CAPITAL LETTER E WITH HOOK ABOVE\",\n    \"LATIN SMALL LETTER E WITH HOOK ABOVE\",\n    \"LATIN CAPITAL LETTER E WITH TILDE\",\n    \"LATIN SMALL LETTER E WITH TILDE\",\n    \"LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE\",\n    \"LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE\",\n    \"LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE\",\n    \"LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE\",\n    \"LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE\",\n    \"LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE\",\n    \"LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE\",\n    \"LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE\",\n    \"LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW\",\n    \"LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW\",\n    \"LATIN CAPITAL LETTER I WITH HOOK ABOVE\",\n    \"LATIN SMALL LETTER I WITH HOOK ABOVE\",\n    \"LATIN CAPITAL LETTER I WITH DOT BELOW\",\n    \"LATIN SMALL LETTER I WITH DOT BELOW\",\n    \"LATIN CAPITAL LETTER O WITH DOT BELOW\",\n    \"LATIN SMALL LETTER O WITH DOT BELOW\",\n    \"LATIN CAPITAL LETTER O WITH HOOK ABOVE\",\n    \"LATIN SMALL LETTER O WITH HOOK ABOVE\",\n    \"LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE\",\n    \"LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE\",\n    \"LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE\",\n    \"LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE\",\n    \"LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE\",\n    \"LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE\",\n    \"LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE\",\n    \"LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE\",\n    \"LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW\",\n    \"LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW\",\n    \"LATIN CAPITAL LETTER O WITH HORN AND ACUTE\",\n    \"LATIN SMALL LETTER O WITH HORN AND ACUTE\",\n    \"LATIN CAPITAL LETTER O WITH HORN AND GRAVE\",\n    \"LATIN SMALL LETTER O WITH HORN AND GRAVE\",\n    \"LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE\",\n    \"LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE\",\n    \"LATIN CAPITAL LETTER O WITH HORN AND TILDE\",\n    \"LATIN SMALL LETTER O WITH HORN AND TILDE\",\n    \"LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW\",\n    \"LATIN SMALL LETTER O WITH HORN AND DOT BELOW\",\n    \"LATIN CAPITAL LETTER U WITH DOT BELOW\",\n    \"LATIN SMALL LETTER U WITH DOT BELOW\",\n    \"LATIN CAPITAL LETTER U WITH HOOK ABOVE\",\n    \"LATIN SMALL LETTER U WITH HOOK ABOVE\",\n    \"LATIN CAPITAL LETTER U WITH HORN AND ACUTE\",\n    \"LATIN SMALL LETTER U WITH HORN AND ACUTE\",\n    \"LATIN CAPITAL LETTER U WITH HORN AND GRAVE\",\n    \"LATIN SMALL LETTER U WITH HORN AND GRAVE\",\n    \"LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE\",\n    \"LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE\",\n    \"LATIN CAPITAL LETTER U WITH HORN AND TILDE\",\n    \"LATIN SMALL LETTER U WITH HORN AND TILDE\",\n    \"LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW\",\n    \"LATIN SMALL LETTER U WITH HORN AND DOT BELOW\",\n    \"LATIN CAPITAL LETTER Y WITH GRAVE\",\n    \"LATIN SMALL LETTER Y WITH GRAVE\",\n    \"LATIN CAPITAL LETTER Y WITH DOT BELOW\",\n    \"LATIN SMALL LETTER Y WITH DOT BELOW\",\n    \"LATIN CAPITAL LETTER Y WITH HOOK ABOVE\",\n    \"LATIN SMALL LETTER Y WITH HOOK ABOVE\",\n    \"LATIN CAPITAL LETTER Y WITH TILDE\",\n    \"LATIN SMALL LETTER Y WITH TILDE\",\n};\n\n} // namespace internal\n\nstd::unordered_map<std::string_view, std::string_view> vniToUtf8;\nstd::unordered_map<char, std::string_view> vpsToUtf8;\nstd::unordered_map<char, std::string_view> viscii3ToUtf8;\nstd::unordered_map<std::string_view, std::string_view> tcvn3ToUtf8;\n\nstd::unordered_map<std::string_view, std::u16string_view> vniToUtf16LE;\nstd::unordered_map<char, std::u16string_view> vpsToUtf16LE;\nstd::unordered_map<char, std::u16string_view> visciiToUtf16LE;\nstd::unordered_map<std::string_view, std::u16string_view> tcvn3ToUtf16LE;\n\nstruct Rune {\n    const std::string_view utf8;\n    const std::u16string_view utf16LE;\n    const std::string_view vni;\n    char vps;\n    char viscii;\n    const std::string_view tcvn3;\n    const std::string_view description;\n\n    void AddToString(std::string &out, Encoding targetEncoding) const noexcept {\n        switch (targetEncoding) {\n        case Encoding::VNI:\n            out += vni;\n            break;\n        case Encoding::VPS:\n            out += vps;\n            break;\n        case Encoding::VISCII:\n            out += viscii;\n            break;\n        case Encoding::TCVN3:\n            out += tcvn3;\n            break;\n        default:\n            assert(0 && \"unsupported encoding\");\n        }\n    }\n};\n\nstd::unordered_map<std::string_view, Rune> utf8ToOthers;\nstd::unordered_map<std::u16string_view, Rune> utf16LEToOthers;\n\nbool &Initialized() noexcept {\n    static bool initialized = false;\n    return initialized;\n}\n\nvoid Init() noexcept {\n    if (Initialized())\n        return;\n\n    for (int i = 0; i < internal::TABLE_LENGTH; ++i) {\n        vniToUtf8[internal::vniTable[i]] = internal::utf8Table[i];\n        vpsToUtf8[internal::vpsTable[i]] = internal::utf8Table[i];\n        viscii3ToUtf8[internal::visciiTable[i]] = internal::utf8Table[i];\n        tcvn3ToUtf8[internal::tcvn3Table[i]] = internal::utf8Table[i];\n\n        vniToUtf16LE[internal::vniTable[i]] = internal::utf16LETable[i];\n        vpsToUtf16LE[internal::vpsTable[i]] = internal::utf16LETable[i];\n        visciiToUtf16LE[internal::visciiTable[i]] = internal::utf16LETable[i];\n        tcvn3ToUtf16LE[internal::tcvn3Table[i]] = internal::utf16LETable[i];\n\n        std::string_view sv = internal::utf8Table[i];\n\n        utf8ToOthers.emplace(internal::utf8Table[i],\n                             Rune{internal::utf8Table[i], internal::utf16LETable[i], internal::vniTable[i],\n                                  internal::vpsTable[i], internal::visciiTable[i], internal::tcvn3Table[i],\n                                  internal::descriptionTable[i]});\n\n        utf16LEToOthers.emplace(internal::utf16LETable[i],\n                                Rune{internal::utf8Table[i], internal::utf16LETable[i], internal::vniTable[i],\n                                     internal::vpsTable[i], internal::visciiTable[i], internal::tcvn3Table[i],\n                                     internal::descriptionTable[i]});\n    }\n    assert(vniToUtf8.size() == internal::TABLE_LENGTH);\n    assert(vpsToUtf8.size() == internal::TABLE_LENGTH);\n    assert(viscii3ToUtf8.size() == internal::TABLE_LENGTH);\n    assert(tcvn3ToUtf8.size() == internal::TABLE_LENGTH);\n    assert(vniToUtf16LE.size() == internal::TABLE_LENGTH);\n    assert(vpsToUtf16LE.size() == internal::TABLE_LENGTH);\n    assert(visciiToUtf16LE.size() == internal::TABLE_LENGTH);\n    assert(tcvn3ToUtf16LE.size() == internal::TABLE_LENGTH);\n    assert(utf8ToOthers.size() == internal::TABLE_LENGTH);\n    assert(utf16LEToOthers.size() == internal::TABLE_LENGTH);\n\n    Initialized() = true;\n}\n\nvoid CheckInit() noexcept {\n    assert(Initialized() && \"viet module is not initialized\");\n}\n\nbool CheckEncoding(const char *str, std::size_t len, Encoding encoding) noexcept {\n    CheckInit();\n    if (encoding == Encoding::VPS || encoding == Encoding::VISCII) {\n        const std::unordered_map<char, std::string_view> *dict = nullptr;\n        switch (encoding) {\n        case Encoding::VPS:\n            dict = &vpsToUtf8;\n            break;\n        case Encoding::VISCII:\n            dict = &viscii3ToUtf8;\n            break;\n        }\n\n        for (int i = 0; i < len; ++i) {\n            auto c = str[i];\n            if (isascii(c)) {\n                continue;\n            }\n            if (dict->find(c) == dict->end()) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    const std::unordered_map<std::string_view, std::string_view> *dict = nullptr;\n    switch (encoding) {\n    case Encoding::VNI:\n        dict = &vniToUtf8;\n        break;\n    case Encoding::TCVN3:\n        dict = &tcvn3ToUtf8;\n        break;\n    default:\n        assert(0 && \"unsupported encoding\");\n        break;\n    }\n\n    for (std::size_t i = 0; i < len; ++i) {\n        char c = str[i];\n        if (isascii(c)) {\n            continue;\n        }\n\n        std::string word(1, c);\n\n        if (dict->find(word) != dict->end()) {\n            continue;\n        }\n\n        i++;\n        if (i == len)\n            break;\n\n        word += str[i];\n        if (dict->find(word) != dict->end()) {\n            continue;\n        }\n\n        return false;\n    }\n\n    return true;\n}\n\nbool CheckEncoding(const std::string &str, Encoding encoding) noexcept {\n    return CheckEncoding(str.c_str(), str.size(), encoding);\n}\n\ntemplate <typename ReturnType, typename XStringView>\nauto ConvertTCVN3ToUtfX(std::string_view src) -> ReturnType {\n    CheckInit();\n\n    ReturnType ret;\n    const std::unordered_map<std::string_view, XStringView> *dict = nullptr;\n\n    if constexpr (std::is_same_v<ReturnType, std::string>) {\n        dict = &tcvn3ToUtf8;\n    } else if constexpr (std::is_same_v<ReturnType, std::u16string>) {\n        dict = &tcvn3ToUtf16LE;\n    } else {\n        static_assert(0);\n    }\n\n    // 虽然TCVN3存在部分2Byte映射的第1个char落在ASCII码表范围内的情况，但是根据\n    // https://vietunicode.sourceforge.net/charset/ 的描述，忽略2B的情况并且报错\n    for (std::size_t i = 0; i < src.size(); ++i) {\n        char c = src[i];\n        if (isascii(c)) {\n            ret += c;\n            continue;\n        }\n\n        std::string word(1, c);\n\n        auto iter = dict->find(word);\n        if (iter != dict->end()) {\n            ret += iter->second;\n            continue;\n        }\n\n        // 不匹配，报错\n        throw ConvertError(word, i, Encoding::TCVN3, Encoding::UTF8);\n    }\n    return ret;\n}\n\ntemplate <typename ReturnType, typename XStringView>\nauto ConvertVNIToUtfX(std::string_view src) -> ReturnType {\n    CheckInit();\n\n    ReturnType ret;\n    const std::unordered_map<std::string_view, XStringView> *dict = nullptr;\n\n    if constexpr (std::is_same_v<ReturnType, std::string>) {\n        dict = &vniToUtf8;\n    } else if constexpr (std::is_same_v<ReturnType, std::u16string>) {\n        dict = &vniToUtf16LE;\n    } else {\n        static_assert(0);\n    }\n\n    for (std::size_t i = 0; i < src.size();) {\n        // 由于VNI存在第1个char落在ASCII码表范围内的问题，所以先判断2字节\n        if (i + 1 < src.size()) {\n            std::string_view word = src.substr(i, 2);\n            auto iter = dict->find(word);\n            if (iter != dict->end()) {\n                ret += iter->second;\n                i += 2;\n                continue;\n            }\n\n            // fallthrough\n        }\n\n        // 由于VNI存在单个char和ASCII码表重叠的问题，所以先判断\n        std::string_view word = src.substr(i, 1);\n\n        auto iter = dict->find(word);\n        if (iter != dict->end()) {\n            ret += iter->second;\n            i++;\n            continue;\n        }\n\n        char c = src[i];\n        if (isascii(c)) {\n            ret += c;\n            i++;\n            continue;\n        }\n\n        throw ConvertError(std::string(word), i, Encoding::VNI, Encoding::UTF8);\n    }\n    return ret;\n}\n\ntemplate <typename ReturnType, typename XStringView>\nauto ConvertToUtfX(std::string_view src, Encoding srcEncoding) -> ReturnType {\n    CheckInit();\n    assert(srcEncoding != Encoding::UTF8);\n\n    ReturnType ret;\n\n    if (srcEncoding == Encoding::VPS || srcEncoding == Encoding::VISCII) {\n        const std::unordered_map<char, XStringView> *dict = nullptr;\n        switch (srcEncoding) {\n        case Encoding::VPS:\n            if constexpr (std::is_same_v<ReturnType, std::string>) {\n                dict = &vpsToUtf8;\n            } else if constexpr (std::is_same_v<ReturnType, std::u16string>) {\n                dict = &vpsToUtf16LE;\n            } else {\n                static_assert(0);\n            }\n            break;\n        case Encoding::VISCII:\n            if constexpr (std::is_same_v<ReturnType, std::string>) {\n                dict = &viscii3ToUtf8;\n            } else if constexpr (std::is_same_v<ReturnType, std::u16string>) {\n                dict = &visciiToUtf16LE;\n            } else {\n                static_assert(0);\n            }\n            break;\n        }\n\n        for (int i = 0; i < src.size(); ++i) {\n            auto c = src[i];\n            // VPS和VISCII覆盖了ASCII的部分码点，应该先查VPS/VISCII表\n            auto iter = dict->find(c);\n            if (iter != dict->end()) {\n                ret += iter->second;\n                continue;\n            }\n\n            if (isascii(c)) {\n                ret += c;\n                continue;\n            }\n\n            throw ConvertError(std::string(1, c), i, srcEncoding, Encoding::UTF8);\n        }\n        return ret;\n    }\n\n    if (srcEncoding == Encoding::VNI) {\n        return ConvertVNIToUtfX<ReturnType, XStringView>(src);\n    }\n\n    if (srcEncoding == Encoding::TCVN3) {\n        return ConvertTCVN3ToUtfX<ReturnType, XStringView>(src);\n    }\n\n    assert(0 && \"unsupported encoding\");\n    return ret;\n}\n\nstd::string ConvertToUtf8(std::string_view src, Encoding srcEncoding) {\n    return ConvertToUtfX<std::string, std::string_view>(src, srcEncoding);\n}\n\nstd::u16string ConvertToUtf16LE(std::string_view src, Encoding srcEncoding) {\n    return ConvertToUtfX<std::u16string, std::u16string_view>(src, srcEncoding);\n}\n\nstd::string ConvertFromUtf8(std::string_view utf8Str, Encoding destEncoding) {\n    CheckInit();\n    std::string ret;\n\n    auto srcSize = utf8Str.size();\n    for (std::size_t i = 0; i < srcSize;) {\n        char c = utf8Str[i];\n        if (isascii(c)) {\n            ret += c;\n            i++;\n            continue;\n        }\n\n        i++;\n        if (i == srcSize)\n            break;\n\n        // 2B utf8\n        std::string word{utf8Str.substr(i - 1, 2)};\n        auto iter = utf8ToOthers.find(word);\n        if (iter != utf8ToOthers.end()) {\n            iter->second.AddToString(ret, destEncoding);\n            i++;\n            continue;\n        }\n\n        i++;\n        if (i == srcSize)\n            break;\n\n        // 3B utf8\n        word += utf8Str[i];\n        iter = utf8ToOthers.find(word);\n        if (iter != utf8ToOthers.end()) {\n            iter->second.AddToString(ret, destEncoding);\n            i++;\n            continue;\n        }\n\n        throw ConvertError(word, i, Encoding::UTF8, destEncoding);\n    }\n    return ret;\n}\n\nstd::string ConvertFromUtf16LE(std::u16string_view utf16Str, Encoding destEncoding) {\n    CheckInit();\n    std::string ret;\n\n    for (std::size_t i = 0; i < utf16Str.size(); ++i) {\n        char16_t c = utf16Str[i];\n        if (isascii(c)) {\n            ret += static_cast<char>(c); // in ASCII range, this cast is safe whatever which endians(BE or LE)\n            continue;\n        }\n\n        std::u16string_view word = utf16Str.substr(i, 1);\n        auto iter = utf16LEToOthers.find(word);\n        if (iter != utf16LEToOthers.end()) {\n            iter->second.AddToString(ret, destEncoding);\n            continue;\n        }\n\n        throw ConvertError(std::string(reinterpret_cast<const char *>(word.data()), word.size() * sizeof(char16_t)), i,\n                           Encoding::UTF8, destEncoding);\n    }\n    return ret;\n}\n\nstd::string Convert(std::string_view src, Encoding srcEncoding, Encoding destEncoding) {\n    if (srcEncoding == destEncoding) {\n        return std::string(src);\n    }\n\n    // utf8 -> other\n    if (srcEncoding == Encoding::UTF8) {\n        return ConvertFromUtf8(src, destEncoding);\n    }\n\n    // other -> utf8\n    if (destEncoding == Encoding::UTF8) {\n        return ConvertToUtf8(src, srcEncoding);\n    }\n\n    // other -> other\n    auto temp = ConvertToUtf8(src, srcEncoding);\n    return ConvertFromUtf8(temp, destEncoding);\n}\n\n} // namespace viet"
  },
  {
    "path": "src/Core/Vietnamese.h",
    "content": "/*\n * Reference:\n *\n * https://vietunicode.sourceforge.net/charset/\n */\n#pragma once\n\n#include <array>\n#include <string>\n#include <string_view>\n#include <stdexcept>\n#include <cassert>\n\nnamespace viet {\n\nnamespace internal {\nconstexpr std::size_t TABLE_LENGTH = 134;\n\nextern const std::array<std::string, TABLE_LENGTH> utf8Table;\nextern const std::array<std::u16string, TABLE_LENGTH> utf16LETable;\nextern const std::array<std::string, TABLE_LENGTH> tcvn3Table;\n} // namespace internal\n\nenum class Encoding { UTF8, UTF16LE, VNI, VPS, VISCII, TCVN3 };\n\ninline std::string_view to_string(Encoding encoding) noexcept {\n    switch (encoding) {\n    case Encoding::UTF8:\n        return \"UTF8\";\n    case Encoding::UTF16LE:\n        return \"UTF-16LE\";\n    case Encoding::VNI:\n        return \"VNI\";\n    case Encoding::VPS:\n        return \"VPS\";\n    case Encoding::VISCII:\n        return \"VISCII\";\n    case Encoding::TCVN3:\n        return \"TCVN3\";\n    default:\n        assert(0 && \"unsupported encoding\");\n    }\n    return \"\";\n}\n\ninline Encoding to_encoding(std::string_view sv) noexcept {\n    if (sv == \"UTF8\") {\n        return Encoding::UTF8;\n    }\n    if (sv == \"UTF-16LE\") {\n        return Encoding::UTF8;\n    }\n    if (sv == \"VNI\") {\n        return Encoding::VNI;\n    }\n    if (sv == \"VPS\") {\n        return Encoding::VPS;\n    }\n    if (sv == \"VISCII\") {\n        return Encoding::VISCII;\n    }\n    if (sv == \"TCVN3\") {\n        return Encoding::TCVN3;\n    }\n    assert(0);\n    return Encoding::UTF8;\n}\n\n/**\n * All FUNCTIONS BELOW SHOULD CALL THIS FIRSTLY.\n */\nvoid Init() noexcept;\n\nbool CheckEncoding(const char *str, std::size_t len, Encoding encoding) noexcept;\nbool CheckEncoding(const std::string &str, Encoding encoding) noexcept;\n\n/**\n * Convert TCVN3 etc. encodings to utf8 string.\n * @exception ConvertError thrown when parse fail.\n */\nstd::string ConvertToUtf8(std::string_view src, Encoding srcEncoding);\n\n/**\n * Convert to TCVN3 etc. encodings from utf8 string.\n * @exception ConvertError thrown when parse fail.\n */\nstd::string ConvertFromUtf8(std::string_view utf8Str, Encoding destEncoding);\n\n/**\n * Convert TCVN3 etc. encodings to UTF16LE string.\n * @exception ConvertError thrown when parse fail.\n */\nstd::u16string ConvertToUtf16LE(std::string_view src, Encoding srcEncoding);\n\n/**\n * Convert to TCVN3 etc. encodings from UTF16LE string.\n * @exception ConvertError thrown when parse fail.\n */\nstd::string ConvertFromUtf16LE(std::u16string_view utf16Str, Encoding destEncoding);\n\n/**\n * Convert any Vietnamese encoding(include utf8) to any Vietnamese encoding.\n * @exception ConvertError thrown when parse fail.\n */\nstd::string Convert(std::string_view src, Encoding srcEncoding, Encoding destEncoding);\n\n} // namespace viet"
  },
  {
    "path": "src/Core/cedHelper.h",
    "content": "#pragma once\n\n#include <util/encodings/encodings.h>\n\n"
  },
  {
    "path": "src/Core/doublemap.h",
    "content": "\n#include <unordered_map>\n#include <cassert>\n\n// 双向map，支持双向查表操作\ntemplate <typename T1, typename T2>\nclass doublemap {\npublic:\n    doublemap(std::initializer_list<std::pair<T1, T2>> &&lst) {\n        for (std::pair<T1, T2> pr : lst) {\n            insert(std::forward<std::pair<T1, T2>>(pr));\n        }\n    }\n\n    bool has(const T1 &t1) const {\n        return t1ToT2.find(t1) != t1ToT2.end();\n    }\n\n    bool has(const T2 &t2) const {\n        return t2ToT1.find(t2) != t2ToT1.end();\n    }\n\n    void insert(std::pair<T1, T2> &&pr) {\n        assert(has(pr.first) == false);\n        assert(has(pr.second) == false);\n        t1ToT2.insert(pr);\n        t2ToT1.insert(std::pair<T2, T1>{pr.second, pr.first});\n    }\n\n    T2 &operator[](const T1 &t1) {\n        return t1ToT2[t1];\n    }\n\n    T1 &operator[](const T2 &t2) {\n        return t2ToT1[t2];\n    }\n\n    const T2 &at(const T1 &t1) const {\n        return t1ToT2.at(t1);\n    }\n\n    const T1 &at(const T2 &t2) const {\n        return t2ToT1.at(t2);\n    }\n\nprivate:\n    std::unordered_map<T1, T2> t1ToT2;\n    std::unordered_map<T2, T1> t2ToT1;\n};"
  },
  {
    "path": "src/SmartCharsetConverter/CLIHandler.cpp",
    "content": "#include \"CLIHandler.h\"\n\n#include \"Core/Core.h\"\n#include \"Common/tstring.h\"\n#include \"Common/FileFunction.h\"\n#include \"Common/ConsoleSettings.h\"\n\n#include <guicon/guicon.h>\n\n#include <sstream>\n#include <iostream>\n#include <filesystem>\n#include <memory>\n\nusing std::cerr;\nusing std::cout;\n\nconst std::string configFileName = \"SmartCharsetConverter.json\";\n\nconst char usage[] = u8R\"(\nSmartCharsetConverter --help [<options>]\nSmartCharsetConverter --input <path>... --target_charset <charset> [--target_linebreak <linebreak>] [--output_origin | --output_dir <dir>]\n\n--help [<options>]\n  打印帮助信息。\n  options:\n  * charset\n      打印出支持的字符集名称。\n      例如：--help charset\n\n--input <path>...\n  指定输入文件或者输入文件夹\n  例如：--input D:\\a.txt D:\\input\n\n--target_charset <charset>\n  指定目标字符集\n  例如：--target_charset UTF-8\n\n--target_linebreak <linebreak>\n  指定目标换行符\n  * linebreak: \n      LF 或者 Linux\n      CRLF 或者 Windows\n      CR 或者 Mac\n\n--output_origin\n  转换后直接覆盖输入文件\n\n--output_dir <dir>\n  指定输出的文件夹\n\n)\";\n\nint CLIMain(const std::vector<std::string> &args) noexcept {\n    std::setlocale(LC_CTYPE, \".UTF-8\");\n\n    try {\n        bool ok = AttachParentConsole(1024);\n        if (!ok) {\n            throw std::runtime_error(\"failed to AttachParentConsole\");\n        }\n\n    } catch (const std::runtime_error &err) {\n        MessageBoxW(NULL, utf8_to_wstring(err.what()).c_str(), L\"Error\", MB_OK | MB_ICONERROR);\n        return -1;\n    }\n\n    std::shared_ptr<void> defer(nullptr, [](auto) {\n        try {\n            bool ok = ReleaseConsole();\n            if (!ok) {\n                throw std::runtime_error(\"failed to ReleaseConsole\");\n            }\n\n        } catch (const std::runtime_error &err) {\n            MessageBoxW(NULL, utf8_to_wstring(err.what()).c_str(), L\"Error\", MB_OK | MB_ICONERROR);\n        }\n    });\n\n    // ==================== 命令行已挂载 =====================\n\n    enum class TaskType { PURE_PRINT, CONVERT };\n    TaskType taskType = TaskType::CONVERT;\n    bool setInput = false;\n    bool setTargetCharset = false;\n    bool setTargetLineBreak = false;\n    bool setOutput = false;\n\n    CoreInitOption coreInitOpt;\n    Core core(configFileName, coreInitOpt);\n\n    core.SetFilterMode(Configuration::FilterMode::NO_FILTER);\n\n    std::stringstream ssErr;\n    std::stringstream ssOutput;\n\n    std::vector<std::string> inputPathes;\n\n    int state = 0;\n    for (std::size_t i = 1; i < args.size(); ++i) {\n        std::string arg = args[i];\n        switch (state) {\n        case 0:\n            if (arg == u8\"--help\") {\n                taskType = TaskType::PURE_PRINT;\n                if (i == args.size() - 1) {\n                    ssOutput << usage;\n                    break;\n                }\n\n                state = 10;\n                break;\n            }\n            if (arg == u8\"--input\") {\n                if (setInput) {\n                    ssErr << u8\"错误：重复设置参数：\" << arg << \"\\n\";\n                    break;\n                }\n                state = 20;\n                break;\n            }\n            if (arg == u8\"--target_charset\") {\n                if (setTargetCharset) {\n                    ssErr << u8\"错误：重复设置参数：\" << arg << \"\\n\";\n                    break;\n                }\n                state = 30;\n                break;\n            }\n            if (arg == u8\"--target_linebreak\") {\n                if (setTargetLineBreak) {\n                    ssErr << u8\"错误：重复设置参数：\" << arg << \"\\n\";\n                    break;\n                }\n                state = 40;\n                break;\n            }\n            if (arg == u8\"--output_origin\") {\n                if (setOutput) {\n                    ssErr << u8\"错误：重复设置参数：\" << arg << \"\\n\";\n                    break;\n                }\n                setOutput = true;\n                core.SetOutputTarget(Configuration::OutputTarget::ORIGIN);\n                break;\n            }\n            if (arg == u8\"--output_dir\") {\n                if (setOutput) {\n                    ssErr << u8\"错误：重复设置参数：\" << arg << \"\\n\";\n                    break;\n                }\n                state = 50;\n                break;\n            }\n\n            ssErr << u8\"无效参数：\" << arg;\n            i = args.size(); // 让最外层循环退出\n            break;\n        case 10: // --help xxx\n            if (arg == u8\"charset\") {\n                ssOutput << u8\"支持的字符集有：\\n\";\n                for (int i = static_cast<int>(CharsetCode::UTF8); i < static_cast<int>(CharsetCode::CHARSET_CODE_END);\n                     ++i) {\n\n                    CharsetCode code = static_cast<CharsetCode>(i);\n                    ssOutput << ToViewCharsetName(code) << u8\"\\n\";\n                }\n                break;\n            }\n\n            ssErr << u8\"错误：无效参数：\" << arg;\n            i = args.size(); // 让最外层循环退出\n            break;\n        case 20: // --input xxx\n        {\n            setInput = true;\n            std::filesystem::path path = std::filesystem::u8path(arg);\n            if (std::filesystem::is_regular_file(path) || std::filesystem::is_directory(path)) {\n                inputPathes.push_back(arg);\n                break;\n            }\n            if (arg.substr(0, 2) == u8\"--\") {\n                state = 0;\n                i--;\n                break;\n            }\n\n            ssErr << u8\"错误：无效路径：\" << arg << u8\"\\n\";\n            break;\n        }\n        case 30:\n            setTargetCharset = true;\n            try {\n                core.SetOutputCharset(ToCharsetCode(arg));\n            } catch (const std::runtime_error &err) {\n                (err);\n                ssErr << u8\"错误：未能识别的字符集名称：\" << arg << u8\"\\n\";\n                ssErr << u8\"提示：使用--help charset可以查看支持的字符集名称。\\n\";\n            }\n            state = 0;\n            break;\n        case 40:\n            setTargetLineBreak = true;\n            core.SetEnableConvertLineBreak(true);\n            if (tolower(arg) == tolower(std::string(u8\"LF\")) || tolower(arg) == tolower(std::string(u8\"Linux\"))) {\n                core.SetLineBreaks(LineBreaks::LF);\n                break;\n            }\n            if (tolower(arg) == tolower(std::string(u8\"CRLF\")) || tolower(arg) == tolower(std::string(u8\"Windows\"))) {\n                core.SetLineBreaks(LineBreaks::CRLF);\n                break;\n            }\n            if (tolower(arg) == tolower(std::string(u8\"CR\")) || tolower(arg) == tolower(std::string(u8\"Mac\"))) {\n                core.SetLineBreaks(LineBreaks::CR);\n                break;\n            }\n            ssErr << u8\"错误：未能识别的换行符名称：\" << arg << u8\"\\n\";\n            ssErr << u8\"提示：使用--help可以查看换行符名称。\\n\";\n            state = 0;\n            break;\n        case 50:\n            setOutput = true;\n            core.SetOutputTarget(Configuration::OutputTarget::TO_DIR);\n            core.SetOutputDir(arg);\n            state = 0;\n            break;\n        } // end of switch\n    }\n\n    // 校验输入参数\n    if (taskType == TaskType::CONVERT) {\n        if (inputPathes.empty()) {\n            ssErr << u8\"错误：没有设置输入文件（--input）。\" << u8\"\\n\";\n        }\n\n        if (!setOutput) {\n            ssErr << u8\"错误：没有设置输出方式（--output_origin或者--output_dir）。\" << u8\"\\n\";\n        } else {\n            if (core.GetConfig().outputTarget == Configuration::OutputTarget::ORIGIN) {\n                ssOutput << u8\"输出方式：原位输出\\n\";\n            } else {\n                ssOutput << u8\"输出方式：输出到文件夹：\" << core.GetConfig().outputDir << u8\"\\n\";\n            }\n        }\n\n        if (!setTargetCharset) {\n            ssErr << u8\"错误：没有设置目标字符集（--targetCharset）。\" << u8\"\\n\";\n        } else {\n            ssOutput << u8\"目标字符集：\" << ToViewCharsetName(core.GetConfig().outputCharset) << u8\"\\n\";\n        }\n\n        if (setTargetLineBreak) {\n            ssOutput << u8\"目标换行符：\" << LineBreaksToViewName(core.GetConfig().lineBreak) << u8\"\\n\";\n        }\n    }\n\n    // 开始输出\n    cout << std::string(32, L'=') << u8\"\\n\";\n\n    int retCode = 0;\n    if (!ssErr.str().empty()) {\n        SetConsoleColor(ConsoleColor::RED);\n        std::cerr << u8\"输入参数：\" << u8\"\\n\";\n        for (auto arg : args) {\n            std::cerr << arg << u8\" \";\n        }\n        std::cerr << u8\"\\n\\n\";\n        std::cerr << ssErr.str() << u8\"\\n\";\n        retCode = -1;\n        SetConsoleColor();\n        return -1;\n    }\n\n    SetConsoleColor(ConsoleColor::GREEN);\n    std::cout << ssOutput.str();\n    SetConsoleColor();\n\n    cout << std::string(32, L'=') << u8\"\\n\";\n    cout << u8\"\\n\";\n\n    ssErr.swap(std::stringstream{});\n    ssOutput.swap(std::stringstream{});\n\n    // 开始转换\n\n    auto AddAndConvertOneFile = [&core, &ssOutput, setTargetLineBreak](\n                                    int index, int total, const std::string &inputFilename, int &success, int &failed) {\n        Core::AddItemResult addedItem;\n        SetConsoleColor(ConsoleColor::YELLOW);\n        std::cout << u8\"[\" << std::to_string(index) << u8\"/\" << std::to_string(total) << u8\"] \" << inputFilename\n                  << u8\"\\n\";\n        SetConsoleColor();\n        try {\n            addedItem = core.AddItem(inputFilename, {});\n            // std::cout << u8\"  文本片段: \" << addedItem.strPiece << u8\"\\n\";\n        } catch (const std::runtime_error &err) {\n            SetConsoleColor(ConsoleColor::RED);\n            cerr << u8\"读入文件失败。原因: \" << err.what() << u8\"\\n\";\n            cerr << u8\"\\n\";\n            SetConsoleColor();\n            failed++;\n            return;\n        }\n\n        Core::ConvertFileResult ret = core.Convert(inputFilename, addedItem.srcCharset, addedItem.srcLineBreak);\n        if (ret.errInfo.has_value()) {\n            cout << u8\"  大小: \" << FileSizeToHumanString(addedItem.filesize) << u8\"\\n\";\n            cout << u8\"  字符集: \" << ToViewCharsetName(addedItem.srcCharset) << u8\"\\n\";\n            cout << u8\"  换行符: \" << LineBreaksToViewName(addedItem.srcLineBreak) << u8\"\\n\";\n            SetConsoleColor(ConsoleColor::RED);\n            cerr << u8\"转换失败。原因: \" << ret.errInfo.value() << u8\"\\n\";\n            cerr << u8\"\\n\";\n            SetConsoleColor();\n            failed++;\n            return;\n        }\n\n        cout << u8\"  大小: \" << FileSizeToHumanString(addedItem.filesize) << u8\"\\n\";\n        cout << u8\"  字符集: \" << ToViewCharsetName(addedItem.srcCharset) << u8\" -> \";\n\n        SetConsoleColor(ConsoleColor::GREEN);\n        cout << ToViewCharsetName(core.GetConfig().outputCharset) << u8\"\\n\";\n        SetConsoleColor();\n\n        cout << u8\"  换行符: \" << LineBreaksToViewName(addedItem.srcLineBreak);\n\n        if (setTargetLineBreak) {\n            cout << u8\" -> \";\n            SetConsoleColor(ConsoleColor::GREEN);\n            cout << LineBreaksToViewName(core.GetConfig().lineBreak) << u8\"\\n\";\n            SetConsoleColor();\n        } else {\n            cout << u8\"\\n\";\n        }\n\n        cout << u8\"转换成功。\\n\\n\";\n        success++;\n        return;\n    };\n\n    std::vector<std::string> inputFileNames;\n    for (auto &inputPath : inputPathes) {\n        if (std::filesystem::is_regular_file(std::filesystem::u8path(inputPath))) {\n            inputFileNames.push_back(inputPath);\n            continue;\n        }\n\n        for (auto &path : std::filesystem::recursive_directory_iterator(std::filesystem::u8path(inputPath))) {\n            if (std::filesystem::is_regular_file(path)) {\n                inputFileNames.push_back(path.path().u8string());\n                continue;\n            }\n        }\n    }\n\n    int success = 0, failed = 0;\n    int total = static_cast<int>(inputFileNames.size());\n    for (int i = 0; i < total; i++) {\n        AddAndConvertOneFile(i + 1, total, inputFileNames[i], success, failed);\n    }\n\n    cout << std::string(32, L'=') << u8\"\\n\";\n    cout << u8\"总计：\" << std::to_string(total) << u8\"\\n\";\n    SetConsoleColor(ConsoleColor::GREEN);\n    cout << u8\"成功：\" << std::to_string(success) << u8\"\\n\";\n    if (failed > 0) {\n        SetConsoleColor(ConsoleColor::RED);\n    }\n    cout << u8\"失败：\" << std::to_string(failed) << u8\"\\n\";\n    SetConsoleColor();\n\n    return retCode;\n}\n"
  },
  {
    "path": "src/SmartCharsetConverter/CLIHandler.h",
    "content": "#pragma once\n\n#include <vector>\n#include <string>\n\nint CLIMain(const std::vector<std::string> &args) noexcept;"
  },
  {
    "path": "src/SmartCharsetConverter/CMakeLists.txt",
    "content": "# === SmartCharsetConverter =============\n\nfile(GLOB SRC_CODE\n\t*.h\n\t*.cpp\n)\n\n# 目标exe\nadd_executable(${PROJECT_NAME}\n\t${SRC_CODE}\n)\n\ntarget_link_libraries(${PROJECT_NAME} PRIVATE\n\tCore\n\tControl\n\tTranslator\n\tguicon\n)\n\n# 添加include目录\ntarget_include_directories(Core PRIVATE\n\t.\n)\n\n# 添加.rc\ntarget_sources(${PROJECT_NAME} PRIVATE SmartCharsetConverter.rc)\n\n# VS 设置 Subsystem 选项\nset_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS_RELEASE \"/SUBSYSTEM:WINDOWS\")\nset_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS_RELWITHDEBINFO \"/SUBSYSTEM:WINDOWS\")\nset_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS_MINSIZEREL \"/SUBSYSTEM:WINDOWS\")"
  },
  {
    "path": "src/SmartCharsetConverter/DialogMain.cpp",
    "content": "#include \"DialogMain.h\"\n\n// self\n#include \"Control/TMenu.h\"\n\n#include <Common/tstring.h>\n#include <Common/FileFunction.h>\n\n#include <cassert>\n\n#include <stdexcept>\n#include <sstream>\n#include <set>\n#include <regex>\n#include <filesystem>\n\n#undef min\n#undef max\n\nconst std::tstring appTitle = TEXT(\"SmartCharsetConverter v0.9.3 by Tom Willow\");\n\nconst std::string configFileName = \"SmartCharsetConverter.json\";\n\nconst std::vector<int> innerLanguageIds = {\n    IDR_LANGUAGEJSON_ENGLISH,\n    IDR_LANGUAGEJSON_SIMPLIFIED_CHINESE,\n    IDR_LANGUAGEJSON_SPANISH,\n};\n\nusing namespace std;\n\nDialogMain::DialogMain(const std::vector<std::string> &filenames) : inputFilenames(filenames) {\n\n    CoreInitOption coreOpt;\n    coreOpt.fnUIUpdateItem = [this](int index, std::string filename, std::string fileSizeStr, std::string charsetStr,\n                                    std::string lineBreakStr, std::u16string textPiece) {\n        PostUIFunc([=]() {\n            listview.SetItemText(index, static_cast<int>(ListViewColumn::FILENAME), utf8_to_wstring(filename).c_str());\n            listview.SetItemText(index, static_cast<int>(ListViewColumn::FILESIZE),\n                                 utf8_to_wstring(fileSizeStr).c_str());\n            listview.SetItemText(index, static_cast<int>(ListViewColumn::ENCODING),\n                                 utf8_to_wstring(charsetStr).c_str());\n            listview.SetItemText(index, static_cast<int>(ListViewColumn::LINE_BREAK),\n                                 utf8_to_wstring(lineBreakStr).c_str());\n            listview.SetItemText(index, static_cast<int>(ListViewColumn::TEXT_PIECE),\n                                 reinterpret_cast<const wchar_t *>(textPiece.c_str()));\n        });\n    };\n\n    try {\n        core = make_unique<Core>(configFileName, coreOpt);\n\n        //\n        LanguageServiceOption option;\n        option.languageName = core->GetConfig().language;\n        option.resourceIds = innerLanguageIds;\n        option.resourceType = L\"LanguageJson\";\n\n        languageService = std::make_unique<LanguageService>(option);\n    } catch (const nlohmann::json::exception &err) {\n        (err);\n        throw;\n    } catch (const std::exception &err) {\n        (err);\n        throw;\n    }\n}\n\nDialogMain::~DialogMain() {}\n\nvoid DialogMain::OnClose() {\n    if (thRunning) {\n        doCancel = true;\n        fu.get();\n    }\n    EndDialog(0);\n}\n\nvoid DialogMain::RefreshInterfaceByCurrentLanguage() noexcept {\n    // set controls by language settings\n    GetDlgItem(IDC_STATIC_FILE_LISTS).SetWindowTextW(languageService->GetWString(v0_2::StringId::FILE_LISTS).c_str());\n    GetDlgItem(IDC_STATIC_SET_FILTER_MODE)\n        .SetWindowTextW(languageService->GetWString(v0_2::StringId::SET_FILTER_MODE).c_str());\n    GetDlgItem(IDC_RADIO_STRETEGY_NO_FILTER)\n        .SetWindowTextW(languageService->GetWString(v0_2::StringId::NO_FILTER).c_str());\n    GetDlgItem(IDC_RADIO_STRETEGY_SMART)\n        .SetWindowTextW(languageService->GetWString(v0_2::StringId::SMART_FILE_DETECTION).c_str());\n    GetDlgItem(IDC_RADIO_STRETEGY_MANUAL)\n        .SetWindowTextW(languageService->GetWString(v0_2::StringId::USE_FILE_EXTENSION).c_str());\n    GetDlgItem(IDC_STATIC_ADD_FILES_OR_FOLDER)\n        .SetWindowTextW(languageService->GetWString(v0_2::StringId::ADD_FILES_OR_FOLDER).c_str());\n    GetDlgItem(IDC_BUTTON_ADD_FILES).SetWindowTextW(languageService->GetWString(v0_2::StringId::ADD_FILES).c_str());\n    GetDlgItem(IDC_BUTTON_ADD_DIR).SetWindowTextW(languageService->GetWString(v0_2::StringId::ADD_FOLDER).c_str());\n    GetDlgItem(IDC_STATIC_SET_OUTPUT).SetWindowTextW(languageService->GetWString(v0_2::StringId::SET_OUTPUT).c_str());\n    GetDlgItem(IDC_RADIO_TO_ORIGIN)\n        .SetWindowTextW(languageService->GetWString(v0_2::StringId::OUTPUT_TO_ORIGIN).c_str());\n    GetDlgItem(IDC_RADIO_TO_DIR).SetWindowTextW(languageService->GetWString(v0_2::StringId::OUTPUT_TO_FOLDER).c_str());\n    GetDlgItem(IDC_BUTTON_SET_OUTPUT_DIR)\n        .SetWindowTextW(languageService->GetWString(v0_2::StringId::SELECT_FOLDER).c_str());\n    GetDlgItem(IDC_STATIC_SET_OUTPUT_CHARSET)\n        .SetWindowTextW(languageService->GetWString(v0_2::StringId::SET_OUTPUT_CHARSET).c_str());\n    GetDlgItem(IDC_RADIO_OTHER).SetWindowTextW(languageService->GetWString(v0_2::StringId::OTHERS).c_str());\n    GetDlgItem(IDC_CHECK_CONVERT_RETURN)\n        .SetWindowTextW(languageService->GetWString(v0_2::StringId::CHANGE_LINE_BREAKS).c_str());\n    GetDlgItem(IDC_BUTTON_START).SetWindowTextW(languageService->GetWString(v0_2::StringId::START_CONVERT).c_str());\n    GetDlgItem(IDC_BUTTON_CLEAR).SetWindowTextW(languageService->GetWString(v0_2::StringId::CLEAR_LISTS).c_str());\n\n    listview.SetColumnText(static_cast<int>(ListViewColumn::INDEX),\n                           languageService->GetWString(v0_2::StringId::INDEX).c_str());\n    listview.SetColumnText(static_cast<int>(ListViewColumn::FILENAME),\n                           languageService->GetWString(v0_2::StringId::FILENAME).c_str());\n    listview.SetColumnText(static_cast<int>(ListViewColumn::FILESIZE),\n                           languageService->GetWString(v0_2::StringId::SIZE).c_str());\n    listview.SetColumnText(static_cast<int>(ListViewColumn::ENCODING),\n                           languageService->GetWString(v0_2::StringId::ENCODING).c_str());\n    listview.SetColumnText(static_cast<int>(ListViewColumn::LINE_BREAK),\n                           languageService->GetWString(v0_2::StringId::LINE_BREAKS).c_str());\n    listview.SetColumnText(static_cast<int>(ListViewColumn::TEXT_PIECE),\n                           languageService->GetWString(v0_2::StringId::TEXT_PIECE).c_str());\n\n    rightMenu->SetItemTextById(ID_OPEN_WITH_NOTEPAD, languageService->GetWString(v0_2::StringId::OPEN_WITH_NOTEPAD));\n    rightMenu->SetItemTextById(ID_SPECIFY_ORIGIN_CHARSET,\n                               languageService->GetWString(v0_2::StringId::SPECIFY_ORIGIN_ENCODING));\n    rightMenu->SetItemTextById(ID_REMOVE_ITEM, languageService->GetWString(v0_2::StringId::REMOVE));\n}\n\nBOOL DialogMain::OnInitDialog(CWindow wndFocus, LPARAM lInitParam) {\n    // 设置窗口的大小图标\n    // 大图标：按下alt+tab键切换窗口时对应的图标\n    // 小图标：就是窗口左上角对应的那个图标\n    HICON hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON1));\n    ::SendMessage(m_hWnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);\n    ::SendMessage(m_hWnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);\n\n    SetWindowText(appTitle.c_str());\n\n    BOOL bHandle = true;\n\n    // 包含/排除指定后缀\n    SetFilterMode(core->GetConfig().filterMode);\n    GetDlgItem(IDC_EDIT_INCLUDE_TEXT).SetWindowTextW(utf8_to_wstring(core->GetConfig().includeRule).c_str());\n\n    // target\n    SetOutputTarget(core->GetConfig().outputTarget);\n    GetDlgItem(IDC_EDIT_OUTPUT_DIR).SetWindowTextW(utf8_to_wstring(core->GetConfig().outputDir).c_str());\n    static_cast<CEdit>(GetDlgItem(IDC_EDIT_OUTPUT_DIR)).SetReadOnly(true);\n\n    // 要从列表框“其他”中排除的字符集（也就是 能直接通过单选按钮选中的字符集）\n    const std::vector<CharsetCode> comboBoxOtherExcludes = {CharsetCode::UTF8, CharsetCode::UTF8BOM,\n                                                            CharsetCode::GB18030};\n    comboBoxOther.Attach(GetDlgItem(IDC_COMBO_OTHER_CHARSET).m_hWnd);\n    for (int icode = static_cast<int>(CharsetCode::UTF8), i = 0;\n         icode < static_cast<int>(CharsetCode::CHARSET_CODE_END); ++icode) {\n        CharsetCode code = static_cast<CharsetCode>(icode);\n        if (std::find(comboBoxOtherExcludes.begin(), comboBoxOtherExcludes.end(), code) !=\n            comboBoxOtherExcludes.end()) {\n            continue;\n        }\n\n        comboBoxOther.AddString(utf8_to_wstring(ToViewCharsetName(code)).c_str());\n        comboBoxOther.SetItemData(i, static_cast<int>(code));\n        i++;\n    }\n    comboBoxOther.SetCurSel(0);\n\n    SetOutputCharset(core->GetConfig().outputCharset);\n\n    // enable/disable line breaks\n    CButton(GetDlgItem(IDC_CHECK_CONVERT_RETURN)).SetCheck(core->GetConfig().enableConvertLineBreaks);\n    OnBnClickedCheckConvertReturn(0, 0, 0, bHandle);\n    CButton(GetDlgItem(IDC_RADIO_CRLF + static_cast<int>(core->GetConfig().lineBreak))).SetCheck(true);\n\n    // listview\n    listview.SubclassWindow(GetDlgItem(IDC_LISTVIEW)); // 必须用SubclassWindow传入句柄，才能让MSG_MAP生效\n\n    listview.ModifyStyle(0, LVS_REPORT);\n    listview.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES, LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);\n\n    listview.AddColumn(languageService->GetWString(v0_2::StringId::INDEX).c_str(),\n                       static_cast<int>(ListViewColumn::INDEX));\n    listview.SetColumnWidth(0, 40);\n\n    listview.AddColumn(languageService->GetWString(v0_2::StringId::FILENAME).c_str(),\n                       static_cast<int>(ListViewColumn::FILENAME));\n    listview.SetColumnWidth(1, 280);\n\n    listview.AddColumn(languageService->GetWString(v0_2::StringId::SIZE).c_str(),\n                       static_cast<int>(ListViewColumn::FILESIZE));\n    listview.SetColumnWidth(2, 60);\n\n    listview.AddColumn(languageService->GetWString(v0_2::StringId::ENCODING).c_str(),\n                       static_cast<int>(ListViewColumn::ENCODING));\n    listview.SetColumnWidth(3, 60);\n\n    listview.AddColumn(languageService->GetWString(v0_2::StringId::LINE_BREAKS).c_str(),\n                       static_cast<int>(ListViewColumn::LINE_BREAK));\n    listview.SetColumnWidth(4, 80);\n\n    listview.AddColumn(languageService->GetWString(v0_2::StringId::TEXT_PIECE).c_str(),\n                       static_cast<int>(ListViewColumn::TEXT_PIECE));\n    listview.SetColumnWidth(5, 200);\n\n    // 右键菜单\n    rightMenu = std::make_unique<TPopupMenu>(IDR_MENU_RIGHT);\n    TMenu &specifyOriginCharsetMenu = rightMenu->SetItemToBeContainer(ID_SPECIFY_ORIGIN_CHARSET);\n    for (auto commandId = SPECIFY_ORIGIN_CHARSET_ID_START; commandId < SPECIFY_ORIGIN_CHARSET_ID_END; ++commandId) {\n        CharsetCode code = CommandIdToCharsetCode(commandId);\n        specifyOriginCharsetMenu.AppendItem(commandId, utf8_to_wstring(ToViewCharsetName(code)));\n    }\n\n    selectLanguageMenu = std::make_unique<TPopupMenu>(IDR_MENU_SELECT_LANGUAGES);\n    TMenu &languageSubMenu = selectLanguageMenu->SetItemToBeContainer(ID_LANGUAGE);\n    for (auto commandId = SELECT_LANUAGE_ID_START; commandId < GetSelectLanguageIdEnd(); ++commandId) {\n        std::string languageName = CommandIdToLanguageName(commandId);\n        languageSubMenu.AppendItem(commandId, utf8_to_wstring(languageName));\n    }\n\n    // 启用拖放\n    ::DragAcceptFiles(listview, true);\n\n    setlocale(LC_CTYPE, \"\");\n\n    RefreshInterfaceByCurrentLanguage();\n\n    CenterWindow();\n\n    AddItemsAsync(inputFilenames);\n\n    return 0;\n}\n\nvoid DialogMain::SetFilterMode(Configuration::FilterMode mode) {\n    core->SetFilterMode(mode);\n\n    CButton(GetDlgItem(IDC_RADIO_STRETEGY_NO_FILTER)).SetCheck(false);\n    CButton(GetDlgItem(IDC_RADIO_STRETEGY_SMART)).SetCheck(false);\n    CButton(GetDlgItem(IDC_RADIO_STRETEGY_MANUAL)).SetCheck(false);\n    switch (mode) {\n    case Configuration::FilterMode::NO_FILTER:\n        CButton(GetDlgItem(IDC_RADIO_STRETEGY_NO_FILTER)).SetCheck(true);\n        break;\n    case Configuration::FilterMode::SMART:\n        CButton(GetDlgItem(IDC_RADIO_STRETEGY_SMART)).SetCheck(true);\n        break;\n    case Configuration::FilterMode::ONLY_SOME_EXTANT:\n        CButton(GetDlgItem(IDC_RADIO_STRETEGY_MANUAL)).SetCheck(true);\n        break;\n    default:\n        assert(0);\n    }\n\n    GetDlgItem(IDC_EDIT_INCLUDE_TEXT).EnableWindow(mode == Configuration::FilterMode::ONLY_SOME_EXTANT);\n}\n\nvoid DialogMain::SetOutputTarget(Configuration::OutputTarget outputTarget) {\n    core->SetOutputTarget(outputTarget);\n    bool isToOrigin = (outputTarget == Configuration::OutputTarget::ORIGIN);\n\n    CButton(GetDlgItem(IDC_RADIO_TO_ORIGIN)).SetCheck(isToOrigin);\n    CButton(GetDlgItem(IDC_RADIO_TO_DIR)).SetCheck(!isToOrigin);\n\n    GetDlgItem(IDC_EDIT_OUTPUT_DIR).EnableWindow(!isToOrigin);\n    GetDlgItem(IDC_BUTTON_SET_OUTPUT_DIR).EnableWindow(!isToOrigin);\n}\n\nvoid DialogMain::SetOutputCharset(CharsetCode charset) {\n    assert(charset != CharsetCode::UNKNOWN);\n    assert(charset != CharsetCode::EMPTY);\n    assert(charset != CharsetCode::NOT_SUPPORTED);\n    assert(charset != CharsetCode::CHARSET_CODE_END);\n\n    core->SetOutputCharset(charset);\n    bool isNormalCharset = Configuration::IsNormalCharset(charset);\n\n    CButton(GetDlgItem(IDC_RADIO_UTF8)).SetCheck(charset == CharsetCode::UTF8);\n    CButton(GetDlgItem(IDC_RADIO_UTF8BOM)).SetCheck(charset == CharsetCode::UTF8BOM);\n    CButton(GetDlgItem(IDC_RADIO_GB18030)).SetCheck(charset == CharsetCode::GB18030);\n    CButton(GetDlgItem(IDC_RADIO_OTHER)).SetCheck(Configuration::IsNormalCharset(charset) == false);\n\n    GetDlgItem(IDC_COMBO_OTHER_CHARSET).EnableWindow(!isNormalCharset);\n\n    if (!isNormalCharset) {\n        for (int i = 0; i < comboBoxOther.GetCount(); ++i) {\n            if (comboBoxOther.GetItemData(i) == static_cast<int>(charset)) {\n                comboBoxOther.SetCurSel(i);\n            }\n        }\n    }\n}\n\nstd::vector<std::string> DialogMain::AddItems(const std::vector<std::string> &pathes) noexcept {\n    // 后缀\n    unordered_set<string> filterDotExts;\n\n    switch (core->GetConfig().filterMode) {\n    case Configuration::FilterMode::NO_FILTER:\n        break;\n    case Configuration::FilterMode::SMART: // 智能识别文本\n        break;\n    case Configuration::FilterMode::ONLY_SOME_EXTANT:\n        // 只包括指定后缀\n        try {\n            CheckAndTraversalIncludeRule([&](const string &dotExt) {\n                filterDotExts.insert(dotExt);\n            });\n        } catch (const std::runtime_error &err) {\n            MessageBoxW(utf8_to_wstring(err.what()).c_str(),\n                        languageService->GetWString(v0_2::StringId::MSGBOX_ERROR).c_str(), MB_OK | MB_ICONERROR);\n            return {};\n        }\n        break;\n    default:\n        assert(0);\n    }\n\n    vector<pair<string, string>> failed; // 失败的文件\n    vector<string> ignored;              // 忽略的文件\n\n    auto AddItemNoException = [&](const std::string &filename) {\n        try {\n            Core::AddItemResult ret = core->AddItem(filename, filterDotExts);\n            if (ret.isIgnore) {\n                return;\n            }\n            PostUIFunc([filename, ret, this]() {\n                AppendListViewItem(filename, ret.filesize, ret.srcCharset, ret.srcLineBreak, ret.strPiece);\n            });\n        } catch (io_error_ignore) { ignored.push_back(filename); } catch (const MyRuntimeError &err) {\n            failed.push_back({filename, err.ToLocalString(languageService.get())});\n        } catch (const runtime_error &err) { failed.push_back({filename, err.what()}); }\n    };\n\n    for (auto &path : pathes) {\n        // 如果是目录\n        if (std::filesystem::is_directory(std::filesystem::u8path(path))) {\n            // 遍历指定目录\n            auto filenames = TraversalAllFileNames(path);\n\n            for (auto &filename : filenames) {\n                if (doCancel) {\n                    goto AddItemsAbort;\n                }\n                AddItemNoException(filename);\n            }\n            continue;\n        }\n\n        // 如果是文件\n        if (doCancel) {\n            goto AddItemsAbort;\n        }\n        AddItemNoException(path);\n    }\n\nAddItemsAbort:\n\n    if (!failed.empty()) {\n        string info = languageService->GetUtf8String(v0_2::StringId::FAILED_ADD_BELOW) + u8\"\\r\\n\";\n        for (auto &pr : failed) {\n            info += pr.first + u8\" \" + languageService->GetUtf8String(v0_2::StringId::REASON) + u8\" \" + pr.second +\n                    u8\"\\r\\n \";\n        }\n\n        MyMessage *msg = new MyMessage([this, info]() {\n            MessageBox(utf8_to_wstring(info).c_str(), languageService->GetWString(v0_2::StringId::MSGBOX_ERROR).c_str(),\n                       MB_OK | MB_ICONERROR);\n        });\n        PostMessage(WM_MY_MESSAGE, 0, reinterpret_cast<LPARAM>(msg));\n    }\n\n    if (!ignored.empty()) {\n        string s;\n\n        std::string dest =\n            fmt::format(languageService->GetUtf8String(v0_2::StringId::NON_TEXT_OR_NO_DETECTED), ignored.size());\n\n        s += dest + u8\"\\r\\n\";\n\n        int count = 0;\n        for (auto &filename : ignored) {\n            s += filename + u8\"\\r\\n\";\n            count++;\n\n            if (count >= 5) {\n                s += languageService->GetUtf8String(v0_2::StringId::AND_SO_ON);\n                break;\n            }\n        }\n\n        s += u8\"\\r\\n\\r\\n\";\n        s += languageService->GetUtf8String(v0_2::StringId::TIPS_USE_NO_FILTER);\n\n        PostUIFunc([this, s]() {\n            MessageBox(utf8_to_wstring(s).c_str(), languageService->GetWString(v0_2::StringId::PROMPT).c_str(),\n                       MB_OK | MB_ICONINFORMATION);\n        });\n        return ignored;\n    }\n    return ignored;\n}\n\nvoid DialogMain::AddItemsAsync(const std::vector<std::string> &filenames) noexcept {\n    auto restore = SetBusyState();\n\n    doCancel = false;\n    assert(thRunning == false);\n    thRunning = true;\n    fu = std::async(std::launch::async, [this, restore, filenames]() {\n        // 使用RTTI的手法记下恢复事件\n        unique_ptr<void, function<void(void *)>> deferRestore(reinterpret_cast<void *>(1), [this, restore](void *) {\n            PostUIFunc([this, restore]() {\n                RestoreReadyState(restore);\n\n                thRunning = false;\n            });\n        });\n\n        try {\n            AddItems(filenames);\n        } catch (const runtime_error &err) {\n            PostUIFunc([this, err]() {\n                MessageBoxW(utf8_to_wstring(err.what()).c_str(),\n                            languageService->GetWString(v0_2::StringId::MSGBOX_ERROR).c_str(), MB_OK | MB_ICONERROR);\n            });\n        }\n    });\n}\n\nvoid DialogMain::StartConvert(const std::vector<std::pair<int, bool>> &restore, const std::vector<Item> &items) try {\n    // 使用RTTI的手法记下恢复事件\n    unique_ptr<void, function<void(void *)>> deferRestore(reinterpret_cast<void *>(1), [this, restore](void *) {\n        PostUIFunc([this, restore]() {\n            RestoreReadyState(restore);\n\n#ifndef NDEBUG\n            cout << \"Exit: StartConvert thread\" << endl;\n#endif\n            thRunning = false;\n        });\n    });\n\n    // 如果没有内容\n    if (listview.GetItemCount() == 0) {\n        throw runtime_error(languageService->GetUtf8String(v0_2::StringId::NO_FILE_TO_CONVERT));\n    }\n\n    // 检查输出目录\n    if (core->GetConfig().outputTarget != Configuration::OutputTarget::ORIGIN) {\n        if (core->GetConfig().outputDir.empty()) {\n            throw runtime_error(languageService->GetUtf8String(v0_2::StringId::INVALID_OUTPUT_DIR));\n        }\n    }\n\n    vector<pair<string, string>> failed; // 失败文件/失败原因\n    vector<string> succeed;              // 成功的文件\n\n    // 目标编码\n    auto targetCode = core->GetConfig().outputCharset;\n\n    // 逐个转换\n    auto count = items.size();\n    for (int i = 0; i < count; ++i) {\n        if (doCancel) {\n            break;\n        }\n\n        auto &filename = items[i].filename;\n        auto originCode = items[i].originCode;\n        auto originLineBreak = items[i].originLineBreak;\n\n        // 更新UI\n        PostUIFunc([=]() {\n            listview.SetItemText(i, static_cast<int>(ListViewColumn::INDEX), (TEXT(\"->\") + to_tstring(i + 1)).c_str());\n\n            // listview滚动\n            listview.SelectItem(i);\n        });\n\n        auto convertResult = core->Convert(filename, originCode, originLineBreak, languageService.get());\n        if (convertResult.errInfo.has_value()) {\n            failed.push_back({filename, convertResult.errInfo.value()});\n        } else {\n            succeed.push_back(filename);\n        }\n\n        // 更新UI\n        PostUIFunc([=]() {\n            listview.SetItemText(i, static_cast<int>(ListViewColumn::INDEX), to_tstring(i + 1).c_str());\n            if (convertResult.errInfo.has_value()) {\n                return;\n            }\n            listview.SetItemText(i, static_cast<int>(ListViewColumn::FILENAME),\n                                 utf8_to_wstring(convertResult.outputFileName).c_str());\n            listview.SetItemText(i, static_cast<int>(ListViewColumn::FILESIZE),\n                                 utf8_to_wstring(FileSizeToHumanString(convertResult.outputFileSize)).c_str());\n            listview.SetItemText(i, static_cast<int>(ListViewColumn::ENCODING),\n                                 utf8_to_wstring(ToViewCharsetName(targetCode)).c_str());\n            listview.SetItemText(i, static_cast<int>(ListViewColumn::LINE_BREAK),\n                                 utf8_to_wstring(LineBreaksToViewName(convertResult.targetLineBreaks)).c_str());\n        });\n    }\n\n    // 已经完成处理\n\n    // 如果有失败的\n    if (failed.empty() == false) {\n        string s;\n\n        std::string dest =\n            fmt::format(languageService->GetUtf8String(v0_2::StringId::SUCCEED_SOME_FILES), succeed.size());\n\n        s += dest + u8\"\\r\\n\\r\\n\";\n        s += languageService->GetUtf8String(v0_2::StringId::FAILED_CONVERT_BELOW) + u8\"\\r\\n\";\n        for (auto &pr : failed) {\n            s += pr.first + u8\" \" + languageService->GetUtf8String(v0_2::StringId::REASON) + pr.second + u8\"\\r\\n\";\n        }\n        if (doCancel) {\n            s += u8\"\\r\\n\\r\\n\" + languageService->GetUtf8String(v0_2::StringId::NO_DEAL_DUE_TO_CANCEL);\n        }\n\n        PostUIFunc([this, s]() {\n            MessageBox(utf8_to_wstring(s).c_str(), languageService->GetWString(v0_2::StringId::CONVERT_RESULT).c_str(),\n                       MB_OK | MB_ICONERROR);\n        });\n    } else {\n        // 全部成功之后\n        stringstream ss;\n        std::string dest =\n            fmt::format(languageService->GetUtf8String(v0_2::StringId::SUCCEED_SOME_FILES), succeed.size());\n        ss << dest << u8\"\\r\\n\\r\\n\";\n\n        if (targetCode == CharsetCode::GB18030) {\n            ss << u8\"\\r\\n\\r\\n\" << languageService->GetUtf8String(v0_2::StringId::NOTICE_SHOW_AS_UTF8);\n        }\n        if (doCancel) {\n            ss << u8\"\\r\\n\\r\\n\" << languageService->GetUtf8String(v0_2::StringId::NO_DEAL_DUE_TO_CANCEL);\n        }\n\n        string s = ss.str();\n        PostUIFunc([this, s]() {\n            MessageBox(utf8_to_wstring(s).c_str(), languageService->GetWString(v0_2::StringId::PROMPT).c_str(),\n                       MB_OK | MB_ICONINFORMATION);\n        });\n    }\n\n    return;\n} catch (const runtime_error &err) {\n    PostUIFunc([this, err]() {\n        MessageBox(utf8_to_wstring(err.what()).c_str(),\n                   languageService->GetWString(v0_2::StringId::MSGBOX_ERROR).c_str(), MB_OK | MB_ICONERROR);\n    });\n    return;\n}\n\nLRESULT DialogMain::OnBnClickedRadioStretegyNoFilter(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/,\n                                                     BOOL & /*bHandled*/) {\n    SetFilterMode(Configuration::FilterMode::NO_FILTER);\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedRadioStretegySmart(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/,\n                                                  BOOL & /*bHandled*/) {\n    SetFilterMode(Configuration::FilterMode::SMART);\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedRadioStretegyManual(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/,\n                                                   BOOL & /*bHandled*/) {\n    SetFilterMode(Configuration::FilterMode::ONLY_SOME_EXTANT);\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedRadioToOrigin(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/,\n                                             BOOL & /*bHandled*/) {\n    SetOutputTarget(Configuration::OutputTarget::ORIGIN);\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedRadioToDir(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/) {\n    SetOutputTarget(Configuration::OutputTarget::TO_DIR);\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedRadioUtf8(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/) {\n    SetOutputCharset(CharsetCode::UTF8);\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedRadioUtf8bom(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/) {\n    SetOutputCharset(CharsetCode::UTF8BOM);\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedRadioGb18030(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/) {\n    SetOutputCharset(CharsetCode::GB18030);\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedRadioOther(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/) {\n    SetOutputCharset(static_cast<CharsetCode>(comboBoxOther.GetItemData(comboBoxOther.GetCurSel())));\n\n    return 0;\n}\n\nvoid DialogMain::CheckAndTraversalIncludeRule(std::function<void(const std::string &dotExt)> fn) {\n    // 后缀字符串\n    auto &extsStr = core->GetConfig().includeRule;\n\n    // 切分\n    auto exts = Split(extsStr, u8\" ,|\");\n\n    string filterExampleStr = languageService->GetUtf8String(v0_2::StringId::SUPPORT_FORMAT_BELOW) +\n                              u8\"\\r\\n *.h *.hpp *.c *.cpp *.txt\\r\\n h hpp c cpp txt\\r\\n h|hpp|c|cpp\\r\\n\" +\n                              languageService->GetUtf8String(v0_2::StringId::SEPERATOR_DESCRIPTION);\n\n    // 如果为空\n    if (exts.empty()) {\n        throw runtime_error(languageService->GetUtf8String(v0_2::StringId::NO_SPECIFY_FILTER_EXTEND) + u8\"\\r\\n\\r\\n\" +\n                            filterExampleStr);\n    }\n\n    // 逐个检查\n    for (auto s : exts) {\n        string extStr(s);\n        string pattern = u8R\"((\\*\\.|\\.|)(\\w+))\"; // 匹配*.xxx/.xxx/xxx的正则\n        regex r(pattern);\n        smatch results;\n        if (regex_match(extStr, results, r) == false) {\n            throw runtime_error(languageService->GetUtf8String(v0_2::StringId::INVALID_EXTEND_FILTER) + extStr +\n                                u8\"\\r\\n\\r\\n\" + filterExampleStr);\n        }\n\n        fn(tolower(u8\".\" + results.str(2)));\n    }\n}\n\nLRESULT DialogMain::OnBnClickedButtonAddFiles(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/,\n                                              BOOL & /*bHandled*/) try {\n    vector<pair<tstring, tstring>> dialogFilter;\n    switch (core->GetConfig().filterMode) {\n    case Configuration::FilterMode::NO_FILTER:\n    case Configuration::FilterMode::SMART: // 智能识别文本\n        dialogFilter = {{languageService->GetWString(v0_2::StringId::ALL_FILES) + L\"*.*\", L\"*.*\"}};\n        break;\n    case Configuration::FilterMode::ONLY_SOME_EXTANT: {\n        // 只包括指定后缀\n        tstring filterExtsStr; // dialog的过滤器要求;分割\n        CheckAndTraversalIncludeRule([&](const string &dotExt) {\n            filterExtsStr += utf8_to_wstring(\"*\" + dotExt + \";\");\n        });\n\n        // dialog过滤器\n        dialogFilter.push_back(make_pair(filterExtsStr, filterExtsStr));\n\n        break;\n    }\n    default:\n        assert(0);\n    }\n\n    // 打开文件对话框\n    TFileDialog dialog(*this, dialogFilter, true);\n    if (dialog.Open()) {\n        auto filenames = to_utf8(dialog.GetResult());\n\n        AddItemsAsync(filenames);\n    }\n    return 0;\n} catch (runtime_error &err) {\n    MessageBox(utf8_to_wstring(err.what()).c_str(), languageService->GetWString(v0_2::StringId::MSGBOX_ERROR).c_str(),\n               MB_OK | MB_ICONERROR);\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedButtonAddDir(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/,\n                                            BOOL & /*bHandled*/) try {\n    static wstring dir; // 可用于赋予TFolderBrowser初始路径\n\n    TFolderBrowser folderBrowser(*this);\n    if (folderBrowser.Open(dir)) {\n        AddItemsAsync(to_utf8(std::vector<std::wstring>{dir}));\n    }\n\n    return 0;\n} catch (runtime_error &err) {\n    MessageBox(utf8_to_wstring(err.what()).c_str(), languageService->GetWString(v0_2::StringId::MSGBOX_ERROR).c_str(),\n               MB_OK | MB_ICONERROR);\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedButtonStart(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/,\n                                           BOOL &bHandle /*bHandled*/) {\n    if (thRunning) {\n        doCancel = true;\n        fu.get();\n        return 0;\n    }\n\n    auto restore = SetBusyState();\n\n    vector<Item> items;\n    for (int i = 0; i < listview.GetItemCount(); ++i) {\n        auto filename = to_utf8(listview.GetItemText(i, static_cast<int>(ListViewColumn::FILENAME)));\n        auto originCode = ToCharsetCode(to_utf8(listview.GetItemText(i, static_cast<int>(ListViewColumn::ENCODING))));\n        auto originLineBreak =\n            ViewNameToLineBreaks(to_utf8(listview.GetItemText(i, static_cast<int>(ListViewColumn::LINE_BREAK))));\n        items.push_back({filename, originCode, originLineBreak});\n    }\n\n    cout << \"OnBnClickedButtonStart set cancel false\" << endl;\n    doCancel = false;\n    cout << \"OnBnClickedButtonStart async StartConvert\" << endl;\n    thRunning = true;\n    fu = std::async(std::launch::async, &DialogMain::StartConvert, this, restore, items);\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedButtonClear(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/) {\n    listview.DeleteAllItems();\n    core->Clear();\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedButtonSettings(WORD, WORD, HWND, BOOL &) {\n    // 弹出右键菜单\n    selectLanguageMenu->Popup(m_hWnd);\n\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedButtonSetOutputDir(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/,\n                                                  BOOL & /*bHandled*/) {\n    tstring dir = utf8_to_wstring(core->GetConfig().outputDir);\n\n    TFolderBrowser folderBrowser(*this);\n    if (folderBrowser.Open(dir)) {\n        core->SetOutputDir(to_utf8(dir));\n        GetDlgItem(IDC_EDIT_OUTPUT_DIR).SetWindowTextW(dir.c_str());\n    }\n\n    return 0;\n}\n\nLRESULT DialogMain::OnCbnSelchangeComboOtherCharset(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/,\n                                                    BOOL & /*bHandled*/) {\n    SetOutputCharset(static_cast<CharsetCode>(comboBoxOther.GetItemData(comboBoxOther.GetCurSel())));\n\n    return 0;\n}\n\nLRESULT DialogMain::OnNMRclickListview(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL & /*bHandled*/) {\n    auto selectedItems = listview.GetSelectedItems();\n    if (selectedItems.empty()) {\n        return 0;\n    }\n\n    // 弹出右键菜单\n    rightMenu->Popup(m_hWnd);\n\n    return 0;\n}\n\nLRESULT DialogMain::OnOpenWithNotepad(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/) {\n    auto selectedItems = listview.GetSelectedItems();\n    for (auto i : selectedItems) {\n        auto filename = listview.GetItemText(i, static_cast<int>(ListViewColumn::FILENAME));\n\n        wstring cmd = L\"notepad \" + filename;\n\n        WinExec(to_string(cmd).c_str(), SW_SHOWNORMAL);\n    }\n\n    return 0;\n}\n\nLRESULT DialogMain::OnRemoveItem(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/) {\n    auto selectedItems = listview.GetSelectedItems();\n    // 选中的序号，倒序遍历\n    for (auto itor = selectedItems.rbegin(); itor != selectedItems.rend(); ++itor) {\n        int i = *itor;\n        auto filename = to_utf8(listview.GetItemText(i, static_cast<int>(ListViewColumn::FILENAME)));\n        listview.DeleteItem(i);\n        core->RemoveItem(filename);\n    }\n\n    // 剩下的重新编号\n    for (int i = selectedItems.front(); i < listview.GetItemCount(); ++i) {\n        listview.SetItemText(i, static_cast<int>(ListViewColumn::INDEX), to_tstring(i + 1).c_str());\n    }\n\n    return 0;\n}\n\nLRESULT DialogMain::OnSpecifyOriginCharset(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL & /*bHandled*/) {\n    CharsetCode code = CommandIdToCharsetCode(wID);\n\n    auto selectedItems = listview.GetSelectedItems();\n\n    vector<pair<string, string>> failed; // 失败文件/失败原因\n    for (auto itor = selectedItems.begin(); itor != selectedItems.end(); ++itor) {\n        int index = *itor;\n        auto filename = to_utf8(listview.GetItemText(index, static_cast<int>(ListViewColumn::FILENAME)));\n        try {\n            core->SpecifyItemCharset(index, filename, code);\n        } catch (const MyRuntimeError &err) {\n            failed.push_back({filename, err.ToLocalString(languageService.get())});\n        } catch (const std::runtime_error &err) { failed.push_back({filename, err.what()}); }\n    }\n\n    if (!failed.empty()) {\n        string info = languageService->GetUtf8String(v0_2::StringId::FAILED_TO_SET_CHARSET_MANUALLY) + u8\"\\r\\n\";\n        for (auto &pr : failed) {\n            info += pr.first + u8\" \" + languageService->GetUtf8String(v0_2::StringId::REASON) + pr.second + u8\"\\r\\n\";\n        }\n\n        MyMessage *msg = new MyMessage([this, info]() {\n            MessageBox(utf8_to_wstring(info).c_str(), languageService->GetWString(v0_2::StringId::MSGBOX_ERROR).c_str(),\n                       MB_OK | MB_ICONERROR);\n        });\n        PostMessage(WM_MY_MESSAGE, 0, reinterpret_cast<LPARAM>(msg));\n    }\n    return 0;\n}\n\nLRESULT DialogMain::OnSelectLanguage(WORD, WORD wID, HWND, BOOL &) {\n    std::string languageName = CommandIdToLanguageName(wID);\n\n    try {\n        languageService->SetCurrentLanguage(languageName);\n    } catch (const std::runtime_error &err) {\n        MessageBox(utf8_to_wstring(err.what()).c_str(),\n                   languageService->GetWString(v0_2::StringId::MSGBOX_ERROR).c_str(), MB_OK | MB_ICONERROR);\n        return 0;\n    }\n\n    core->SetLanguage(languageName);\n\n    RefreshInterfaceByCurrentLanguage();\n\n    return 0;\n}\n\nLRESULT DialogMain::OnEnChangeEditIncludeText(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl,\n                                              BOOL & /*bHandled*/) try {\n    // 取得字符串\n    tstring filterStr;\n\n    BSTR bstr = nullptr;\n    CEdit edit(hWndCtl);\n    if (edit.GetWindowTextLengthW() != 0) {\n        bool ok = edit.GetWindowTextW(bstr);\n        if (!ok)\n            throw runtime_error(languageService->GetUtf8String(v0_2::StringId::NO_MEMORY));\n        filterStr = bstr;\n        SysFreeString(bstr);\n    }\n\n    // 保存到core\n    core->SetFilterRule(to_utf8(filterStr));\n\n    return 0;\n} catch (runtime_error &err) {\n    MessageBox(utf8_to_wstring(err.what()).c_str(), languageService->GetWString(v0_2::StringId::MSGBOX_ERROR).c_str(),\n               MB_OK | MB_ICONERROR);\n    return 0;\n}\n\nLRESULT DialogMain::OnNMClickSyslink1(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL & /*bHandled*/) {\n    HINSTANCE r = ShellExecute(NULL, L\"open\", L\"https://github.com/tomwillow/SmartCharsetConverter/releases\", NULL,\n                               NULL, SW_SHOWNORMAL);\n\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedCheckConvertReturn(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/,\n                                                  BOOL & /*bHandled*/) {\n    bool enableLineBreaks = CButton(GetDlgItem(IDC_CHECK_CONVERT_RETURN)).GetCheck();\n    core->SetEnableConvertLineBreak(enableLineBreaks);\n\n    CButton(GetDlgItem(IDC_RADIO_CRLF)).EnableWindow(enableLineBreaks);\n    CButton(GetDlgItem(IDC_RADIO_LF)).EnableWindow(enableLineBreaks);\n    CButton(GetDlgItem(IDC_RADIO_CR)).EnableWindow(enableLineBreaks);\n\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedRadioCrlf(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/) {\n    core->SetLineBreaks(LineBreaks::CRLF);\n\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedRadioLf(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/) {\n    core->SetLineBreaks(LineBreaks::LF);\n\n    return 0;\n}\n\nLRESULT DialogMain::OnBnClickedRadioCr(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/) {\n    core->SetLineBreaks(LineBreaks::CR);\n\n    return 0;\n}\n\nLRESULT DialogMain::OnDropFiles(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) try {\n    HDROP hDrop = reinterpret_cast<HDROP>(wParam);\n\n    vector<string> filenames;\n    UINT nFileNum = DragQueryFileW(hDrop, 0xFFFFFFFF, NULL, 0); // 拖拽文件个数\n    TCHAR strFileName[MAX_PATH];\n    for (UINT i = 0; i < nFileNum; i++) {\n        DragQueryFileW(hDrop, i, strFileName, MAX_PATH); // 获得拖曳的文件名\n        filenames.push_back(to_utf8(strFileName));\n    }\n    DragFinish(hDrop); // 释放hDrop\n\n    AddItemsAsync(filenames);\n\n    return 0;\n} catch (const std::runtime_error &err) {\n    MessageBox(utf8_to_wstring(err.what()).c_str(), languageService->GetWString(v0_2::StringId::MSGBOX_ERROR).c_str(),\n               MB_OK | MB_ICONERROR);\n    return 0;\n}\n\nvoid DialogMain::PostUIFunc(std::function<void()> fn) {\n    MyMessage *msg = new MyMessage(fn);\n    PostMessage(WM_MY_MESSAGE, 0, reinterpret_cast<LPARAM>(msg));\n}\n\nLRESULT DialogMain::OnUser(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) {\n    // cout << \"OnUser Begin \" << std::hex << lParam << endl;\n    unique_ptr<MyMessage> msg(reinterpret_cast<MyMessage *>(lParam));\n    msg->fn();\n    // cout << \"OnUser End \" << std::hex << lParam << endl;\n    return 0;\n}\n\nstd::vector<pair<int, bool>> DialogMain::SetBusyState() noexcept {\n    // 遍历控件，如果是启用状态，那么设置为disable，并在restore中记下，留待日后恢复\n    vector<pair<int, bool>> restore;\n    for (auto id = IDC_RADIO_STRETEGY_SMART; id <= IDC_RADIO_CR; ++id) {\n        if (::GetDlgItem(m_hWnd, id) != NULL) {\n            auto wnd = GetDlgItem(id);\n            if (wnd.IsWindowEnabled()) {\n                restore.push_back({id, true});\n                wnd.EnableWindow(false);\n            }\n        }\n    }\n\n    // 开始按钮text变更为“取消”，并额外enable，用于让用户按“取消”\n    GetDlgItem(IDC_BUTTON_START).SetWindowTextW(languageService->GetWString(v0_2::StringId::CANCEL).c_str());\n    GetDlgItem(IDC_BUTTON_START).EnableWindow(true);\n    return restore;\n}\n\nvoid DialogMain::RestoreReadyState(const std::vector<std::pair<int, bool>> &restore) noexcept {\n    for (auto &pr : restore) {\n        auto wnd = GetDlgItem(pr.first);\n        wnd.EnableWindow(pr.second);\n    }\n\n    GetDlgItem(IDC_BUTTON_START).SetWindowTextW(languageService->GetWString(v0_2::StringId::START_CONVERT).c_str());\n}\n\nvoid DialogMain::AppendListViewItem(std::string filename, uint64_t fileSize, CharsetCode charset, LineBreaks lineBreak,\n                                    std::u16string textPiece) noexcept {\n    auto count = listview.GetItemCount();\n    listview.AddItem(count, static_cast<int>(ListViewColumn::INDEX), to_tstring(count + 1).c_str());\n    listview.AddItem(count, static_cast<int>(ListViewColumn::FILENAME), utf8_to_wstring(filename).c_str());\n    listview.AddItem(count, static_cast<int>(ListViewColumn::FILESIZE),\n                     utf8_to_wstring(FileSizeToHumanString(fileSize)).c_str());\n    listview.AddItem(count, static_cast<int>(ListViewColumn::ENCODING),\n                     utf8_to_wstring(ToViewCharsetName(charset)).c_str());\n    listview.AddItem(count, static_cast<int>(ListViewColumn::LINE_BREAK),\n                     utf8_to_wstring(LineBreaksToViewName(lineBreak)).c_str());\n    listview.AddItem(count, static_cast<int>(ListViewColumn::TEXT_PIECE),\n                     reinterpret_cast<const wchar_t *>(textPiece.c_str()));\n\n    // listview滚动到最下面\n    listview.SelectItem(count);\n}\n"
  },
  {
    "path": "src/SmartCharsetConverter/DialogMain.h",
    "content": "#pragma once\n\n#include \"Core/Core.h\"\n#include \"Common/ThreadPool/ThreadPool.h\"\n#include \"Control/TMenu.h\"\n#include <Translator/LanguageService.h>\n\n#include \"resource.h\"\n\n#include <Common/tstring.h>\n#include <Control/TListView.h>\n\n#include <atlbase.h> // 基本的ATL类\n#include <atlwin.h>  // ATL窗口类\n#include <atlapp.h>  // WTL 主框架窗口类\n#include <atlctrls.h>\n#include <atlcrack.h> // WTL 增强的消息宏\n\n#include <vector>\n#include <chrono>\n#include <string>\n#include <unordered_set>\n#include <thread>\n#include <atomic>\n#include <future>\n#include <iostream>\n\nconst unsigned int WM_MY_MESSAGE = WM_USER + 1;\nstruct MyMessage {\n    std::function<void()> fn;\n    MyMessage(std::function<void()> fn) : fn(fn) {\n        // std::cout << \"MyMessage ctor: \" << this << std::endl;\n    }\n};\n\nclass DialogMain : public CDialogImpl<DialogMain> {\npublic:\n    enum { IDD = IDD_DIALOG_MAIN };\n\n    /*\n     * 如果需要初始时就添加文件/文件夹，则传入filenames参数\n     */\n    DialogMain(const std::vector<std::string> &filenames = {});\n\n    ~DialogMain();\n\nprivate:\n    const std::string caption;\n\n    std::vector<std::string> inputFilenames;\n\n    std::unique_ptr<Core> core;\n    std::unique_ptr<LanguageService> languageService;\n\n    CComboBox comboBoxOther;\n    TListView listview;\n    std::unique_ptr<TPopupMenu> rightMenu;\n    std::unique_ptr<TPopupMenu> selectLanguageMenu;\n\n    enum class ListViewColumn { INDEX = 0, FILENAME, FILESIZE, ENCODING, LINE_BREAK, TEXT_PIECE };\n\n    std::future<void> fu;\n    std::atomic<bool> thRunning;\n    std::atomic<bool> doCancel;\n\n    ThreadPool thPool;\n\n    void RefreshInterfaceByCurrentLanguage() noexcept;\n\n    BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam);\n\n    void SetFilterMode(Configuration::FilterMode mode);\n\n    void SetOutputTarget(Configuration::OutputTarget outputTarget);\n\n    void SetOutputCharset(CharsetCode charset);\n\n    /*\n     * 加入多个文件/文件夹到列表。\n     * 如果有添加失败的文件，会在事件队列中Post一个弹窗事件\n     * 线程安全。\n     */\n    std::vector<std::string> AddItems(const std::vector<std::string> &filenames) noexcept;\n\n    /*\n     * 加入多个文件/文件夹到列表。\n     * 如果有添加失败的文件，会在事件队列中Post一个弹窗事件\n     */\n    void AddItemsAsync(const std::vector<std::string> &filenames) noexcept;\n\n    struct Item {\n        std::string filename;\n        CharsetCode originCode;\n        LineBreaks originLineBreak;\n    };\n\n    void StartConvert(const std::vector<std::pair<int, bool>> &restore, const std::vector<Item> &items);\n\n    void OnClose();\n\n    // ================================================\n\n    /*\n        为了动态地在listview的右键菜单\"指定原编码\"项目里面添加字符集菜单选项，需要为每个字符集指定一个id。\n        但手动指定太麻烦，根据观察，菜单项目的起始编号为40000，所以这里选定了一个30000为起始编号，目的是不和其他id重合。\n        然后这个30000加上字符集的index则得到菜单项的id。\n    */\n    const int SPECIFY_ORIGIN_CHARSET_ID_CONST = 30000;\n    const int SPECIFY_ORIGIN_CHARSET_ID_START = SPECIFY_ORIGIN_CHARSET_ID_CONST + static_cast<int>(CharsetCode::UTF8);\n    const int SPECIFY_ORIGIN_CHARSET_ID_END =\n        SPECIFY_ORIGIN_CHARSET_ID_CONST + static_cast<int>(CharsetCode::CHARSET_CODE_END);\n    int CharsetCodeToCommandId(CharsetCode code) noexcept {\n        return SPECIFY_ORIGIN_CHARSET_ID_CONST + static_cast<int>(code);\n    }\n\n    CharsetCode CommandIdToCharsetCode(int id) noexcept {\n        return static_cast<CharsetCode>(id - SPECIFY_ORIGIN_CHARSET_ID_CONST);\n    }\n\n    /*\n        为了动态地在Settings按钮\"右键菜单\"Language\"项目里面添加语言菜单选项，需要为每个语言包指定一个id。\n        但只能动态指定。根据观察，菜单项目的起始编号为40000，所以这里选定了一个20000为起始编号，目的是不和其他id重合。\n        然后这个20000加上语言包的index则得到菜单项的id。\n    */\n    const int SELECT_LANUAGE_ID_CONST = 20000;\n    const int SELECT_LANUAGE_ID_START = SELECT_LANUAGE_ID_CONST + 0;\n    int GetSelectLanguageIdEnd() noexcept {\n        return static_cast<int>(SELECT_LANUAGE_ID_START + languageService->GetLanguageArray().size());\n    }\n\n    int LanguageNameToCommandId(const std::string &languageName) noexcept {\n        return static_cast<int>(SELECT_LANUAGE_ID_START +\n                                std::distance(languageService->GetLanguagesTable().begin(),\n                                              languageService->GetLanguagesTable().find(languageName)));\n    }\n\n    std::string CommandIdToLanguageName(int id) noexcept {\n        return languageService->GetLanguageArray()[id - SELECT_LANUAGE_ID_START];\n    }\n    // ================================================\n\n    BEGIN_MSG_MAP(DialogMain)\n    MSG_WM_INITDIALOG(OnInitDialog)\n    MSG_WM_CLOSE(OnClose)\n\n    COMMAND_HANDLER(IDC_RADIO_STRETEGY_SMART, BN_CLICKED, OnBnClickedRadioStretegySmart)\n    COMMAND_HANDLER(IDC_RADIO_STRETEGY_MANUAL, BN_CLICKED, OnBnClickedRadioStretegyManual)\n    COMMAND_HANDLER(IDC_RADIO_TO_ORIGIN, BN_CLICKED, OnBnClickedRadioToOrigin)\n    COMMAND_HANDLER(IDC_RADIO_TO_DIR, BN_CLICKED, OnBnClickedRadioToDir)\n    COMMAND_HANDLER(IDC_RADIO_UTF8, BN_CLICKED, OnBnClickedRadioUtf8)\n    COMMAND_HANDLER(IDC_RADIO_UTF8BOM, BN_CLICKED, OnBnClickedRadioUtf8bom)\n    COMMAND_HANDLER(IDC_RADIO_GB18030, BN_CLICKED, OnBnClickedRadioGb18030)\n    COMMAND_HANDLER(IDC_RADIO_OTHER, BN_CLICKED, OnBnClickedRadioOther)\n    COMMAND_HANDLER(IDC_BUTTON_ADD_FILES, BN_CLICKED, OnBnClickedButtonAddFiles)\n    COMMAND_HANDLER(IDC_BUTTON_ADD_DIR, BN_CLICKED, OnBnClickedButtonAddDir)\n    COMMAND_HANDLER(IDC_BUTTON_SET_OUTPUT_DIR, BN_CLICKED, OnBnClickedButtonSetOutputDir)\n    COMMAND_HANDLER(IDC_COMBO_OTHER_CHARSET, CBN_SELCHANGE, OnCbnSelchangeComboOtherCharset)\n\n    NOTIFY_HANDLER(IDC_LISTVIEW, NM_RCLICK, OnNMRclickListview)\n    COMMAND_ID_HANDLER(ID_OPEN_WITH_NOTEPAD, OnOpenWithNotepad)\n    COMMAND_ID_HANDLER(ID_REMOVE_ITEM, OnRemoveItem)\n\n    // 指定原编码\n    COMMAND_RANGE_HANDLER(SPECIFY_ORIGIN_CHARSET_ID_START, SPECIFY_ORIGIN_CHARSET_ID_END, OnSpecifyOriginCharset)\n\n    // Language\n    COMMAND_RANGE_HANDLER(SELECT_LANUAGE_ID_START, GetSelectLanguageIdEnd(), OnSelectLanguage)\n\n    COMMAND_HANDLER(IDC_EDIT_INCLUDE_TEXT, EN_CHANGE, OnEnChangeEditIncludeText)\n    COMMAND_HANDLER(IDC_RADIO_STRETEGY_NO_FILTER, BN_CLICKED, OnBnClickedRadioStretegyNoFilter)\n    NOTIFY_HANDLER(IDC_SYSLINK1, NM_CLICK, OnNMClickSyslink1)\n    COMMAND_HANDLER(IDC_CHECK_CONVERT_RETURN, BN_CLICKED, OnBnClickedCheckConvertReturn)\n    COMMAND_HANDLER(IDC_RADIO_CRLF, BN_CLICKED, OnBnClickedRadioCrlf)\n    COMMAND_HANDLER(IDC_RADIO_LF, BN_CLICKED, OnBnClickedRadioLf)\n    COMMAND_HANDLER(IDC_RADIO_CR, BN_CLICKED, OnBnClickedRadioCr)\n\n    MESSAGE_HANDLER(WM_DROPFILES, OnDropFiles)\n\n    COMMAND_HANDLER(IDC_BUTTON_START, BN_CLICKED, OnBnClickedButtonStart)\n    COMMAND_HANDLER(IDC_BUTTON_CLEAR, BN_CLICKED, OnBnClickedButtonClear)\n    COMMAND_HANDLER(IDC_BUTTON_SETTINGS, BN_CLICKED, OnBnClickedButtonSettings)\n\n    MESSAGE_HANDLER(WM_MY_MESSAGE, OnUser)\n    END_MSG_MAP()\n    LRESULT OnBnClickedRadioStretegySmart(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedRadioStretegyManual(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedRadioToOrigin(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedRadioToDir(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedRadioUtf8(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedRadioUtf8bom(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedRadioGb18030(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n\n    /**\n     * 检查 include过滤器。\n     * @exception runtime_error 过滤器字符串不合法\n     */\n    void CheckAndTraversalIncludeRule(std::function<void(const std::string &dotExt)> fn);\n\n    LRESULT OnBnClickedRadioOther(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedButtonAddFiles(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedButtonAddDir(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedButtonSetOutputDir(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnCbnSelchangeComboOtherCharset(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n\n    // 右键点击listview\n    LRESULT OnNMRclickListview(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL & /*bHandled*/);\n\n    LRESULT OnOpenWithNotepad(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnRemoveItem(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnSpecifyOriginCharset(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnSelectLanguage(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n\n    LRESULT OnEnChangeEditIncludeText(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedRadioStretegyNoFilter(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnNMClickSyslink1(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedCheckConvertReturn(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedRadioCrlf(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedRadioLf(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedRadioCr(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n\n    LRESULT OnDropFiles(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);\n\n    LRESULT OnBnClickedButtonStart(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedButtonClear(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n    LRESULT OnBnClickedButtonSettings(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL & /*bHandled*/);\n\n    void PostUIFunc(std::function<void()> fn);\n    LRESULT OnUser(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);\n\n    /**\n     * @brief 禁用控件，只保留一个取消按钮。\n     * @return vector<被禁用控件的id, 恢复时应该设置的enable值>\n     */\n    std::vector<std::pair<int, bool>> SetBusyState() noexcept;\n\n    /**\n     * @brief 恢复控件。\n     * @return vector<被禁用控件的id, 恢复时应该设置的enable值>\n     */\n    void RestoreReadyState(const std::vector<std::pair<int, bool>> &restore) noexcept;\n\n    void AppendListViewItem(std::string filename, uint64_t fileSize, CharsetCode charset, LineBreaks lineBreak,\n                            std::u16string textPiece) noexcept;\n};"
  },
  {
    "path": "src/SmartCharsetConverter/Resource/lang_embed/English.json",
    "content": "{\n\t\"language\":\"English\",\n\t\"langId\": 1033,\n\t\"author\":\"Tom Willow\",\n\t\"version\":\"0.2\",\n\t\"date\":\"2024-12-22\",\n\t\"data\":[\n\t\t[1,\"Some characters will be lost when converting to the target encoding: {}\"],\n\t\t[2,\"Content contains invalid characters\"],\n\t\t[3,\"UCNV Error. Error code: {}\"],\n\t\t[4,\"[{}->{}] Conversion error. Position: {}, Content: {}\"],\n\t\t[5,\"Truncated character found\"],\n\t\t[6,\"Duplicate addition\"],\n\t\t[7,\"Encoding not detected\"],\n\t\t[8,\"Failed to write file: {}\"],\n\t\t[9,\"File size exceeds limit: {}\"],\n\t\t[10,\"String length exceeds limit\"],\n\t\t[11,\"Failed to open file: {}\"],\n\t\t[12,\"Corrupted data found while decode as {}. position: {} content(in hex, shown {} bytes at most): {}\"],\n\t\t[13,\"Conversion to the {} charset is not supported\"],\n\t\t[14,\"No permission. Tip: The file might be read-only: {}\"],\n\t\t[101,\"Index\"],\n\t\t[102,\"File Name\"],\n\t\t[103,\"Size\"],\n\t\t[104,\"Encoding\"],\n\t\t[105,\"Line Breaks\"],\n\t\t[106,\"Text Fragment\"],\n\t\t[107,\"Error\"],\n\t\t[108,\"Failed to add the following files:\"],\n\t\t[109,\"Reason:\"],\n\t\t[110,\"{} files were detected to be non-text files, or no character set was detected:\"],\n\t\t[111,\"...etc.\"],\n\t\t[112, \"Tip: Use the \\\"No Filter\\\" mode to add again, and you can right-click in the list box to specify the original encoding manually.\"],\n\t\t[113,\"Tip\"],\n\t\t[114,\"There are no files to convert.\"],\n\t\t[115,\"The output directory is invalid.\"],\n\t\t[116,\"Conversion of {} files was successful.\"],\n\t\t[117,\"The following files failed to be converted:\"],\n\t\t[118,\"The remaining files are not processed because the operation was canceled.\"],\n\t\t[119,\"Conversion result\"],\n\t\t[120, \"Note: GB18030 and other some encodings is overlapped with UTF-8 encoding while content is in pure English(or only ASCII characters), so it may be displayed as UTF-8 encoding after conversion.\"],\n\t\t[121,\"The following formats are supported:\"],\n\t\t[122, \"(The separator allows spaces, commas, and vertical bars, and the extension allows *. or without)\"],\n\t\t[123,\"No extension was specified to filter.\"],\n\t\t[124,\"This extension filter is invalid:\"],\n\t\t[125,\"All files\"],\n\t\t[126,\"Failed to specify encoding for the following file:\"],\n\t\t[127,\"Out of memory.\"],\n\t\t[128,\"Cancel\"],\n\t\t[129,\"Convert\"],\n\t\t[130,\"Content contains invalid characters\"],\n\t\t[131,\"Some characters will be lost when converting to the target encoding:\"],\n\t\t[132,\"Not supported yet: {}, please contact the author.\"],\n\t\t[133,\"Duplicate addition\"],\n\t\t[134,\"No encoding detected\"],\n\t\t[135,\"Write failed:\"],\n\t\t[136,\"File size exceeds limit\"],\n\t\t[137,\"Failed to open file:\"],\n\t\t[138,\"File List\"],\n\t\t[139,\"1. Setup Files Filter:\"],\n\t\t[140,\"No Filter Files\"],\n\t\t[141,\"Smart File Detection\"],\n\t\t[142,\"Use File Extension:\"],\n\t\t[143,\"2. Add Files / Folders:\"],\n\t\t[144,\"Files\"],\n\t\t[145,\"Folder\"],\n\t\t[146,\"3. Select Output:\"],\n\t\t[147,\"Original File\"],\n\t\t[148,\"Use Folder:\"],\n\t\t[149,\"4. Select File Encoding:\"],\n\t\t[150,\"Other:\"],\n\t\t[151,\"Change Line Breaks\"],\n\t\t[152,\"Empty List\"],\n\t\t[153,\"Open with Notepad\"],\n\t\t[154,\"Specify original encoding\"],\n\t\t[155,\"Remove\"],\n\t\t[156,\"Select Folder\"]\n\t]\n}"
  },
  {
    "path": "src/SmartCharsetConverter/Resource/lang_embed/Simplified Chinese.json",
    "content": "{\n\t\"language\":\"Simplified Chinese\",\n\t\"langId\": 2052,\n\t\"author\":\"Tom Willow\",\n\t\"version\":\"0.2\",\n\t\"date\":\"2024-12-22\",\n\t\"data\":[\n\t\t[1,\"转换到目标编码会丢失字符：{}\"],\n\t\t[2,\"内容包含无效字符\"],\n\t\t[3,\"UCNV 错误。错误码：{}\"],\n\t\t[4,\"[{}->{}] 转换出错。位置：{}，内容：{}\"],\n\t\t[5,\"发现截断的字符\"],\n\t\t[6,\"重复添加\"],\n\t\t[7,\"未探测出编码集\"],\n\t\t[8,\"写入文件失败：{}\"],\n\t\t[9,\"文件大小超出限制：{}\"],\n\t\t[10,\"字符串长度超出限制\"],\n\t\t[11,\"打开文件失败：{}\"],\n\t\t[12,\"以{}编码集解码时出现错误字符。位置：{} 内容(以16进制表示，最多显示{}字节): {}\"],\n\t\t[13,\"不支持转换到{}字符集\"],\n\t\t[14,\"没有权限。提示：可能文件是只读状态：{}\"],\n\t\t[101,\"序号\"],\n\t\t[102,\"文件名\"],\n\t\t[103,\"大小\"],\n\t\t[104,\"编码\"],\n\t\t[105,\"换行符\"],\n\t\t[106,\"文本片段\"],\n\t\t[107,\"出错\"],\n\t\t[108,\"以下文件添加失败：\"],\n\t\t[109,\"原因：\"],\n\t\t[110,\"{}个文件被判定为非文本文件、或者没有探测出字符集：\"],\n\t\t[111,\"......等\"],\n\t\t[112,\"提示：使用“不过滤”模式再次添加，可以在列表框中点击右键手动指定原编码集。\"],\n\t\t[113,\"提示\"],\n\t\t[114,\"没有待转换的文件。\"],\n\t\t[115,\"输出目录无效。\"],\n\t\t[116,\"转换成功 {} 个文件。\"],\n\t\t[117,\"以下文件转换失败：\"],\n\t\t[118,\"剩余文件由于取消操作所以未做处理。\"],\n\t\t[119,\"转换结果\"],\n\t\t[120,\"注意：GB18030等多个编码在纯英文（只有ASCII码）的情况下和UTF-8编码位重合，所以可能会出现转换后显示为UTF-8编码的情况。\"],\n\t\t[121,\"支持以下格式：\"],\n\t\t[122,\"(分隔符允许空格、逗号、竖线，后缀允许带*.或者不带)\"],\n\t\t[123,\"没有指定要过滤的后缀。\"],\n\t\t[124,\"指定的后缀过滤器无效：\"],\n\t\t[125,\"所有文件\"],\n\t\t[126,\"以下文件设置字符集失败：\"],\n\t\t[127,\"内存不足。\"],\n\t\t[128,\"取消\"],\n\t\t[129,\"开始转换\"],\n\t\t[130,\"内容包含无效字符\"],\n\t\t[131,\"转换到目标编码会丢失字符：\"],\n\t\t[132,\"暂不支持：{}，请联系作者。\"],\n\t\t[133,\"重复添加\"],\n\t\t[134,\"未探测出编码集\"],\n\t\t[135,\"写入失败：\"],\n\t\t[136,\"文件大小超出限制\"],\n\t\t[137,\"打开文件失败：\"],\n\t\t[138,\"文件列表\"],\n\t\t[139,\"1. 设置文件过滤：\"],\n\t\t[140,\"不过滤\"],\n\t\t[141,\"智能识别文本文件\"],\n\t\t[142,\"只要指定后缀的文件：\"],\n\t\t[143,\"2. 添加要转换的文件或文件夹：\"],\n\t\t[144,\"添加文件\"],\n\t\t[145,\"添加文件夹\"],\n\t\t[146,\"3. 选择转出位置：\"],\n\t\t[147,\"转出到原文件\"],\n\t\t[148,\"转出到文件夹：\"],\n\t\t[149,\"4. 指定转出字符集：\"],\n\t\t[150,\"其他：\"],\n\t\t[151,\"转换换行符\"],\n\t\t[152,\"清空列表\"],\n\t\t[153,\"用记事本打开\"],\n\t\t[154,\"指定原编码\"],\n\t\t[155,\"移除\"],\n\t\t[156,\"选择文件夹\"]\n\t]\n}"
  },
  {
    "path": "src/SmartCharsetConverter/Resource/lang_embed/Spanish.json",
    "content": "{\n\t\"language\":\"Spanish\",\n\t\"langId\": 1252,\n\t\"author\":\"Carlos Sánchez, Last Edited by Tom Willow\",\n\t\"version\":\"0.2\",\n\t\"date\":\"2024-12-22\",\n\t\"data\":[\n\t\t[1,\"Algunos caracteres se perderán al convertir a la codificación de destino: {}\"],\n\t\t[2,\"El contenido incluye caracteres no válidos\"],\n\t\t[3,\"UCNV Error. Error code: {}\"],\n\t\t[4,\"[{}->{}] Error de conversión. Posición: {}, Contenido: {}\"],\n\t\t[5,\"Se encontró carácter truncado\"],\n\t\t[6,\"Adición duplicada\"],\n\t\t[7,\"No se detectó codificación\"],\n\t\t[8,\"Fallo al escribir el archivo: {}\"],\n\t\t[9,\"El tamaño del archivo excede el límite: {}\"],\n\t\t[10,\"La longitud de la cadena excede el límite\"],\n\t\t[11,\"Fallo al abrir el archivo: {}\"],\n\t\t[12,\"Se encontraron datos dañados mientras se intentaba decodificar como {}. posición: {} contenido (en hexadecimal, mostrando como máximo {} bytes): {}\"],\n\t\t[13,\"No se admite la conversión al conjunto de caracteres {}\"],\n\t\t[14,\"Sin permisos. Consejo: Es posible que el archivo sea de solo lectura: {}\"],\n\t\t[101,\"#\"],\n\t\t[102,\"Archivo\"],\n\t\t[103,\"Tamaño\"],\n\t\t[104,\"Codificación\"],\n\t\t[105,\"Salto de línea\"],\n\t\t[106,\"Fragmento de texto\"],\n\t\t[107,\"Error\"],\n\t\t[108,\"Error al añadir los siguientes archivos:\"],\n\t\t[109,\"Reason:\"],\n\t\t[110,\"Se detectaron {} archivos que no eran archivos de texto, o no se detectó ningún juego de caracteres:\"],\n\t\t[111,\"...etc.\"],\n\t\t[112, \"Consejo: use el modo \\\"Sin filtro\\\" para agregar nuevamente, y puede hacer clic derecho en el cuadro de lista para especificar la codificación original manualmente.\"],\n\t\t[113,\"Consejo\"],\n\t\t[114,\"No hay archivos que convertir.\"],\n\t\t[115,\"El directorio de salida no es válido.\"],\n\t\t[116,\"La conversión de {} archivos se ha realizado correctamente.\"],\n\t\t[117,\"No se han podido convertir los siguientes archivos:\"],\n\t\t[118,\"Los archivos restantes no se procesan porque la operación se canceló.\"],\n\t\t[119,\"Resultado de la conversión\"],\n\t\t[120, \"Note: GB18030 y otras codificaciones se superponen con la codificación UTF-8, mientras que el contenido está en inglés puro (o sólo caracteres ASCII), por lo que puede mostrarse como codificación UTF-8 después de la conversión.\"],\n\t\t[121,\"Se soportan los siguientes formatos:\"],\n\t\t[122, \"(El separador permite espacios, comas y barras verticales, y la extensión permite *. o sin)\"],\n\t\t[123,\"No se ha especificado ninguna extensión para filtrar.\"],\n\t\t[124,\"Este filtro de extensión no es válido:\"],\n\t\t[125,\"Todos los archivos\"],\n\t\t[126,\"Error al especificar la codificación del siguiente archivo:\"],\n\t\t[127,\"Sin memoria.\"],\n\t\t[128,\"Cancelar\"],\n\t\t[129,\"Convertir\"],\n\t\t[130,\"El contenido incluye caracteres no válidos\"],\n\t\t[131,\"Algunos caracteres se perderán al convertir a la codificación de destino:\"],\n\t\t[132,\"Aún no se soporta: {}, póngase en contacto con el autor.\"],\n\t\t[133,\"Añadir por duplicado\"],\n\t\t[134,\"No se ha detectado ninguna codificación\"],\n\t\t[135,\"Error de escritura:\"],\n\t\t[136,\"El tamaño del archivo supera el límite\"],\n\t\t[137,\"Error al abrir el archivo:\"],\n\t\t[138,\"Lista de archivos\"],\n\t\t[139,\"1. Configurar filtro de archivos:\"],\n\t\t[140,\"Sin filtrar archivos\"],\n\t\t[141,\"Detección inteligente\"],\n\t\t[142,\"Usar extensión:\"],\n\t\t[143,\"2. Añadir archivos / carpetas:\"],\n\t\t[144,\"Archivos\"],\n\t\t[145,\"Carpetas\"],\n\t\t[146,\"3. Seleccionar salida:\"],\n\t\t[147,\"Archivo original\"],\n\t\t[148,\"Usar carpeta:\"],\n\t\t[149,\"4. Seleccionar codificación:\"],\n\t\t[150,\"Otra:\"],\n\t\t[151,\"Cambiar saltos de línea\"],\n\t\t[152,\"Vaciar lista\"],\n\t\t[153,\"Abrir con el Bloc de notas\"],\n\t\t[154,\"Especificar la codificación original\"],\n\t\t[155,\"Quitar\"],\n\t\t[156,\"Seleccionar carpeta\"]\n\t]\n}"
  },
  {
    "path": "src/SmartCharsetConverter/SmartCharsetConverter.cpp",
    "content": "#include <Control/ControlStyle.h>\n\n#include \"CLIHandler.h\"\n#include \"DialogMain.h\"\n#include \"Common/CommandLineParser.h\"\n\n#include <Common/tstring.h>\n#include <Common/ErrorFunction.h>\n\n#include <stdexcept>\n#include <filesystem>\n\nusing namespace std;\n\n#ifndef NDEBUG\nint main() {\n#else\nint WINAPI WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, LPSTR szCmdLine, int nCmdShow) {\n#endif\n\n    // 得到命令行参数\n    const vector<string> args = GetCommandLineArgs();\n\n    // 是否使用命令模式\n    // 进入命令行模式的前提条件：有传入参数，且这些参数不全为文件或文件夹路径\n    bool useCli = false;\n\n    // GUI模式下的初始输入文件。目的是文件拖到程序图标上时能够自动加载\n    vector<string> inputFilenames;\n\n    // 第1个参数是程序路径。多于1个参数说明传入更多参数了\n    if (args.size() > 1) {\n        for (int i = 1; i < args.size(); ++i) {\n            auto path = filesystem::u8path(args[i]);\n            if (!filesystem::is_regular_file(path) && !filesystem::is_directory(path)) {\n                useCli = true;\n                break;\n            }\n            inputFilenames.push_back(args[i]);\n        }\n\n        if (useCli) {\n            // 进入命令行模式\n            return CLIMain(args);\n        }\n    }\n\n    // GUI模式\n    try {\n        InitCommonControls();\n        SupportHighDPI();\n\n        {\n            DialogMain dialogMain(inputFilenames);\n            auto ret = dialogMain.DoModal();\n            if (ret == -1) {\n                auto code = GetLastError();\n                throw runtime_error(string(\"DoModal fail. \\ncode = \") + to_string(code) + string(\"\\ninfo = \") +\n                                    to_utf8(GetLastErrorString(code)));\n            }\n        }\n\n        return 0;\n    } catch (const std::exception &err) {\n        MessageBox(0, utf8_to_wstring(err.what()).c_str(), L\"Error\", MB_OK | MB_ICONERROR);\n        return -1;\n    }\n}"
  },
  {
    "path": "src/SmartCharsetConverter/SmartCharsetConverter.json",
    "content": "{\n    \"enableConvertLineBreaks\": false,\n    \"excludeRule\": \"\",\n    \"filterMode\": 1,\n    \"includeRule\": \"h hpp c cpp cxx txt\",\n    \"language\": \"\",\n    \"lineBreak\": 0,\n    \"outputCharset\": 3,\n    \"outputDir\": \"\",\n    \"outputTarget\": 0\n}"
  },
  {
    "path": "src/SmartCharsetConverter/resource.h",
    "content": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ 生成的包含文件。\n// 供 SmartCharsetConverter.rc 使用\n//\n#define IDD_DIALOG_MAIN                 101\n#define IDI_ICON1                       102\n#define IDR_MENU_RIGHT                  106\n#define IDR_MENU_SELECT_LANGUAGES       107\n#define IDR_LANGUAGEJSON_ENGLISH        108\n#define IDR_LANGUAGEJSON2               109\n#define IDR_LANGUAGEJSON_SIMPLIFIED_CHINESE 109\n#define IDR_LANGUAGEJSON1               111\n#define IDR_LANGUAGEJSON_SPANISH        111\n#define IDC_RADIO_STRETEGY_SMART        1001\n#define IDC_RADIO_STRETEGY_MANUAL       1002\n#define IDC_RADIO_STRETEGY_NO_FILTER    1003\n#define IDC_EDIT_INCLUDE_TEXT           1004\n#define IDC_BUTTON_ADD_DIR              1010\n#define IDC_BUTTON_ADD_FILES            1011\n#define IDC_RADIO_TO_ORIGIN             1020\n#define IDC_RADIO_TO_DIR                1021\n#define IDC_EDIT_OUTPUT_DIR             1022\n#define IDC_BUTTON_SET_OUTPUT_DIR       1023\n#define IDC_RADIO_UTF8                  1030\n#define IDC_RADIO_UTF8BOM               1031\n#define IDC_RADIO_GB18030               1032\n#define IDC_RADIO_OTHER                 1033\n#define IDC_COMBO_OTHER_CHARSET         1034\n#define IDC_LISTVIEW                    1040\n#define IDC_BUTTON_START                1050\n#define IDC_BUTTON_CLEAR                1051\n#define IDC_CHECK_CONVERT_RETURN        1052\n#define IDC_RADIO_CRLF                  1053\n#define IDC_RADIO_LF                    1054\n#define IDC_RADIO_CR                    1055\n#define IDC_SYSLINK1                    1057\n#define IDC_BUTTON1                     1058\n#define IDC_BUTTON_SETTINGS             1058\n#define IDC_STATIC_FILE_LISTS           1059\n#define IDC_STATIC_SET_FILTER_MODE      1060\n#define IDC_STATIC_ADD_FILES_OR_FOLDER  1061\n#define IDC_STATIC_SET_OUTPUT           1062\n#define IDC_STATIC_SET_OUTPUT_CHARSET   1063\n#define ID_OPEN_WITH_NOTEPAD            40003\n#define ID_REMOVE_ITEM                  40004\n#define ID_40005                        40005\n#define ID_SPECIFY_ORIGIN_CHARSET       40006\n#define ID_40007                        40007\n#define ID_LANGUAGE                     40008\n\n// Next default values for new objects\n// \n#ifdef APSTUDIO_INVOKED\n#ifndef APSTUDIO_READONLY_SYMBOLS\n#define _APS_NEXT_RESOURCE_VALUE        112\n#define _APS_NEXT_COMMAND_VALUE         40009\n#define _APS_NEXT_CONTROL_VALUE         1064\n#define _APS_NEXT_SYMED_VALUE           101\n#endif\n#endif\n"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/CMakeLists.txt",
    "content": "# === SmartCharsetConverter-imgui =============\nset(target_name SmartCharsetConverter-imgui)\n\nfile(GLOB SRC_CODE\n\t*.h\n\t*.cpp\n)\n\n# 目标exe\nadd_executable(${target_name}\n\t${SRC_CODE}\n\tSmartCharsetConverter.rc\n)\n\nfind_package(imgui CONFIG REQUIRED)\n\ntarget_link_libraries(${target_name} PRIVATE\n\tCore\n\tTranslator\n\tguicon\n\timgui::imgui\n\topengl32.lib\n)\n\n# 添加include目录\ntarget_include_directories(${target_name} PRIVATE\n\t.\n)\n\n# VS 设置 Subsystem 选项\nset_target_properties(${target_name} PROPERTIES LINK_FLAGS_RELEASE \"/SUBSYSTEM:WINDOWS\")\nset_target_properties(${target_name} PROPERTIES LINK_FLAGS_RELWITHDEBINFO \"/SUBSYSTEM:WINDOWS\")\nset_target_properties(${target_name} PROPERTIES LINK_FLAGS_MINSIZEREL \"/SUBSYSTEM:WINDOWS\")"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/FontAnalyzer.cpp",
    "content": ""
  },
  {
    "path": "src/SmartCharsetConverter-imgui/FontAnalyzer.h",
    "content": "#pragma once\n\n#include <freetype/freetype.h>\n#include <fmt/format.h>\n\n#include <stdexcept>\n#include <memory>\n#include <functional>\n\ntemplate <typename Container = std::unordered_set<FT_Long>>\nclass FontAnalyzer {\npublic:\n    using InsertFunc = std::function<void(Container &, typename Container::value_type)>;\n\n    FontAnalyzer(InsertFunc insertFunc)\n        : library([]() -> std::unique_ptr<FT_LibraryRec_, void (*)(FT_LibraryRec_ *p)> {\n              FT_Library rawLibrary;\n              FT_Error error = FT_Init_FreeType(&rawLibrary);\n              if (error) {\n                  throw std::runtime_error(\n                      fmt::format(\"Failed to initialize FreeType library. error code = {}\", error));\n              }\n              return std::unique_ptr<FT_LibraryRec_, void (*)(FT_LibraryRec_ *p)>(rawLibrary, [](FT_LibraryRec_ *lib) {\n                  FT_Done_FreeType(lib);\n              });\n          }()),\n          insertFunc(insertFunc) {}\n\n    Container GetUnicodePointRange(const std::string &fontFilePath) const {\n        // Load font file\n        FT_Face face;\n        FT_Error error = FT_New_Face(library.get(), fontFilePath.c_str(), 0, &face);\n        if (error == FT_Err_Unknown_File_Format) {\n            throw std::runtime_error(\n                fmt::format(\"Font file could be opened and read, but it appears that its font format is unsupported.\"));\n        } else if (error) {\n            throw std::runtime_error(fmt::format(\"Font file could be opened and read, but it appears that its font \"\n                                                 \"format is unsupported. error code = {}\",\n                                                 error));\n        }\n\n        // Select the Unicode character map.\n        error = FT_Select_Charmap(face, ft_encoding_unicode);\n        if (error) {\n            throw std::runtime_error(fmt::format(\"failed at FT_Select_Charmap. error code = {}\", error));\n        }\n\n        // Iterate over the character map to find supported Unicode characters.\n        FT_ULong charcode = FT_Get_First_Char(face, nullptr);\n        FT_ULong prev_charcode = charcode;\n        Container seen;\n\n        while (charcode != 0) {\n            insertFunc(seen, static_cast<Container::value_type>(charcode));\n            charcode = FT_Get_Next_Char(face, charcode, nullptr);\n        }\n\n        // Cleanup\n        FT_Done_Face(face);\n        return seen;\n    }\n\nprivate:\n    std::unique_ptr<FT_LibraryRec_, void (*)(FT_LibraryRec_ *p)> library;\n    InsertFunc insertFunc;\n};\n"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/FontLoader.cpp",
    "content": "#include \"FontLoader.h\"\n\n#include \"FontAnalyzer.h\"\n\n#include <imgui.h>\n#include <fmt/format.h>\n\n#include <string>\n#include <vector>\n#include <filesystem>\n\nstruct FontInfo {\n    std::string fontPath;\n    int fontSize;\n    std::vector<ImWchar> dict;\n};\n\nconstexpr char windowsFontDir[] = \"C:\\\\Windows\\\\Fonts\\\\\";\n\nvoid LoadFonts(ImFontAtlas *ioFonts, float scaleFactor) {\n    std::vector<FontInfo> fontInfos{\n        FontInfo{std::string(windowsFontDir) + \"segoeui.ttf\", static_cast<int>(16.0f * scaleFactor),\n                 std::vector<ImWchar>{}},\n        FontInfo{std::string(windowsFontDir) + \"msyh.ttc\", static_cast<int>(16.0f * scaleFactor),\n                 std::vector<ImWchar>{}},\n        FontInfo{std::string(windowsFontDir) + \"simsun.ttc\", static_cast<int>(16.0f * scaleFactor),\n                 std::vector<ImWchar>{}},\n    };\n\n    ImFontConfig fontConfig;\n    bool loadedTheFirst = false;\n\n    for (std::size_t i = 0; i < fontInfos.size(); ++i) {\n        if (loadedTheFirst) {\n            fontConfig.MergeMode = true;\n        }\n\n        auto &fontInfo = fontInfos[i];\n        if (!std::filesystem::is_regular_file(std::filesystem::u8path(fontInfo.fontPath))) {\n            continue;\n        }\n\n        FontAnalyzer<std::vector<ImWchar>> fontAnalyzer([](std::vector<ImWchar> &c, ImWchar val) {\n            c.push_back(val);\n        });\n        auto ret = fontAnalyzer.GetUnicodePointRange(fontInfos[i].fontPath);\n        ret.push_back(0);\n        fontInfos[i].dict = std::move(ret);\n\n        ImFont *font =\n            ioFonts->AddFontFromFileTTF(fontInfos[i].fontPath.c_str(), static_cast<float>(fontInfos[i].fontSize),\n                                        &fontConfig, fontInfos[i].dict.data());\n        if (!font) {\n            throw std::runtime_error(fmt::format(\"failed to add font: {}\", fontInfo.fontPath));\n        }\n        loadedTheFirst = true;\n    }\n\n    ioFonts->Build();\n    for (auto font : ioFonts->Fonts) {\n        if (!font->IsLoaded()) {\n            throw std::runtime_error(fmt::format(\"failed to load font: {}\", font->ConfigData->Name));\n        }\n    }\n}\n"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/FontLoader.h",
    "content": "#pragma once\n\n#include <imgui.h>\n\n#include <future>\n\nvoid LoadFonts(ImFontAtlas *ioFonts, float scaleFactor = 1.0f);\n\nclass FontLoader {\npublic:\n    FontLoader() {}\n\n    void StartAsyncLoad(float scaleFactor = 1.0f) {\n        assert(!fu.valid());\n        fu = std::async(std::launch::async, [scaleFactor]() -> std::unique_ptr<ImFontAtlas> {\n            std::unique_ptr<ImFontAtlas> ioFonts(IM_NEW(ImFontAtlas));\n            LoadFonts(ioFonts.get(), scaleFactor);\n            return ioFonts;\n        });\n    }\n\n    std::unique_ptr<ImFontAtlas> TryGetFontAtlas() {\n        if (!fu.valid()) {\n            return nullptr;\n        }\n        if (fu.wait_for(std::chrono::milliseconds(0)) == std::future_status::ready) {\n            return fu.get();\n        }\n        return nullptr;\n    }\n\nprivate:\n    std::future<std::unique_ptr<ImFontAtlas>> fu;\n};"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/ListView.cpp",
    "content": "#include \"ListView.h\"\n\n#include <algorithm>\n#include <vector>\n\n/**\n * @return <return_value, should_break>\n */\ntemplate <std::size_t ItemIndex>\nstd::tuple<bool, bool> Compare(const ListView::MyItem *a, const ListView::MyItem *b, bool ascending) {\n    if (std::get<ItemIndex>(a->AsTuple()) == std::get<ItemIndex>(b->AsTuple())) {\n        return {false, true};\n    }\n\n    bool isLessThan = std::get<ItemIndex>(a->AsTuple()) < std::get<ItemIndex>(b->AsTuple());\n    return {ascending ? isLessThan : !isLessThan, false};\n}\n\nbool CompareWithSortSpecs(ImGuiTableSortSpecs *sort_specs, const ListView::MyItem *a, const ListView::MyItem *b) {\n    for (int n = 0; n < sort_specs->SpecsCount; n++) {\n        // Here we identify columns using the ColumnUserID value that we ourselves passed to TableSetupColumn()\n        // We could also choose to identify columns based on their index (sort_spec->ColumnIndex), which is\n        // simpler!\n        const ImGuiTableColumnSortSpecs *sort_spec = &sort_specs->Specs[n];\n\n        switch (sort_spec->ColumnUserID) {\n        case 0: {\n            auto [returnValue, shouldBreak] =\n                Compare<0>(a, b, sort_spec->SortDirection == ImGuiSortDirection_Ascending);\n            if (shouldBreak) {\n                break;\n            }\n            return returnValue;\n        }\n        case 1: {\n            auto [returnValue, shouldBreak] =\n                Compare<1>(a, b, sort_spec->SortDirection == ImGuiSortDirection_Ascending);\n            if (shouldBreak) {\n                break;\n            }\n            return returnValue;\n        }\n        case 2: {\n            auto [returnValue, shouldBreak] =\n                Compare<2>(a, b, sort_spec->SortDirection == ImGuiSortDirection_Ascending);\n            if (shouldBreak) {\n                break;\n            }\n            return returnValue;\n        }\n        case 3: {\n            auto [returnValue, shouldBreak] =\n                Compare<3>(a, b, sort_spec->SortDirection == ImGuiSortDirection_Ascending);\n            if (shouldBreak) {\n                break;\n            }\n            return returnValue;\n        }\n        case 4: {\n            auto [returnValue, shouldBreak] =\n                Compare<4>(a, b, sort_spec->SortDirection == ImGuiSortDirection_Ascending);\n            if (shouldBreak) {\n                break;\n            }\n            return returnValue;\n        }\n        case 5: {\n            auto [returnValue, shouldBreak] =\n                Compare<5>(a, b, sort_spec->SortDirection == ImGuiSortDirection_Ascending);\n            if (shouldBreak) {\n                break;\n            }\n            return returnValue;\n        }\n        default:\n            IM_ASSERT(0);\n            break;\n        }\n    }\n\n    return false;\n}\n\nListView::ListView(LanguageService &languageService) noexcept : languageService(languageService) {\n\n    static const char *template_items_names[] = {u8\"香蕉\", u8\"苹果\", u8\"樱桃\",   u8\"西瓜\", u8\"葡萄柚\",\n                                                 u8\"草莓\", u8\"芒果\", u8\"猕猴桃\", u8\"橙子\", u8\"菠萝\",\n                                                 u8\"蓝莓\", u8\"李子\", u8\"椰子\",   u8\"梨\",   u8\"杏\"};\n\n    const float TEXT_BASE_HEIGHT = ImGui::GetTextLineHeightWithSpacing();\n    // Create item list\n    if (items.size() == 0) {\n        items.resize(50, MyItem());\n        for (int n = 0; n < items.size(); n++) {\n            const int template_n = n % IM_ARRAYSIZE(template_items_names);\n            MyItem &item = items[n];\n            item.index = n;\n            item.fileName = template_items_names[template_n];\n            item.fileSize = (n * n - n) % 20; // Assign default quantities\n        }\n    }\n}\n\nvoid ListView::Render() {\n    std::vector<MyItem> itemsTemp;\n    {\n        std::unique_lock ul(itemsLock);\n        itemsTemp.swap(itemsQueue);\n    }\n    items.insert(items.end(), itemsTemp.begin(), itemsTemp.end());\n\n    const float TEXT_BASE_HEIGHT = ImGui::GetTextLineHeightWithSpacing();\n\n    // Options\n    static ImGuiTableFlags flags = ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable |\n                                   ImGuiTableFlags_Sortable | ImGuiTableFlags_SortMulti | ImGuiTableFlags_RowBg |\n                                   ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV |\n                                   ImGuiTableFlags_ScrollY; //  ImGuiTableFlags_NoBordersInBody |\n    // PushStyleCompact();\n    // ImGui::CheckboxFlags(\"ImGuiTableFlags_SortMulti\", &flags, ImGuiTableFlags_SortMulti);\n    // ImGui::SameLine();\n    // HelpMarker(\"When sorting is enabled: hold shift when clicking headers to sort on multiple column. \"\n    //            \"TableGetSortSpecs() may return specs where (SpecsCount > 1).\");\n    // ImGui::CheckboxFlags(\"ImGuiTableFlags_SortTristate\", &flags, ImGuiTableFlags_SortTristate);\n    // ImGui::SameLine();\n    // HelpMarker(\"When sorting is enabled: allow no sorting, disable default sorting. TableGetSortSpecs() may \"\n    //            \"return specs where (SpecsCount == 0).\");\n    // PopStyleCompact();\n\n    if (ImGui::BeginTable(\"table_sorting\", static_cast<int>(ListViewColumn::TEXT_PIECE) + 1, flags,\n                          ImVec2(0.0f, TEXT_BASE_HEIGHT * 15), 0.0f)) {\n        // Declare columns\n        // We use the \"user_id\" parameter of TableSetupColumn() to specify a user id that will be stored in the\n        // sort specifications. This is so our sort function can identify a column given our own identifier. We\n        // could also identify them based on their index! Demonstrate using a mixture of flags among available\n        // sort-related flags:\n        // - ImGuiTableColumnFlags_DefaultSort\n        // - ImGuiTableColumnFlags_NoSort / ImGuiTableColumnFlags_NoSortAscending /\n        // ImGuiTableColumnFlags_NoSortDescending\n        // - ImGuiTableColumnFlags_PreferSortAscending / ImGuiTableColumnFlags_PreferSortDescending\n        ImGui::TableSetupColumn(languageService.GetUtf8String(v0_2::StringId::INDEX).c_str(),\n                                ImGuiTableColumnFlags_DefaultSort | ImGuiTableColumnFlags_WidthFixed, 0.0f,\n                                static_cast<ImGuiID>(ListViewColumn::INDEX));\n        ImGui::TableSetupColumn(languageService.GetUtf8String(v0_2::StringId::FILENAME).c_str(),\n                                ImGuiTableColumnFlags_WidthFixed, 0.0f, static_cast<ImGuiID>(ListViewColumn::FILENAME));\n        ImGui::TableSetupColumn(languageService.GetUtf8String(v0_2::StringId::SIZE).c_str(),\n                                ImGuiTableColumnFlags_WidthFixed, 0.0f, static_cast<ImGuiID>(ListViewColumn::FILESIZE));\n        ImGui::TableSetupColumn(languageService.GetUtf8String(v0_2::StringId::ENCODING).c_str(),\n                                ImGuiTableColumnFlags_WidthFixed, 0.0f, static_cast<ImGuiID>(ListViewColumn::ENCODING));\n        ImGui::TableSetupColumn(languageService.GetUtf8String(v0_2::StringId::LINE_BREAKS).c_str(),\n                                ImGuiTableColumnFlags_WidthFixed, 0.0f,\n                                static_cast<ImGuiID>(ListViewColumn::LINE_BREAK));\n        ImGui::TableSetupColumn(languageService.GetUtf8String(v0_2::StringId::TEXT_PIECE).c_str(),\n                                ImGuiTableColumnFlags_WidthStretch, 0.0f,\n                                static_cast<ImGuiID>(ListViewColumn::TEXT_PIECE));\n        ImGui::TableSetupScrollFreeze(0, 1); // Make row always visible\n        ImGui::TableHeadersRow();\n\n        // Sort our data if sort specs have been changed!\n        if (ImGuiTableSortSpecs *sort_specs = ImGui::TableGetSortSpecs())\n            if (sort_specs->SpecsDirty) {\n                std::sort(items.begin(), items.end(), [sort_specs](const MyItem &lhs, const MyItem &rhs) -> bool {\n                    return CompareWithSortSpecs(sort_specs, &lhs, &rhs);\n                });\n                sort_specs->SpecsDirty = false;\n            }\n\n        // Demonstrate using clipper for large vertical lists\n        ImGuiListClipper clipper;\n        clipper.Begin(static_cast<int>(items.size()));\n        while (clipper.Step())\n            for (int row_n = clipper.DisplayStart; row_n < clipper.DisplayEnd; row_n++) {\n                // Display a data item\n                MyItem *item = &items[row_n];\n                ImGui::PushID(item->index);\n                ImGui::TableNextRow();\n                ImGui::TableNextColumn();\n                // ImGui::Text(\"%04d\", item->ID);\n\n                {\n                    static ImVector<int> selection;\n                    const bool item_is_selected = selection.contains(item->index);\n                    std::string label = fmt::format(\"{}\", item->index);\n\n                    ImGuiSelectableFlags selectable_flags =\n                        ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap;\n                    if (ImGui::Selectable(label.c_str(), item_is_selected, selectable_flags, ImVec2(0, 0))) {\n                        if (ImGui::GetIO().KeyCtrl) {\n                            if (item_is_selected)\n                                selection.find_erase_unsorted(item->index);\n                            else\n                                selection.push_back(item->index);\n                        } else {\n                            selection.clear();\n                            selection.push_back(item->index);\n                        }\n                    }\n                }\n\n                ImGui::TableNextColumn();\n                ImGui::TextUnformatted(item->fileName.c_str());\n                ImGui::TableNextColumn();\n                ImGui::Text(\"%d\", item->fileSize);\n                ImGui::TableNextColumn();\n                ImGui::PopID();\n            }\n\n        // if in this frame there are new items to add, to scroll table to bottom\n        if (!itemsTemp.empty()) {\n            ImGui::SetScrollHereY(1.0);\n        }\n\n        ImGui::EndTable();\n    }\n}\n\nvoid ListView::AddItem(MyItem myItem) {\n    std::unique_lock ul(itemsLock);\n    itemsQueue.push_back(std::move(myItem));\n}\n"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/ListView.h",
    "content": "#pragma once\n\n#include <Core/CharsetCode.h>\n#include <Core/LineBreaks.h>\n#include <Translator/LanguageService.h>\n\n#include <imgui.h>\n#include <fmt/format.h>\n\n#include <mutex>\n\nclass ListView {\npublic:\n    ListView(LanguageService &languageService) noexcept;\n\n    enum class ListViewColumn { INDEX = 0, FILENAME, FILESIZE, ENCODING, LINE_BREAK, TEXT_PIECE };\n\n    struct MyItem {\n        int index;\n        std::string fileName;\n        std::size_t fileSize;\n        CharsetCode encoding;\n        LineBreaks lineBreak;\n        std::string textPiece;\n\n        const std::tuple<const int &, const std::string &, const std::size_t &, const CharsetCode &, const LineBreaks &,\n                         const std::string &>\n        AsTuple() const noexcept {\n            return std::tie(index, fileName, fileSize, encoding, lineBreak, textPiece);\n        }\n    };\n\n    void Render();\n\n    void AddItem(MyItem myItem);\n\nprivate:\n    LanguageService &languageService;\n\n    std::mutex itemsLock;\n    std::vector<MyItem> itemsQueue;\n    std::vector<MyItem> items;\n};"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/MainWindow.cpp",
    "content": "#include \"MainWindow.h\"\n#include \"resource.h\"\n\n#include <Common/tstring.h>\n#include <Common/FileFunction.h>\n\n// third party\n#include <fmt/ranges.h>\n#define GLFW_EXPOSE_NATIVE_WIN32\n#include <GLFW/glfw3native.h>\n#include <nlohmann/json.hpp>\n#include <imgui_internal.h>\n#include <imgui_stdlib.h>\n#include <spdlog/spdlog.h>\n#include <boost/thread/synchronized_value.hpp>\n\n#include <regex>\n\nconst std::string configFileName = \"SmartCharsetConverter.json\";\n\nconst std::vector<int> innerLanguageIds = {\n    IDR_LANGUAGEJSON_ENGLISH,\n    IDR_LANGUAGEJSON_SIMPLIFIED_CHINESE,\n    IDR_LANGUAGEJSON_SPANISH,\n};\n\nEventAction PopupMessageBox(const std::string &text, const std::string &caption,\n                            std::function<EventAction()> fnInPopupScope = nullptr) noexcept {\n    ImGui::OpenPopup(caption.c_str());\n\n    // Always center this window when appearing\n    ImVec2 center = ImGui::GetMainViewport()->GetCenter();\n    ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));\n\n    if (ImGui::BeginPopupModal(caption.c_str(), NULL, ImGuiWindowFlags_AlwaysAutoResize)) {\n        std::shared_ptr<void> defer(nullptr, [](...) {\n            ImGui::EndPopup();\n        });\n\n        ImGui::Text(text.c_str());\n        ImGui::Separator();\n\n        ImGui::SetItemDefaultFocus();\n        if (ImGui::Button(\"OK\", ImVec2(120, 0))) {\n            ImGui::CloseCurrentPopup();\n            return EventAction::FINISH;\n        }\n\n        if (fnInPopupScope) {\n            return fnInPopupScope();\n        }\n    }\n    return EventAction::KEEP_ALIVE;\n}\n\nMainWindow::MainWindow(GLFWwindow *glfwWindow, const std::vector<std::string> &filenames)\n    : glfwWindow(glfwWindow), core(configFileName, CoreInitOption{}),\n      languageService([this]() -> LanguageServiceOption {\n          LanguageServiceOption option;\n          option.languageName = core.GetConfig().language;\n          option.resourceIds = innerLanguageIds;\n          option.resourceType = L\"LanguageJson\";\n          return option;\n      }()),\n      listView(languageService) {\n    uni_table::InitUtf8Table();\n\n    pool.detach_task([this, filenames = std::move(filenames)]() {\n        AddItems(filenames);\n    });\n}\n\nvoid MainWindow::Render() {\n\n    ImGui::StyleColorsLight();\n\n    {\n        ImGuiStyle &style = ImGui::GetStyle();\n        style.FrameBorderSize = 1.0f;\n        style.ScrollbarSize = 20.0f;\n        style.ScrollbarRounding = 0.0f;\n    }\n\n    {\n        bool open = true;\n        static bool use_work_area = true;\n        static ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove |\n                                        ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_MenuBar;\n\n        // We demonstrate using the full viewport area or the work area (without menu-bars, task-bars etc.)\n        // Based on your use case you may want one or the other.\n        const ImGuiViewport *viewport = ImGui::GetMainViewport();\n        ImGui::SetNextWindowPos(use_work_area ? viewport->WorkPos : viewport->Pos);\n        ImGui::SetNextWindowSize(use_work_area ? viewport->WorkSize : viewport->Size);\n\n        if (ImGui::Begin(\"Example: Simple layout\", &open, flags)) {\n            if (ImGui::BeginMenuBar()) {\n                if (ImGui::BeginMenu(\"File\")) {\n                    if (ImGui::MenuItem(\"Close\", \"Ctrl+W\")) {\n                        //*p_open = false;\n                    }\n                    ImGui::EndMenu();\n                }\n                ImGui::EndMenuBar();\n            }\n\n            // Left\n            static int selected = 0;\n            {\n                ImGui::BeginGroup();\n                ImGui::BeginChild(\"left pane\", ImVec2(150, 0), ImGuiChildFlags_ResizeX);\n                ImGui::SeparatorText(languageService.GetUtf8String(v0_2::StringId::FILE_LISTS).c_str());\n                {\n                    ImGui::BeginChild(\"left pane\", ImVec2(0, 0), ImGuiChildFlags_Border);\n                    // for (int i = 0; i < 100; i++) {\n                    //     // FIXME: Good candidate to use ImGuiSelectableFlags_SelectOnNav\n                    //     char label[128];\n                    //     sprintf(label, \"MyObject %d\", i);\n                    //     if (ImGui::Selectable(label, selected == i))\n                    //         selected = i;\n                    // }\n                    listView.Render();\n                    ImGui::EndChild();\n                }\n                ImGui::EndChild();\n                ImGui::EndGroup();\n            }\n            // here can catch the drop event at left panel\n            HandleDragDrop();\n\n            ImGui::SameLine();\n\n            // Right\n            {\n                ImGui::BeginGroup();\n                ImGui::BeginChild(\"item view\",\n                                  ImVec2(0, -ImGui::GetFrameHeightWithSpacing())); // Leave room for 1 line below us\n\n                // whether configuration is changed.\n                // after all the flow, this flag indicates whether the configuration should be wrote to file.\n                bool changed = false;\n\n                // 1. selete filter mode\n                ImGui::SetNextItemOpen(true, ImGuiCond_FirstUseEver);\n                if (ImGui::TreeNode(\n                        fmt::format(languageService.GetUtf8String(v0_2::StringId::SET_FILTER_MODE)).c_str())) {\n                    changed |= ImGui::RadioButton(languageService.GetUtf8String(v0_2::StringId::NO_FILTER).c_str(),\n                                                  reinterpret_cast<int *>(&core.GetConfigRef().filterMode),\n                                                  static_cast<int>(Configuration::FilterMode::NO_FILTER));\n                    changed |=\n                        ImGui::RadioButton(languageService.GetUtf8String(v0_2::StringId::SMART_FILE_DETECTION).c_str(),\n                                           reinterpret_cast<int *>(&core.GetConfigRef().filterMode),\n                                           static_cast<int>(Configuration::FilterMode::SMART));\n                    changed |=\n                        ImGui::RadioButton(languageService.GetUtf8String(v0_2::StringId::USE_FILE_EXTENSION).c_str(),\n                                           reinterpret_cast<int *>(&core.GetConfigRef().filterMode),\n                                           static_cast<int>(Configuration::FilterMode::ONLY_SOME_EXTANT));\n                    ImGui::BeginDisabled(core.GetConfigRef().filterMode != Configuration::FilterMode::ONLY_SOME_EXTANT);\n                    ImGui::InputText(\"##\", &core.GetConfigRef().includeRule);\n                    ImGui::EndDisabled();\n\n                    ImGui::TreePop();\n                }\n\n                // 2. add files or folder\n                ImGui::SetNextItemOpen(true, ImGuiCond_FirstUseEver);\n                if (ImGui::TreeNode(\n                        fmt::format(languageService.GetUtf8String(v0_2::StringId::ADD_FILES_OR_FOLDER)).c_str())) {\n                    if (ImGui::Button(languageService.GetUtf8String(v0_2::StringId::ADD_FILES).c_str())) {\n                        try {\n                            std::vector<std::pair<std::wstring, std::wstring>> dialogFilter;\n                            switch (core.GetConfig().filterMode) {\n                            case Configuration::FilterMode::NO_FILTER:\n                            case Configuration::FilterMode::SMART: // 智能识别文本\n                                dialogFilter = {\n                                    {languageService.GetWString(v0_2::StringId::ALL_FILES) + L\"*.*\", L\"*.*\"}};\n                                break;\n                            case Configuration::FilterMode::ONLY_SOME_EXTANT: {\n                                // 只包括指定后缀\n                                std::wstring filterExtsStr; // dialog的过滤器要求;分割\n                                CheckAndTraversalIncludeRule([&](const std::string &dotExt) {\n                                    filterExtsStr += utf8_to_wstring(\"*\" + dotExt + \";\");\n                                });\n\n                                // dialog过滤器\n                                dialogFilter.push_back(make_pair(filterExtsStr, filterExtsStr));\n\n                                break;\n                            }\n                            default:\n                                assert(0);\n                            }\n\n                            // 打开文件对话框\n                            TFileDialog dialog(glfwGetWin32Window(glfwWindow), dialogFilter, true);\n                            if (dialog.Open()) {\n                                auto filenames = to_utf8(dialog.GetResult());\n\n                                pool.detach_task([this, filenames = std::move(filenames)]() {\n                                    AddItems(filenames);\n                                });\n                            }\n                        } catch (const std::runtime_error &err) {\n                            PopupMessageBox(err.what(), languageService.GetUtf8String(v0_2::StringId::MSGBOX_ERROR));\n                        }\n                    }\n                    ImGui::SameLine();\n                    bool clicked = ImGui::Button(languageService.GetUtf8String(v0_2::StringId::ADD_FOLDER).c_str());\n                    if (clicked) {\n                        TFolderBrowser folderBrowser(glfwGetWin32Window(glfwWindow));\n                        if (folderBrowser.Open(folderBrowserDir)) {\n                            pool.detach_task([this]() {\n                                AddItems({to_utf8(folderBrowserDir)});\n                            });\n                        }\n                    }\n                    ImGui::TreePop();\n                }\n\n                // 3. select output target\n                ImGui::SetNextItemOpen(true, ImGuiCond_FirstUseEver);\n                if (ImGui::TreeNode(fmt::format(languageService.GetUtf8String(v0_2::StringId::SET_OUTPUT)).c_str())) {\n                    changed |=\n                        ImGui::RadioButton(languageService.GetUtf8String(v0_2::StringId::OUTPUT_TO_ORIGIN).c_str(),\n                                           reinterpret_cast<int *>(&core.GetConfigRef().outputTarget),\n                                           static_cast<int>(Configuration::OutputTarget::ORIGIN));\n                    changed |=\n                        ImGui::RadioButton(languageService.GetUtf8String(v0_2::StringId::OUTPUT_TO_FOLDER).c_str(),\n                                           reinterpret_cast<int *>(&core.GetConfigRef().outputTarget),\n                                           static_cast<int>(Configuration::OutputTarget::TO_DIR));\n\n                    ImGui::BeginDisabled(core.GetConfigRef().outputTarget != Configuration::OutputTarget::TO_DIR);\n                    ImGui::InputText(\"##\", &core.GetConfigRef().outputDir);\n                    ImGui::SameLine();\n                    if (ImGui::Button(languageService.GetUtf8String(v0_2::StringId::SELECT_FOLDER).c_str())) {\n                        TFolderBrowser folderBrowser(glfwGetWin32Window(glfwWindow));\n                        if (folderBrowser.Open(folderBrowserDir)) {\n                            core.SetOutputDir(to_utf8(folderBrowserDir));\n                        }\n                    }\n                    ImGui::EndDisabled();\n\n                    ImGui::TreePop();\n                }\n\n                // 4. specify output charset\n                ImGui::SetNextItemOpen(true, ImGuiCond_FirstUseEver);\n                if (ImGui::TreeNode(\n                        fmt::format(languageService.GetUtf8String(v0_2::StringId::SET_OUTPUT_CHARSET)).c_str())) {\n\n                    // shown, outer charset (these charset are not in combo box)\n                    const std::vector<CharsetCode> comboBoxOtherExcludes = {CharsetCode::UTF8, CharsetCode::UTF8BOM,\n                                                                            CharsetCode::GB18030};\n                    // FIXME: move to initializing\n                    std::vector<CharsetCode> comboBoxOthers;\n                    for (int icode = static_cast<int>(CharsetCode::UTF8);\n                         icode < static_cast<int>(CharsetCode::CHARSET_CODE_END); ++icode) {\n                        CharsetCode code = static_cast<CharsetCode>(icode);\n                        if (std::find(comboBoxOtherExcludes.begin(), comboBoxOtherExcludes.end(), code) !=\n                            comboBoxOtherExcludes.end()) {\n                            continue;\n                        }\n                        comboBoxOthers.push_back(code);\n                    }\n\n                    for (auto charset : comboBoxOtherExcludes) {\n                        changed |= ImGui::RadioButton(ToViewCharsetName(charset).c_str(),\n                                                      reinterpret_cast<int *>(&core.GetConfigRef().outputCharset),\n                                                      static_cast<int>(charset));\n                    }\n\n                    bool outputCharsetIsInOthersComboBox =\n                        std::find(comboBoxOtherExcludes.begin(), comboBoxOtherExcludes.end(),\n                                  core.GetConfigRef().outputCharset) == comboBoxOtherExcludes.end();\n                    int selectedOthers = outputCharsetIsInOthersComboBox;\n                    changed |= ImGui::RadioButton(languageService.GetUtf8String(v0_2::StringId::OTHERS).c_str(),\n                                                  &selectedOthers, true);\n\n                    CharsetCode comboSelectionCode;\n                    if (outputCharsetIsInOthersComboBox) {\n                        comboSelectionCode = core.GetConfigRef().outputCharset;\n                    } else {\n                        assert(comboBoxOthers.size() > 0);\n                        comboSelectionCode = comboBoxOthers[0];\n                    }\n\n                    if (!outputCharsetIsInOthersComboBox && selectedOthers) {\n                        core.GetConfigRef().outputCharset = comboSelectionCode;\n                        changed = true;\n                    }\n\n                    ImGui::BeginDisabled(!outputCharsetIsInOthersComboBox);\n\n                    ImGui::SameLine();\n                    if (ImGui::BeginCombo(\"##combo 1\", ToViewCharsetName(comboSelectionCode).c_str())) {\n                        for (auto code : comboBoxOthers) {\n                            if (ImGui::Selectable(ToViewCharsetName(code).c_str(),\n                                                  core.GetConfigRef().outputCharset == code)) {\n                                core.GetConfigRef().outputCharset = code;\n                                changed = true;\n                            }\n\n                            // Set the initial focus when opening the combo (scrolling + keyboard navigation focus)\n                            if (core.GetConfigRef().outputCharset == code) {\n                                ImGui::SetItemDefaultFocus();\n                            }\n                        }\n\n                        ImGui::EndCombo();\n                    }\n\n                    ImGui::EndDisabled();\n\n                    ImGui::TreePop();\n                }\n\n                if (changed) {\n                    core.WriteConfigToFile();\n                }\n\n                ImGui::EndChild();\n                ImGui::EndGroup();\n            }\n            // here can catch the drop event at right panel\n            HandleDragDrop();\n        }\n        ImGui::End();\n        // in theory here is the whole window's end, but HandleDragDrop() not work if it's at here.\n        // so have to put two HandleDragDrop at both left panel and right panel's end.\n    }\n\n    {\n        static uni_table::ExampleAssetsBrowser brower;\n        bool open = true;\n        brower.Draw(\"aa\", &open);\n    }\n\n    // 在这里放置你所有的 UI 控件\n    static bool show_demo_window = true;\n    if (show_demo_window)\n        ImGui::ShowDemoWindow(&show_demo_window);\n\n    {\n        std::unique_lock<std::mutex> ul(guiEventsLock);\n        localGuiEvents.insert(localGuiEvents.end(), guiEvents.begin(), guiEvents.end());\n        guiEvents.clear();\n    }\n\n    for (auto it = localGuiEvents.begin(); it != localGuiEvents.end();) {\n        auto &ev = *it;\n        EventAction act = ev();\n        if (act == EventAction::FINISH) {\n            it = localGuiEvents.erase(it);\n        } else {\n            it++;\n        }\n    }\n}\n\nvoid MainWindow::AddGuiEvent(std::function<EventAction()> guiEvent) noexcept {\n    std::unique_lock<std::mutex> ul(guiEventsLock);\n    guiEvents.push_back(guiEvent);\n}\n\nvoid MainWindow::HandleDragDrop() {\n    if (ImGui::BeginDragDropTarget()) {\n        auto payload = ImGui::AcceptDragDropPayload(\"files\", ImGuiDragDropFlags_AcceptBeforeDelivery);\n        if (payload->IsDelivery()) {\n            std::string s(reinterpret_cast<const char *>(payload->Data), payload->DataSize);\n            auto j = nlohmann::json::parse(s);\n            std::vector<std::string> filenames = j[\"data\"].get<std::vector<std::string>>();\n            fmt::print(\"accept: {}\\n\", filenames);\n            pool.detach_task([this, filenames = std::move(filenames)]() {\n                AddItems(filenames);\n            });\n        }\n\n        ImGui::EndDragDropTarget();\n    }\n}\n\nvoid MainWindow::CheckAndTraversalIncludeRule(std::function<void(const std::string &dotExt)> fn) {\n    // 后缀字符串\n    auto &extsStr = core.GetConfig().includeRule;\n\n    // 切分\n    auto exts = Split(extsStr, u8\" ,|\");\n\n    std::string filterExampleStr = languageService.GetUtf8String(v0_2::StringId::SUPPORT_FORMAT_BELOW) +\n                                   u8\"\\r\\n *.h *.hpp *.c *.cpp *.txt\\r\\n h hpp c cpp txt\\r\\n h|hpp|c|cpp\\r\\n\" +\n                                   languageService.GetUtf8String(v0_2::StringId::SEPERATOR_DESCRIPTION);\n\n    // 如果为空\n    if (exts.empty()) {\n        throw std::runtime_error(languageService.GetUtf8String(v0_2::StringId::NO_SPECIFY_FILTER_EXTEND) +\n                                 u8\"\\r\\n\\r\\n\" + filterExampleStr);\n    }\n\n    // 逐个检查\n    for (auto s : exts) {\n        std::string extStr(s);\n        std::string pattern = u8R\"((\\*\\.|\\.|)(\\w+))\"; // 匹配*.xxx/.xxx/xxx的正则\n        std::regex r(pattern);\n        std::smatch results;\n        if (std::regex_match(extStr, results, r) == false) {\n            throw std::runtime_error(languageService.GetUtf8String(v0_2::StringId::INVALID_EXTEND_FILTER) + extStr +\n                                     u8\"\\r\\n\\r\\n\" + filterExampleStr);\n        }\n\n        fn(tolower(u8\".\" + results.str(2)));\n    }\n}\n\nvoid MainWindow::AddItems(const std::vector<std::string> &pathStrings) noexcept {\n    std::shared_ptr<std::atomic<bool>> doCancel = std::make_shared<std::atomic<bool>>(false);\n\n    // =========================================================\n    // 后缀\n    std::unordered_set<std::string> filterDotExts;\n\n    switch (core.GetConfig().filterMode) {\n    case Configuration::FilterMode::NO_FILTER:\n        break;\n    case Configuration::FilterMode::SMART: // 智能识别文本\n        break;\n    case Configuration::FilterMode::ONLY_SOME_EXTANT:\n        // 只包括指定后缀\n        try {\n            CheckAndTraversalIncludeRule([&](const std::string &dotExt) {\n                filterDotExts.insert(dotExt);\n            });\n        } catch (const std::runtime_error &err) {\n            AddGuiEvent([this, err]() -> EventAction {\n                return ::PopupMessageBox(err.what(), languageService.GetUtf8String(v0_2::StringId::MSGBOX_ERROR));\n            });\n            return;\n        }\n        break;\n    default:\n        assert(0);\n    }\n\n    std::shared_ptr<std::atomic<bool>> finished = std::make_shared<std::atomic<bool>>(false);\n    std::shared_ptr<void> defer = std::shared_ptr<void>(nullptr, [finished](...) {\n        finished->store(true);\n    });\n\n    std::shared_ptr<boost::synchronized_value<std::string>> status =\n        std::make_shared<boost::synchronized_value<std::string>>();\n    std::shared_ptr<std::atomic<int>> progress = std::make_shared<std::atomic<int>>(-1);\n    std::shared_ptr<std::atomic<int>> progressTotal = std::make_shared<std::atomic<int>>(-1);\n\n    // =========================================================\n    AddGuiEvent([this, doCancel, status, finished, progress, progressTotal]() -> EventAction {\n        // FIXME\n        ImGui::OpenPopup(\"adding\");\n\n        // Always center this window when appearing\n        ImVec2 center = ImGui::GetMainViewport()->GetCenter();\n        ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));\n\n        if (ImGui::BeginPopupModal(\"adding\", NULL, ImGuiWindowFlags_AlwaysAutoResize)) {\n            std::shared_ptr<void> defer(nullptr, [](...) {\n                ImGui::EndPopup();\n            });\n            ImGui::Text(status->synchronize()->c_str());\n\n            if (progress->load() < 0) {\n                ImGui::ProgressBar(-1.0f * (float)ImGui::GetTime(), ImVec2(0.0f, 0.0f), \"Searching..\"); // FIXME\n            } else {\n                float fraction = static_cast<float>(progress->load()) / static_cast<float>(progressTotal->load());\n                ImGui::ProgressBar(fraction, ImVec2(0.0f, 0.0f),\n                                   fmt::format(\"{}/{}\", progress->load(), progressTotal->load()).c_str()); // FIXME\n            }\n            ImGui::Separator();\n            if (ImGui::Button(languageService.GetUtf8String(v0_2::StringId::CANCEL).c_str())) {\n                doCancel->store(true);\n            }\n        }\n\n        return finished->load() ? EventAction::FINISH : EventAction::KEEP_ALIVE;\n    });\n\n    // =========================================================\n    status->synchronize()->assign(u8\"正在统计文件数量...\"); // FIXME\n    std::vector<std::string> paths;\n    for (auto &pathString : pathStrings) {\n        if (doCancel->load()) {\n            return;\n        }\n        auto path = std::filesystem::u8path(pathString);\n\n        // 如果是目录\n        if (std::filesystem::is_directory(path)) {\n            for (auto p : std::filesystem::recursive_directory_iterator(path)) {\n                paths.push_back(p.path().u8string());\n                status->synchronize()->assign(fmt::format(u8\"正在统计文件数量:{}...\", paths.size())); // FIXME\n            }\n            continue;\n        }\n\n        // 如果是文件\n        paths.push_back(path.u8string());\n        status->synchronize()->assign(fmt::format(u8\"正在统计文件数量:{}...\", paths.size())); // FIXME\n    }\n\n    // =========================================================\n    std::vector<std::pair<std::string, std::string>> failed; // 失败的文件\n    std::vector<std::string> ignored;                        // 忽略的文件\n    progressTotal->store(static_cast<int>(paths.size()));\n    for (auto it = paths.begin(); it != paths.end(); it++) {\n        if (doCancel->load()) {\n            break;\n        }\n        progress->store(static_cast<int>(it - paths.begin()));\n        auto &filename = *it;\n        status->synchronize()->assign(u8\"正在探测字符集...\"); // FIXME\n\n        try {\n            Core::AddItemResult ret = core.AddItem(filename, filterDotExts);\n            if (ret.isIgnore) {\n                continue;\n            }\n            listView.AddItem(\n                ListView::MyItem{-1, filename, ret.filesize, ret.srcCharset, ret.srcLineBreak, to_utf8(ret.strPiece)});\n        } catch (io_error_ignore) {\n            ignored.push_back(filename);\n        } catch (const MyRuntimeError &err) {\n            failed.push_back({filename, err.ToLocalString(&languageService)});\n        } catch (const std::runtime_error &err) {\n            failed.push_back({filename, err.what()});\n        }\n    }\n\n    // =========================================================\n    // show results\n    std::shared_ptr<bool> closeButtonNotPressed = std::make_shared<bool>(true);\n    AddGuiEvent([this, failed, ignored, closeButtonNotPressed]() -> EventAction {\n        // 计算父窗口的 80% 宽高\n        ImVec2 parentSize = ImGui::GetMainViewport()->WorkSize;\n\n        // Always center this window when appearing\n        // ImVec2 popupSize(parentSize.x * 0.8f, parentSize.y * 0.8f);\n        // ImGui::SetNextWindowSize(popupSize, ImGuiCond_Appearing);\n        ImVec2 maxPopupSize(parentSize.x * 0.8f, parentSize.y * 0.8f);\n\n        // 设置弹出窗口的大小约束（允许缩小，但最大不超过 80%）\n        ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), maxPopupSize);\n        ImVec2 center = ImGui::GetMainViewport()->GetCenter();\n        ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));\n\n        if (failed.empty() && ignored.empty()) {\n            return EventAction::FINISH;\n        }\n\n        if (!*closeButtonNotPressed) {\n            return EventAction::FINISH;\n        }\n        // FIXME\n        ImGui::OpenPopup(\"results\");\n        if (ImGui::BeginPopupModal(\"results\", closeButtonNotPressed.get())) {\n            std::shared_ptr<void> defer(nullptr, [](...) {\n                ImGui::EndPopup();\n            });\n\n            ImGuiTableFlags flags = ImGuiTableFlags_Resizable | ImGuiTableFlags_RowBg |\n                                    ImGuiTableFlags_ScrollY; //  ImGuiTableFlags_NoBordersInBody |\n            flags = ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV;\n\n            if (!failed.empty()) {\n                ImGui::Text(languageService.GetUtf8String(v0_2::StringId::FAILED_ADD_BELOW).c_str());\n                ImGui::Separator();\n                if (ImGui::BeginTable(\"##failed add below\", 3, flags)) {\n                    ImGui::TableSetupColumn(u8\"index\", ImGuiTableColumnFlags_WidthFixed);\n                    ImGui::TableSetupColumn(u8\"filename\");\n                    ImGui::TableSetupColumn(u8\"reason\");\n                    ImGui::TableSetupScrollFreeze(0, 1); // Make row always visible\n                    ImGui::TableHeadersRow();\n                    int index = 1;\n                    for (auto &pr : failed) {\n                        ImGui::TableNextRow();\n                        ImGui::TableNextColumn();\n                        ImGui::Text(fmt::format(\"{}\", index++).c_str());\n                        ImGui::TableNextColumn();\n                        ImGui::Text(pr.first.c_str());\n                        ImGui::TableNextColumn();\n                        ImGui::Text(pr.second.c_str());\n                    }\n                    ImGui::EndTable();\n                }\n            }\n            if (!ignored.empty()) {\n                ImGui::Text(\n                    fmt::format(languageService.GetUtf8String(v0_2::StringId::NON_TEXT_OR_NO_DETECTED), ignored.size())\n                        .c_str());\n                ImGui::Separator();\n                if (ImGui::BeginTable(\"##non text or no detected\", 2, flags)) {\n                    ImGui::TableSetupColumn(u8\"index\", ImGuiTableColumnFlags_WidthFixed);\n                    ImGui::TableSetupColumn(u8\"filename\");\n                    ImGui::TableSetupScrollFreeze(0, 1); // Make row always visible\n                    ImGui::TableHeadersRow();\n                    int index = 1;\n\n                    for (auto &filename : ignored) {\n                        ImGui::TableNextRow();\n                        ImGui::TableNextColumn();\n                        ImGui::Text(fmt::format(\"{}\", index++).c_str());\n                        ImGui::TableNextColumn();\n                        ImGui::Text(filename.c_str());\n                    }\n                    ImGui::EndTable();\n                }\n\n                ImGui::Text(languageService.GetUtf8String(v0_2::StringId::TIPS_USE_NO_FILTER).c_str());\n            }\n\n            ImGui::SetItemDefaultFocus();\n            if (ImGui::Button(\"OK\", ImVec2(120, 0))) {\n                ImGui::CloseCurrentPopup();\n                return EventAction::FINISH;\n            }\n        }\n        return EventAction::KEEP_ALIVE;\n    });\n    return;\n}"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/MainWindow.h",
    "content": "#pragma once\n\n#include \"UnicodeTable.h\"\n#include \"ListView.h\"\n#include \"Core/Core.h\"\n#include \"Translator/LanguageService.h\"\n\n// third party\n#include <GLFW/glfw3.h>\n#include <imgui.h>\n#include <fmt/format.h>\n#include <BS_thread_pool.hpp>\n\nenum class EventAction {\n    KEEP_ALIVE,\n    FINISH,\n};\n\nclass MainWindow {\npublic:\n    MainWindow(GLFWwindow *glfwWindow, const std::vector<std::string> &filenames = {});\n\n    void Render();\n\nprivate:\n    // not own it, only ref it\n    GLFWwindow *glfwWindow;\n    Core core;\n    LanguageService languageService;\n    ListView listView;\n    BS::thread_pool pool;\n\n    mutable std::mutex guiEventsLock;\n    std::vector<std::function<EventAction()>> guiEvents;\n    std::vector<std::function<EventAction()>> localGuiEvents;\n\n    std::wstring folderBrowserDir;\n\n    std::atomic<bool> doCancel;\n\n    void AddGuiEvent(std::function<EventAction()> guiEvent) noexcept;\n    void HandleDragDrop();\n    void CheckAndTraversalIncludeRule(std::function<void(const std::string &dotExt)> fn);\n    void AddItems(const std::vector<std::string> &pathes) noexcept;\n};"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/Resource/lang_embed/English.json",
    "content": "{\n\t\"language\":\"English\",\n\t\"langId\": 1033,\n\t\"author\":\"Tom Willow\",\n\t\"version\":\"0.2\",\n\t\"date\":\"2024-12-22\",\n\t\"data\":[\n\t\t[1,\"Some characters will be lost when converting to the target encoding: {}\"],\n\t\t[2,\"Content contains invalid characters\"],\n\t\t[3,\"UCNV Error. Error code: {}\"],\n\t\t[4,\"[{}->{}] Conversion error. Position: {}, Content: {}\"],\n\t\t[5,\"Truncated character found\"],\n\t\t[6,\"Duplicate addition\"],\n\t\t[7,\"Encoding not detected\"],\n\t\t[8,\"Failed to write file: {}\"],\n\t\t[9,\"File size exceeds limit: {}\"],\n\t\t[10,\"String length exceeds limit\"],\n\t\t[11,\"Failed to open file: {}\"],\n\t\t[12,\"Corrupted data found while decode as {}. position: {} content(in hex, shown {} bytes at most): {}\"],\n\t\t[13,\"Conversion to the {} charset is not supported\"],\n\t\t[14,\"No permission. Tip: The file might be read-only: {}\"],\n\t\t[101,\"Index\"],\n\t\t[102,\"File Name\"],\n\t\t[103,\"Size\"],\n\t\t[104,\"Encoding\"],\n\t\t[105,\"Line Breaks\"],\n\t\t[106,\"Text Fragment\"],\n\t\t[107,\"Error\"],\n\t\t[108,\"Failed to add the following files:\"],\n\t\t[109,\"Reason:\"],\n\t\t[110,\"{} files were detected to be non-text files, or no character set was detected:\"],\n\t\t[111,\"...etc.\"],\n\t\t[112, \"Tip: Use the \\\"No Filter\\\" mode to add again, and you can right-click in the list box to specify the original encoding manually.\"],\n\t\t[113,\"Tip\"],\n\t\t[114,\"There are no files to convert.\"],\n\t\t[115,\"The output directory is invalid.\"],\n\t\t[116,\"Conversion of {} files was successful.\"],\n\t\t[117,\"The following files failed to be converted:\"],\n\t\t[118,\"The remaining files are not processed because the operation was canceled.\"],\n\t\t[119,\"Conversion result\"],\n\t\t[120, \"Note: GB18030 and other some encodings is overlapped with UTF-8 encoding while content is in pure English(or only ASCII characters), so it may be displayed as UTF-8 encoding after conversion.\"],\n\t\t[121,\"The following formats are supported:\"],\n\t\t[122, \"(The separator allows spaces, commas, and vertical bars, and the extension allows *. or without)\"],\n\t\t[123,\"No extension was specified to filter.\"],\n\t\t[124,\"This extension filter is invalid:\"],\n\t\t[125,\"All files\"],\n\t\t[126,\"Failed to specify encoding for the following file:\"],\n\t\t[127,\"Out of memory.\"],\n\t\t[128,\"Cancel\"],\n\t\t[129,\"Convert\"],\n\t\t[130,\"Content contains invalid characters\"],\n\t\t[131,\"Some characters will be lost when converting to the target encoding:\"],\n\t\t[132,\"Not supported yet: {}, please contact the author.\"],\n\t\t[133,\"Duplicate addition\"],\n\t\t[134,\"No encoding detected\"],\n\t\t[135,\"Write failed:\"],\n\t\t[136,\"File size exceeds limit\"],\n\t\t[137,\"Failed to open file:\"],\n\t\t[138,\"File List\"],\n\t\t[139,\"1. Setup Files Filter:\"],\n\t\t[140,\"No Filter Files\"],\n\t\t[141,\"Smart File Detection\"],\n\t\t[142,\"Use File Extension:\"],\n\t\t[143,\"2. Add Files / Folders:\"],\n\t\t[144,\"Files\"],\n\t\t[145,\"Folder\"],\n\t\t[146,\"3. Select Output:\"],\n\t\t[147,\"Original File\"],\n\t\t[148,\"Use Folder:\"],\n\t\t[149,\"4. Select File Encoding:\"],\n\t\t[150,\"Other:\"],\n\t\t[151,\"Change Line Breaks\"],\n\t\t[152,\"Empty List\"],\n\t\t[153,\"Open with Notepad\"],\n\t\t[154,\"Specify original encoding\"],\n\t\t[155,\"Remove\"],\n\t\t[156,\"Select Folder\"]\n\t]\n}"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/Resource/lang_embed/Simplified Chinese.json",
    "content": "{\n\t\"language\":\"Simplified Chinese\",\n\t\"langId\": 2052,\n\t\"author\":\"Tom Willow\",\n\t\"version\":\"0.2\",\n\t\"date\":\"2024-12-22\",\n\t\"data\":[\n\t\t[1,\"转换到目标编码会丢失字符：{}\"],\n\t\t[2,\"内容包含无效字符\"],\n\t\t[3,\"UCNV 错误。错误码：{}\"],\n\t\t[4,\"[{}->{}] 转换出错。位置：{}，内容：{}\"],\n\t\t[5,\"发现截断的字符\"],\n\t\t[6,\"重复添加\"],\n\t\t[7,\"未探测出编码集\"],\n\t\t[8,\"写入文件失败：{}\"],\n\t\t[9,\"文件大小超出限制：{}\"],\n\t\t[10,\"字符串长度超出限制\"],\n\t\t[11,\"打开文件失败：{}\"],\n\t\t[12,\"以{}编码集解码时出现错误字符。位置：{} 内容(以16进制表示，最多显示{}字节): {}\"],\n\t\t[13,\"不支持转换到{}字符集\"],\n\t\t[14,\"没有权限。提示：可能文件是只读状态：{}\"],\n\t\t[101,\"序号\"],\n\t\t[102,\"文件名\"],\n\t\t[103,\"大小\"],\n\t\t[104,\"编码\"],\n\t\t[105,\"换行符\"],\n\t\t[106,\"文本片段\"],\n\t\t[107,\"出错\"],\n\t\t[108,\"以下文件添加失败：\"],\n\t\t[109,\"原因：\"],\n\t\t[110,\"{}个文件被判定为非文本文件、或者没有探测出字符集：\"],\n\t\t[111,\"......等\"],\n\t\t[112,\"提示：使用“不过滤”模式再次添加，可以在列表框中点击右键手动指定原编码集。\"],\n\t\t[113,\"提示\"],\n\t\t[114,\"没有待转换的文件。\"],\n\t\t[115,\"输出目录无效。\"],\n\t\t[116,\"转换成功 {} 个文件。\"],\n\t\t[117,\"以下文件转换失败：\"],\n\t\t[118,\"剩余文件由于取消操作所以未做处理。\"],\n\t\t[119,\"转换结果\"],\n\t\t[120,\"注意：GB18030等多个编码在纯英文（只有ASCII码）的情况下和UTF-8编码位重合，所以可能会出现转换后显示为UTF-8编码的情况。\"],\n\t\t[121,\"支持以下格式：\"],\n\t\t[122,\"(分隔符允许空格、逗号、竖线，后缀允许带*.或者不带)\"],\n\t\t[123,\"没有指定要过滤的后缀。\"],\n\t\t[124,\"指定的后缀过滤器无效：\"],\n\t\t[125,\"所有文件\"],\n\t\t[126,\"以下文件设置字符集失败：\"],\n\t\t[127,\"内存不足。\"],\n\t\t[128,\"取消\"],\n\t\t[129,\"开始转换\"],\n\t\t[130,\"内容包含无效字符\"],\n\t\t[131,\"转换到目标编码会丢失字符：\"],\n\t\t[132,\"暂不支持：{}，请联系作者。\"],\n\t\t[133,\"重复添加\"],\n\t\t[134,\"未探测出编码集\"],\n\t\t[135,\"写入失败：\"],\n\t\t[136,\"文件大小超出限制\"],\n\t\t[137,\"打开文件失败：\"],\n\t\t[138,\"文件列表\"],\n\t\t[139,\"1. 设置文件过滤：\"],\n\t\t[140,\"不过滤\"],\n\t\t[141,\"智能识别文本文件\"],\n\t\t[142,\"只要指定后缀的文件：\"],\n\t\t[143,\"2. 添加要转换的文件或文件夹：\"],\n\t\t[144,\"添加文件\"],\n\t\t[145,\"添加文件夹\"],\n\t\t[146,\"3. 选择转出位置：\"],\n\t\t[147,\"转出到原文件\"],\n\t\t[148,\"转出到文件夹：\"],\n\t\t[149,\"4. 指定转出字符集：\"],\n\t\t[150,\"其他：\"],\n\t\t[151,\"转换换行符\"],\n\t\t[152,\"清空列表\"],\n\t\t[153,\"用记事本打开\"],\n\t\t[154,\"指定原编码\"],\n\t\t[155,\"移除\"],\n\t\t[156,\"选择文件夹\"]\n\t]\n}"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/Resource/lang_embed/Spanish.json",
    "content": "{\n\t\"language\":\"Spanish\",\n\t\"langId\": 1252,\n\t\"author\":\"Carlos Sánchez, Last Edited by Tom Willow\",\n\t\"version\":\"0.2\",\n\t\"date\":\"2024-12-22\",\n\t\"data\":[\n\t\t[1,\"Algunos caracteres se perderán al convertir a la codificación de destino: {}\"],\n\t\t[2,\"El contenido incluye caracteres no válidos\"],\n\t\t[3,\"UCNV Error. Error code: {}\"],\n\t\t[4,\"[{}->{}] Error de conversión. Posición: {}, Contenido: {}\"],\n\t\t[5,\"Se encontró carácter truncado\"],\n\t\t[6,\"Adición duplicada\"],\n\t\t[7,\"No se detectó codificación\"],\n\t\t[8,\"Fallo al escribir el archivo: {}\"],\n\t\t[9,\"El tamaño del archivo excede el límite: {}\"],\n\t\t[10,\"La longitud de la cadena excede el límite\"],\n\t\t[11,\"Fallo al abrir el archivo: {}\"],\n\t\t[12,\"Se encontraron datos dañados mientras se intentaba decodificar como {}. posición: {} contenido (en hexadecimal, mostrando como máximo {} bytes): {}\"],\n\t\t[13,\"No se admite la conversión al conjunto de caracteres {}\"],\n\t\t[14,\"Sin permisos. Consejo: Es posible que el archivo sea de solo lectura: {}\"],\n\t\t[101,\"#\"],\n\t\t[102,\"Archivo\"],\n\t\t[103,\"Tamaño\"],\n\t\t[104,\"Codificación\"],\n\t\t[105,\"Salto de línea\"],\n\t\t[106,\"Fragmento de texto\"],\n\t\t[107,\"Error\"],\n\t\t[108,\"Error al añadir los siguientes archivos:\"],\n\t\t[109,\"Reason:\"],\n\t\t[110,\"Se detectaron {} archivos que no eran archivos de texto, o no se detectó ningún juego de caracteres:\"],\n\t\t[111,\"...etc.\"],\n\t\t[112, \"Consejo: use el modo \\\"Sin filtro\\\" para agregar nuevamente, y puede hacer clic derecho en el cuadro de lista para especificar la codificación original manualmente.\"],\n\t\t[113,\"Consejo\"],\n\t\t[114,\"No hay archivos que convertir.\"],\n\t\t[115,\"El directorio de salida no es válido.\"],\n\t\t[116,\"La conversión de {} archivos se ha realizado correctamente.\"],\n\t\t[117,\"No se han podido convertir los siguientes archivos:\"],\n\t\t[118,\"Los archivos restantes no se procesan porque la operación se canceló.\"],\n\t\t[119,\"Resultado de la conversión\"],\n\t\t[120, \"Note: GB18030 y otras codificaciones se superponen con la codificación UTF-8, mientras que el contenido está en inglés puro (o sólo caracteres ASCII), por lo que puede mostrarse como codificación UTF-8 después de la conversión.\"],\n\t\t[121,\"Se soportan los siguientes formatos:\"],\n\t\t[122, \"(El separador permite espacios, comas y barras verticales, y la extensión permite *. o sin)\"],\n\t\t[123,\"No se ha especificado ninguna extensión para filtrar.\"],\n\t\t[124,\"Este filtro de extensión no es válido:\"],\n\t\t[125,\"Todos los archivos\"],\n\t\t[126,\"Error al especificar la codificación del siguiente archivo:\"],\n\t\t[127,\"Sin memoria.\"],\n\t\t[128,\"Cancelar\"],\n\t\t[129,\"Convertir\"],\n\t\t[130,\"El contenido incluye caracteres no válidos\"],\n\t\t[131,\"Algunos caracteres se perderán al convertir a la codificación de destino:\"],\n\t\t[132,\"Aún no se soporta: {}, póngase en contacto con el autor.\"],\n\t\t[133,\"Añadir por duplicado\"],\n\t\t[134,\"No se ha detectado ninguna codificación\"],\n\t\t[135,\"Error de escritura:\"],\n\t\t[136,\"El tamaño del archivo supera el límite\"],\n\t\t[137,\"Error al abrir el archivo:\"],\n\t\t[138,\"Lista de archivos\"],\n\t\t[139,\"1. Configurar filtro de archivos:\"],\n\t\t[140,\"Sin filtrar archivos\"],\n\t\t[141,\"Detección inteligente\"],\n\t\t[142,\"Usar extensión:\"],\n\t\t[143,\"2. Añadir archivos / carpetas:\"],\n\t\t[144,\"Archivos\"],\n\t\t[145,\"Carpetas\"],\n\t\t[146,\"3. Seleccionar salida:\"],\n\t\t[147,\"Archivo original\"],\n\t\t[148,\"Usar carpeta:\"],\n\t\t[149,\"4. Seleccionar codificación:\"],\n\t\t[150,\"Otra:\"],\n\t\t[151,\"Cambiar saltos de línea\"],\n\t\t[152,\"Vaciar lista\"],\n\t\t[153,\"Abrir con el Bloc de notas\"],\n\t\t[154,\"Especificar la codificación original\"],\n\t\t[155,\"Quitar\"],\n\t\t[156,\"Seleccionar carpeta\"]\n\t]\n}"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/UnicodeTable.cpp",
    "content": "#include \"UnicodeTable.h\"\n\nnamespace uni_table {\n\nconstexpr std::size_t UTF8_SPACE_SIZE = 0x10FFFF;\nstd::array<Utf8Str, UTF8_SPACE_SIZE + 1> utf8table;\n\nUtf8Str PointToUtf8(int point) noexcept {\n    Utf8Str utf8 = {{0, 0, 0, 0, 0, 0}};\n    unsigned int codepoint = static_cast<unsigned int>(point);\n\n    if (codepoint <= 0x7F) {\n        // 1-byte sequence\n        utf8[0] = static_cast<char>(codepoint);\n        utf8[1] = '\\0';\n    } else if (codepoint <= 0x7FF) {\n        // 2-byte sequence\n        utf8[0] = static_cast<char>(0xC0 | (codepoint >> 6));\n        utf8[1] = static_cast<char>(0x80 | (codepoint & 0x3F));\n        utf8[2] = '\\0';\n    } else if (codepoint <= 0xFFFF) {\n        // 3-byte sequence\n        utf8[0] = static_cast<char>(0xE0 | (codepoint >> 12));\n        utf8[1] = static_cast<char>(0x80 | ((codepoint >> 6) & 0x3F));\n        utf8[2] = static_cast<char>(0x80 | (codepoint & 0x3F));\n        utf8[3] = '\\0';\n    } else if (codepoint <= 0x10FFFF) {\n        // 4-byte sequence\n        utf8[0] = static_cast<char>(0xF0 | (codepoint >> 18));\n        utf8[1] = static_cast<char>(0x80 | ((codepoint >> 12) & 0x3F));\n        utf8[2] = static_cast<char>(0x80 | ((codepoint >> 6) & 0x3F));\n        utf8[3] = static_cast<char>(0x80 | (codepoint & 0x3F));\n        utf8[4] = '\\0';\n    } else {\n        // Invalid codepoint, return empty string\n        utf8[0] = '\\0';\n    }\n\n    return utf8;\n}\n\nvoid InitUtf8Table() {\n    for (int i = 1; i <= UTF8_SPACE_SIZE; ++i) {\n        auto utf8 = PointToUtf8(i);\n        utf8table[i] = utf8;\n    }\n}\n\n// Functions\n\nExampleAssetsBrowser::ExampleAssetsBrowser() {\n    AddItems(UTF8_SPACE_SIZE);\n}\n\n} // namespace uni_table"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/UnicodeTable.h",
    "content": "#pragma once\n\n#define _CRT_SECURE_NO_WARNINGS\n#include <imgui.h>\n#define IMGUI_CDECL __cdecl\n\n// Helpers macros\n// We normally try to not use many helpers in imgui_demo.cpp in order to make code easier to copy and paste,\n// but making an exception here as those are largely simplifying code...\n// In other imgui sources we can use nicer internal functions from imgui_internal.h (ImMin/ImMax) but not in the demo.\n#define IM_MIN(A, B) (((A) < (B)) ? (A) : (B))\n#define IM_MAX(A, B) (((A) >= (B)) ? (A) : (B))\n#define IM_CLAMP(V, MN, MX) ((V) < (MN) ? (MN) : (V) > (MX) ? (MX) : (V))\n\n#include <string>\n#include <array>\n\nnamespace uni_table {\n\nusing Utf8Str = std::array<char, 6>;\nUtf8Str PointToUtf8(int point) noexcept;\n\nvoid InitUtf8Table();\n\n// Helper to display a little (?) mark which shows a tooltip when hovered.\n// In your own code you may want to display an actual icon if you are using a merged icon fonts (see docs/FONTS.md)\nstatic void HelpMarker(const char *desc) {\n    ImGui::TextDisabled(\"(?)\");\n    if (ImGui::BeginItemTooltip()) {\n        ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);\n        ImGui::TextUnformatted(desc);\n        ImGui::PopTextWrapPos();\n        ImGui::EndTooltip();\n    }\n}\n\nstruct ExampleAsset {\n    ImGuiID ID;\n    int Type;\n\n    ExampleAsset(ImGuiID id, int type) {\n        ID = id;\n        Type = type;\n    }\n\n    static const ImGuiTableSortSpecs *&Gets_current_sort_specs() {\n        static const ImGuiTableSortSpecs *p = nullptr;\n        return p;\n    }\n\n    static void SortWithSortSpecs(ImGuiTableSortSpecs *sort_specs, ExampleAsset *items, int items_count) {\n        Gets_current_sort_specs() = sort_specs; // Store in variable accessible by the sort function.\n        if (items_count > 1)\n            qsort(items, (size_t)items_count, sizeof(items[0]), ExampleAsset::CompareWithSortSpecs);\n        Gets_current_sort_specs() = NULL;\n    }\n\n    // Compare function to be used by qsort()\n    static int IMGUI_CDECL CompareWithSortSpecs(const void *lhs, const void *rhs) {\n        const ExampleAsset *a = (const ExampleAsset *)lhs;\n        const ExampleAsset *b = (const ExampleAsset *)rhs;\n        for (int n = 0; n < Gets_current_sort_specs()->SpecsCount; n++) {\n            const ImGuiTableColumnSortSpecs *sort_spec = &Gets_current_sort_specs()->Specs[n];\n            int delta = 0;\n            if (sort_spec->ColumnIndex == 0)\n                delta = ((int)a->ID - (int)b->ID);\n            else if (sort_spec->ColumnIndex == 1)\n                delta = (a->Type - b->Type);\n            if (delta > 0)\n                return (sort_spec->SortDirection == ImGuiSortDirection_Ascending) ? +1 : -1;\n            if (delta < 0)\n                return (sort_spec->SortDirection == ImGuiSortDirection_Ascending) ? -1 : +1;\n        }\n        return ((int)a->ID - (int)b->ID);\n    }\n};\n\n// Extra functions to add deletion support to ImGuiSelectionBasicStorage\nstruct ExampleSelectionWithDeletion : ImGuiSelectionBasicStorage {\n    // Find which item should be Focused after deletion.\n    // Call _before_ item submission. Retunr an index in the before-deletion item list, your item loop should call\n    // SetKeyboardFocusHere() on it. The subsequent ApplyDeletionPostLoop() code will use it to apply Selection.\n    // - We cannot provide this logic in core Dear ImGui because we don't have access to selection data.\n    // - We don't actually manipulate the ImVector<> here, only in ApplyDeletionPostLoop(), but using similar API for\n    // consistency and flexibility.\n    // - Important: Deletion only works if the underlying ImGuiID for your items are stable: aka not depend on their\n    // index, but on e.g. item id/ptr.\n    // FIXME-MULTISELECT: Doesn't take account of the possibility focus target will be moved during deletion. Need\n    // refocus or scroll offset.\n    int ApplyDeletionPreLoop(ImGuiMultiSelectIO *ms_io, int items_count) {\n        if (Size == 0)\n            return -1;\n\n        // If focused item is not selected...\n        const int focused_idx = (int)ms_io->NavIdItem; // Index of currently focused item\n        if (ms_io->NavIdSelected ==\n            false) // This is merely a shortcut, == Contains(adapter->IndexToStorage(items, focused_idx))\n        {\n            ms_io->RangeSrcReset = true; // Request to recover RangeSrc from NavId next frame. Would be ok to reset even\n                                         // when NavIdSelected==true, but it would take an extra frame to recover\n                                         // RangeSrc when deleting a selected item.\n            return focused_idx;          // Request to focus same item after deletion.\n        }\n\n        // If focused item is selected: land on first unselected item after focused item.\n        for (int idx = focused_idx + 1; idx < items_count; idx++)\n            if (!Contains(GetStorageIdFromIndex(idx)))\n                return idx;\n\n        // If focused item is selected: otherwise return last unselected item before focused item.\n        for (int idx = IM_MIN(focused_idx, items_count) - 1; idx >= 0; idx--)\n            if (!Contains(GetStorageIdFromIndex(idx)))\n                return idx;\n\n        return -1;\n    }\n\n    // Rewrite item list (delete items) + update selection.\n    // - Call after EndMultiSelect()\n    // - We cannot provide this logic in core Dear ImGui because we don't have access to your items, nor to selection\n    // data.\n    template <typename ITEM_TYPE>\n    void ApplyDeletionPostLoop(ImGuiMultiSelectIO *ms_io, ImVector<ITEM_TYPE> &items, int item_curr_idx_to_select) {\n        // Rewrite item list (delete items) + convert old selection index (before deletion) to new selection index\n        // (after selection). If NavId was not part of selection, we will stay on same item.\n        ImVector<ITEM_TYPE> new_items;\n        new_items.reserve(items.Size - Size);\n        int item_next_idx_to_select = -1;\n        for (int idx = 0; idx < items.Size; idx++) {\n            if (!Contains(GetStorageIdFromIndex(idx)))\n                new_items.push_back(items[idx]);\n            if (item_curr_idx_to_select == idx)\n                item_next_idx_to_select = new_items.Size - 1;\n        }\n        items.swap(new_items);\n\n        // Update selection\n        Clear();\n        if (item_next_idx_to_select != -1 && ms_io->NavIdSelected)\n            SetItemSelected(GetStorageIdFromIndex(item_next_idx_to_select), true);\n    }\n};\n\nstruct ExampleAssetsBrowser {\n    // Options\n    bool ShowTypeOverlay = true;\n    bool AllowSorting = true;\n    bool AllowDragUnselected = false;\n    bool AllowBoxSelect = true;\n    float IconSize = 32.0f;\n    int IconSpacing = 10;\n    int IconHitSpacing =\n        4; // Increase hit-spacing if you want to make it possible to clear or box-select from gaps. Some spacing is\n           // required to able to amend with Shift+box-select. Value is small in Explorer.\n    bool StretchSpacing = true;\n\n    // State\n    ImVector<ExampleAsset> Items; // Our items\n    ExampleSelectionWithDeletion\n        Selection;               // Our selection (ImGuiSelectionBasicStorage + helper funcs to handle deletion)\n    ImGuiID NextItemId = 0;      // Unique identifier when creating new items\n    bool RequestDelete = false;  // Deferred deletion request\n    bool RequestSort = false;    // Deferred sort request\n    float ZoomWheelAccum = 0.0f; // Mouse wheel accumulator to handle smooth wheels better\n\n    // Calculated sizes for layout, output of UpdateLayoutSizes(). Could be locals but our code is simpler this way.\n    ImVec2 LayoutItemSize;\n    ImVec2 LayoutItemStep; // == LayoutItemSize + LayoutItemSpacing\n    float LayoutItemSpacing = 0.0f;\n    float LayoutSelectableSpacing = 0.0f;\n    float LayoutOuterPadding = 0.0f;\n    int LayoutColumnCount = 0;\n    int LayoutLineCount = 0;\n\n    // Functions\n    ExampleAssetsBrowser();\n    void AddItems(int count) {\n        if (Items.Size == 0)\n            NextItemId = 0;\n        Items.reserve(Items.Size + count);\n        for (int n = 0; n < count; n++, NextItemId++)\n            Items.push_back(ExampleAsset(NextItemId, (NextItemId % 20) < 15 ? 0 : (NextItemId % 20) < 18 ? 1 : 2));\n        RequestSort = true;\n    }\n    void ClearItems() {\n        Items.clear();\n        Selection.Clear();\n    }\n\n    // Logic would be written in the main code BeginChild() and outputing to local variables.\n    // We extracted it into a function so we can call it easily from multiple places.\n    void UpdateLayoutSizes(float avail_width) {\n        // Layout: when not stretching: allow extending into right-most spacing.\n        LayoutItemSpacing = (float)IconSpacing;\n        if (StretchSpacing == false)\n            avail_width += floorf(LayoutItemSpacing * 0.5f);\n\n        // Layout: calculate number of icon per line and number of lines\n        LayoutItemSize = ImVec2(floorf(IconSize), floorf(IconSize));\n        LayoutColumnCount = IM_MAX((int)(avail_width / (LayoutItemSize.x + LayoutItemSpacing)), 1);\n        LayoutLineCount = (Items.Size + LayoutColumnCount - 1) / LayoutColumnCount;\n\n        // Layout: when stretching: allocate remaining space to more spacing. Round before division, so item_spacing may\n        // be non-integer.\n        if (StretchSpacing && LayoutColumnCount > 1)\n            LayoutItemSpacing = floorf(avail_width - LayoutItemSize.x * LayoutColumnCount) / LayoutColumnCount;\n\n        LayoutItemStep = ImVec2(LayoutItemSize.x + LayoutItemSpacing, LayoutItemSize.y + LayoutItemSpacing);\n        LayoutSelectableSpacing = IM_MAX(floorf(LayoutItemSpacing) - IconHitSpacing, 0.0f);\n        LayoutOuterPadding = floorf(LayoutItemSpacing * 0.5f);\n    }\n\n    void Draw(const char *title, bool *p_open) {\n        ImGui::SetNextWindowSize(ImVec2(IconSize * 25, IconSize * 15), ImGuiCond_FirstUseEver);\n        if (!ImGui::Begin(title, p_open, ImGuiWindowFlags_MenuBar)) {\n            ImGui::End();\n            return;\n        }\n\n        // Menu bar\n        if (ImGui::BeginMenuBar()) {\n            if (ImGui::BeginMenu(\"File\")) {\n                if (ImGui::MenuItem(\"Add 10000 items\"))\n                    AddItems(10000);\n                if (ImGui::MenuItem(\"Clear items\"))\n                    ClearItems();\n                ImGui::Separator();\n                if (ImGui::MenuItem(\"Close\", NULL, false, p_open != NULL))\n                    *p_open = false;\n                ImGui::EndMenu();\n            }\n            if (ImGui::BeginMenu(\"Edit\")) {\n                if (ImGui::MenuItem(\"Delete\", \"Del\", false, Selection.Size > 0))\n                    RequestDelete = true;\n                ImGui::EndMenu();\n            }\n            if (ImGui::BeginMenu(\"Options\")) {\n                ImGui::PushItemWidth(ImGui::GetFontSize() * 10);\n\n                ImGui::SeparatorText(\"Contents\");\n                ImGui::Checkbox(\"Show Type Overlay\", &ShowTypeOverlay);\n                ImGui::Checkbox(\"Allow Sorting\", &AllowSorting);\n\n                ImGui::SeparatorText(\"Selection Behavior\");\n                ImGui::Checkbox(\"Allow dragging unselected item\", &AllowDragUnselected);\n                ImGui::Checkbox(\"Allow box-selection\", &AllowBoxSelect);\n\n                ImGui::SeparatorText(\"Layout\");\n                ImGui::SliderFloat(\"Icon Size\", &IconSize, 16.0f, 128.0f, \"%.0f\");\n                ImGui::SameLine();\n                HelpMarker(\"Use CTRL+Wheel to zoom\");\n                ImGui::SliderInt(\"Icon Spacing\", &IconSpacing, 0, 32);\n                ImGui::SliderInt(\"Icon Hit Spacing\", &IconHitSpacing, 0, 32);\n                ImGui::Checkbox(\"Stretch Spacing\", &StretchSpacing);\n                ImGui::PopItemWidth();\n                ImGui::EndMenu();\n            }\n            ImGui::EndMenuBar();\n        }\n\n        // Show a table with ONLY one header row to showcase the idea/possibility of using this to provide a sorting UI\n        if (AllowSorting) {\n            ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));\n            ImGuiTableFlags table_flags_for_sort_specs = ImGuiTableFlags_Sortable | ImGuiTableFlags_SortMulti |\n                                                         ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_Borders;\n            if (ImGui::BeginTable(\"for_sort_specs_only\", 2, table_flags_for_sort_specs,\n                                  ImVec2(0.0f, ImGui::GetFrameHeight()))) {\n                ImGui::TableSetupColumn(\"Index\");\n                ImGui::TableSetupColumn(\"Type\");\n                ImGui::TableHeadersRow();\n                if (ImGuiTableSortSpecs *sort_specs = ImGui::TableGetSortSpecs())\n                    if (sort_specs->SpecsDirty || RequestSort) {\n                        ExampleAsset::SortWithSortSpecs(sort_specs, Items.Data, Items.Size);\n                        sort_specs->SpecsDirty = RequestSort = false;\n                    }\n                ImGui::EndTable();\n            }\n            ImGui::PopStyleVar();\n        }\n\n        ImGuiIO &io = ImGui::GetIO();\n        ImGui::SetNextWindowContentSize(\n            ImVec2(0.0f, LayoutOuterPadding + LayoutLineCount * (LayoutItemSize.x + LayoutItemSpacing)));\n        if (ImGui::BeginChild(\"Assets\", ImVec2(0.0f, -ImGui::GetTextLineHeightWithSpacing()), ImGuiChildFlags_Border,\n                              ImGuiWindowFlags_NoMove)) {\n            ImDrawList *draw_list = ImGui::GetWindowDrawList();\n\n            const float avail_width = ImGui::GetContentRegionAvail().x;\n            UpdateLayoutSizes(avail_width);\n\n            // Calculate and store start position.\n            ImVec2 start_pos = ImGui::GetCursorScreenPos();\n            start_pos = ImVec2(start_pos.x + LayoutOuterPadding, start_pos.y + LayoutOuterPadding);\n            ImGui::SetCursorScreenPos(start_pos);\n\n            // Multi-select\n            ImGuiMultiSelectFlags ms_flags =\n                ImGuiMultiSelectFlags_ClearOnEscape | ImGuiMultiSelectFlags_ClearOnClickVoid;\n\n            // - Enable box-select (in 2D mode, so that changing box-select rectangle X1/X2 boundaries will affect\n            // clipped items)\n            if (AllowBoxSelect)\n                ms_flags |= ImGuiMultiSelectFlags_BoxSelect2d;\n\n            // - This feature allows dragging an unselected item without selecting it (rarely used)\n            if (AllowDragUnselected)\n                ms_flags |= ImGuiMultiSelectFlags_SelectOnClickRelease;\n\n            // - Enable keyboard wrapping on X axis\n            // (FIXME-MULTISELECT: We haven't designed/exposed a general nav wrapping api yet, so this flag is provided\n            // as a courtesy to avoid doing:\n            //    ImGui::NavMoveRequestTryWrapping(ImGui::GetCurrentWindow(), ImGuiNavMoveFlags_WrapX);\n            // When we finish implementing a more general API for this, we will obsolete this flag in favor of the new\n            // system)\n            ms_flags |= ImGuiMultiSelectFlags_NavWrapX;\n\n            ImGuiMultiSelectIO *ms_io = ImGui::BeginMultiSelect(ms_flags, Selection.Size, Items.Size);\n\n            // Use custom selection adapter: store ID in selection (recommended)\n            Selection.UserData = this;\n            Selection.AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage *self_, int idx) {\n                ExampleAssetsBrowser *self = (ExampleAssetsBrowser *)self_->UserData;\n                return self->Items[idx].ID;\n            };\n            Selection.ApplyRequests(ms_io);\n\n            const bool want_delete =\n                (ImGui::Shortcut(ImGuiKey_Delete, ImGuiInputFlags_Repeat) && (Selection.Size > 0)) || RequestDelete;\n            const int item_curr_idx_to_focus = want_delete ? Selection.ApplyDeletionPreLoop(ms_io, Items.Size) : -1;\n            RequestDelete = false;\n\n            // Push LayoutSelectableSpacing (which is LayoutItemSpacing minus hit-spacing, if we decide to have hit gaps\n            // between items) Altering style ItemSpacing may seem unnecessary as we position every items using\n            // SetCursorScreenPos()... But it is necessary for two reasons:\n            // - Selectables uses it by default to visually fill the space between two items.\n            // - The vertical spacing would be measured by Clipper to calculate line height if we didn't provide it\n            // explicitly (here we do).\n            ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(LayoutSelectableSpacing, LayoutSelectableSpacing));\n\n            // Rendering parameters\n            const ImU32 icon_type_overlay_colors[3] = {0, IM_COL32(200, 70, 70, 255), IM_COL32(70, 170, 70, 255)};\n            const ImU32 icon_bg_color = ImGui::GetColorU32(ImGuiCol_MenuBarBg);\n            const ImVec2 icon_type_overlay_size = ImVec2(4.0f, 4.0f);\n            const bool display_label = (LayoutItemSize.x >= ImGui::CalcTextSize(\"999\").x);\n\n            const int column_count = LayoutColumnCount;\n            ImGuiListClipper clipper;\n            clipper.Begin(LayoutLineCount, LayoutItemStep.y);\n            if (item_curr_idx_to_focus != -1)\n                clipper.IncludeItemByIndex(item_curr_idx_to_focus /\n                                           column_count); // Ensure focused item line is not clipped.\n            if (ms_io->RangeSrcItem != -1)\n                clipper.IncludeItemByIndex((int)ms_io->RangeSrcItem /\n                                           column_count); // Ensure RangeSrc item line is not clipped.\n            while (clipper.Step()) {\n                for (int line_idx = clipper.DisplayStart; line_idx < clipper.DisplayEnd; line_idx++) {\n                    const int item_min_idx_for_current_line = line_idx * column_count;\n                    const int item_max_idx_for_current_line = IM_MIN((line_idx + 1) * column_count, Items.Size);\n                    for (int item_idx = item_min_idx_for_current_line; item_idx < item_max_idx_for_current_line;\n                         ++item_idx) {\n                        ExampleAsset *item_data = &Items[item_idx];\n                        ImGui::PushID((int)item_data->ID);\n\n                        // Position item\n                        ImVec2 pos = ImVec2(start_pos.x + (item_idx % column_count) * LayoutItemStep.x,\n                                            start_pos.y + line_idx * LayoutItemStep.y);\n                        ImGui::SetCursorScreenPos(pos);\n\n                        ImGui::SetNextItemSelectionUserData(item_idx);\n                        bool item_is_selected = Selection.Contains((ImGuiID)item_data->ID);\n                        bool item_is_visible = ImGui::IsRectVisible(LayoutItemSize);\n                        ImGui::Selectable(\"\", item_is_selected, ImGuiSelectableFlags_None, LayoutItemSize);\n\n                        // Update our selection state immediately (without waiting for EndMultiSelect() requests)\n                        // because we use this to alter the color of our text/icon.\n                        if (ImGui::IsItemToggledSelection())\n                            item_is_selected = !item_is_selected;\n\n                        // Focus (for after deletion)\n                        if (item_curr_idx_to_focus == item_idx)\n                            ImGui::SetKeyboardFocusHere(-1);\n\n                        // Drag and drop\n                        if (ImGui::BeginDragDropSource()) {\n                            // Create payload with full selection OR single unselected item.\n                            // (the later is only possible when using ImGuiMultiSelectFlags_SelectOnClickRelease)\n                            if (ImGui::GetDragDropPayload() == NULL) {\n                                ImVector<ImGuiID> payload_items;\n                                void *it = NULL;\n                                ImGuiID id = 0;\n                                if (!item_is_selected)\n                                    payload_items.push_back(item_data->ID);\n                                else\n                                    while (Selection.GetNextSelectedItem(&it, &id))\n                                        payload_items.push_back(id);\n                                ImGui::SetDragDropPayload(\"ASSETS_BROWSER_ITEMS\", payload_items.Data,\n                                                          (size_t)payload_items.size_in_bytes());\n                            }\n\n                            // Display payload content in tooltip, by extracting it from the payload data\n                            // (we could read from selection, but it is more correct and reusable to read from payload)\n                            const ImGuiPayload *payload = ImGui::GetDragDropPayload();\n                            const int payload_count = (int)payload->DataSize / (int)sizeof(ImGuiID);\n                            ImGui::Text(\"%d assets\", payload_count);\n\n                            ImGui::EndDragDropSource();\n                        }\n\n                        // Render icon (a real app would likely display an image/thumbnail here)\n                        // Because we use ImGuiMultiSelectFlags_BoxSelect2d, clipping vertical may occasionally be\n                        // larger, so we coarse-clip our rendering as well.\n                        if (item_is_visible) {\n                            ImVec2 box_min(pos.x - 1, pos.y - 1);\n                            ImVec2 box_max(box_min.x + LayoutItemSize.x + 2,\n                                           box_min.y + LayoutItemSize.y + 2);          // Dubious\n                            draw_list->AddRectFilled(box_min, box_max, icon_bg_color); // Background color\n                            if (ShowTypeOverlay && item_data->Type != 0) {\n                                ImU32 type_col =\n                                    icon_type_overlay_colors[item_data->Type % IM_ARRAYSIZE(icon_type_overlay_colors)];\n                                draw_list->AddRectFilled(\n                                    ImVec2(box_max.x - 2 - icon_type_overlay_size.x, box_min.y + 2),\n                                    ImVec2(box_max.x - 2, box_min.y + 2 + icon_type_overlay_size.y), type_col);\n                            }\n                            if (display_label) {\n                                ImU32 label_col =\n                                    ImGui::GetColorU32(item_is_selected ? ImGuiCol_Text : ImGuiCol_TextDisabled);\n                                char label[32];\n                                sprintf(label, \"%d\", item_data->ID); //, utf8table[item_data->ID].data()\n                                draw_list->AddText(ImVec2(box_min.x, box_max.y - ImGui::GetFontSize()), label_col,\n                                                   label);\n                            }\n                        }\n\n                        ImGui::PopID();\n                    }\n                }\n            }\n            clipper.End();\n            ImGui::PopStyleVar(); // ImGuiStyleVar_ItemSpacing\n\n            // Context menu\n            if (ImGui::BeginPopupContextWindow()) {\n                ImGui::Text(\"Selection: %d items\", Selection.Size);\n                ImGui::Separator();\n                if (ImGui::MenuItem(\"Delete\", \"Del\", false, Selection.Size > 0))\n                    RequestDelete = true;\n                ImGui::EndPopup();\n            }\n\n            ms_io = ImGui::EndMultiSelect();\n            Selection.ApplyRequests(ms_io);\n            if (want_delete)\n                Selection.ApplyDeletionPostLoop(ms_io, Items, item_curr_idx_to_focus);\n\n            // Zooming with CTRL+Wheel\n            if (ImGui::IsWindowAppearing())\n                ZoomWheelAccum = 0.0f;\n            if (ImGui::IsWindowHovered() && io.MouseWheel != 0.0f && ImGui::IsKeyDown(ImGuiMod_Ctrl) &&\n                ImGui::IsAnyItemActive() == false) {\n                ZoomWheelAccum += io.MouseWheel;\n                if (fabsf(ZoomWheelAccum) >= 1.0f) {\n                    // Calculate hovered item index from mouse location\n                    // FIXME: Locking aiming on 'hovered_item_idx' (with a cool-down timer) would ensure zoom keeps on\n                    // it.\n                    const float hovered_item_nx =\n                        (io.MousePos.x - start_pos.x + LayoutItemSpacing * 0.5f) / LayoutItemStep.x;\n                    const float hovered_item_ny =\n                        (io.MousePos.y - start_pos.y + LayoutItemSpacing * 0.5f) / LayoutItemStep.y;\n                    const int hovered_item_idx = ((int)hovered_item_ny * LayoutColumnCount) + (int)hovered_item_nx;\n                    // ImGui::SetTooltip(\"%f,%f -> item %d\", hovered_item_nx, hovered_item_ny, hovered_item_idx); //\n                    // Move those 4 lines in block above for easy debugging\n\n                    // Zoom\n                    IconSize *= powf(1.1f, (float)(int)ZoomWheelAccum);\n                    IconSize = IM_CLAMP(IconSize, 16.0f, 128.0f);\n                    ZoomWheelAccum -= (int)ZoomWheelAccum;\n                    UpdateLayoutSizes(avail_width);\n\n                    // Manipulate scroll to that we will land at the same Y location of currently hovered item.\n                    // - Calculate next frame position of item under mouse\n                    // - Set new scroll position to be used in next ImGui::BeginChild() call.\n                    float hovered_item_rel_pos_y =\n                        ((float)(hovered_item_idx / LayoutColumnCount) + fmodf(hovered_item_ny, 1.0f)) *\n                        LayoutItemStep.y;\n                    hovered_item_rel_pos_y += ImGui::GetStyle().WindowPadding.y;\n                    float mouse_local_y = io.MousePos.y - ImGui::GetWindowPos().y;\n                    ImGui::SetScrollY(hovered_item_rel_pos_y - mouse_local_y);\n                }\n            }\n        }\n        ImGui::EndChild();\n\n        ImGui::Text(\"Selected: %d/%d items\", Selection.Size, Items.Size);\n        ImGui::End();\n    }\n};\n\n} // namespace uni_table"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/main.cpp",
    "content": "// Dear ImGui: standalone example application for GLFW + OpenGL 3, using programmable pipeline\n// (GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan/Metal graphics context\n// creation, etc.)\n\n// Learn about Dear ImGui:\n// - FAQ                  https://dearimgui.com/faq\n// - Getting Started      https://dearimgui.com/getting-started\n// - Documentation        https://dearimgui.com/docs (same as your local docs/ folder).\n// - Introduction, links and more at the top of imgui.cpp\n\n#include \"MainWindow.h\"\n\n#include \"FontLoader.h\"\n\n#include <Common/tstring.h>\n#include <Common/CommandLineParser.h>\n\n#include \"imgui.h\"\n#include \"imgui_impl_glfw.h\"\n#include \"imgui_impl_opengl3.h\"\n#include <nlohmann/json.hpp>\n#include <stdio.h>\n#define GL_SILENCE_DEPRECATION\n#if defined(IMGUI_IMPL_OPENGL_ES2)\n#include <GLES2/gl2.h>\n#endif\n#include <GLFW/glfw3.h> // Will drag system OpenGL headers\n\n#include <Windows.h>\n\n#include <chrono>\n#include <thread>\n\n// [Win32] Our example includes a copy of glfw3.lib pre-compiled with VS2010 to maximize ease of testing and\n// compatibility with old VS compilers. To link with VS2010-era libraries, VS2015+ requires linking with\n// legacy_stdio_definitions.lib, which we do using this pragma. Your own project should not be affected, as you are\n// likely to link with a newer binary of GLFW that is adequate for your version of Visual Studio.\n#if defined(_MSC_VER) && (_MSC_VER >= 1900) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS)\n#pragma comment(lib, \"legacy_stdio_definitions\")\n#endif\n\n// This example can also compile and run with Emscripten! See 'Makefile.emscripten' for details.\n#ifdef __EMSCRIPTEN__\n#include \"../libs/emscripten/emscripten_mainloop_stub.h\"\n#endif\n\nstatic void glfw_error_callback(int error, const char *description) {\n    fprintf(stderr, \"GLFW Error %d: %s\\n\", error, description);\n}\n\n// File drop callback function\nvoid drop_callback(GLFWwindow *window, int count, const char **paths) {\n    std::vector<std::string> filenames;\n    for (int i = 0; i < count; i++) {\n        printf(\"send: %s\\n\", paths[i]);\n        filenames.push_back(std::string(paths[i]));\n    }\n    nlohmann::json j;\n    j[\"data\"] = filenames;\n    std::string s = j.dump();\n\n    if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceExtern | ImGuiDragDropFlags_SourceNoPreviewTooltip)) {\n        ImGui::SetDragDropPayload(\"files\", s.c_str(), s.size());\n        ImGui::EndDragDropSource();\n    }\n}\n\n#ifndef NDEBUG\nint main(int, char **) try {\n#else\nint WINAPI WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, LPSTR szCmdLine, int nCmdShow) try {\n#endif\n    std::setlocale(LC_CTYPE, \".UTF-8\");\n\n    auto startTime = std::chrono::system_clock::now();\n\n    glfwSetErrorCallback(glfw_error_callback);\n    if (!glfwInit())\n        return 1;\n\n        // Decide GL+GLSL versions\n#if defined(IMGUI_IMPL_OPENGL_ES2)\n    // GL ES 2.0 + GLSL 100 (WebGL 1.0)\n    const char *glsl_version = \"#version 100\";\n    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);\n    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);\n    glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);\n#elif defined(IMGUI_IMPL_OPENGL_ES3)\n    // GL ES 3.0 + GLSL 300 es (WebGL 2.0)\n    const char *glsl_version = \"#version 300 es\";\n    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);\n    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);\n    glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);\n#elif defined(__APPLE__)\n// GL 3.2 + GLSL 150\nconst char *glsl_version = \"#version 150\";\nglfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);\nglfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);\nglfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // 3.2+ only\nglfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);           // Required on Mac\n#else\n// GL 3.0 + GLSL 130\nconst char *glsl_version = \"#version 130\";\nglfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);\nglfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);\n// glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);  // 3.2+ only\n// glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);            // 3.0+ only\n#endif\n\n    // Create window with graphics context\n    GLFWwindow *window = glfwCreateWindow(1280, 720, \"Dear ImGui GLFW+OpenGL3 example\", nullptr, nullptr);\n    if (window == nullptr)\n        return 1;\n\n    // Set the file drop callback\n    glfwSetDropCallback(window, drop_callback);\n\n    glfwMakeContextCurrent(window);\n    glfwSwapInterval(1); // Enable vsync\n\n    // Setup Dear ImGui context\n    IMGUI_CHECKVERSION();\n    ImGui::CreateContext();\n    ImGuiIO &io = ImGui::GetIO();\n    (void)io;\n    io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls\n    io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;  // Enable Gamepad Controls\n\n    // Setup Dear ImGui style\n    ImGui::StyleColorsDark();\n\n    // Set DPI: Step 1/2: set global DPI scale factor\n    float xscale = 1.0f, yscale = 1.0f;\n    glfwGetMonitorContentScale(glfwGetPrimaryMonitor(), &xscale, &yscale);\n    float scale = std::max(xscale, yscale);\n    ImGui::GetStyle().ScaleAllSizes(scale);\n\n    // Setup Platform/Renderer backends\n    ImGui_ImplGlfw_InitForOpenGL(window, true);\n#ifdef __EMSCRIPTEN__\n    ImGui_ImplGlfw_InstallEmscriptenCallbacks(window, \"#canvas\");\n#endif\n    ImGui_ImplOpenGL3_Init(glsl_version);\n\n    bool fontLoaded = false;\n\n    FontLoader fontLoader;\n    // Set DPI: Step 2/2: set font size\n    fontLoader.StartAsyncLoad(scale);\n\n    // Our state\n    bool show_demo_window = true;\n    bool show_another_window = false;\n    ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);\n\n    // 得到命令行参数\n    const std::vector<std::string> args = GetCommandLineArgs();\n\n    // GUI模式下的初始输入文件。目的是文件拖到程序图标上时能够自动加载\n    std::vector<std::string> inputFilenames;\n    if (args.size() > 1) {\n        for (int i = 1; i < args.size(); ++i) {\n            auto path = std::filesystem::u8path(args[i]);\n            if (!std::filesystem::is_regular_file(path) && !std::filesystem::is_directory(path)) {\n                throw std::runtime_error(fmt::format(\"illegal path: {}\", path.u8string())); // FIXME\n                break;\n            }\n            inputFilenames.push_back(args[i]);\n        }\n    }\n\n    // Main loop\n    MainWindow mainWindow(window, inputFilenames);\n\n    auto initEndTime = std::chrono::system_clock::now();\n    fmt::print(\"init time: {}s\\n\", std::chrono::duration<double>(initEndTime - startTime).count());\n\n    // Main loop\n#ifdef __EMSCRIPTEN__\n    // For an Emscripten build we are disabling file-system access, so let's not attempt to do a fopen() of the\n    // imgui.ini file. You may manually call LoadIniSettingsFromMemory() to load settings from your own storage.\n    io.IniFilename = nullptr;\n    EMSCRIPTEN_MAINLOOP_BEGIN\n#else\n    while (!glfwWindowShouldClose(window))\n#endif\n    {\n        // Poll and handle events (inputs, window resize, etc.)\n        // You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your\n        // inputs.\n        // - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application, or\n        // clear/overwrite your copy of the mouse data.\n        // - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application, or\n        // clear/overwrite your copy of the keyboard data. Generally you may always pass all inputs to dear imgui, and\n        // hide them from your application based on those two flags.\n        glfwPollEvents();\n        if (glfwGetWindowAttrib(window, GLFW_ICONIFIED) != 0) {\n            std::this_thread::sleep_for(std::chrono::milliseconds(10));\n            continue;\n        }\n\n        auto newIoFonts = fontLoader.TryGetFontAtlas();\n        if (newIoFonts) {\n            ImGui_ImplOpenGL3_DestroyFontsTexture();\n\n            io.Fonts = newIoFonts.release();\n\n            ImGui_ImplOpenGL3_CreateFontsTexture();\n        }\n\n        // Start the Dear ImGui frame\n        ImGui_ImplOpenGL3_NewFrame();\n        ImGui_ImplGlfw_NewFrame();\n        ImGui::NewFrame();\n\n        mainWindow.Render();\n\n        // Rendering\n        ImGui::Render();\n        int display_w, display_h;\n        glfwGetFramebufferSize(window, &display_w, &display_h);\n        glViewport(0, 0, display_w, display_h);\n        glClearColor(clear_color.x * clear_color.w, clear_color.y * clear_color.w, clear_color.z * clear_color.w,\n                     clear_color.w);\n        glClear(GL_COLOR_BUFFER_BIT);\n        ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());\n\n        glfwSwapBuffers(window);\n    }\n#ifdef __EMSCRIPTEN__\n    EMSCRIPTEN_MAINLOOP_END;\n#endif\n\n    // Cleanup\n    ImGui_ImplOpenGL3_Shutdown();\n    ImGui_ImplGlfw_Shutdown();\n    ImGui::DestroyContext();\n\n    glfwDestroyWindow(window);\n    glfwTerminate();\n\n    return 0;\n} catch (const std::exception &e) {\n    MessageBoxW(NULL, utf8_to_wstring(e.what()).c_str(), L\"Error\", MB_ICONERROR | MB_OK);\n    return -1;\n}"
  },
  {
    "path": "src/SmartCharsetConverter-imgui/resource.h",
    "content": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ 生成的包含文件。\n// 供 SmartCharsetConverter.rc 使用\n//\n#define IDD_DIALOG_MAIN                 101\n#define IDI_ICON1                       102\n#define IDR_MENU_RIGHT                  106\n#define IDR_MENU_SELECT_LANGUAGES       107\n#define IDR_LANGUAGEJSON_ENGLISH        108\n#define IDR_LANGUAGEJSON2               109\n#define IDR_LANGUAGEJSON_SIMPLIFIED_CHINESE 109\n#define IDR_LANGUAGEJSON1               111\n#define IDR_LANGUAGEJSON_SPANISH        111\n#define IDC_RADIO_STRETEGY_SMART        1001\n#define IDC_RADIO_STRETEGY_MANUAL       1002\n#define IDC_RADIO_STRETEGY_NO_FILTER    1003\n#define IDC_EDIT_INCLUDE_TEXT           1004\n#define IDC_BUTTON_ADD_DIR              1010\n#define IDC_BUTTON_ADD_FILES            1011\n#define IDC_RADIO_TO_ORIGIN             1020\n#define IDC_RADIO_TO_DIR                1021\n#define IDC_EDIT_OUTPUT_DIR             1022\n#define IDC_BUTTON_SET_OUTPUT_DIR       1023\n#define IDC_RADIO_UTF8                  1030\n#define IDC_RADIO_UTF8BOM               1031\n#define IDC_RADIO_GB18030               1032\n#define IDC_RADIO_OTHER                 1033\n#define IDC_COMBO_OTHER_CHARSET         1034\n#define IDC_LISTVIEW                    1040\n#define IDC_BUTTON_START                1050\n#define IDC_BUTTON_CLEAR                1051\n#define IDC_CHECK_CONVERT_RETURN        1052\n#define IDC_RADIO_CRLF                  1053\n#define IDC_RADIO_LF                    1054\n#define IDC_RADIO_CR                    1055\n#define IDC_SYSLINK1                    1057\n#define IDC_BUTTON1                     1058\n#define IDC_BUTTON_SETTINGS             1058\n#define IDC_STATIC_FILE_LISTS           1059\n#define IDC_STATIC_SET_FILTER_MODE      1060\n#define IDC_STATIC_ADD_FILES_OR_FOLDER  1061\n#define IDC_STATIC_SET_OUTPUT           1062\n#define IDC_STATIC_SET_OUTPUT_CHARSET   1063\n#define ID_OPEN_WITH_NOTEPAD            40003\n#define ID_REMOVE_ITEM                  40004\n#define ID_40005                        40005\n#define ID_SPECIFY_ORIGIN_CHARSET       40006\n#define ID_40007                        40007\n#define ID_LANGUAGE                     40008\n\n// Next default values for new objects\n// \n#ifdef APSTUDIO_INVOKED\n#ifndef APSTUDIO_READONLY_SYMBOLS\n#define _APS_NEXT_RESOURCE_VALUE        112\n#define _APS_NEXT_COMMAND_VALUE         40009\n#define _APS_NEXT_CONTROL_VALUE         1064\n#define _APS_NEXT_SYMED_VALUE           101\n#endif\n#endif\n"
  },
  {
    "path": "src/Translator/CMakeLists.txt",
    "content": "# =============================================\nfind_package(nlohmann_json CONFIG REQUIRED)\n\n# =======================================\nfile(GLOB_RECURSE SRC_CODE\n\t*.h\n\t*.cpp\n)\n\nadd_library(Translator STATIC ${SRC_CODE})\n\ntarget_link_libraries(Translator PUBLIC\n\tnlohmann_json::nlohmann_json\n\tCore\n)\n\ntarget_include_directories(Translator PUBLIC\n\t..\n)\n"
  },
  {
    "path": "src/Translator/LanguageService.cpp",
    "content": "#include \"LanguageService.h\"\n\n#include <Common/tstring.h>\n#include <Common/ResourceLoader.h>\n#include <Common/CommandLineParser.h>\n\nconst char DEFAULT_LANGUAGE[] = u8\"English\";\n\nLanguageService::LanguageService(LanguageServiceOption option) : option(option) {\n    /*\n        加载流程：\n        先从内置的json语言文件加载。\n        然后加载外置的json语言文件。如果和内置的重复，那么覆盖内置的。\n\n        从配置读取当前语言，如果没有设置，\n        那么读取系统语言。如果系统语言没有对应的语言包，那么加载英语。\n    */\n    LoadLanguageNameFromInnerRCFile();\n\n    LoadLanguageNameFromDir(\"lang\");\n\n    std::string lang = option.languageName;\n    if (lang.empty()) {\n        LANGID langId = GetUserDefaultLangID();\n\n        lang = GetLanguageNameByLangIdFromLoadedLanguages(langId);\n\n        if (lang.empty()) {\n            lang = DEFAULT_LANGUAGE;\n        }\n    }\n\n    if (languages.find(lang) == languages.end()) {\n        throw std::runtime_error(\n            \"language json file is lost. language name = \" + lang +\n            \"\\r\\n\\r\\nTip: Remove the configuration json file could make program load default language.\");\n    }\n    currentLang = languages[lang].get();\n}\n\nstd::string LanguageService::GetCurrentLanguage() const noexcept {\n    return currentLang->language;\n}\n\nconst std::string &LanguageService::GetUtf8String(v0_2::StringId id) const noexcept {\n    return currentLang->GetString(id);\n}\n\nstd::wstring LanguageService::GetWString(v0_2::StringId id) const noexcept {\n    return utf8_to_wstring(GetUtf8String(id));\n}\n\nvoid LanguageService::LoadLanguageNameFromInnerRCFile() noexcept {\n    for (auto id : option.resourceIds) {\n        internal::LanguagePack langPack(id, option.resourceType);\n\n        auto langName = langPack.language;\n        languages.emplace(langName, std::make_unique<internal::LanguagePack>(std::move(langPack)));\n    }\n}\n\nvoid LanguageService::LoadLanguageNameFromDir(const std::filesystem::path &dir) {\n    // 得到命令行参数\n    const std::vector<std::string> args = GetCommandLineArgs();\n    std::string selfPath = args[0];\n    std::filesystem::path exeDir = std::filesystem::u8path(selfPath).parent_path();\n\n    std::filesystem::path langDir = exeDir / dir;\n    if (!std::filesystem::is_directory(langDir)) {\n        return;\n    }\n\n    for (auto path : std::filesystem::directory_iterator(exeDir / dir)) {\n        std::unique_ptr<internal::LanguagePack> langPack;\n        try {\n            langPack = std::make_unique<internal::LanguagePack>(path.path().wstring());\n        } catch (const nlohmann::json::exception &err) {\n            throw std::runtime_error(\"failed to load language file from \" + path.path().u8string() +\n                                     \" \\r\\nReason: \" + err.what());\n        }\n\n        if (langPack->language.empty()) {\n            throw std::runtime_error(\"failed to load language file from \" + path.path().u8string() +\n                                     \" \\r\\nReason: \\\"language\\\" field is empty\");\n        }\n\n        auto langName = langPack->language;\n        // make external language file override inner language file from the .rc file\n        languages[langName] = std::move(langPack);\n    }\n}\n\nbool LanguageService::HasLanguagePack(const std::string &lang) const noexcept {\n    return languages.find(lang) != languages.end();\n}\n\nstd::string LanguageService::GetLanguageNameByLangIdFromLoadedLanguages(int langId) const noexcept {\n    for (auto &pr : languages) {\n        if (pr.second->langId == langId) {\n            return pr.first;\n        }\n    }\n    return \"\";\n}\n\nvoid LanguageService::SetCurrentLanguage(const std::string &languageName) {\n    currentLang = languages.at(languageName).get();\n}\n\nstd::vector<std::string> LanguageService::GetLanguageArray() const noexcept {\n    std::vector<std::string> ret;\n    for (auto &pr : languages) {\n        ret.push_back(pr.first);\n    }\n    return ret;\n}\n\nstd::string LanguageService::MessageIdToString(MessageId mid) const noexcept {\n    return GetUtf8String(static_cast<v0_2::StringId>(mid));\n}\n"
  },
  {
    "path": "src/Translator/LanguageService.h",
    "content": "#pragma once\n\n#include \"StringId.h\"\n#include \"internal/Language.h\"\n\n#include <functional>\n#include <vector>\n\nstruct LanguageServiceOption {\n    // specify the language at starting.\n    // the content should be equal of \"language\" field data of one of language json files.\n    std::string languageName;\n    std::wstring resourceType;\n    std::vector<int> resourceIds;\n};\n\n/*\n    多语言支持\n\n    加载流程：\n    先从内置的json语言文件加载。\n    然后加载外置的json语言文件。如果和内置的重复，那么覆盖内置的。\n\n    等待配置读取当前语言，如果没有设置，\n    那么读取系统语言。如果系统语言没有对应的语言包，那么加载英语。\n*/\nclass LanguageService : public TranslatorBase {\npublic:\n    /**\n     * @exception json解析失败抛出异常\n     */\n    LanguageService(LanguageServiceOption option);\n\n    std::string GetCurrentLanguage() const noexcept;\n\n    /**\n     * 设置当前语言。会校验语言包，如果校验失败抛出异常。\n     * @exception std::runtime_error 校验失败\n     */\n    void SetCurrentLanguage(const std::string &languageName);\n\n    const std::string &GetUtf8String(v0_2::StringId id) const noexcept;\n\n    std::wstring GetWString(v0_2::StringId id) const noexcept;\n\n    std::vector<std::string> GetLanguageArray() const noexcept;\n\n    const std::unordered_map<std::string, std::unique_ptr<internal::LanguagePack>> &GetLanguagesTable() const noexcept;\n\n    virtual std::string MessageIdToString(MessageId mid) const noexcept;\n\nprivate:\n    LanguageServiceOption option;\n    std::vector<std::string> avaliableLanguages;\n    internal::LanguagePack *currentLang;\n    std::map<std::string, std::unique_ptr<internal::LanguagePack>> languages;\n\n    void LoadLanguageNameFromInnerRCFile() noexcept;\n\n    void LoadLanguageNameFromDir(const std::filesystem::path &dir);\n\n    bool HasLanguagePack(const std::string &lang) const noexcept;\n\n    std::string GetLanguageNameByLangIdFromLoadedLanguages(int langId) const noexcept;\n};\n"
  },
  {
    "path": "src/Translator/StringId.h",
    "content": "#pragma once\n\n#include <Core/Messages.h>\n\n// third party\n\n// standard\n#include <unordered_map>\n#include <array>\n\nconst std::string StringIdVersion = \"0.2\";\n\nnamespace v0_2 {\nenum class StringId {\n    BEGIN = 100,\n\n    // 序号\n    INDEX,\n    FILENAME,\n    SIZE,\n    ENCODING,\n    LINE_BREAKS,\n    TEXT_PIECE,\n    MSGBOX_ERROR,\n    FAILED_ADD_BELOW,\n    REASON,\n    NON_TEXT_OR_NO_DETECTED, // 10\n    AND_SO_ON,\n    TIPS_USE_NO_FILTER,\n    PROMPT,\n    NO_FILE_TO_CONVERT,\n    INVALID_OUTPUT_DIR,\n    SUCCEED_SOME_FILES,\n    FAILED_CONVERT_BELOW,\n    NO_DEAL_DUE_TO_CANCEL,\n    CONVERT_RESULT,\n    NOTICE_SHOW_AS_UTF8, // 20\n    SUPPORT_FORMAT_BELOW,\n    SEPERATOR_DESCRIPTION,\n    NO_SPECIFY_FILTER_EXTEND,\n    INVALID_EXTEND_FILTER,\n    ALL_FILES,\n    FAILED_TO_SET_CHARSET_MANUALLY,\n    NO_MEMORY,\n    CANCEL,\n    START_CONVERT,\n    INVALID_CHARACTERS, // 30\n    WILL_LOST_CHARACTERS,\n    NOT_SUPPORT_ENCODING,\n    ADD_REDUNDANTLY,\n    NO_DETECTED_ENCODING,\n    FAILED_TO_WRITE_FILE,\n    FILE_SIZE_OUT_OF_LIMIT,\n    FAILED_TO_OPEN_FILE,\n    FILE_LISTS,\n    SET_FILTER_MODE,\n    NO_FILTER, // 40\n    SMART_FILE_DETECTION,\n    USE_FILE_EXTENSION,\n    ADD_FILES_OR_FOLDER,\n    ADD_FILES,\n    ADD_FOLDER,\n    SET_OUTPUT,\n    OUTPUT_TO_ORIGIN,\n    OUTPUT_TO_FOLDER,\n    SET_OUTPUT_CHARSET,\n    OTHERS, // 50\n    CHANGE_LINE_BREAKS,\n    CLEAR_LISTS,\n    OPEN_WITH_NOTEPAD,\n    SPECIFY_ORIGIN_ENCODING,\n    REMOVE,\n    SELECT_FOLDER,\n\n    END\n};\n\nconstexpr std::array<std::pair<int, int>, 2> STRING_ID_RANGES = {\n    std::pair<int, int>{static_cast<int>(MessageId::BEGIN), static_cast<int>(MessageId::END)},\n    std::pair<int, int>{static_cast<int>(StringId::BEGIN), static_cast<int>(StringId::END)},\n};\n\n} // namespace v0_2"
  },
  {
    "path": "src/Translator/Translator.cpp",
    "content": "#include \"Translator.h\""
  },
  {
    "path": "src/Translator/Translator.h",
    "content": "#pragma once\n\n#include <Core/TranslatorBase.h>\n\nclass Translator : public TranslatorBase {\npublic:\n    Translator() {}\n};\n"
  },
  {
    "path": "src/Translator/internal/Language.cpp",
    "content": "#include \"Language.h\"\n#include \"Translator/StringId.h\"\n\n#include <Common/CommandLineParser.h>\n#include <Common/ResourceLoader.h>\n\n#include <Common/tstring.h>\n\n// standard\n#include <cassert>\n#include <stdexcept>\n#include <fstream>\n#include <filesystem>\n\nnamespace internal {\n\nLanguagePack::LanguagePack(const std::wstring &filename) {\n    std::ifstream ifs(to_string(filename));\n    if (!ifs) {\n        throw std::runtime_error(\"open file fail: \" + to_utf8(filename));\n    }\n\n    nlohmann::json j = nlohmann::json::parse(ifs);\n    from_json(j, *this);\n\n    ifs.close();\n\n#ifndef NDEBUG\n    // check file content at Debug\n    CheckLanguagePack();\n#endif\n}\n\nLanguagePack::LanguagePack(int resourceId, const std::wstring &resourceType) {\n\n    std::vector<char> jsonData = LoadCustomFileFromResource(resourceId, resourceType);\n    jsonData.push_back('\\0');\n\n    nlohmann::json j = nlohmann::json::parse(jsonData.data());\n\n    from_json(j, *this);\n\n#ifndef NDEBUG\n    // check file content at Debug\n    CheckLanguagePack();\n#endif\n}\n\nconst std::string &LanguagePack::GetString(v0_2::StringId sid) const {\n    return data.at(static_cast<int>(sid));\n}\n\nvoid LanguagePack::CheckLanguagePack() {\n    if (version != StringIdVersion) {\n        throw std::runtime_error(\"unsupported language file version: \" + version);\n    }\n    for (auto [begin, end] : v0_2::STRING_ID_RANGES) {\n        for (int i = begin + 1; i < end; ++i) {\n            v0_2::StringId sid = static_cast<v0_2::StringId>(i);\n            bool found = data.find(static_cast<int>(sid)) != data.end();\n            if (!found) {\n                throw std::runtime_error(\"Error at language pack of \" + language +\n                                         \"\\r\\ninvalid language pack: lack of id of \" + std::to_string(i));\n            }\n        }\n    }\n}\n\n} // namespace internal"
  },
  {
    "path": "src/Translator/internal/Language.h",
    "content": "#pragma once\n\n#include \"Translator/StringId.h\"\n\n// third party\n#include <nlohmann/json.hpp>\n\n// standard\n#include <map>\n#include <functional>\n\nnamespace internal {\n\nstruct LanguagePack {\n    std::string language;\n    int langId;\n    std::string author;\n    std::string version;\n    std::string date;\n    std::unordered_map<int, std::string> data;\n\n    /**\n     * @exception json解析失败抛出异常\n     */\n    LanguagePack(const std::wstring &filename);\n\n    LanguagePack(int resourceId, const std::wstring &resourceType);\n\n    const std::string &GetString(v0_2::StringId sid) const;\n\n    /**\n     * 校验语言包。检查是否所有的StringId都有对应的字段。\n     * @exception std::runtime_error 校验失败抛出异常。\n     */\n    void CheckLanguagePack();\n};\n\nNLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(LanguagePack, language, langId, author, version, date, data)\n\n} // namespace internal"
  },
  {
    "path": "tests/CMakeLists.txt",
    "content": "find_package(GTest CONFIG REQUIRED)\n\n# === CoreUnitTest ===\nfile(GLOB TEST_CODE\n\t*.h\n\t*.cpp\n)\n\nadd_executable(CoreUnitTest ${TEST_CODE})\n\ntarget_link_libraries(CoreUnitTest\n\tPRIVATE\n\tGTest::gtest_main\n\tCore\n)\n\n# ===========================================\nset(SmartCharsetConverter_TEST_DIR u8\\\"${PROJECT_SOURCE_DIR}/sample\\\")\nconfigure_file(config.h.in config.h @ONLY)\ntarget_include_directories(CoreUnitTest PRIVATE \"${CMAKE_CURRENT_BINARY_DIR}\")\n\n# ===========================================\ninclude(GoogleTest)\ngtest_discover_tests(CoreUnitTest)\n"
  },
  {
    "path": "tests/Core_Vietnamese_test.cpp",
    "content": "#include \"config.h\"\n\n#include \"Core/Core.h\"\n\n#include <Common/FileFunction.h>\n#include <Common/ConsoleSettings.h>\n\n#include <gtest/gtest.h>\n\n#include <filesystem>\n#include <unordered_map>\n#include <random>\n\nTEST(CoreVietnamese, ConvertToUtf8) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n\n    std::string inputFilename = std::string(SmartCharsetConverter_TEST_DIR) + \"/tcvn/demo1-tcvn.txt\";\n    auto [buf, bufSize] = ReadFileToBuffer(inputFilename);\n\n    ConvertParam param;\n    param.originCode = CharsetCode::TCVN3;\n    param.targetCode = CharsetCode::UTF8;\n    param.doConvertLineBreaks = false;\n    std::string utf8Str = Convert(std::string_view(buf.get(), bufSize), param);\n    // WriteFileFromBuffer(std::string(SmartCharsetConverter_TEST_DIR) + L\"/tcvn/demo1-got.txt\", utf8Str.c_str(),\n    //                    utf8Str.size());\n\n    std::string expectFilename = std::string(SmartCharsetConverter_TEST_DIR) + \"/tcvn/demo1-utf8.txt\";\n    auto [utf8Buf, utf8BufSize] = ReadFileToBuffer(expectFilename);\n    std::string utf8ExpectStr(utf8Buf.get(), utf8BufSize);\n\n    ASSERT_EQ(utf8Str.size(), utf8BufSize);\n    ASSERT_EQ(utf8Str, utf8ExpectStr);\n}\n\nTEST(CoreVietnamese, ConvertToUtf16LE) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n\n    std::string inputFilename = std::string(SmartCharsetConverter_TEST_DIR) + \"/tcvn/demo1-tcvn.txt\";\n    auto [buf, bufSize] = ReadFileToBuffer(inputFilename);\n\n    ConvertParam param;\n    param.originCode = CharsetCode::TCVN3;\n    param.targetCode = CharsetCode::UTF16LE;\n    param.doConvertLineBreaks = false;\n    std::string ret = Convert(std::string_view(buf.get(), bufSize), param);\n    std::u16string utf16LEStr;\n    utf16LEStr.resize(ret.size() / sizeof(char16_t));\n    memcpy(utf16LEStr.data(), ret.data(), ret.size());\n\n    // WriteFileFromBuffer(std::string(SmartCharsetConverter_TEST_DIR) + L\"/tcvn/demo1-got.txt\", utf8Str.c_str(),\n    //                    utf8Str.size());\n\n    std::string expectFilename = std::string(SmartCharsetConverter_TEST_DIR) + \"/tcvn/demo1-utf16le.txt\";\n    auto [utf16LEBuf, utf16LEBufSize] = ReadFileToBuffer(expectFilename);\n    std::size_t utf16LEBufPsudoCharNums = utf16LEBufSize / sizeof(char16_t);\n    std::u16string utf16LEExpectStr(reinterpret_cast<char16_t const *>(utf16LEBuf.get()), utf16LEBufPsudoCharNums);\n\n    ASSERT_EQ(utf16LEStr.size(), utf16LEBufPsudoCharNums);\n    ASSERT_EQ(utf16LEStr, utf16LEExpectStr);\n}\n\nTEST(CoreVietnamese, ConvertFromUtf8) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n\n    std::string inputFilename = std::string(SmartCharsetConverter_TEST_DIR) + \"/tcvn/demo1-utf8.txt\";\n    auto [buf, bufSize] = ReadFileToBuffer(inputFilename);\n\n    ConvertParam param;\n    param.originCode = CharsetCode::UTF8;\n    param.targetCode = CharsetCode::TCVN3;\n    param.doConvertLineBreaks = false;\n    std::string tcvn3StrGot = Convert(std::string_view(buf.get(), bufSize), param);\n    // WriteFileFromBuffer(std::string(SmartCharsetConverter_TEST_DIR) + L\"/tcvn/demo1-got.txt\", utf8Str.c_str(),\n    //                    utf8Str.size());\n\n    std::string expectFilename = std::string(SmartCharsetConverter_TEST_DIR) + \"/tcvn/demo1-tcvn.txt\";\n    auto [tcvn3BufExpected, tcvn3BufExpectedSize] = ReadFileToBuffer(expectFilename);\n    std::string tcvn3StrExpected(tcvn3BufExpected.get(), tcvn3BufExpectedSize);\n\n    ASSERT_EQ(tcvn3StrGot.size(), tcvn3BufExpectedSize);\n    ASSERT_EQ(tcvn3StrGot, tcvn3StrExpected);\n}\n\nTEST(CoreVietnamese, ConvertFromUtf16LE) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n\n    std::string inputFilename = std::string(SmartCharsetConverter_TEST_DIR) + \"/tcvn/demo1-utf16le.txt\";\n    auto [buf, bufSize] = ReadFileToBuffer(inputFilename);\n\n    ConvertParam param;\n    param.originCode = CharsetCode::UTF16LE;\n    param.targetCode = CharsetCode::TCVN3;\n    param.doConvertLineBreaks = false;\n    std::string tcvn3StrGot = Convert(std::string_view((buf.get()), bufSize), param);\n    // WriteFileFromBuffer(std::string(SmartCharsetConverter_TEST_DIR) + L\"/tcvn/demo1-got.txt\", utf8Str.c_str(),\n    //                    utf8Str.size());\n\n    std::string expectFilename = std::string(SmartCharsetConverter_TEST_DIR) + \"/tcvn/demo1-tcvn.txt\";\n    auto [tcvn3BufExpected, tcvn3BufExpectedSize] = ReadFileToBuffer(expectFilename);\n    std::string tcvn3StrExpected(tcvn3BufExpected.get(), tcvn3BufExpectedSize);\n\n    ASSERT_EQ(tcvn3StrGot.size(), tcvn3BufExpectedSize);\n    ASSERT_EQ(tcvn3StrGot, tcvn3StrExpected);\n}\n\n/**\n * @exception file_io_error\n *            ConvertError\n */\nvoid TestBuiltinConvertOtherToOther(CharsetCode middleEncoding) {\n\n    std::string inputFilename = std::string(SmartCharsetConverter_TEST_DIR) + \"/tcvn/demo1-tcvn.txt\";\n    auto [buf, bufSize] = ReadFileToBuffer(inputFilename);\n\n    std::string vniStr;\n\n    ConvertParam param;\n    param.originCode = CharsetCode::TCVN3;\n    param.targetCode = middleEncoding;\n    param.doConvertLineBreaks = false;\n    EXPECT_NO_THROW(vniStr = Convert(std::string_view(buf.get(), bufSize), param));\n\n    std::string tcvnStrGot;\n    param.originCode = middleEncoding;\n    param.targetCode = CharsetCode::TCVN3;\n    EXPECT_NO_THROW(tcvnStrGot = Convert(vniStr, param));\n\n    EXPECT_EQ(bufSize, tcvnStrGot.size());\n    EXPECT_EQ(std::string(buf.get(), bufSize), tcvnStrGot);\n}\n\nTEST(CoreVietnamese, ConvertOtherToOther) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n\n    TestBuiltinConvertOtherToOther(CharsetCode::VNI);\n    TestBuiltinConvertOtherToOther(CharsetCode::VPS);\n    TestBuiltinConvertOtherToOther(CharsetCode::VISCII);\n}\n"
  },
  {
    "path": "tests/Core_test.cpp",
    "content": "#include \"config.h\"\n\n#include \"memory_leak_detection.h\"\n#include \"Helper.h\"\n\n#include <Core/Core.h>\n#include <Core/Detect.h>\n#include <Common/FileFunction.h>\n#include <Common/ConsoleSettings.h>\n\n#include <gtest/gtest.h>\n\n#include <filesystem>\n#include <unordered_map>\n#include <regex>\n\nTEST(Core, EncodeWithUnassignedChars) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n    // MemoryLeakDetection mld;\n\n    try {\n        Encode(u\"abcdefg小舟从此逝，江海寄余生。asdfghjkl\", CharsetCode::WINDOWS_1252);\n        FAIL();\n    } catch (const UnassignedCharError &err) {\n        ASSERT_EQ(err.GetUnassignedChar(), std::string(u8\"小舟从此逝，江海寄余生。\"));\n    }\n}\n\nTEST(Core, DetectEncodingMulti) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n\n    auto table =\n        helper::ScanDirectoryForExpectedEncodingTable(std::string(SmartCharsetConverter_TEST_DIR) + \"/expect_pass\");\n\n    CoreInitOption opt;\n    Core core(\"temp.json\", opt);\n\n    for (auto [filename, expectedEncoding] : table) {\n        auto [buf, len] = ReadFileToBuffer(filename);\n        auto charsetCode = DetectEncoding(core.GetUCharDet().get(), buf.get(), len);\n\n        if (charsetCode == expectedEncoding) {\n            continue;\n        }\n        std::cout << std::string(20, '=') << std::endl;\n        std::cout << \"file: \" << filename << std::endl;\n        std::cout << \"detect: \" << ToViewCharsetName(charsetCode) << std::endl;\n        std::cout << \"expected: \" << ToViewCharsetName(expectedEncoding) << std::endl;\n        std::cout << std::endl;\n        EXPECT_EQ(charsetCode, expectedEncoding);\n\n        SetConsoleColor();\n    }\n}\n"
  },
  {
    "path": "tests/Helper.cpp",
    "content": "#include \"Helper.h\"\n\n#include <Core/CharsetCode.h>\n\n#include <fmt/format.h>\n\n#include <filesystem>\n#include <regex>\n\nnamespace helper {\n\n/**\n * scan directory for get the pairs of \"filename\" and \"expected encoding\".\n * @param pattern the pattern to tell regular expression engine how to get the encoding name from stem of file name.\n *          for example: for the file name \"[UTF-8]test.txt\", its stem is \"[UTF-8]test\", the pattern could be\n *          R\"(\\[([\\S]+)\\].*)\" to catch the encoding part \"UTF-8\".\n */\nstd::unordered_map<std::string, CharsetCode> ScanDirectoryForExpectedEncodingTable(const std::string &dir,\n                                                                                   const std::string &pattern) {\n\n    std::unordered_map<std::string, CharsetCode> table; // filename, expect encoding\n    std::regex r(pattern);\n    for (auto path : std::filesystem::recursive_directory_iterator(std::filesystem::u8path(dir))) {\n        if (path.is_directory()) {\n            continue;\n        }\n\n        std::string stem = path.path().stem().u8string();\n        std::smatch ret;\n        bool ok = std::regex_match(stem, ret, r);\n        if (!ok) {\n            throw std::runtime_error(\n                fmt::format(\"encoding description not found in filename: {}\\nbasename should match this pattern {}\",\n                            path.path().string(), pattern));\n        }\n        table[path.path().u8string()] = ToCharsetCode(ret[1]);\n    }\n    return table;\n}\n\n} // namespace helper"
  },
  {
    "path": "tests/Helper.h",
    "content": "#pragma once\n\n#include <Core/CharsetCode.h>\n\n#include <unordered_map>\n#include <string>\n\nnamespace helper {\n\n/**\n * scan directory for get the pairs of \"filename\" and \"expected encoding\".\n * @param pattern the pattern of encoding. typical example: for the file name \"[UTF-8]test.txt\", the pattern should be\n * R\"(\\[([\\S]+)\\].*)\"\n */\nstd::unordered_map<std::string, CharsetCode>\nScanDirectoryForExpectedEncodingTable(const std::string &dir, const std::string &pattern = R\"(\\[([\\S]+)\\].*)\");\n\n} // namespace helper"
  },
  {
    "path": "tests/LineBreaks_test.cpp",
    "content": "#include \"config.h\"\n\n#include <Core/LineBreaks.h>\n\n#include <gtest/gtest.h>\n\nTEST(LineBreaks, LineBreaks) {\n    std::u16string ws;\n\n    ws = u\"\\r\";\n    ASSERT_EQ(GetLineBreaks(ws.c_str(), ws.length()), LineBreaks::CR);\n    ws = u\"\\r\\r\";\n    ASSERT_EQ(GetLineBreaks(ws.c_str(), ws.length()), LineBreaks::CR);\n    ws = u\"\\r00\\r\";\n    ASSERT_EQ(GetLineBreaks(ws.c_str(), ws.length()), LineBreaks::CR);\n    ws = u\"\\r\\r\\n\";\n    ASSERT_EQ(GetLineBreaks(ws.c_str(), ws.length()), LineBreaks::MIX);\n\n    ws = u\"\\n\";\n    ASSERT_EQ(GetLineBreaks(ws.c_str(), ws.length()), LineBreaks::LF);\n    ws = u\"\\n\\r\";\n    ASSERT_EQ(GetLineBreaks(ws.c_str(), ws.length()), LineBreaks::MIX);\n    ws = u\"\\n\\n\";\n    ASSERT_EQ(GetLineBreaks(ws.c_str(), ws.length()), LineBreaks::LF);\n    ws = u\"\\n\\n\\r\";\n    ASSERT_EQ(GetLineBreaks(ws.c_str(), ws.length()), LineBreaks::MIX);\n\n    ws = u\"\\r\\n\";\n    ASSERT_EQ(GetLineBreaks(ws.c_str(), ws.length()), LineBreaks::CRLF);\n    ws = u\"\\r\\n\\n\";\n    ASSERT_EQ(GetLineBreaks(ws.c_str(), ws.length()), LineBreaks::MIX);\n    ws = u\"\\r\\n\\r\";\n    ASSERT_EQ(GetLineBreaks(ws.c_str(), ws.length()), LineBreaks::MIX);\n\n    ws = u\"\\n\\r\";\n    ASSERT_EQ(GetLineBreaks(ws.c_str(), ws.length()), LineBreaks::MIX);\n}"
  },
  {
    "path": "tests/String_test.cpp",
    "content": "#include \"config.h\"\n\n#include <Common/tstring.h>\n\n#include <gtest/gtest.h>\n\nTEST(Split, Split) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n\n    struct Sample {\n        std::string input;\n        std::string sep;\n        std::vector<std::string_view> expect;\n    };\n\n    std::vector<Sample> samples = {\n        Sample{u8\"\", u8\" \", std::vector<std::string_view>{}},\n        Sample{u8\"a\", u8\" \", std::vector<std::string_view>{u8\"a\"}},\n        Sample{u8\"  a  \", u8\" \", std::vector<std::string_view>{u8\"a\"}},\n        Sample{u8\"  a\", u8\" \", std::vector<std::string_view>{u8\"a\"}},\n        Sample{u8\"a  \", u8\" \", std::vector<std::string_view>{u8\"a\"}},\n        Sample{u8\"a b c\", u8\" \", std::vector<std::string_view>{u8\"a\", u8\"b\", u8\"c\"}},\n        Sample{u8\" a b c\", u8\" \", std::vector<std::string_view>{u8\"a\", u8\"b\", u8\"c\"}},\n        Sample{u8\"a b c \", u8\" \", std::vector<std::string_view>{u8\"a\", u8\"b\", u8\"c\"}},\n        Sample{u8\" a b c \", u8\" \", std::vector<std::string_view>{u8\"a\", u8\"b\", u8\"c\"}},\n        Sample{u8\"a\\tb c\\t\", u8\" \\t\", std::vector<std::string_view>{u8\"a\", u8\"b\", u8\"c\"}},\n    };\n\n    for (auto &sample : samples) {\n        ASSERT_EQ(Split(sample.input, sample.sep), sample.expect);\n    }\n}"
  },
  {
    "path": "tests/Vietnamese_test.cpp",
    "content": "#include \"config.h\"\n\n#include \"Core/Vietnamese.h\"\n\n#include <Common/FileFunction.h>\n#include <Common/ConsoleSettings.h>\n\n#include <gtest/gtest.h>\n\n#include <filesystem>\n#include <unordered_map>\n#include <random>\n\nTEST(Vietnamese, CheckEncoding) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n    viet::Init();\n\n    std::string inputFilename = std::string(SmartCharsetConverter_TEST_DIR) + u8\"/tcvn/demo1-tcvn.txt\";\n\n    auto [buf, bufSize] = ReadFileToBuffer(inputFilename);\n\n    EXPECT_FALSE(viet::CheckEncoding(buf.get(), bufSize, viet::Encoding::VNI));\n    EXPECT_FALSE(viet::CheckEncoding(buf.get(), bufSize, viet::Encoding::VPS));\n    EXPECT_TRUE(viet::CheckEncoding(buf.get(), bufSize, viet::Encoding::VISCII));\n    EXPECT_TRUE(viet::CheckEncoding(buf.get(), bufSize, viet::Encoding::TCVN3));\n}\n\nTEST(Vietnamese, BuiltinConvertToUtf8) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n    viet::Init();\n\n    std::string inputFilename = std::string(SmartCharsetConverter_TEST_DIR) + u8\"/tcvn/demo1-tcvn.txt\";\n    auto [buf, bufSize] = ReadFileToBuffer(inputFilename);\n    std::string utf8Str = viet::ConvertToUtf8(std::string_view(buf.get(), bufSize), viet::Encoding::TCVN3);\n    // WriteFileFromBuffer(utf8_to_wstring(SmartCharsetConverter_TEST_DIR) + u8\"/tcvn/demo1-got.txt\", utf8Str.c_str(),\n    //                    utf8Str.size());\n\n    std::string expectFilename = std::string(SmartCharsetConverter_TEST_DIR) + u8\"/tcvn/demo1-utf8.txt\";\n    auto [utf8Buf, utf8BufSize] = ReadFileToBuffer(expectFilename);\n    std::string utf8ExpectStr(utf8Buf.get(), utf8BufSize);\n\n    ASSERT_EQ(utf8Str.size(), utf8BufSize);\n    ASSERT_EQ(utf8Str, utf8ExpectStr);\n}\n\nTEST(Vietnamese, BuiltinConvertToUtf16LE) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n    viet::Init();\n\n    std::string inputFilename = std::string(SmartCharsetConverter_TEST_DIR) + u8\"/tcvn/demo1-tcvn.txt\";\n    auto [buf, bufSize] = ReadFileToBuffer(inputFilename);\n    std::u16string utf16LEStr = viet::ConvertToUtf16LE(std::string_view(buf.get(), bufSize), viet::Encoding::TCVN3);\n    // WriteFileFromBuffer(utf8_to_wstring(SmartCharsetConverter_TEST_DIR) + u8\"/tcvn/demo1-got.txt\", utf8Str.c_str(),\n    //                    utf8Str.size());\n\n    std::string expectFilename = std::string(SmartCharsetConverter_TEST_DIR) + u8\"/tcvn/demo1-utf16le.txt\";\n    auto [utf16LEBuf, utf16LEBufSize] = ReadFileToBuffer(expectFilename);\n    std::size_t utf16LEBufPsudoCharNums = utf16LEBufSize / sizeof(char16_t);\n    std::u16string utf16LEExpectStr(reinterpret_cast<char16_t const *>(utf16LEBuf.get()), utf16LEBufPsudoCharNums);\n\n    ASSERT_EQ(utf16LEStr.size(), utf16LEBufPsudoCharNums);\n    ASSERT_EQ(utf16LEStr, utf16LEExpectStr);\n}\n\nTEST(Vietnamese, BuiltinConvertFromUtf8) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n    viet::Init();\n\n    std::string inputFilename = std::string(SmartCharsetConverter_TEST_DIR) + u8\"/tcvn/demo1-utf8.txt\";\n    auto [buf, bufSize] = ReadFileToBuffer(inputFilename);\n    std::string tcvn3StrGot = viet::ConvertFromUtf8(std::string_view(buf.get(), bufSize), viet::Encoding::TCVN3);\n    // WriteFileFromBuffer(utf8_to_wstring(SmartCharsetConverter_TEST_DIR) + u8\"/tcvn/demo1-got.txt\", utf8Str.c_str(),\n    //                    utf8Str.size());\n\n    std::string expectFilename = std::string(SmartCharsetConverter_TEST_DIR) + u8\"/tcvn/demo1-tcvn.txt\";\n    auto [tcvn3BufExpected, tcvn3BufExpectedSize] = ReadFileToBuffer(expectFilename);\n    std::string tcvn3StrExpected(tcvn3BufExpected.get(), tcvn3BufExpectedSize);\n\n    ASSERT_EQ(tcvn3StrGot.size(), tcvn3BufExpectedSize);\n    ASSERT_EQ(tcvn3StrGot, tcvn3StrExpected);\n}\n\nTEST(Vietnamese, BuiltinConvertFromUtf16LE) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n    viet::Init();\n\n    std::string inputFilename = std::string(SmartCharsetConverter_TEST_DIR) + u8\"/tcvn/demo1-utf16le.txt\";\n    auto [buf, bufSize] = ReadFileToBuffer(inputFilename);\n    std::string tcvn3StrGot = viet::ConvertFromUtf16LE(\n        std::u16string_view(reinterpret_cast<const char16_t *>(buf.get()), bufSize / sizeof(char16_t)),\n        viet::Encoding::TCVN3);\n    // WriteFileFromBuffer(utf8_to_wstring(SmartCharsetConverter_TEST_DIR) + u8\"/tcvn/demo1-got.txt\", utf8Str.c_str(),\n    //                    utf8Str.size());\n\n    std::string expectFilename = std::string(SmartCharsetConverter_TEST_DIR) + u8\"/tcvn/demo1-tcvn.txt\";\n    auto [tcvn3BufExpected, tcvn3BufExpectedSize] = ReadFileToBuffer(expectFilename);\n    std::string tcvn3StrExpected(tcvn3BufExpected.get(), tcvn3BufExpectedSize);\n\n    ASSERT_EQ(tcvn3StrGot.size(), tcvn3BufExpectedSize);\n    ASSERT_EQ(tcvn3StrGot, tcvn3StrExpected);\n}\n\n/**\n * @exception file_io_error\n *            ConvertError\n */\nvoid TestBuiltinConvertOtherToOther(viet::Encoding middleEncoding) {\n    viet::Init();\n\n    std::string inputFilename = std::string(SmartCharsetConverter_TEST_DIR) + u8\"/tcvn/demo1-tcvn.txt\";\n    auto [buf, bufSize] = ReadFileToBuffer(inputFilename);\n\n    std::string vniStr;\n    EXPECT_NO_THROW(vniStr =\n                        viet::Convert(std::string_view(buf.get(), bufSize), viet::Encoding::TCVN3, middleEncoding));\n    std::string tcvnStrGot;\n    EXPECT_NO_THROW(tcvnStrGot = viet::Convert(vniStr, middleEncoding, viet::Encoding::TCVN3));\n\n    EXPECT_EQ(bufSize, tcvnStrGot.size());\n    EXPECT_EQ(std::string(buf.get(), bufSize), tcvnStrGot);\n}\n\nTEST(Vietnamese, BuiltinConvertOtherToOther) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n\n    TestBuiltinConvertOtherToOther(viet::Encoding::VNI);\n    TestBuiltinConvertOtherToOther(viet::Encoding::VPS);\n    TestBuiltinConvertOtherToOther(viet::Encoding::VISCII);\n}\n\nTEST(Vietnamese, ConvertFuzz) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n    viet::Init();\n\n    const int count = 1024;\n    std::string randUtf8Str;\n    std::default_random_engine eng(\n        static_cast<unsigned char>(std::chrono::high_resolution_clock::now().time_since_epoch().count()));\n    std::uniform_int_distribution<int> unif(0, viet::internal::TABLE_LENGTH - 1);\n    for (int i = 0; i < count; ++i) {\n        int index = unif(eng);\n        randUtf8Str += viet::internal::utf8Table[index];\n    }\n\n    {\n        std::string dialect = viet::ConvertFromUtf8(randUtf8Str, viet::Encoding::VNI);\n        std::string gotUtf8 = viet::ConvertToUtf8(dialect, viet::Encoding::VNI);\n        EXPECT_EQ(gotUtf8, randUtf8Str);\n    }\n    {\n        std::string dialect = viet::ConvertFromUtf8(randUtf8Str, viet::Encoding::VPS);\n        std::string gotUtf8 = viet::ConvertToUtf8(dialect, viet::Encoding::VPS);\n        EXPECT_EQ(gotUtf8, randUtf8Str);\n    }\n    {\n        std::string dialect = viet::ConvertFromUtf8(randUtf8Str, viet::Encoding::VISCII);\n        std::string gotUtf8 = viet::ConvertToUtf8(dialect, viet::Encoding::VISCII);\n        EXPECT_EQ(gotUtf8, randUtf8Str);\n    }\n\n    // TCVN3比较特殊，不能用上面的方法来测试。原因是TCVN3的映射表虽然有2字节的，但TCVN3并不是一个多字节字符集(MBCS)。\n    // 所以，这里构造TCVN3的测试方法为：构造由随机的单字节TCVN3字符组成的字符串，再和UTF8互转。\n    {\n        std::string randTCVN3;\n        std::uniform_int_distribution<int> unifASCII(32, 126);\n        for (int i = 0; i < count; ++i) {\n            int rn = unif(eng);\n            if (rn % 2) {\n                randTCVN3 += static_cast<char>(unifASCII(eng));\n            } else {\n                while (1) {\n                    auto &tcvn3Word = viet::internal::tcvn3Table[rn];\n                    if (tcvn3Word.size() == 1) {\n                        randTCVN3 += tcvn3Word;\n                        break;\n                    }\n\n                    rn = unif(eng);\n                }\n            }\n        }\n\n        std::string middleUtf8 = viet::ConvertToUtf8(randTCVN3, viet::Encoding::TCVN3);\n        std::string gotTCVN3 = viet::ConvertFromUtf8(middleUtf8, viet::Encoding::TCVN3);\n        EXPECT_EQ(gotTCVN3, randTCVN3);\n    }\n}\n\nTEST(Vietnamese, ConvertWithUTF16LEFuzz) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n    viet::Init();\n\n    const int count = 1024;\n    std::u16string randUtf16LEStr;\n    std::default_random_engine eng(\n        static_cast<unsigned char>(std::chrono::high_resolution_clock::now().time_since_epoch().count()));\n    std::uniform_int_distribution<int> unif(0, viet::internal::TABLE_LENGTH - 1);\n    for (int i = 0; i < count; ++i) {\n        int index = unif(eng);\n        randUtf16LEStr += viet::internal::utf16LETable[index];\n    }\n\n    {\n        std::string dialect = viet::ConvertFromUtf16LE(randUtf16LEStr, viet::Encoding::VNI);\n        std::u16string gotUtf16LE = viet::ConvertToUtf16LE(dialect, viet::Encoding::VNI);\n        EXPECT_EQ(gotUtf16LE, randUtf16LEStr);\n    }\n    {\n        std::string dialect = viet::ConvertFromUtf16LE(randUtf16LEStr, viet::Encoding::VPS);\n        std::u16string gotUtf16LE = viet::ConvertToUtf16LE(dialect, viet::Encoding::VPS);\n        EXPECT_EQ(gotUtf16LE, randUtf16LEStr);\n    }\n    {\n        std::string dialect = viet::ConvertFromUtf16LE(randUtf16LEStr, viet::Encoding::VISCII);\n        std::u16string gotUtf16LE = viet::ConvertToUtf16LE(dialect, viet::Encoding::VISCII);\n        EXPECT_EQ(gotUtf16LE, randUtf16LEStr);\n    }\n\n    // TCVN3比较特殊，不能用上面的方法来测试。原因是TCVN3的映射表虽然有2字节的，但TCVN3并不是一个多字节字符集(MBCS)。\n    // 所以，这里构造TCVN3的测试方法为：构造由随机的单字节TCVN3字符组成的字符串，再和UTF8互转。\n    {\n        std::string randTCVN3;\n        std::uniform_int_distribution<int> unifASCII(32, 126);\n        for (int i = 0; i < count; ++i) {\n            int rn = unif(eng);\n            if (rn % 2) {\n                randTCVN3 += static_cast<char>(unifASCII(eng));\n            } else {\n                while (1) {\n                    auto &tcvn3Word = viet::internal::tcvn3Table[rn];\n                    if (tcvn3Word.size() == 1) {\n                        randTCVN3 += tcvn3Word;\n                        break;\n                    }\n\n                    rn = unif(eng);\n                }\n            }\n        }\n\n        std::u16string middleUtf16LE = viet::ConvertToUtf16LE(randTCVN3, viet::Encoding::TCVN3);\n        std::string gotTCVN3 = viet::ConvertFromUtf16LE(middleUtf16LE, viet::Encoding::TCVN3);\n        EXPECT_EQ(gotTCVN3, randTCVN3);\n    }\n}"
  },
  {
    "path": "tests/config.h.in",
    "content": "#cmakedefine SmartCharsetConverter_TEST_DIR @SmartCharsetConverter_TEST_DIR@"
  },
  {
    "path": "tests/icu_test.cpp",
    "content": "#include \"config.h\"\n\n#include \"memory_leak_detection.h\"\n\n#include <Core/Core.h>\n#include <Core/Detect.h>\n#include <Common/FileFunction.h>\n#include <Common/ConsoleSettings.h>\n\n#include <gtest/gtest.h>\n\n#include <filesystem>\n#include <unordered_map>\n\nTEST(Core, icu) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n\n    std::unordered_set<std::string> icuEncodings;\n\n    UErrorCode err;\n    UEnumeration *allNames = ucnv_openAllNames(&err);\n    while (1) {\n        auto name = uenum_next(allNames, nullptr, &err);\n        if (name == nullptr) {\n            break;\n        }\n        icuEncodings.insert(name);\n        std::cout << name << std::endl;\n    }\n\n    std::vector<std::string> noICUNames;\n    std::vector<std::runtime_error> errors;\n\n    for (int i = static_cast<int>(CharsetCode::UTF8); i < static_cast<int>(CharsetCode::CHARSET_CODE_END); i++) {\n        CharsetCode code = static_cast<CharsetCode>(i);\n\n        if (GetConvertEngine(code) != ConvertEngine::ICU) {\n            continue;\n        }\n\n        std::string icuName = ToICUCharsetName(code);\n        if (icuEncodings.count(icuName) == 0) {\n            std::cout << \"Encoding \\\"\" << icuName << \"\\\" not found in icu supported name\\n\";\n\n            try {\n                Encode(u\"abcdefg\", code);\n            } catch (const std::runtime_error &err) {\n                std::cerr << err.what() << std::endl;\n                errors.push_back(err);\n            }\n        }\n    }\n\n    ASSERT_TRUE(errors.empty());\n}"
  },
  {
    "path": "tests/memory_leak_detection.h",
    "content": "#pragma once\n\n#ifdef WIN32\n#include \"memory_leak_detection_win.h\"\n#else\nclass MemoryLeakDetection final {\npublic:\n    MemoryLeakDetection() {}\n};\n#endif\n"
  },
  {
    "path": "tests/memory_leak_detection_win.h",
    "content": "#pragma once\n\n#ifdef WIN32\n\n#include <windows.h>\n\n#undef max\n#undef min\n\n#define _CRTDBG_MAP_ALLOC // to get more details\n#include <stdlib.h>\n#include <crtdbg.h> //for malloc and free\n\n#include <gtest/gtest.h>\n\n#include <iostream>\n#include <cassert>\n\nclass MemoryLeakDetection final {\npublic:\n    MemoryLeakDetection() {\n        _CrtMemCheckpoint(&sOld); // take a snapshot\n    }\n\n    ~MemoryLeakDetection() {\n        _CrtMemCheckpoint(&sNew);                    // take a snapshot\n        if (_CrtMemDifference(&sDiff, &sOld, &sNew)) // if there is a difference\n        {\n            // OutputDebugString(TEXT(\"-----------_CrtMemDumpStatistics ---------\"));\n            //_CrtMemDumpStatistics(&sDiff);\n            // OutputDebugString(TEXT(\"-----------_CrtMemDumpAllObjectsSince ---------\"));\n            //_CrtMemDumpAllObjectsSince(&sOld);\n            // OutputDebugString(TEXT(\"-----------_CrtDumpMemoryLeaks ---------\"));\n            _CrtDumpMemoryLeaks();\n\n            EXPECT_TRUE(0 && \"Memory leak is detected! See debug output for detail.\");\n        }\n    }\n\n    void SetBreakAlloc(long index) const noexcept {\n        (index);\n        _CrtSetBreakAlloc(index);\n    }\n\nprivate:\n    _CrtMemState sOld;\n    _CrtMemState sNew;\n    _CrtMemState sDiff;\n};\n\n#endif"
  },
  {
    "path": "tests/uchardet_samples_test.cpp",
    "content": "#include \"config.h\"\n\n#include \"memory_leak_detection.h\"\n#include \"Helper.h\"\n\n#include <Core/Core.h>\n#include <Core/Detect.h>\n#include <Common/FileFunction.h>\n#include <Common/ConsoleSettings.h>\n\n#include <gtest/gtest.h>\n\n#include <filesystem>\n#include <unordered_map>\n\nTEST(Core, uchardet_sample_test) {\n    SetConsoleOutputCP(65001); // 设置代码页为UTF-8\n\n    const std::string uchardetSampleDir = std::string(SmartCharsetConverter_TEST_DIR) + \"/uchardet_test_samples\";\n    auto table = helper::ScanDirectoryForExpectedEncodingTable(uchardetSampleDir, R\"((.*))\");\n    auto expectPassTable =\n        helper::ScanDirectoryForExpectedEncodingTable(std::string(SmartCharsetConverter_TEST_DIR) + \"/expect_pass\");\n    auto notPassYetTable =\n        helper::ScanDirectoryForExpectedEncodingTable(std::string(SmartCharsetConverter_TEST_DIR) + \"/not_pass_yet\");\n    table.merge(std::move(expectPassTable));\n    table.merge(std::move(notPassYetTable));\n\n    CoreInitOption opt;\n    Core core(u8\"temp.json\", opt);\n\n    int passed = 0;\n    for (auto [filename, expectedEncoding] : table) {\n        auto [buf, len] = ReadFileToBuffer(filename);\n        auto charsetCode = DetectEncoding(core.GetUCharDet().get(), buf.get(), len);\n\n        if (charsetCode == expectedEncoding) {\n            passed++;\n            continue;\n        }\n\n        std::cout << std::string(20, '=') << std::endl;\n        std::cout << \"file: \" << filename << std::endl;\n        std::cout << \"detect: \" << ToViewCharsetName(charsetCode) << std::endl;\n        std::cout << \"expected: \" << ToViewCharsetName(expectedEncoding) << std::endl;\n        std::cout << std::endl;\n\n        // EXPECT_EQ(charsetCode, expectedEncoding);  // not pass now\n    }\n\n    double rate = static_cast<double>(passed) / static_cast<double>(table.size());\n    std::cout << \"PASSED: \" << rate * 100.0 << \"% \\n\";\n\n    // any changes to charset detection should increase this rate, not decrease it\n    ASSERT_TRUE(rate > 0.337);\n}"
  },
  {
    "path": "third_party/CMakeLists.txt",
    "content": "# === CED ===\n# 添加ced库\nset(CED_ROOT \"ced\")\nset(CED_LIBRARY_SOURCES\n    ${CED_ROOT}/compact_enc_det/compact_enc_det.cc\n    ${CED_ROOT}/compact_enc_det/compact_enc_det_hint_code.cc\n    ${CED_ROOT}/util/encodings/encodings.cc\n    ${CED_ROOT}/util/languages/languages.cc\n)\n\nadd_library(ced STATIC ${CED_LIBRARY_SOURCES})\n\ntarget_include_directories(ced PUBLIC ${CED_ROOT})\ntarget_compile_options(ced PRIVATE -W0)\n\n# =====================================\nadd_subdirectory(uchardet/uchardet)\ntarget_compile_options(libuchardet_static PRIVATE -W0)\n\nadd_subdirectory(guicon)"
  },
  {
    "path": "third_party/WTL/Include/atlapp.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLAPP_H__\n#define __ATLAPP_H__\n\n#pragma once\n\n#ifndef __cplusplus\n\t#error WTL requires C++ compilation (use a .cpp suffix)\n#endif\n\n#ifndef __ATLBASE_H__\n\t#error atlapp.h requires atlbase.h to be included first\n#endif\n\n#ifdef _WIN32_WCE\n\t#error WTL10 doesn't support Windows CE\n#endif\n\n#ifdef _ATL_NO_COMMODULE\n\t#error WTL doesn't support _ATL_NO_COMMODULE\n#endif\n\n#ifdef _ATL_NO_WIN_SUPPORT\n\t#error WTL doesn't support _ATL_NO_WIN_SUPPORT\n#endif\n\n#if (_MSC_VER < 1400)\n\t#error WTL10 requires C++ compiler version 14 (Visual C++ 2005) or higher\n#endif\n\n#if (WINVER < 0x0501)\n\t#error WTL requires WINVER >= 0x0501\n#endif\n\n#if (_WIN32_WINNT < 0x0501)\n\t#error WTL requires _WIN32_WINNT >= 0x0501\n#endif\n\n#if (_WIN32_IE < 0x0600)\n\t#error WTL requires _WIN32_IE >= 0x0600\n#endif\n\n#if (_ATL_VER < 0x0800)\n\t#error WTL10 requires ATL version 8 or higher\n#endif\n\n#ifdef _ATL_MIN_CRT\n\t#error WTL10 doesn't support _ATL_MIN_CRT\n#endif\n\n#ifdef _ATL_NO_MSIMG\n\t#error WTL10 doesn't support _ATL_NO_MSIMG\n#endif\n\n#include <limits.h>\n#ifdef _MT\n  #include <process.h>\t// for _beginthreadex\n#endif\n\n#include <commctrl.h>\n#pragma comment(lib, \"comctl32.lib\")\n\n#include <commdlg.h>\n#include <shellapi.h>\n\n// Check for VS2005 without newer WinSDK\n#if (_MSC_VER == 1400) && !defined(RB_GETEXTENDEDSTYLE)\n\t#error WTL10 requires WinSDK 6.0 ot higher\n#endif\n\n#include <uxtheme.h>\n#pragma comment(lib, \"uxtheme.lib\")\n\n#if defined(_SYSINFOAPI_H_) && defined(NOT_BUILD_WINDOWS_DEPRECATE)\n  #include <VersionHelpers.h>\n#endif\n\n#include \"atlres.h\"\n\n\n///////////////////////////////////////////////////////////////////////////////\n// WTL version number\n\n#define _WTL_VER\t0x1000   // version 10.0\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CMessageFilter\n// CIdleHandler\n// CMessageLoop\n//\n// CAppModule\n// CServerAppModule\n//\n// Global functions:\n//   AtlInitCommonControls()\n//   AtlGetDefaultGuiFont()\n//   AtlCreateControlFont()\n//   AtlCreateBoldFont()\n//   AtlGetStringPtr()\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Miscellaneous global support\n\n// define useful macros from winuser.h\n#ifndef IS_INTRESOURCE\n  #define IS_INTRESOURCE(_r) (((ULONG_PTR)(_r) >> 16) == 0)\n#endif // IS_INTRESOURCE\n\n// protect template members from windowsx.h macros\n#ifdef _INC_WINDOWSX\n  #undef SubclassWindow\n#endif // _INC_WINDOWSX\n\n// define useful macros from windowsx.h\n#ifndef GET_X_LPARAM\n  #define GET_X_LPARAM(lParam)\t((int)(short)LOWORD(lParam))\n#endif\n#ifndef GET_Y_LPARAM\n  #define GET_Y_LPARAM(lParam)\t((int)(short)HIWORD(lParam))\n#endif\n\n// Dummy structs for compiling with /CLR\n#ifdef _MANAGED\n  __if_not_exists(_IMAGELIST::_IMAGELIST) { struct _IMAGELIST { }; }\n  __if_not_exists(_TREEITEM::_TREEITEM) { struct _TREEITEM { }; }\n  __if_not_exists(_PSP::_PSP) { struct _PSP { }; }\n#endif\n\n// Forward declaration for ATL11 fix\n#if (_ATL_VER >= 0x0B00)\n  namespace ATL { HRESULT AtlGetCommCtrlVersion(LPDWORD pdwMajor, LPDWORD pdwMinor); }\n#endif\n\n#ifndef WM_MOUSEHWHEEL\n  #define WM_MOUSEHWHEEL                  0x020E\n#endif\n\n// Used for stack allocations with ATL::CTempBuffer\n#ifndef _WTL_STACK_ALLOC_THRESHOLD\n  #define _WTL_STACK_ALLOC_THRESHOLD   512\n#endif\n\n\nnamespace WTL\n{\n\nDECLARE_TRACE_CATEGORY(atlTraceUI)\n#ifdef _DEBUG\n  __declspec(selectany) ATL::CTraceCategory atlTraceUI(_T(\"atlTraceUI\"));\n#endif // _DEBUG\n\n// Common Controls initialization helper\ninline BOOL AtlInitCommonControls(DWORD dwFlags)\n{\n\tINITCOMMONCONTROLSEX iccx = { sizeof(INITCOMMONCONTROLSEX), dwFlags };\n\tBOOL bRet = ::InitCommonControlsEx(&iccx);\n\tATLASSERT(bRet);\n\treturn bRet;\n}\n\n// Default GUI font helper - \"MS Shell Dlg\" stock font\ninline HFONT AtlGetDefaultGuiFont()\n{\n\treturn (HFONT)::GetStockObject(DEFAULT_GUI_FONT);\n}\n\n// Control font helper - default font for controls not in a dialog\n// (NOTE: Caller owns the font, and should destroy it when it's no longer needed)\ninline HFONT AtlCreateControlFont()\n{\n\tLOGFONT lf = {};\n\tATLVERIFY(::SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, 0) != FALSE);\n\tHFONT hFont = ::CreateFontIndirect(&lf);\n\tATLASSERT(hFont != NULL);\n\treturn hFont;\n}\n\n// Bold font helper\n// (NOTE: Caller owns the font, and should destroy it when it's no longer needed)\ninline HFONT AtlCreateBoldFont(HFONT hFont = NULL)\n{\n\tLOGFONT lf = {};\n\tif(hFont == NULL)\n\t\tATLVERIFY(::SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, 0) != FALSE);\n\telse\n\t\tATLVERIFY(::GetObject(hFont, sizeof(LOGFONT), &lf) == sizeof(LOGFONT));\n\tlf.lfWeight = FW_BOLD;\n\tHFONT hFontBold =  ::CreateFontIndirect(&lf);\n\tATLASSERT(hFontBold != NULL);\n\treturn hFontBold;\n}\n\n// Resource string pointer\ninline LPCWSTR AtlGetStringPtr(UINT uID, int* pch = NULL)\n{\n\tLPCWSTR lpstr = NULL;\n\tint nRet = ::LoadStringW(ATL::_AtlBaseModule.GetResourceInstance(), uID, (LPWSTR)&lpstr, 0);\n\tif(pch != NULL)\n\t\t*pch = nRet;\n\treturn lpstr;\n}\n\n\n///////////////////////////////////////////////////////////////////////////////\n// RunTimeHelper - helper functions for Windows version and structure sizes\n\n#ifndef _WTL_NO_RUNTIME_STRUCT_SIZE\n\n#ifndef _SIZEOF_STRUCT\n  #define _SIZEOF_STRUCT(structname, member)  (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))\n#endif\n\n#if (_WIN32_WINNT >= 0x0600) && !defined(REBARBANDINFO_V6_SIZE)\n  #define REBARBANDINFO_V6_SIZE   _SIZEOF_STRUCT(REBARBANDINFO, cxHeader)\n#endif // (_WIN32_WINNT >= 0x0600) && !defined(REBARBANDINFO_V6_SIZE)\n\n#if (_WIN32_WINNT >= 0x0600) && !defined(LVGROUP_V5_SIZE)\n  #define LVGROUP_V5_SIZE   _SIZEOF_STRUCT(LVGROUP, uAlign)\n#endif // (_WIN32_WINNT >= 0x0600) && !defined(LVGROUP_V5_SIZE)\n\n#if (_WIN32_WINNT >= 0x0600) && !defined(LVTILEINFO_V5_SIZE)\n  #define LVTILEINFO_V5_SIZE   _SIZEOF_STRUCT(LVTILEINFO, puColumns)\n#endif // (_WIN32_WINNT >= 0x0600) && !defined(LVTILEINFO_V5_SIZE)\n\n#if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN) && !defined(MCHITTESTINFO_V1_SIZE)\n  #define MCHITTESTINFO_V1_SIZE   _SIZEOF_STRUCT(MCHITTESTINFO, st)\n#endif // defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN) && !defined(MCHITTESTINFO_V1_SIZE)\n\n#if (WINVER >= 0x0600) && !defined(NONCLIENTMETRICS_V1_SIZE)\n  #define NONCLIENTMETRICS_V1_SIZE   _SIZEOF_STRUCT(NONCLIENTMETRICS, lfMessageFont)\n#endif // (WINVER >= 0x0600) && !defined(NONCLIENTMETRICS_V1_SIZE)\n\n#ifndef TTTOOLINFO_V2_SIZE\n  #define TTTOOLINFO_V2_SIZE   _SIZEOF_STRUCT(TTTOOLINFO, lParam)\n#endif\n\n#endif // !_WTL_NO_RUNTIME_STRUCT_SIZE\n\nnamespace RunTimeHelper\n{\n\tinline bool IsCommCtrl6()\n\t{\n\t\tDWORD dwMajor = 0, dwMinor = 0;\n\t\tHRESULT hRet = ATL::AtlGetCommCtrlVersion(&dwMajor, &dwMinor);\n\t\treturn (SUCCEEDED(hRet) && (dwMajor >= 6));\n\t}\n\n\tinline bool IsVista()\n\t{\n#ifdef _versionhelpers_H_INCLUDED_\n\t\treturn ::IsWindowsVistaOrGreater();\n#else // !_versionhelpers_H_INCLUDED_\n\t\tOSVERSIONINFO ovi = { sizeof(OSVERSIONINFO) };\n\t\tBOOL bRet = ::GetVersionEx(&ovi);\n\t\treturn ((bRet != FALSE) && (ovi.dwMajorVersion >= 6));\n#endif // _versionhelpers_H_INCLUDED_\n\t}\n\n\tinline bool IsThemeAvailable()\n\t{\n\t\treturn IsCommCtrl6() && (::IsThemeActive() != FALSE) && (::IsAppThemed() != FALSE);\n\t}\n\n\tinline bool IsWin7()\n\t{\n#ifdef _versionhelpers_H_INCLUDED_\n\t\treturn ::IsWindows7OrGreater();\n#else // !_versionhelpers_H_INCLUDED_\n\t\tOSVERSIONINFO ovi = { sizeof(OSVERSIONINFO) };\n\t\tBOOL bRet = ::GetVersionEx(&ovi);\n\t\treturn ((bRet != FALSE) && ((ovi.dwMajorVersion > 6) || ((ovi.dwMajorVersion == 6) && (ovi.dwMinorVersion >= 1))));\n#endif // _versionhelpers_H_INCLUDED_\n\t}\n\n\tinline bool IsRibbonUIAvailable()\n\t{\n\t\tstatic INT iRibbonUI = -1;\n\n#if defined(NTDDI_WIN7) && (NTDDI_VERSION >= NTDDI_WIN7)\n\t\tif (iRibbonUI == -1)\n\t\t{\n\t\t\tHMODULE hRibbonDLL = ::LoadLibrary(_T(\"propsys.dll\"));\n\t\t\tif (hRibbonDLL != NULL)\n\t\t\t{\n\t\t\t\tconst GUID CLSID_UIRibbonFramework = { 0x926749fa, 0x2615, 0x4987, { 0x88, 0x45, 0xc3, 0x3e, 0x65, 0xf2, 0xb9, 0x57 } };\n\t\t\t\t// block - create instance\n\t\t\t\t{\n\t\t\t\t\tATL::CComPtr<IUnknown> pIUIFramework;\n\t\t\t\t\tiRibbonUI = SUCCEEDED(pIUIFramework.CoCreateInstance(CLSID_UIRibbonFramework)) ? 1 : 0;\n\t\t\t\t}\n\t\t\t\t::FreeLibrary(hRibbonDLL);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tiRibbonUI = 0;\n\t\t\t}\n\t\t}\n#endif // defined(NTDDI_WIN7) && (NTDDI_VERSION >= NTDDI_WIN7)\n\n\t\treturn (iRibbonUI == 1);\n\t}\n\n\tinline UINT SizeOf_REBARBANDINFO()\n\t{\n\t\tUINT uSize = sizeof(REBARBANDINFO);\n#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)\n\t\tif(!(IsVista() && IsCommCtrl6()))\n\t\t\tuSize = REBARBANDINFO_V6_SIZE;\n#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)\n\t\treturn uSize;\n\t}\n\n  \tinline UINT SizeOf_LVGROUP()\n\t{\n\t\tUINT uSize = sizeof(LVGROUP);\n#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)\n\t\tif(!IsVista())\n\t\t\tuSize = LVGROUP_V5_SIZE;\n#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)\n\t\treturn uSize;\n\t}\n\n\tinline UINT SizeOf_LVTILEINFO()\n\t{\n\t\tUINT uSize = sizeof(LVTILEINFO);\n#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)\n\t\tif(!IsVista())\n\t\t\tuSize = LVTILEINFO_V5_SIZE;\n#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)\n\t\treturn uSize;\n\t}\n\n\tinline UINT SizeOf_MCHITTESTINFO()\n\t{\n\t\tUINT uSize = sizeof(MCHITTESTINFO);\n#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\n\t\tif(!(IsVista() && IsCommCtrl6()))\n\t\t\tuSize = MCHITTESTINFO_V1_SIZE;\n#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\n\t\treturn uSize;\n\t}\n\n\tinline UINT SizeOf_NONCLIENTMETRICS()\n\t{\n\t\tUINT uSize = sizeof(NONCLIENTMETRICS);\n#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (WINVER >= 0x0600)\n\t\tif(!IsVista())\n\t\t\tuSize = NONCLIENTMETRICS_V1_SIZE;\n#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (WINVER >= 0x0600)\n\t\treturn uSize;\n\t}\n\n\tinline UINT SizeOf_TOOLINFO()\n\t{\n\t\tUINT uSize = sizeof(TOOLINFO);\n#ifndef _WTL_NO_RUNTIME_STRUCT_SIZE\n\t\tif(!IsVista())\n\t\t\tuSize = TTTOOLINFO_V2_SIZE;\n#endif\n\t\treturn uSize;\n\t}\n} // namespace RunTimeHelper\n\n\n///////////////////////////////////////////////////////////////////////////////\n// ModuleHelper - helper functions for ATL (deprecated)\n\nnamespace ModuleHelper\n{\n\tinline HINSTANCE GetModuleInstance()\n\t{\n\t\treturn ATL::_AtlBaseModule.GetModuleInstance();\n\t}\n\n\tinline HINSTANCE GetResourceInstance()\n\t{\n\t\treturn ATL::_AtlBaseModule.GetResourceInstance();\n\t}\n\n\tinline void AddCreateWndData(ATL::_AtlCreateWndData* pData, void* pObject)\n\t{\n\t\tATL::_AtlWinModule.AddCreateWndData(pData, pObject);\n\t}\n\n\tinline void* ExtractCreateWndData()\n\t{\n\t\treturn ATL::_AtlWinModule.ExtractCreateWndData();\n\t}\n} // namespace ModuleHelper\n\n\n///////////////////////////////////////////////////////////////////////////////\n// SecureHelper - WTL10 requires use of secure functions\n// these are here only for compatibility with existing projects\n\nnamespace SecureHelper\n{\n\tinline void strcpyA_x(char* lpstrDest, size_t cchDest, const char* lpstrSrc)\n\t{\n\t\tATL::Checked::strcpy_s(lpstrDest, cchDest, lpstrSrc);\n\t}\n\n\tinline void strcpyW_x(wchar_t* lpstrDest, size_t cchDest, const wchar_t* lpstrSrc)\n\t{\n\t\tATL::Checked::wcscpy_s(lpstrDest, cchDest, lpstrSrc);\n\t}\n\n\tinline void strcpy_x(LPTSTR lpstrDest, size_t cchDest, LPCTSTR lpstrSrc)\n\t{\n#ifdef _UNICODE\n\t\tstrcpyW_x(lpstrDest, cchDest, lpstrSrc);\n#else\n\t\tstrcpyA_x(lpstrDest, cchDest, lpstrSrc);\n#endif\n\t}\n\n\tinline errno_t strncpyA_x(char* lpstrDest, size_t cchDest, const char* lpstrSrc, size_t cchCount)\n\t{\n\t\treturn ATL::Checked::strncpy_s(lpstrDest, cchDest, lpstrSrc, cchCount);\n\t}\n\n\tinline errno_t strncpyW_x(wchar_t* lpstrDest, size_t cchDest, const wchar_t* lpstrSrc, size_t cchCount)\n\t{\n\t\treturn ATL::Checked::wcsncpy_s(lpstrDest, cchDest, lpstrSrc, cchCount);\n\t}\n\n\tinline errno_t strncpy_x(LPTSTR lpstrDest, size_t cchDest, LPCTSTR lpstrSrc, size_t cchCount)\n\t{\n#ifdef _UNICODE\n\t\treturn strncpyW_x(lpstrDest, cchDest, lpstrSrc, cchCount);\n#else\n\t\treturn strncpyA_x(lpstrDest, cchDest, lpstrSrc, cchCount);\n#endif\n\t}\n\n\tinline void strcatA_x(char* lpstrDest, size_t cchDest, const char* lpstrSrc)\n\t{\n\t\tATL::Checked::strcat_s(lpstrDest, cchDest, lpstrSrc);\n\t}\n\n\tinline void strcatW_x(wchar_t* lpstrDest, size_t cchDest, const wchar_t* lpstrSrc)\n\t{\n\t\tATL::Checked::wcscat_s(lpstrDest, cchDest, lpstrSrc);\n\t}\n\n\tinline void strcat_x(LPTSTR lpstrDest, size_t cchDest, LPCTSTR lpstrSrc)\n\t{\n#ifdef _UNICODE\n\t\tstrcatW_x(lpstrDest, cchDest, lpstrSrc);\n#else\n\t\tstrcatA_x(lpstrDest, cchDest, lpstrSrc);\n#endif\n\t}\n\n\tinline void memcpy_x(void* pDest, size_t cbDest, const void* pSrc, size_t cbSrc)\n\t{\n\t\tATL::Checked::memcpy_s(pDest, cbDest, pSrc, cbSrc);\n\t}\n\n\tinline void memmove_x(void* pDest, size_t cbDest, const void* pSrc, size_t cbSrc)\n\t{\n\t\tATL::Checked::memmove_s(pDest, cbDest, pSrc, cbSrc);\n\t}\n\n\tinline int vsprintf_x(LPTSTR lpstrBuff, size_t cchBuff, LPCTSTR lpstrFormat, va_list args)\n\t{\n\t\treturn _vstprintf_s(lpstrBuff, cchBuff, lpstrFormat, args);\n\t}\n\n\tinline int wvsprintf_x(LPTSTR lpstrBuff, size_t cchBuff, LPCTSTR lpstrFormat, va_list args)\n\t{\n\t\treturn _vstprintf_s(lpstrBuff, cchBuff, lpstrFormat, args);\n\t}\n\n\tinline int sprintf_x(LPTSTR lpstrBuff, size_t cchBuff, LPCTSTR lpstrFormat, ...)\n\t{\n\t\tva_list args;\n\t\tva_start(args, lpstrFormat);\n\t\tint nRes = vsprintf_x(lpstrBuff, cchBuff, lpstrFormat, args);\n\t\tva_end(args);\n\t\treturn nRes;\n\t}\n\n\tinline int wsprintf_x(LPTSTR lpstrBuff, size_t cchBuff, LPCTSTR lpstrFormat, ...)\n\t{\n\t\tva_list args;\n\t\tva_start(args, lpstrFormat);\n\t\tint nRes = wvsprintf_x(lpstrBuff, cchBuff, lpstrFormat, args);\n\t\tva_end(args);\n\t\treturn nRes;\n\t}\n} // namespace SecureHelper\n\n\n///////////////////////////////////////////////////////////////////////////////\n// MinCrtHelper - WTL10 doesn't support _ATL_MIN_CRT,\n// these are here only for compatibility with existing projects\n\nnamespace MinCrtHelper\n{\n\tinline int _isspace(TCHAR ch)\n\t{\n\t\treturn _istspace(ch);\n\t}\n\n\tinline int _isdigit(TCHAR ch)\n\t{\n\t\treturn _istdigit(ch);\n\t}\n\n\tinline int _atoi(LPCTSTR str)\n\t{\n\t\treturn _ttoi(str);\n\t}\n\n\tinline LPCTSTR _strrchr(LPCTSTR str, TCHAR ch)\n\t{\n\t\treturn _tcsrchr(str, ch);\n\t}\n\n\tinline LPTSTR _strrchr(LPTSTR str, TCHAR ch)\n\t{\n\t\treturn _tcsrchr(str, ch);\n\t}\n} // namespace MinCrtHelper\n\n\n///////////////////////////////////////////////////////////////////////////////\n// GenericWndClass - generic window class usable for subclassing\n\n// Use in dialog templates to specify a placeholder to be subclassed\n// Specify as a custom control with class name WTL_GenericWindow\n// Call Rregister() before creating dialog (for example, in WinMain)\nnamespace GenericWndClass\n{\n\tinline LPCTSTR GetName()\n\t{\n\t\treturn _T(\"WTL_GenericWindow\");\n\t}\n\n\tinline ATOM Register()\n\t{\n\t\tWNDCLASSEX wc = { sizeof(WNDCLASSEX) };\n\t\twc.lpfnWndProc = ::DefWindowProc;\n\t\twc.hInstance = ModuleHelper::GetModuleInstance();\n\t\twc.hCursor = ::LoadCursor(NULL, IDC_ARROW);\n\t\twc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);\n\t\twc.lpszClassName = GetName();\n\t\tATOM atom = ::RegisterClassEx(&wc);\n\t\tATLASSERT(atom != 0);\n\t\treturn atom;\n\t}\n\n\tinline BOOL Unregister()   // only needed for DLLs or tmp use\n\t{\n\t\treturn ::UnregisterClass(GetName(), ModuleHelper::GetModuleInstance());\n\t}\n} // namespace GenericWndClass\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CMessageFilter - Interface for message filter support\n\nclass ATL_NO_VTABLE CMessageFilter\n{\npublic:\n\tvirtual BOOL PreTranslateMessage(MSG* pMsg) = 0;\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CIdleHandler - Interface for idle processing\n\nclass ATL_NO_VTABLE CIdleHandler\n{\npublic:\n\tvirtual BOOL OnIdle() = 0;\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CMessageLoop - message loop implementation\n\nclass CMessageLoop\n{\npublic:\n\tATL::CSimpleArray<CMessageFilter*> m_aMsgFilter;\n\tATL::CSimpleArray<CIdleHandler*> m_aIdleHandler;\n\tMSG m_msg;\n\n\tCMessageLoop()\n\t{\n\t\tmemset(&m_msg, 0, sizeof(m_msg));\n\t}\n\n\tvirtual ~CMessageLoop()\n\t{ }\n\n// Message filter operations\n\tBOOL AddMessageFilter(CMessageFilter* pMessageFilter)\n\t{\n\t\treturn m_aMsgFilter.Add(pMessageFilter);\n\t}\n\n\tBOOL RemoveMessageFilter(CMessageFilter* pMessageFilter)\n\t{\n\t\treturn m_aMsgFilter.Remove(pMessageFilter);\n\t}\n\n// Idle handler operations\n\tBOOL AddIdleHandler(CIdleHandler* pIdleHandler)\n\t{\n\t\treturn m_aIdleHandler.Add(pIdleHandler);\n\t}\n\n\tBOOL RemoveIdleHandler(CIdleHandler* pIdleHandler)\n\t{\n\t\treturn m_aIdleHandler.Remove(pIdleHandler);\n\t}\n\n// message loop\n\tint Run()\n\t{\n\t\tBOOL bDoIdle = TRUE;\n\t\tint nIdleCount = 0;\n\t\tBOOL bRet = FALSE;\n\n\t\tfor(;;)\n\t\t{\n\t\t\twhile(bDoIdle && !::PeekMessage(&m_msg, NULL, 0, 0, PM_NOREMOVE))\n\t\t\t{\n\t\t\t\tif(!OnIdle(nIdleCount++))\n\t\t\t\t\tbDoIdle = FALSE;\n\t\t\t}\n\n\t\t\tbRet = ::GetMessage(&m_msg, NULL, 0, 0);\n\n\t\t\tif(bRet == -1)\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"::GetMessage returned -1 (error)\\n\"));\n\t\t\t\tcontinue;   // error, don't process\n\t\t\t}\n\t\t\telse if(!bRet)\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"CMessageLoop::Run - exiting\\n\"));\n\t\t\t\tbreak;   // WM_QUIT, exit message loop\n\t\t\t}\n\n\t\t\tif(!PreTranslateMessage(&m_msg))\n\t\t\t{\n\t\t\t\t::TranslateMessage(&m_msg);\n\t\t\t\t::DispatchMessage(&m_msg);\n\t\t\t}\n\n\t\t\tif(IsIdleMessage(&m_msg))\n\t\t\t{\n\t\t\t\tbDoIdle = TRUE;\n\t\t\t\tnIdleCount = 0;\n\t\t\t}\n\t\t}\n\n\t\treturn (int)m_msg.wParam;\n\t}\n\n// Overrideables\n\t// Override to change message filtering\n\tvirtual BOOL PreTranslateMessage(MSG* pMsg)\n\t{\n\t\t// loop backwards\n\t\tfor(int i = m_aMsgFilter.GetSize() - 1; i >= 0; i--)\n\t\t{\n\t\t\tCMessageFilter* pMessageFilter = m_aMsgFilter[i];\n\t\t\tif((pMessageFilter != NULL) && pMessageFilter->PreTranslateMessage(pMsg))\n\t\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;   // not translated\n\t}\n\n\t// override to change idle processing\n\tvirtual BOOL OnIdle(int /*nIdleCount*/)\n\t{\n\t\tfor(int i = 0; i < m_aIdleHandler.GetSize(); i++)\n\t\t{\n\t\t\tCIdleHandler* pIdleHandler = m_aIdleHandler[i];\n\t\t\tif(pIdleHandler != NULL)\n\t\t\t\tpIdleHandler->OnIdle();\n\t\t}\n\t\treturn FALSE;   // don't continue\n\t}\n\n\t// override to change non-idle messages\n\tvirtual BOOL IsIdleMessage(MSG* pMsg) const\n\t{\n\t\t// These messages should NOT cause idle processing\n\t\tswitch(pMsg->message)\n\t\t{\n\t\tcase WM_MOUSEMOVE:\n\t\tcase WM_NCMOUSEMOVE:\n\t\tcase WM_PAINT:\n\t\tcase 0x0118:\t// WM_SYSTIMER (caret blink)\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CStaticDataInitCriticalSectionLock and CWindowCreateCriticalSectionLock\n// internal classes to manage critical sections for ATL (deprecated)\n\nclass CStaticDataInitCriticalSectionLock\n{\npublic:\n\tATL::CComCritSecLock<ATL::CComCriticalSection> m_cslock;\n\n\tCStaticDataInitCriticalSectionLock() : m_cslock(ATL::_pAtlModule->m_csStaticDataInitAndTypeInfo, false)\n\t{ }\n\n\tHRESULT Lock()\n\t{\n\t\treturn m_cslock.Lock();\n\t}\n\n\tvoid Unlock()\n\t{\n\t\tm_cslock.Unlock();\n\t}\n};\n\n\nclass CWindowCreateCriticalSectionLock\n{\npublic:\n\tATL::CComCritSecLock<ATL::CComCriticalSection> m_cslock;\n\n\tCWindowCreateCriticalSectionLock() : m_cslock(ATL::_AtlWinModule.m_csWindowCreate, false)\n\t{ }\n\n\tHRESULT Lock()\n\t{\n\t\treturn m_cslock.Lock();\n\t}\n\n\tvoid Unlock()\n\t{\n\t\tm_cslock.Unlock();\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CAppModule - module class for an application\n\n#if (_MSC_VER == 1400)   // VS2005\n  #pragma warning(push)\n  #pragma warning(disable : 4244)\n  #pragma warning(disable : 4312)\n#endif\n\nclass CAppModule : public ATL::CComModule\n{\npublic:\n\tDWORD m_dwMainThreadID;\n\tATL::CSimpleMap<DWORD, CMessageLoop*>* m_pMsgLoopMap;\n\tATL::CSimpleArray<HWND>* m_pSettingChangeNotify;\n\n\tCAppModule() : m_dwMainThreadID(0), m_pMsgLoopMap(NULL), m_pSettingChangeNotify(NULL)\n\t{ }\n\n// Overrides of CComModule::Init and Term\n\tHRESULT Init(ATL::_ATL_OBJMAP_ENTRY* pObjMap, HINSTANCE hInstance, const GUID* pLibID = NULL)\n\t{\n\t\tHRESULT hRet = CComModule::Init(pObjMap, hInstance, pLibID);\n\t\tif(FAILED(hRet))\n\t\t\treturn hRet;\n\n\t\tm_dwMainThreadID = ::GetCurrentThreadId();\n\t\ttypedef ATL::CSimpleMap<DWORD, CMessageLoop*>   _mapClass;\n\t\tm_pMsgLoopMap = NULL;\n\t\tATLTRY(m_pMsgLoopMap = new _mapClass);\n\t\tif(m_pMsgLoopMap == NULL)\n\t\t\treturn E_OUTOFMEMORY;\n\t\tm_pSettingChangeNotify = NULL;\n\n\t\treturn hRet;\n\t}\n\n\tvoid Term()\n\t{\n\t\tTermSettingChangeNotify();\n\t\tdelete m_pMsgLoopMap;\n\t\tCComModule::Term();\n\t}\n\n// Message loop map methods\n\tBOOL AddMessageLoop(CMessageLoop* pMsgLoop)\n\t{\n\t\tCStaticDataInitCriticalSectionLock lock;\n\t\tif(FAILED(lock.Lock()))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CAppModule::AddMessageLoop.\\n\"));\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tATLASSERT(pMsgLoop != NULL);\n\t\tATLASSERT(m_pMsgLoopMap->Lookup(::GetCurrentThreadId()) == NULL);   // not in map yet\n\n\t\tBOOL bRet = m_pMsgLoopMap->Add(::GetCurrentThreadId(), pMsgLoop);\n\n\t\tlock.Unlock();\n\n\t\treturn bRet;\n\t}\n\n\tBOOL RemoveMessageLoop()\n\t{\n\t\tCStaticDataInitCriticalSectionLock lock;\n\t\tif(FAILED(lock.Lock()))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CAppModule::RemoveMessageLoop.\\n\"));\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tBOOL bRet = m_pMsgLoopMap->Remove(::GetCurrentThreadId());\n\n\t\tlock.Unlock();\n\n\t\treturn bRet;\n\t}\n\n\tCMessageLoop* GetMessageLoop(DWORD dwThreadID = ::GetCurrentThreadId()) const\n\t{\n\t\tCStaticDataInitCriticalSectionLock lock;\n\t\tif(FAILED(lock.Lock()))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CAppModule::GetMessageLoop.\\n\"));\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn NULL;\n\t\t}\n\n\t\tCMessageLoop* pLoop =  m_pMsgLoopMap->Lookup(dwThreadID);\n\n\t\tlock.Unlock();\n\n\t\treturn pLoop;\n\t}\n\n// Setting change notify methods\n\t// Note: Call this from the main thread for MSDI apps\n\tBOOL InitSettingChangeNotify(DLGPROC pfnDlgProc = _SettingChangeDlgProc)\n\t{\n\t\tCStaticDataInitCriticalSectionLock lock;\n\t\tif(FAILED(lock.Lock()))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CAppModule::InitSettingChangeNotify.\\n\"));\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif(m_pSettingChangeNotify == NULL)\n\t\t{\n\t\t\ttypedef ATL::CSimpleArray<HWND>   _notifyClass;\n\t\t\tATLTRY(m_pSettingChangeNotify = new _notifyClass);\n\t\t\tATLASSERT(m_pSettingChangeNotify != NULL);\n\t\t}\n\n\t\tBOOL bRet = (m_pSettingChangeNotify != NULL);\n\t\tif(bRet && (m_pSettingChangeNotify->GetSize() == 0))\n\t\t{\n\t\t\t// init everything\n\t\t\t_ATL_EMPTY_DLGTEMPLATE templ;\n\t\t\tHWND hNtfWnd = ::CreateDialogIndirect(GetModuleInstance(), &templ, NULL, pfnDlgProc);\n\t\t\tATLASSERT(::IsWindow(hNtfWnd));\n\t\t\tif(::IsWindow(hNtfWnd))\n\t\t\t{\n\t\t\t\t::SetWindowLongPtr(hNtfWnd, GWLP_USERDATA, (LONG_PTR)this);\n\t\t\t\tbRet = m_pSettingChangeNotify->Add(hNtfWnd);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbRet = FALSE;\n\t\t\t}\n\t\t}\n\n\t\tlock.Unlock();\n\n\t\treturn bRet;\n\t}\n\n\tvoid TermSettingChangeNotify()\n\t{\n\t\tCStaticDataInitCriticalSectionLock lock;\n\t\tif(FAILED(lock.Lock()))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CAppModule::TermSettingChangeNotify.\\n\"));\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn;\n\t\t}\n\n\t\tif((m_pSettingChangeNotify != NULL) && (m_pSettingChangeNotify->GetSize() > 0))\n\t\t\t::DestroyWindow((*m_pSettingChangeNotify)[0]);\n\t\tdelete m_pSettingChangeNotify;\n\t\tm_pSettingChangeNotify = NULL;\n\n\t\tlock.Unlock();\n\t}\n\n\tBOOL AddSettingChangeNotify(HWND hWnd)\n\t{\n\t\tCStaticDataInitCriticalSectionLock lock;\n\t\tif(FAILED(lock.Lock()))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CAppModule::AddSettingChangeNotify.\\n\"));\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tATLASSERT(::IsWindow(hWnd));\n\t\tBOOL bRet = FALSE;\n\t\tif(InitSettingChangeNotify() != FALSE)\n\t\t\tbRet = m_pSettingChangeNotify->Add(hWnd);\n\n\t\tlock.Unlock();\n\n\t\treturn bRet;\n\t}\n\n\tBOOL RemoveSettingChangeNotify(HWND hWnd)\n\t{\n\t\tCStaticDataInitCriticalSectionLock lock;\n\t\tif(FAILED(lock.Lock()))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CAppModule::RemoveSettingChangeNotify.\\n\"));\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tBOOL bRet = FALSE;\n\t\tif(m_pSettingChangeNotify != NULL)\n\t\t\tbRet = m_pSettingChangeNotify->Remove(hWnd);\n\n\t\tlock.Unlock();\n\n\t\treturn bRet;\n\t}\n\n// Implementation - setting change notify dialog template and dialog procedure\n\tstruct _ATL_EMPTY_DLGTEMPLATE : DLGTEMPLATE\n\t{\n\t\t_ATL_EMPTY_DLGTEMPLATE()\n\t\t{\n\t\t\tmemset(this, 0, sizeof(_ATL_EMPTY_DLGTEMPLATE));\n\t\t\tstyle = WS_POPUP;\n\t\t}\n\t\tWORD wMenu, wClass, wTitle;\n\t};\n\n\tstatic INT_PTR CALLBACK _SettingChangeDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\n\t{\n\t\tif(uMsg == WM_SETTINGCHANGE)\n\t\t{\n\t\t\tCAppModule* pModule = (CAppModule*)::GetWindowLongPtr(hWnd, GWLP_USERDATA);\n\t\t\tATLASSERT(pModule != NULL);\n\t\t\tATLASSERT(pModule->m_pSettingChangeNotify != NULL);\n\t\t\tconst UINT uTimeout = 1500;   // ms\n\t\t\tfor(int i = 1; i < pModule->m_pSettingChangeNotify->GetSize(); i++)\n\t\t\t\t::SendMessageTimeout((*pModule->m_pSettingChangeNotify)[i], uMsg, wParam, lParam, SMTO_ABORTIFHUNG, uTimeout, NULL);\n\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}\n};\n\n#if (_MSC_VER == 1400)   // VS2005\n  #pragma warning(pop)\n#endif\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CServerAppModule - module class for a COM server application\n\nclass CServerAppModule : public CAppModule\n{\npublic:\n\tHANDLE m_hEventShutdown;\n\tbool m_bActivity;\n\tDWORD m_dwTimeOut;\n\tDWORD m_dwPause;\n\n\tCServerAppModule() : m_hEventShutdown(NULL), m_bActivity(false), m_dwTimeOut(5000), m_dwPause(1000)\n\t{ }\n\n// Override of CAppModule::Init\n\tHRESULT Init(ATL::_ATL_OBJMAP_ENTRY* pObjMap, HINSTANCE hInstance, const GUID* pLibID = NULL)\n\t{\n\t\tm_dwTimeOut = 5000;\n\t\tm_dwPause = 1000;\n\t\treturn CAppModule::Init(pObjMap, hInstance, pLibID);\n\t}\n\n\tvoid Term()\n\t{\n\t\tif((m_hEventShutdown != NULL) && ::CloseHandle(m_hEventShutdown))\n\t\t\tm_hEventShutdown = NULL;\n\t\tCAppModule::Term();\n\t}\n\n// COM Server methods\n\tLONG Unlock() throw()\n\t{\n\t\tLONG lRet = CComModule::Unlock();\n\t\tif(lRet == 0)\n\t\t{\n\t\t\tm_bActivity = true;\n\t\t\t::SetEvent(m_hEventShutdown); // tell monitor that we transitioned to zero\n\t\t}\n\t\treturn lRet;\n\t}\n\n\tvoid MonitorShutdown()\n\t{\n\t\tfor(;;)\n\t\t{\n\t\t\t::WaitForSingleObject(m_hEventShutdown, INFINITE);\n\t\t\tDWORD dwWait = 0;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tm_bActivity = false;\n\t\t\t\tdwWait = ::WaitForSingleObject(m_hEventShutdown, m_dwTimeOut);\n\t\t\t}\n\t\t\twhile(dwWait == WAIT_OBJECT_0);\n\t\t\t// timed out\n\t\t\tif(!m_bActivity && (m_nLockCnt == 0)) // if no activity let's really bail\n\t\t\t{\n#if defined(_WIN32_DCOM) && defined(_ATL_FREE_THREADED)\n\t\t\t\t::CoSuspendClassObjects();\n\t\t\t\tif(!m_bActivity && (m_nLockCnt == 0))\n#endif\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// This handle should be valid now. If it isn't, \n\t\t// check if _Module.Term was called first (it shouldn't)\n\t\tif(::CloseHandle(m_hEventShutdown))\n\t\t\tm_hEventShutdown = NULL;\n\t\t::PostThreadMessage(m_dwMainThreadID, WM_QUIT, 0, 0);\n\t}\n\n\tbool StartMonitor()\n\t{\n\t\tm_hEventShutdown = ::CreateEvent(NULL, false, false, NULL);\n\t\tif(m_hEventShutdown == NULL)\n\t\t\treturn false;\n\t\tDWORD dwThreadID = 0;\n#ifdef _MT\n\t\tHANDLE hThread = (HANDLE)_beginthreadex(NULL, 0, (UINT (WINAPI*)(void*))MonitorProc, this, 0, (UINT*)&dwThreadID);\n#else\n\t\tHANDLE hThread = ::CreateThread(NULL, 0, MonitorProc, this, 0, &dwThreadID);\n#endif\n\t\tbool bRet = (hThread != NULL);\n\t\tif(bRet)\n\t\t\t::CloseHandle(hThread);\n\t\treturn bRet;\n\t}\n\n\tstatic DWORD WINAPI MonitorProc(void* pv)\n\t{\n\t\tCServerAppModule* p = (CServerAppModule*)pv;\n\t\tp->MonitorShutdown();\n\t\treturn 0;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CRegKeyEx - not used any more, here only for compatibility with old projects\n\ntypedef ATL::CRegKey CRegKeyEx;\n\n} // namespace WTL\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CString forward reference (enables CString use in atluser.h and atlgdi.h)\n\n#if (defined(_WTL_USE_CSTRING) || defined(_WTL_FORWARD_DECLARE_CSTRING)) && !defined(__ATLSTR_H__)\n  #include <atlstr.h>\n#endif\n\n// CString namespace\n#define _CSTRING_NS\tATL\n\n// Type classes namespace\n#define _WTYPES_NS\n\n\n///////////////////////////////////////////////////////////////////////////////\n// General DLL version helpers (removed in ATL11)\n\n#if (_ATL_VER >= 0x0B00)\n\nnamespace ATL\n{\n\ninline HRESULT AtlGetDllVersion(HINSTANCE hInstDLL, DLLVERSIONINFO* pDllVersionInfo)\n{\n\tATLASSERT(pDllVersionInfo != NULL);\n\tif(pDllVersionInfo == NULL)\n\t\treturn E_INVALIDARG;\n\n\t// We must get this function explicitly because some DLLs don't implement it.\n\tDLLGETVERSIONPROC pfnDllGetVersion = (DLLGETVERSIONPROC)::GetProcAddress(hInstDLL, \"DllGetVersion\");\n\tif(pfnDllGetVersion == NULL)\n\t\treturn E_NOTIMPL;\n\n\treturn (*pfnDllGetVersion)(pDllVersionInfo);\n}\n\ninline HRESULT AtlGetDllVersion(LPCTSTR lpstrDllName, DLLVERSIONINFO* pDllVersionInfo)\n{\n\tHINSTANCE hInstDLL = ::LoadLibrary(lpstrDllName);\n\tif(hInstDLL == NULL)\n\t\treturn E_FAIL;\n\tHRESULT hRet = AtlGetDllVersion(hInstDLL, pDllVersionInfo);\n\t::FreeLibrary(hInstDLL);\n\treturn hRet;\n}\n\n// Common Control Versions:\n//   Win95/WinNT 4.0    maj=4 min=00\n//   IE 3.x     maj=4 min=70\n//   IE 4.0     maj=4 min=71\ninline HRESULT AtlGetCommCtrlVersion(LPDWORD pdwMajor, LPDWORD pdwMinor)\n{\n\tATLASSERT((pdwMajor != NULL) && (pdwMinor != NULL));\n\tif((pdwMajor == NULL) || (pdwMinor == NULL))\n\t\treturn E_INVALIDARG;\n\n\tDLLVERSIONINFO dvi;\n\t::ZeroMemory(&dvi, sizeof(dvi));\n\tdvi.cbSize = sizeof(dvi);\n\tHRESULT hRet = AtlGetDllVersion(_T(\"comctl32.dll\"), &dvi);\n\n\tif(SUCCEEDED(hRet))\n\t{\n\t\t*pdwMajor = dvi.dwMajorVersion;\n\t\t*pdwMinor = dvi.dwMinorVersion;\n\t}\n\telse if(hRet == E_NOTIMPL)\n\t{\n\t\t// If DllGetVersion is not there, then the DLL is a version\n\t\t// previous to the one shipped with IE 3.x\n\t\t*pdwMajor = 4;\n\t\t*pdwMinor = 0;\n\t\thRet = S_OK;\n\t}\n\n\treturn hRet;\n}\n\n// Shell Versions:\n//   Win95/WinNT 4.0                    maj=4 min=00\n//   IE 3.x, IE 4.0 without Web Integrated Desktop  maj=4 min=00\n//   IE 4.0 with Web Integrated Desktop         maj=4 min=71\n//   IE 4.01 with Web Integrated Desktop        maj=4 min=72\ninline HRESULT AtlGetShellVersion(LPDWORD pdwMajor, LPDWORD pdwMinor)\n{\n\tATLASSERT((pdwMajor != NULL) && (pdwMinor != NULL));\n\tif((pdwMajor == NULL) || (pdwMinor == NULL))\n\t\treturn E_INVALIDARG;\n\n\tDLLVERSIONINFO dvi;\n\t::ZeroMemory(&dvi, sizeof(dvi));\n\tdvi.cbSize = sizeof(dvi);\n\tHRESULT hRet = AtlGetDllVersion(_T(\"shell32.dll\"), &dvi);\n\n\tif(SUCCEEDED(hRet))\n\t{\n\t\t*pdwMajor = dvi.dwMajorVersion;\n\t\t*pdwMinor = dvi.dwMinorVersion;\n\t}\n\telse if(hRet == E_NOTIMPL)\n\t{\n\t\t// If DllGetVersion is not there, then the DLL is a version\n\t\t// previous to the one shipped with IE 4.x\n\t\t*pdwMajor = 4;\n\t\t*pdwMinor = 0;\n\t\thRet = S_OK;\n\t}\n\n\treturn hRet;\n}\n\n} // namespace ATL\n\n#endif // (_ATL_VER >= 0x0B00)\n\n\n// These are always included\n#include \"atlwinx.h\"\n#include \"atluser.h\"\n#include \"atlgdi.h\"\n\n#ifndef _WTL_NO_AUTOMATIC_NAMESPACE\nusing namespace WTL;\n#endif // !_WTL_NO_AUTOMATIC_NAMESPACE\n\n#endif // __ATLAPP_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlcrack.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLCRACK_H__\n#define __ATLCRACK_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atlcrack.h requires atlapp.h to be included first\n#endif\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Message map macro for cracked handlers\n\n// Note about message maps with cracked handlers:\n//   You can use BEGIN_MSG_MAP for classes that derive from CWindowImpl/CDialogImpl,\n//   but must use BEGIN_MSG_MAP_EX for classes that don't.\n\n#define BEGIN_MSG_MAP_EX(theClass) \\\npublic: \\\n\tBOOL m_bMsgHandled; \\\n\t/* \"handled\" management for cracked handlers */ \\\n\tBOOL IsMsgHandled() const \\\n\t{ \\\n\t\treturn m_bMsgHandled; \\\n\t} \\\n\tvoid SetMsgHandled(BOOL bHandled) \\\n\t{ \\\n\t\tm_bMsgHandled = bHandled; \\\n\t} \\\n\tBOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lResult, DWORD dwMsgMapID = 0) \\\n\t{ \\\n\t\tBOOL bOldMsgHandled = m_bMsgHandled; \\\n\t\tBOOL bRet = _ProcessWindowMessage(hWnd, uMsg, wParam, lParam, lResult, dwMsgMapID); \\\n\t\tm_bMsgHandled = bOldMsgHandled; \\\n\t\treturn bRet; \\\n\t} \\\n\tBOOL _ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lResult, DWORD dwMsgMapID) \\\n\t{ \\\n\t\tBOOL bHandled = TRUE; \\\n\t\t(hWnd); \\\n\t\t(uMsg); \\\n\t\t(wParam); \\\n\t\t(lParam); \\\n\t\t(lResult); \\\n\t\t(bHandled); \\\n\t\tswitch(dwMsgMapID) \\\n\t\t{ \\\n\t\tcase 0:\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Standard Windows message macros\n\n// int OnCreate(LPCREATESTRUCT lpCreateStruct)\n#define MSG_WM_CREATE(func) \\\n\tif (uMsg == WM_CREATE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((LPCREATESTRUCT)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam)\n#define MSG_WM_INITDIALOG(func) \\\n\tif (uMsg == WM_INITDIALOG) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HWND)wParam, lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// BOOL OnCopyData(CWindow wnd, PCOPYDATASTRUCT pCopyDataStruct)\n#define MSG_WM_COPYDATA(func) \\\n\tif (uMsg == WM_COPYDATA) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HWND)wParam, (PCOPYDATASTRUCT)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnDestroy()\n#define MSG_WM_DESTROY(func) \\\n\tif (uMsg == WM_DESTROY) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnMove(CPoint ptPos)\n#define MSG_WM_MOVE(func) \\\n\tif (uMsg == WM_MOVE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnSize(UINT nType, CSize size)\n#define MSG_WM_SIZE(func) \\\n\tif (uMsg == WM_SIZE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnActivate(UINT nState, BOOL bMinimized, CWindow wndOther)\n#define MSG_WM_ACTIVATE(func) \\\n\tif (uMsg == WM_ACTIVATE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)LOWORD(wParam), (BOOL)HIWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnSetFocus(CWindow wndOld)\n#define MSG_WM_SETFOCUS(func) \\\n\tif (uMsg == WM_SETFOCUS) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HWND)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnKillFocus(CWindow wndFocus)\n#define MSG_WM_KILLFOCUS(func) \\\n\tif (uMsg == WM_KILLFOCUS) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HWND)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnEnable(BOOL bEnable)\n#define MSG_WM_ENABLE(func) \\\n\tif (uMsg == WM_ENABLE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((BOOL)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnPaint(CDCHandle dc)\n#define MSG_WM_PAINT(func) \\\n\tif (uMsg == WM_PAINT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HDC)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnClose()\n#define MSG_WM_CLOSE(func) \\\n\tif (uMsg == WM_CLOSE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// BOOL OnQueryEndSession(UINT nSource, UINT uLogOff)\n#define MSG_WM_QUERYENDSESSION(func) \\\n\tif (uMsg == WM_QUERYENDSESSION) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((UINT)wParam, (UINT)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// BOOL OnQueryOpen()\n#define MSG_WM_QUERYOPEN(func) \\\n\tif (uMsg == WM_QUERYOPEN) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func(); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// BOOL OnEraseBkgnd(CDCHandle dc)\n#define MSG_WM_ERASEBKGND(func) \\\n\tif (uMsg == WM_ERASEBKGND) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HDC)wParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnSysColorChange()\n#define MSG_WM_SYSCOLORCHANGE(func) \\\n\tif (uMsg == WM_SYSCOLORCHANGE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnEndSession(BOOL bEnding, UINT uLogOff)\n#define MSG_WM_ENDSESSION(func) \\\n\tif (uMsg == WM_ENDSESSION) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((BOOL)wParam, (UINT)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnShowWindow(BOOL bShow, UINT nStatus)\n#define MSG_WM_SHOWWINDOW(func) \\\n\tif (uMsg == WM_SHOWWINDOW) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((BOOL)wParam, (int)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HBRUSH OnCtlColorEdit(CDCHandle dc, CEdit edit)\n#define MSG_WM_CTLCOLOREDIT(func) \\\n\tif (uMsg == WM_CTLCOLOREDIT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HBRUSH OnCtlColorListBox(CDCHandle dc, CListBox listBox)\n#define MSG_WM_CTLCOLORLISTBOX(func) \\\n\tif (uMsg == WM_CTLCOLORLISTBOX) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HBRUSH OnCtlColorBtn(CDCHandle dc, CButton button)\n#define MSG_WM_CTLCOLORBTN(func) \\\n\tif (uMsg == WM_CTLCOLORBTN) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HBRUSH OnCtlColorDlg(CDCHandle dc, CWindow wnd)\n#define MSG_WM_CTLCOLORDLG(func) \\\n\tif (uMsg == WM_CTLCOLORDLG) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HBRUSH OnCtlColorScrollBar(CDCHandle dc, CScrollBar scrollBar)\n#define MSG_WM_CTLCOLORSCROLLBAR(func) \\\n\tif (uMsg == WM_CTLCOLORSCROLLBAR) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HBRUSH OnCtlColorStatic(CDCHandle dc, CStatic wndStatic)\n#define MSG_WM_CTLCOLORSTATIC(func) \\\n\tif (uMsg == WM_CTLCOLORSTATIC) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnSettingChange(UINT uFlags, LPCTSTR lpszSection)\n#define MSG_WM_SETTINGCHANGE(func) \\\n\tif (uMsg == WM_SETTINGCHANGE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (LPCTSTR)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnDevModeChange(LPCTSTR lpDeviceName)\n#define MSG_WM_DEVMODECHANGE(func) \\\n\tif (uMsg == WM_DEVMODECHANGE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((LPCTSTR)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnActivateApp(BOOL bActive, DWORD dwThreadID)\n#define MSG_WM_ACTIVATEAPP(func) \\\n\tif (uMsg == WM_ACTIVATEAPP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((BOOL)wParam, (DWORD)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnFontChange()\n#define MSG_WM_FONTCHANGE(func) \\\n\tif (uMsg == WM_FONTCHANGE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnTimeChange()\n#define MSG_WM_TIMECHANGE(func) \\\n\tif (uMsg == WM_TIMECHANGE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnCancelMode()\n#define MSG_WM_CANCELMODE(func) \\\n\tif (uMsg == WM_CANCELMODE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// BOOL OnSetCursor(CWindow wnd, UINT nHitTest, UINT message)\n#define MSG_WM_SETCURSOR(func) \\\n\tif (uMsg == WM_SETCURSOR) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HWND)wParam, (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// int OnMouseActivate(CWindow wndTopLevel, UINT nHitTest, UINT message)\n#define MSG_WM_MOUSEACTIVATE(func) \\\n\tif (uMsg == WM_MOUSEACTIVATE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HWND)wParam, (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnChildActivate()\n#define MSG_WM_CHILDACTIVATE(func) \\\n\tif (uMsg == WM_CHILDACTIVATE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnGetMinMaxInfo(LPMINMAXINFO lpMMI)\n#define MSG_WM_GETMINMAXINFO(func) \\\n\tif (uMsg == WM_GETMINMAXINFO) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((LPMINMAXINFO)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnIconEraseBkgnd(CDCHandle dc)\n#define MSG_WM_ICONERASEBKGND(func) \\\n\tif (uMsg == WM_ICONERASEBKGND) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HDC)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnSpoolerStatus(UINT nStatus, UINT nJobs)\n#define MSG_WM_SPOOLERSTATUS(func) \\\n\tif (uMsg == WM_SPOOLERSTATUS) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (UINT)LOWORD(lParam)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)\n#define MSG_WM_DRAWITEM(func) \\\n\tif (uMsg == WM_DRAWITEM) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (LPDRAWITEMSTRUCT)lParam); \\\n\t\tlResult = TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)\n#define MSG_WM_MEASUREITEM(func) \\\n\tif (uMsg == WM_MEASUREITEM) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (LPMEASUREITEMSTRUCT)lParam); \\\n\t\tlResult = TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnDeleteItem(int nIDCtl, LPDELETEITEMSTRUCT lpDeleteItemStruct)\n#define MSG_WM_DELETEITEM(func) \\\n\tif (uMsg == WM_DELETEITEM) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (LPDELETEITEMSTRUCT)lParam); \\\n\t\tlResult = TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n//int OnCharToItem(UINT nChar, UINT nIndex, CListBox listBox)\n#define MSG_WM_CHARTOITEM(func) \\\n\tif (uMsg == WM_CHARTOITEM) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// int OnVKeyToItem(UINT nKey, UINT nIndex, CListBox listBox)\n#define MSG_WM_VKEYTOITEM(func) \\\n\tif (uMsg == WM_VKEYTOITEM) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HCURSOR OnQueryDragIcon()\n#define MSG_WM_QUERYDRAGICON(func) \\\n\tif (uMsg == WM_QUERYDRAGICON) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func(); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// int OnCompareItem(int nIDCtl, LPCOMPAREITEMSTRUCT lpCompareItemStruct)\n#define MSG_WM_COMPAREITEM(func) \\\n\tif (uMsg == WM_COMPAREITEM) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((UINT)wParam, (LPCOMPAREITEMSTRUCT)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnCompacting(UINT nCpuTime)\n#define MSG_WM_COMPACTING(func) \\\n\tif (uMsg == WM_COMPACTING) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// BOOL OnNcCreate(LPCREATESTRUCT lpCreateStruct)\n#define MSG_WM_NCCREATE(func) \\\n\tif (uMsg == WM_NCCREATE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((LPCREATESTRUCT)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNcDestroy()\n#define MSG_WM_NCDESTROY(func) \\\n\tif (uMsg == WM_NCDESTROY) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnNcCalcSize(BOOL bCalcValidRects, LPARAM lParam)\n#define MSG_WM_NCCALCSIZE(func) \\\n\tif (uMsg == WM_NCCALCSIZE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((BOOL)wParam, lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// UINT OnNcHitTest(CPoint point)\n#define MSG_WM_NCHITTEST(func) \\\n\tif (uMsg == WM_NCHITTEST) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func(::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNcPaint(CRgnHandle rgn)\n#define MSG_WM_NCPAINT(func) \\\n\tif (uMsg == WM_NCPAINT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HRGN)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// BOOL OnNcActivate(BOOL bActive)\n#define MSG_WM_NCACTIVATE(func) \\\n\tif (uMsg == WM_NCACTIVATE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((BOOL)wParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// UINT OnGetDlgCode(LPMSG lpMsg)\n#define MSG_WM_GETDLGCODE(func) \\\n\tif (uMsg == WM_GETDLGCODE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((LPMSG)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNcMouseMove(UINT nHitTest, CPoint point)\n#define MSG_WM_NCMOUSEMOVE(func) \\\n\tif (uMsg == WM_NCMOUSEMOVE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNcLButtonDown(UINT nHitTest, CPoint point)\n#define MSG_WM_NCLBUTTONDOWN(func) \\\n\tif (uMsg == WM_NCLBUTTONDOWN) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNcLButtonUp(UINT nHitTest, CPoint point)\n#define MSG_WM_NCLBUTTONUP(func) \\\n\tif (uMsg == WM_NCLBUTTONUP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNcLButtonDblClk(UINT nHitTest, CPoint point)\n#define MSG_WM_NCLBUTTONDBLCLK(func) \\\n\tif (uMsg == WM_NCLBUTTONDBLCLK) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNcRButtonDown(UINT nHitTest, CPoint point)\n#define MSG_WM_NCRBUTTONDOWN(func) \\\n\tif (uMsg == WM_NCRBUTTONDOWN) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNcRButtonUp(UINT nHitTest, CPoint point)\n#define MSG_WM_NCRBUTTONUP(func) \\\n\tif (uMsg == WM_NCRBUTTONUP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNcRButtonDblClk(UINT nHitTest, CPoint point)\n#define MSG_WM_NCRBUTTONDBLCLK(func) \\\n\tif (uMsg == WM_NCRBUTTONDBLCLK) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNcMButtonDown(UINT nHitTest, CPoint point)\n#define MSG_WM_NCMBUTTONDOWN(func) \\\n\tif (uMsg == WM_NCMBUTTONDOWN) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNcMButtonUp(UINT nHitTest, CPoint point)\n#define MSG_WM_NCMBUTTONUP(func) \\\n\tif (uMsg == WM_NCMBUTTONUP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNcMButtonDblClk(UINT nHitTest, CPoint point)\n#define MSG_WM_NCMBUTTONDBLCLK(func) \\\n\tif (uMsg == WM_NCMBUTTONDBLCLK) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)\n#define MSG_WM_KEYDOWN(func) \\\n\tif (uMsg == WM_KEYDOWN) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)\n#define MSG_WM_KEYUP(func) \\\n\tif (uMsg == WM_KEYUP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnChar(TCHAR chChar, UINT nRepCnt, UINT nFlags)\n#define MSG_WM_CHAR(func) \\\n\tif (uMsg == WM_CHAR) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnDeadChar(TCHAR chChar, UINT nRepCnt, UINT nFlags)\n#define MSG_WM_DEADCHAR(func) \\\n\tif (uMsg == WM_DEADCHAR) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)\n#define MSG_WM_SYSKEYDOWN(func) \\\n\tif (uMsg == WM_SYSKEYDOWN) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnSysKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)\n#define MSG_WM_SYSKEYUP(func) \\\n\tif (uMsg == WM_SYSKEYUP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnSysChar(TCHAR chChar, UINT nRepCnt, UINT nFlags)\n#define MSG_WM_SYSCHAR(func) \\\n\tif (uMsg == WM_SYSCHAR) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnSysDeadChar(TCHAR chChar, UINT nRepCnt, UINT nFlags)\n#define MSG_WM_SYSDEADCHAR(func) \\\n\tif (uMsg == WM_SYSDEADCHAR) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnSysCommand(UINT nID, CPoint point)\n#define MSG_WM_SYSCOMMAND(func) \\\n\tif (uMsg == WM_SYSCOMMAND) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnTCard(UINT idAction, DWORD dwActionData)\n#define MSG_WM_TCARD(func) \\\n\tif (uMsg == WM_TCARD) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (DWORD)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnTimer(UINT_PTR nIDEvent)\n#define MSG_WM_TIMER(func) \\\n\tif (uMsg == WM_TIMER) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT_PTR)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar pScrollBar)\n#define MSG_WM_HSCROLL(func) \\\n\tif (uMsg == WM_HSCROLL) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((int)LOWORD(wParam), (short)HIWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar pScrollBar)\n#define MSG_WM_VSCROLL(func) \\\n\tif (uMsg == WM_VSCROLL) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((int)LOWORD(wParam), (short)HIWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnInitMenu(CMenuHandle menu)\n#define MSG_WM_INITMENU(func) \\\n\tif (uMsg == WM_INITMENU) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HMENU)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnInitMenuPopup(CMenuHandle menuPopup, UINT nIndex, BOOL bSysMenu)\n#define MSG_WM_INITMENUPOPUP(func) \\\n\tif (uMsg == WM_INITMENUPOPUP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HMENU)wParam, (UINT)LOWORD(lParam), (BOOL)HIWORD(lParam)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnMenuSelect(UINT nItemID, UINT nFlags, CMenuHandle menu)\n#define MSG_WM_MENUSELECT(func) \\\n\tif (uMsg == WM_MENUSELECT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (HMENU)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenuHandle menu)\n#define MSG_WM_MENUCHAR(func) \\\n\tif (uMsg == WM_MENUCHAR) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((TCHAR)LOWORD(wParam), (UINT)HIWORD(wParam), (HMENU)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnNotify(int idCtrl, LPNMHDR pnmh)\n#define MSG_WM_NOTIFY(func) \\\n\tif (uMsg == WM_NOTIFY) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((int)wParam, (LPNMHDR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnEnterIdle(UINT nWhy, CWindow wndWho)\n#define MSG_WM_ENTERIDLE(func) \\\n\tif (uMsg == WM_ENTERIDLE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnMouseMove(UINT nFlags, CPoint point)\n#define MSG_WM_MOUSEMOVE(func) \\\n\tif (uMsg == WM_MOUSEMOVE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)\n#define MSG_WM_MOUSEWHEEL(func) \\\n\tif (uMsg == WM_MOUSEWHEEL) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((UINT)LOWORD(wParam), (short)HIWORD(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnLButtonDown(UINT nFlags, CPoint point)\n#define MSG_WM_LBUTTONDOWN(func) \\\n\tif (uMsg == WM_LBUTTONDOWN) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnLButtonUp(UINT nFlags, CPoint point)\n#define MSG_WM_LBUTTONUP(func) \\\n\tif (uMsg == WM_LBUTTONUP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnLButtonDblClk(UINT nFlags, CPoint point)\n#define MSG_WM_LBUTTONDBLCLK(func) \\\n\tif (uMsg == WM_LBUTTONDBLCLK) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnRButtonDown(UINT nFlags, CPoint point)\n#define MSG_WM_RBUTTONDOWN(func) \\\n\tif (uMsg == WM_RBUTTONDOWN) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnRButtonUp(UINT nFlags, CPoint point)\n#define MSG_WM_RBUTTONUP(func) \\\n\tif (uMsg == WM_RBUTTONUP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnRButtonDblClk(UINT nFlags, CPoint point)\n#define MSG_WM_RBUTTONDBLCLK(func) \\\n\tif (uMsg == WM_RBUTTONDBLCLK) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnMButtonDown(UINT nFlags, CPoint point)\n#define MSG_WM_MBUTTONDOWN(func) \\\n\tif (uMsg == WM_MBUTTONDOWN) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnMButtonUp(UINT nFlags, CPoint point)\n#define MSG_WM_MBUTTONUP(func) \\\n\tif (uMsg == WM_MBUTTONUP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnMButtonDblClk(UINT nFlags, CPoint point)\n#define MSG_WM_MBUTTONDBLCLK(func) \\\n\tif (uMsg == WM_MBUTTONDBLCLK) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnParentNotify(UINT message, UINT nChildID, LPARAM lParam)\n#define MSG_WM_PARENTNOTIFY(func) \\\n\tif (uMsg == WM_PARENTNOTIFY) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnMDIActivate(CWindow wndDeactivate, CWindow wndActivate)\n#define MSG_WM_MDIACTIVATE(func) \\\n\tif (uMsg == WM_MDIACTIVATE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HWND)wParam, (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnRenderFormat(UINT nFormat)\n#define MSG_WM_RENDERFORMAT(func) \\\n\tif (uMsg == WM_RENDERFORMAT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnRenderAllFormats()\n#define MSG_WM_RENDERALLFORMATS(func) \\\n\tif (uMsg == WM_RENDERALLFORMATS) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnDestroyClipboard()\n#define MSG_WM_DESTROYCLIPBOARD(func) \\\n\tif (uMsg == WM_DESTROYCLIPBOARD) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnDrawClipboard()\n#define MSG_WM_DRAWCLIPBOARD(func) \\\n\tif (uMsg == WM_DRAWCLIPBOARD) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnPaintClipboard(CWindow wndViewer, const LPPAINTSTRUCT lpPaintStruct)\n#define MSG_WM_PAINTCLIPBOARD(func) \\\n\tif (uMsg == WM_PAINTCLIPBOARD) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HWND)wParam, (const LPPAINTSTRUCT)::GlobalLock((HGLOBAL)lParam)); \\\n\t\t::GlobalUnlock((HGLOBAL)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnVScrollClipboard(CWindow wndViewer, UINT nSBCode, UINT nPos)\n#define MSG_WM_VSCROLLCLIPBOARD(func) \\\n\tif (uMsg == WM_VSCROLLCLIPBOARD) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HWND)wParam, (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnContextMenu(CWindow wnd, CPoint point)\n#define MSG_WM_CONTEXTMENU(func) \\\n\tif (uMsg == WM_CONTEXTMENU) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HWND)wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnSizeClipboard(CWindow wndViewer, const LPRECT lpRect)\n#define MSG_WM_SIZECLIPBOARD(func) \\\n\tif (uMsg == WM_SIZECLIPBOARD) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HWND)wParam, (const LPRECT)::GlobalLock((HGLOBAL)lParam)); \\\n\t\t::GlobalUnlock((HGLOBAL)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnAskCbFormatName(UINT nMaxCount, LPTSTR lpszString)\n#define MSG_WM_ASKCBFORMATNAME(func) \\\n\tif (uMsg == WM_ASKCBFORMATNAME) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (LPTSTR)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnChangeCbChain(CWindow wndRemove, CWindow wndAfter)\n#define MSG_WM_CHANGECBCHAIN(func) \\\n\tif (uMsg == WM_CHANGECBCHAIN) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HWND)wParam, (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnHScrollClipboard(CWindow wndViewer, UINT nSBCode, UINT nPos)\n#define MSG_WM_HSCROLLCLIPBOARD(func) \\\n\tif (uMsg == WM_HSCROLLCLIPBOARD) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HWND)wParam, (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// BOOL OnQueryNewPalette()\n#define MSG_WM_QUERYNEWPALETTE(func) \\\n\tif (uMsg == WM_QUERYNEWPALETTE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func(); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnPaletteChanged(CWindow wndFocus)\n#define MSG_WM_PALETTECHANGED(func) \\\n\tif (uMsg == WM_PALETTECHANGED) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HWND)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnPaletteIsChanging(CWindow wndPalChg)\n#define MSG_WM_PALETTEISCHANGING(func) \\\n\tif (uMsg == WM_PALETTEISCHANGING) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HWND)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnDropFiles(HDROP hDropInfo)\n#define MSG_WM_DROPFILES(func) \\\n\tif (uMsg == WM_DROPFILES) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HDROP)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnWindowPosChanging(LPWINDOWPOS lpWndPos)\n#define MSG_WM_WINDOWPOSCHANGING(func) \\\n\tif (uMsg == WM_WINDOWPOSCHANGING) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((LPWINDOWPOS)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnWindowPosChanged(LPWINDOWPOS lpWndPos)\n#define MSG_WM_WINDOWPOSCHANGED(func) \\\n\tif (uMsg == WM_WINDOWPOSCHANGED) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((LPWINDOWPOS)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnExitMenuLoop(BOOL fIsTrackPopupMenu)\n#define MSG_WM_EXITMENULOOP(func) \\\n\tif (uMsg == WM_EXITMENULOOP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((BOOL)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnEnterMenuLoop(BOOL fIsTrackPopupMenu)\n#define MSG_WM_ENTERMENULOOP(func) \\\n\tif (uMsg == WM_ENTERMENULOOP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((BOOL)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct)\n#define MSG_WM_STYLECHANGED(func) \\\n\tif (uMsg == WM_STYLECHANGED) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (LPSTYLESTRUCT)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnStyleChanging(int nStyleType, LPSTYLESTRUCT lpStyleStruct)\n#define MSG_WM_STYLECHANGING(func) \\\n\tif (uMsg == WM_STYLECHANGING) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (LPSTYLESTRUCT)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnSizing(UINT fwSide, LPRECT pRect)\n#define MSG_WM_SIZING(func) \\\n\tif (uMsg == WM_SIZING) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (LPRECT)lParam); \\\n\t\tlResult = TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnMoving(UINT fwSide, LPRECT pRect)\n#define MSG_WM_MOVING(func) \\\n\tif (uMsg == WM_MOVING) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (LPRECT)lParam); \\\n\t\tlResult = TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnCaptureChanged(CWindow wnd)\n#define MSG_WM_CAPTURECHANGED(func) \\\n\tif (uMsg == WM_CAPTURECHANGED) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// BOOL OnDeviceChange(UINT nEventType, DWORD_PTR dwData)\n#define MSG_WM_DEVICECHANGE(func) \\\n\tif (uMsg == WM_DEVICECHANGE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((UINT)wParam, (DWORD_PTR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnCommand(UINT uNotifyCode, int nID, CWindow wndCtl)\n#define MSG_WM_COMMAND(func) \\\n\tif (uMsg == WM_COMMAND) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnDisplayChange(UINT uBitsPerPixel, CSize sizeScreen)\n#define MSG_WM_DISPLAYCHANGE(func) \\\n\tif (uMsg == WM_DISPLAYCHANGE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnEnterSizeMove()\n#define MSG_WM_ENTERSIZEMOVE(func) \\\n\tif (uMsg == WM_ENTERSIZEMOVE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnExitSizeMove()\n#define MSG_WM_EXITSIZEMOVE(func) \\\n\tif (uMsg == WM_EXITSIZEMOVE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HFONT OnGetFont()\n#define MSG_WM_GETFONT(func) \\\n\tif (uMsg == WM_GETFONT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func(); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnGetHotKey()\n#define MSG_WM_GETHOTKEY(func) \\\n\tif (uMsg == WM_GETHOTKEY) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func(); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HICON OnGetIcon()\n#define MSG_WM_GETICON(func) \\\n\tif (uMsg == WM_GETICON) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((UINT)wParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// int OnGetText(int cchTextMax, LPTSTR lpszText)\n#define MSG_WM_GETTEXT(func) \\\n\tif (uMsg == WM_GETTEXT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((int)wParam, (LPTSTR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// int OnGetTextLength()\n#define MSG_WM_GETTEXTLENGTH(func) \\\n\tif (uMsg == WM_GETTEXTLENGTH) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func(); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnHelp(LPHELPINFO lpHelpInfo)\n#define MSG_WM_HELP(func) \\\n\tif (uMsg == WM_HELP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((LPHELPINFO)lParam); \\\n\t\tlResult = TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnHotKey(int nHotKeyID, UINT uModifiers, UINT uVirtKey)\n#define MSG_WM_HOTKEY(func) \\\n\tif (uMsg == WM_HOTKEY) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((int)wParam, (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnInputLangChange(DWORD dwCharSet, HKL hKbdLayout)\n#define MSG_WM_INPUTLANGCHANGE(func) \\\n\tif (uMsg == WM_INPUTLANGCHANGE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((DWORD)wParam, (HKL)lParam); \\\n\t\tlResult = TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnInputLangChangeRequest(BOOL bSysCharSet, HKL hKbdLayout)\n#define MSG_WM_INPUTLANGCHANGEREQUEST(func) \\\n\tif (uMsg == WM_INPUTLANGCHANGEREQUEST) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((BOOL)wParam, (HKL)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNextDlgCtl(BOOL bHandle, WPARAM wCtlFocus)\n#define MSG_WM_NEXTDLGCTL(func) \\\n\tif (uMsg == WM_NEXTDLGCTL) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((BOOL)LOWORD(lParam), wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNextMenu(int nVirtKey, LPMDINEXTMENU lpMdiNextMenu)\n#define MSG_WM_NEXTMENU(func) \\\n\tif (uMsg == WM_NEXTMENU) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((int)wParam, (LPMDINEXTMENU)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// int OnNotifyFormat(CWindow wndFrom, int nCommand)\n#define MSG_WM_NOTIFYFORMAT(func) \\\n\tif (uMsg == WM_NOTIFYFORMAT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HWND)wParam, (int)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// BOOL OnPowerBroadcast(DWORD dwPowerEvent, DWORD_PTR dwData)\n#define MSG_WM_POWERBROADCAST(func) \\\n\tif (uMsg == WM_POWERBROADCAST) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((DWORD)wParam, (DWORD_PTR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnPrint(CDCHandle dc, UINT uFlags)\n#define MSG_WM_PRINT(func) \\\n\tif (uMsg == WM_PRINT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HDC)wParam, (UINT)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnPrintClient(CDCHandle dc, UINT uFlags)\n#define MSG_WM_PRINTCLIENT(func) \\\n\tif (uMsg == WM_PRINTCLIENT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HDC)wParam, (UINT)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnRasDialEvent(RASCONNSTATE rasconnstate, DWORD dwError)\n#define MSG_WM_RASDIALEVENT(func) \\\n\tif (uMsg == WM_RASDIALEVENT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((RASCONNSTATE)wParam, (DWORD)lParam); \\\n\t\tlResult = TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnSetFont(CFontHandle font, BOOL bRedraw)\n#define MSG_WM_SETFONT(func) \\\n\tif (uMsg == WM_SETFONT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((HFONT)wParam, (BOOL)LOWORD(lParam)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// int OnSetHotKey(int nVirtKey, UINT uFlags)\n#define MSG_WM_SETHOTKEY(func) \\\n\tif (uMsg == WM_SETHOTKEY) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((int)LOBYTE(LOWORD(wParam)), (UINT)HIBYTE(LOWORD(wParam))); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HICON OnSetIcon(UINT uType, HICON hIcon)\n#define MSG_WM_SETICON(func) \\\n\tif (uMsg == WM_SETICON) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((UINT)wParam, (HICON)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnSetRedraw(BOOL bRedraw)\n#define MSG_WM_SETREDRAW(func) \\\n\tif (uMsg == WM_SETREDRAW) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((BOOL)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// int OnSetText(LPCTSTR lpstrText)\n#define MSG_WM_SETTEXT(func) \\\n\tif (uMsg == WM_SETTEXT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((LPCTSTR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnUserChanged()\n#define MSG_WM_USERCHANGED(func) \\\n\tif (uMsg == WM_USERCHANGED) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n///////////////////////////////////////////////////////////////////////////////\n// Newer Windows messages\n\n// void OnMouseHover(WPARAM wParam, CPoint ptPos)\n#define MSG_WM_MOUSEHOVER(func) \\\n\tif (uMsg == WM_MOUSEHOVER) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(wParam, ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnMouseLeave()\n#define MSG_WM_MOUSELEAVE(func) \\\n\tif (uMsg == WM_MOUSELEAVE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNcMouseHover(UINT nHitTest, CPoint ptPos)\n#define MSG_WM_NCMOUSEHOVER(func) \\\n\tif (uMsg == WM_NCMOUSEHOVER) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, ::CPoint(MAKEPOINTS(lParam).x, MAKEPOINTS(lParam).y)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNcMouseLeave()\n#define MSG_WM_NCMOUSELEAVE(func) \\\n\tif (uMsg == WM_NCMOUSELEAVE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnMenuRButtonUp(WPARAM wParam, CMenuHandle menu)\n#define MSG_WM_MENURBUTTONUP(func) \\\n\tif (uMsg == WM_MENURBUTTONUP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(wParam, (HMENU)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnMenuDrag(WPARAM wParam, CMenuHandle menu)\n#define MSG_WM_MENUDRAG(func) \\\n\tif (uMsg == WM_MENUDRAG) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func(wParam, (HMENU)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnMenuGetObject(PMENUGETOBJECTINFO info)\n#define MSG_WM_MENUGETOBJECT(func) \\\n\tif (uMsg == WM_MENUGETOBJECT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((PMENUGETOBJECTINFO)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnUnInitMenuPopup(UINT nID, CMenuHandle menu)\n#define MSG_WM_UNINITMENUPOPUP(func) \\\n\tif (uMsg == WM_UNINITMENUPOPUP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)HIWORD(lParam), (HMENU)wParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnMenuCommand(WPARAM nIndex, CMenuHandle menu)\n#define MSG_WM_MENUCOMMAND(func) \\\n\tif (uMsg == WM_MENUCOMMAND) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(wParam, (HMENU)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// BOOL OnAppCommand(CWindow wndFocus, short cmd, WORD uDevice, int dwKeys)\n#define MSG_WM_APPCOMMAND(func) \\\n\tif (uMsg == WM_APPCOMMAND) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HWND)wParam, GET_APPCOMMAND_LPARAM(lParam), GET_DEVICE_LPARAM(lParam), GET_KEYSTATE_LPARAM(lParam)); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNCXButtonDown(int fwButton, short nHittest, CPoint ptPos)\n#define MSG_WM_NCXBUTTONDOWN(func) \\\n\tif (uMsg == WM_NCXBUTTONDOWN) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(GET_XBUTTON_WPARAM(wParam), GET_NCHITTEST_WPARAM(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = (LRESULT)TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNCXButtonUp(int fwButton, short nHittest, CPoint ptPos)\n#define MSG_WM_NCXBUTTONUP(func) \\\n\tif (uMsg == WM_NCXBUTTONUP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(GET_XBUTTON_WPARAM(wParam), GET_NCHITTEST_WPARAM(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = (LRESULT)TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnNCXButtonDblClk(int fwButton, short nHittest, CPoint ptPos)\n#define MSG_WM_NCXBUTTONDBLCLK(func) \\\n\tif (uMsg == WM_NCXBUTTONDBLCLK) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(GET_XBUTTON_WPARAM(wParam), GET_NCHITTEST_WPARAM(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = (LRESULT)TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnXButtonDown(int fwButton, int dwKeys, CPoint ptPos)\n#define MSG_WM_XBUTTONDOWN(func) \\\n\tif (uMsg == WM_XBUTTONDOWN) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(GET_XBUTTON_WPARAM(wParam), GET_KEYSTATE_WPARAM(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = (LRESULT)TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnXButtonUp(int fwButton, int dwKeys, CPoint ptPos)\n#define MSG_WM_XBUTTONUP(func) \\\n\tif (uMsg == WM_XBUTTONUP) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(GET_XBUTTON_WPARAM(wParam), GET_KEYSTATE_WPARAM(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = (LRESULT)TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnXButtonDblClk(int fwButton, int dwKeys, CPoint ptPos)\n#define MSG_WM_XBUTTONDBLCLK(func) \\\n\tif (uMsg == WM_XBUTTONDBLCLK) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(GET_XBUTTON_WPARAM(wParam), GET_KEYSTATE_WPARAM(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tlResult = (LRESULT)TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnChangeUIState(WORD nAction, WORD nState)\n#define MSG_WM_CHANGEUISTATE(func) \\\n\tif (uMsg == WM_CHANGEUISTATE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(LOWORD(wParam), HIWORD(wParam)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnUpdateUIState(WORD nAction, WORD nState)\n#define MSG_WM_UPDATEUISTATE(func) \\\n\tif (uMsg == WM_UPDATEUISTATE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(LOWORD(wParam), HIWORD(wParam)); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnQueryUIState()\n#define MSG_WM_QUERYUISTATE(func) \\\n\tif (uMsg == WM_QUERYUISTATE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func(); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnInput(WPARAM RawInputCode, HRAWINPUT hRawInput)\n#define MSG_WM_INPUT(func) \\\n\tif (uMsg == WM_INPUT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(GET_RAWINPUT_CODE_WPARAM(wParam), (HRAWINPUT)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnUniChar(TCHAR nChar, UINT nRepCnt, UINT nFlags)\n#define MSG_WM_UNICHAR(func) \\\n\tif (uMsg == WM_UNICHAR) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t{ \\\n\t\t\tlResult = (wParam == UNICODE_NOCHAR) ? TRUE : FALSE; \\\n\t\t\treturn TRUE; \\\n\t\t} \\\n\t}\n\n// void OnWTSSessionChange(WPARAM nStatusCode, DWORD dwSessionID)\n#define MSG_WM_WTSSESSION_CHANGE(func) \\\n\tif (uMsg == WM_WTSSESSION_CHANGE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(wParam, (DWORD)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnThemeChanged()\n#define MSG_WM_THEMECHANGED(func) \\\n\tif (uMsg == WM_THEMECHANGED) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#if (_WIN32_WINNT >= 0x0600)\n\n// BOOL OnMouseHWheel(UINT nFlags, short zDelta, CPoint pt)\n#define MSG_WM_MOUSEHWHEEL(func) \\\n\tif (uMsg == WM_MOUSEHWHEEL) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((UINT)LOWORD(wParam), (short)HIWORD(wParam), ::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#endif // (_WIN32_WINNT >= 0x0600)\n\n#if (WINVER >= 0x0601)\n\n// void OnGesture(ULONGLONG ullArguments, HGESTUREINFO hGestureInfo)\n#define MSG_WM_GESTURE(func) \\\n\tif (uMsg == WM_GESTURE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((ULONGLONG)wParam, (HGESTUREINFO)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnGestureNotify(PGESTURENOTIFYSTRUCT pGestureNotifyStruct)\n#define MSG_WM_GESTURENOTIFY(func) \\\n\tif (uMsg == WM_GESTURENOTIFY) \\\n\t{ \\\n\t\tfunc((PGESTURENOTIFYSTRUCT)lParam); \\\n\t}\n\n// void OnDpiChanged(UINT nDpiX, UINT nDpiY, PRECT pRect)\n#define MSG_WM_DPICHANGED(func) \\\n\tif (uMsg == WM_DPICHANGED) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (PRECT)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#endif // (WINVER >= 0x0601)\n\n#if (WINVER >= 0x0605)\n\n// void OnDpiChangedBeforeParent()\n#define MSG_WM_DPICHANGED_BEFOREPARENT(func) \\\n\tif (uMsg == WM_DPICHANGED_BEFOREPARENT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnDpiChangedAfterParent()\n#define MSG_WM_DPICHANGED_AFTERPARENT(func) \\\n\tif (uMsg == WM_DPICHANGED_AFTERPARENT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// BOOL OnGetDpiScaledSize(UINT uDpi, PSIZE pSize)\n#define MSG_WM_GETDPISCALEDSIZE(func) \\\nif (uMsg == WM_GETDPISCALEDSIZE) \\\n{ \\\n\tthis->SetMsgHandled(TRUE); \\\n\tlResult = (LRESULT)func((UINT)wParam, (PSIZE)lParam); \\\n\tif(this->IsMsgHandled()) \\\n\t\treturn TRUE; \\\n}\n\n#endif // (WINVER >= 0x0605)\n\n///////////////////////////////////////////////////////////////////////////////\n// ATL defined messages\n\n// BOOL OnForwardMsg(LPMSG Msg, DWORD nUserData)\n#define MSG_WM_FORWARDMSG(func) \\\n\tif (uMsg == WM_FORWARDMSG) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((LPMSG)lParam, (DWORD)wParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n///////////////////////////////////////////////////////////////////////////////\n// Dialog specific messages\n\n// LRESULT OnDMGetDefID()\n#define MSG_DM_GETDEFID(func) \\\n\tif (uMsg == DM_GETDEFID) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func(); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnDMSetDefID(UINT DefID)\n#define MSG_DM_SETDEFID(func) \\\n\tif (uMsg == DM_SETDEFID) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam); \\\n\t\tlResult = TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnDMReposition()\n#define MSG_DM_REPOSITION(func) \\\n\tif (uMsg == DM_REPOSITION) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n///////////////////////////////////////////////////////////////////////////////\n// Reflected messages\n\n// void OnReflectedCommand(UINT uNotifyCode, int nID, CWindow wndCtl)\n#define MSG_OCM_COMMAND(func) \\\n\tif (uMsg == OCM_COMMAND) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnReflectedNotify(int idCtrl, LPNMHDR pnmh)\n#define MSG_OCM_NOTIFY(func) \\\n\tif (uMsg == OCM_NOTIFY) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((int)wParam, (LPNMHDR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnReflectedParentNotify(UINT message, UINT nChildID, LPARAM lParam)\n#define MSG_OCM_PARENTNOTIFY(func) \\\n\tif (uMsg == OCM_PARENTNOTIFY) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnReflectedDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)\n#define MSG_OCM_DRAWITEM(func) \\\n\tif (uMsg == OCM_DRAWITEM) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (LPDRAWITEMSTRUCT)lParam); \\\n\t\tlResult = TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnReflectedMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)\n#define MSG_OCM_MEASUREITEM(func) \\\n\tif (uMsg == OCM_MEASUREITEM) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (LPMEASUREITEMSTRUCT)lParam); \\\n\t\tlResult = TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// int OnReflectedCompareItem(int nIDCtl, LPCOMPAREITEMSTRUCT lpCompareItemStruct)\n#define MSG_OCM_COMPAREITEM(func) \\\n\tif (uMsg == OCM_COMPAREITEM) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((UINT)wParam, (LPCOMPAREITEMSTRUCT)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnReflectedDeleteItem(int nIDCtl, LPDELETEITEMSTRUCT lpDeleteItemStruct)\n#define MSG_OCM_DELETEITEM(func) \\\n\tif (uMsg == OCM_DELETEITEM) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)wParam, (LPDELETEITEMSTRUCT)lParam); \\\n\t\tlResult = TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// int OnReflectedVKeyToItem(UINT nKey, UINT nIndex, CListBox listBox)\n#define MSG_OCM_VKEYTOITEM(func) \\\n\tif (uMsg == OCM_VKEYTOITEM) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n//int OnReflectedCharToItem(UINT nChar, UINT nIndex, CListBox listBox)\n#define MSG_OCM_CHARTOITEM(func) \\\n\tif (uMsg == OCM_CHARTOITEM) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnReflectedHScroll(UINT nSBCode, UINT nPos, CScrollBar pScrollBar)\n#define MSG_OCM_HSCROLL(func) \\\n\tif (uMsg == OCM_HSCROLL) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((int)LOWORD(wParam), (short)HIWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnReflectedVScroll(UINT nSBCode, UINT nPos, CScrollBar pScrollBar)\n#define MSG_OCM_VSCROLL(func) \\\n\tif (uMsg == OCM_VSCROLL) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((int)LOWORD(wParam), (short)HIWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HBRUSH OnReflectedCtlColorEdit(CDCHandle dc, CEdit edit)\n#define MSG_OCM_CTLCOLOREDIT(func) \\\n\tif (uMsg == OCM_CTLCOLOREDIT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HBRUSH OnReflectedCtlColorListBox(CDCHandle dc, CListBox listBox)\n#define MSG_OCM_CTLCOLORLISTBOX(func) \\\n\tif (uMsg == OCM_CTLCOLORLISTBOX) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HBRUSH OnReflectedCtlColorBtn(CDCHandle dc, CButton button)\n#define MSG_OCM_CTLCOLORBTN(func) \\\n\tif (uMsg == OCM_CTLCOLORBTN) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HBRUSH OnReflectedCtlColorDlg(CDCHandle dc, CWindow wnd)\n#define MSG_OCM_CTLCOLORDLG(func) \\\n\tif (uMsg == OCM_CTLCOLORDLG) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HBRUSH OnReflectedCtlColorScrollBar(CDCHandle dc, CScrollBar scrollBar)\n#define MSG_OCM_CTLCOLORSCROLLBAR(func) \\\n\tif (uMsg == OCM_CTLCOLORSCROLLBAR) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// HBRUSH OnReflectedCtlColorStatic(CDCHandle dc, CStatic wndStatic)\n#define MSG_OCM_CTLCOLORSTATIC(func) \\\n\tif (uMsg == OCM_CTLCOLORSTATIC) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n///////////////////////////////////////////////////////////////////////////////\n// Edit specific messages\n\n// void OnClear()\n#define MSG_WM_CLEAR(func) \\\n\tif (uMsg == WM_CLEAR) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnCopy()\n#define MSG_WM_COPY(func) \\\n\tif (uMsg == WM_COPY) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnCut()\n#define MSG_WM_CUT(func) \\\n\tif (uMsg == WM_CUT) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnPaste()\n#define MSG_WM_PASTE(func) \\\n\tif (uMsg == WM_PASTE) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnUndo()\n#define MSG_WM_UNDO(func) \\\n\tif (uMsg == WM_UNDO) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n///////////////////////////////////////////////////////////////////////////////\n// Generic message handlers\n\n// LRESULT OnMessageHandlerEX(UINT uMsg, WPARAM wParam, LPARAM lParam)\n#define MESSAGE_HANDLER_EX(msg, func) \\\n\tif(uMsg == msg) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func(uMsg, wParam, lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnMessageRangeHandlerEX(UINT uMsg, WPARAM wParam, LPARAM lParam)\n#define MESSAGE_RANGE_HANDLER_EX(msgFirst, msgLast, func) \\\n\tif((uMsg >= msgFirst) && (uMsg <= msgLast)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func(uMsg, wParam, lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n///////////////////////////////////////////////////////////////////////////////\n// Commands and notifications\n\n// void OnCommandHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\n#define COMMAND_HANDLER_EX(id, code, func) \\\n\tif ((uMsg == WM_COMMAND) && (code == HIWORD(wParam)) && (id == LOWORD(wParam))) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnCommandIDHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\n#define COMMAND_ID_HANDLER_EX(id, func) \\\n\tif ((uMsg == WM_COMMAND) && (id == LOWORD(wParam))) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnCommandCodeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\n#define COMMAND_CODE_HANDLER_EX(code, func) \\\n\tif ((uMsg == WM_COMMAND) && (code == HIWORD(wParam))) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnNotifyHandlerEX(LPNMHDR pnmh)\n#define NOTIFY_HANDLER_EX(id, cd, func) \\\n\tif ((uMsg == WM_NOTIFY) && (cd == ((LPNMHDR)lParam)->code) && (id == ((LPNMHDR)lParam)->idFrom)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((LPNMHDR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnNotifyIDHandlerEX(LPNMHDR pnmh)\n#define NOTIFY_ID_HANDLER_EX(id, func) \\\n\tif ((uMsg == WM_NOTIFY) && (id == ((LPNMHDR)lParam)->idFrom)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((LPNMHDR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnNotifyCodeHandlerEX(LPNMHDR pnmh)\n#define NOTIFY_CODE_HANDLER_EX(cd, func) \\\n\tif ((uMsg == WM_NOTIFY) && (cd == ((LPNMHDR)lParam)->code)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((LPNMHDR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnCommandRangeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\n#define COMMAND_RANGE_HANDLER_EX(idFirst, idLast, func) \\\n\tif((uMsg == WM_COMMAND) && (LOWORD(wParam) >= idFirst) && (LOWORD(wParam) <= idLast)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnCommandRangeCodeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\n#define COMMAND_RANGE_CODE_HANDLER_EX(idFirst, idLast, code, func) \\\n\tif((uMsg == WM_COMMAND) && (code == HIWORD(wParam)) && (LOWORD(wParam) >= idFirst) && (LOWORD(wParam) <= idLast)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnNotifyRangeHandlerEX(LPNMHDR pnmh)\n#define NOTIFY_RANGE_HANDLER_EX(idFirst, idLast, func) \\\n\tif((uMsg == WM_NOTIFY) && (((LPNMHDR)lParam)->idFrom >= idFirst) && (((LPNMHDR)lParam)->idFrom <= idLast)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((LPNMHDR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnNotifyRangeCodeHandlerEX(LPNMHDR pnmh)\n#define NOTIFY_RANGE_CODE_HANDLER_EX(idFirst, idLast, cd, func) \\\n\tif((uMsg == WM_NOTIFY) && (cd == ((LPNMHDR)lParam)->code) && (((LPNMHDR)lParam)->idFrom >= idFirst) && (((LPNMHDR)lParam)->idFrom <= idLast)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((LPNMHDR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnReflectedCommandHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\n#define REFLECTED_COMMAND_HANDLER_EX(id, code, func) \\\n\tif ((uMsg == OCM_COMMAND) && (code == HIWORD(wParam)) && (id == LOWORD(wParam))) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnReflectedCommandIDHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\n#define REFLECTED_COMMAND_ID_HANDLER_EX(id, func) \\\n\tif ((uMsg == OCM_COMMAND) && (id == LOWORD(wParam))) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnReflectedCommandCodeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\n#define REFLECTED_COMMAND_CODE_HANDLER_EX(code, func) \\\n\tif ((uMsg == OCM_COMMAND) && (code == HIWORD(wParam))) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnReflectedNotifyHandlerEX(LPNMHDR pnmh)\n#define REFLECTED_NOTIFY_HANDLER_EX(id, cd, func) \\\n\tif ((uMsg == OCM_NOTIFY) && (cd == ((LPNMHDR)lParam)->code) && (id == ((LPNMHDR)lParam)->idFrom)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((LPNMHDR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnReflectedNotifyIDHandlerEX(LPNMHDR pnmh)\n#define REFLECTED_NOTIFY_ID_HANDLER_EX(id, func) \\\n\tif ((uMsg == OCM_NOTIFY) && (id == ((LPNMHDR)lParam)->idFrom)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((LPNMHDR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnReflectedNotifyCodeHandlerEX(LPNMHDR pnmh)\n#define REFLECTED_NOTIFY_CODE_HANDLER_EX(cd, func) \\\n\tif ((uMsg == OCM_NOTIFY) && (cd == ((LPNMHDR)lParam)->code)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((LPNMHDR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnReflectedCommandRangeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\n#define REFLECTED_COMMAND_RANGE_HANDLER_EX(idFirst, idLast, func) \\\n\tif((uMsg == OCM_COMMAND) && (LOWORD(wParam) >= idFirst) && (LOWORD(wParam) <= idLast)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnReflectedCommandRangeCodeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\n#define REFLECTED_COMMAND_RANGE_CODE_HANDLER_EX(idFirst, idLast, code, func) \\\n\tif((uMsg == OCM_COMMAND) && (code == HIWORD(wParam)) && (LOWORD(wParam) >= idFirst) && (LOWORD(wParam) <= idLast)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\\n\t\tlResult = 0; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnReflectedNotifyRangeHandlerEX(LPNMHDR pnmh)\n#define REFLECTED_NOTIFY_RANGE_HANDLER_EX(idFirst, idLast, func) \\\n\tif((uMsg == OCM_NOTIFY) && (((LPNMHDR)lParam)->idFrom >= idFirst) && (((LPNMHDR)lParam)->idFrom <= idLast)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((LPNMHDR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// LRESULT OnReflectedNotifyRangeCodeHandlerEX(LPNMHDR pnmh)\n#define REFLECTED_NOTIFY_RANGE_CODE_HANDLER_EX(idFirst, idLast, cd, func) \\\n\tif((uMsg == OCM_NOTIFY) && (cd == ((LPNMHDR)lParam)->code) && (((LPNMHDR)lParam)->idFrom >= idFirst) && (((LPNMHDR)lParam)->idFrom <= idLast)) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tlResult = func((LPNMHDR)lParam); \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// void OnAppCommandHandler(UINT uDevice, DWORD dwKeys, CWindow wndFocus)\n#define APPCOMMAND_HANDLER_EX(cmd, func) \\\n\tif((uMsg == WM_APPCOMMAND) && (cmd == GET_APPCOMMAND_LPARAM(lParam))) \\\n\t{ \\\n\t\tthis->SetMsgHandled(TRUE); \\\n\t\tfunc(GET_DEVICE_LPARAM(lParam), GET_KEYSTATE_LPARAM(lParam), (HWND)wParam); \\\n\t\tlResult = TRUE; \\\n\t\tif(this->IsMsgHandled()) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#endif // __ATLCRACK_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlctrls.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLCTRLS_H__\n#define __ATLCTRLS_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atlctrls.h requires atlapp.h to be included first\n#endif\n\n#ifndef __ATLWIN_H__\n\t#error atlctrls.h requires atlwin.h to be included first\n#endif\n\n#include <richedit.h>\n#include <richole.h>\n\n#if (_RICHEDIT_VER < 0x0300)\n\t#error WTL10 requires _RICHEDIT_VER >= 0x0300\n#endif\n\n// protect template members from windowsx.h macros\n#ifdef _INC_WINDOWSX\n  #undef GetNextSibling\n  #undef GetPrevSibling\n#endif // _INC_WINDOWSX\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CStaticT<TBase> - CStatic\n// CButtonT<TBase> - CButton\n// CListBoxT<TBase> - CListBox\n// CComboBoxT<TBase> - CComboBox\n// CEditT<TBase> - CEdit\n// CEditCommands<T>\n// CScrollBarT<TBase> - CScrollBar\n//\n// CImageListT<t_bManaged> - CImageList, CImageListManaged\n// CListViewCtrlT<TBase> - CListViewCtrl\n// CTreeViewCtrlT<TBase> - CTreeViewCtrl\n// CTreeItemT<TBase> - CTreeItem\n// CTreeViewCtrlExT<TBase> - CTreeViewCtrlEx\n// CHeaderCtrlT<TBase> - CHeaderCtrl\n// CToolBarCtrlT<TBase> - CToolBarCtrl\n// CStatusBarCtrlT<TBase> - CStatusBarCtrl\n// CTabCtrlT<TBase> - CTabCtrl\n// CToolInfo\n// CToolTipCtrlT<TBase> - CToolTipCtrl\n// CTrackBarCtrlT<TBase> - CTrackBarCtrl\n// CUpDownCtrlT<TBase> - CUpDownCtrl\n// CProgressBarCtrlT<TBase> - CProgressBarCtrl\n// CHotKeyCtrlT<TBase> - CHotKeyCtrl\n// CAnimateCtrlT<TBase> - CAnimateCtrl\n// CRichEditCtrlT<TBase> - CRichEditCtrl\n// CRichEditCommands<T>\n// CDragListBoxT<TBase> - CDragListBox\n// CDragListNotifyImpl<T>\n// CReBarCtrlT<TBase> - CReBarCtrl\n// CComboBoxExT<TBase> - CComboBoxEx\n// CDateTimePickerCtrlT<TBase> - CDateTimePickerCtrl\n// CMonthCalendarCtrlT<TBase> - CMonthCalendarCtrl\n// CFlatScrollBarImpl<T>\n// CFlatScrollBarT<TBase> - CFlatScrollBar\n// CIPAddressCtrlT<TBase> - CIPAddressCtrl\n// CPagerCtrlT<TBase> - CPagerCtrl\n// CLinkCtrlT<TBase> - CLinkCtrl\n//\n// CCustomDraw<T>\n\n\nnamespace WTL\n{\n\n// These are wrapper classes for Windows standard and common controls.\n// To implement a window based on a control, use following:\n// Example: Implementing a window based on a list box\n//\n// class CMyListBox : CWindowImpl<CMyListBox, CListBox>\n// {\n// public:\n//      BEGIN_MSG_MAP(CMyListBox)\n//          // put your message handler entries here\n//      END_MSG_MAP()\n// };\n\n\n\n// --- Standard Windows controls ---\n\n///////////////////////////////////////////////////////////////////////////////\n// CStatic - client side for a Windows STATIC control\n\ntemplate <class TBase>\nclass CStaticT : public TBase\n{\npublic:\n// Constructors\n\tCStaticT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCStaticT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn _T(\"STATIC\");\n\t}\n\n\tHICON GetIcon() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HICON)::SendMessage(this->m_hWnd, STM_GETICON, 0, 0L);\n\t}\n\n\tHICON SetIcon(HICON hIcon)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HICON)::SendMessage(this->m_hWnd, STM_SETICON, (WPARAM)hIcon, 0L);\n\t}\n\n\tHENHMETAFILE GetEnhMetaFile() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HENHMETAFILE)::SendMessage(this->m_hWnd, STM_GETIMAGE, IMAGE_ENHMETAFILE, 0L);\n\t}\n\n\tHENHMETAFILE SetEnhMetaFile(HENHMETAFILE hMetaFile)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HENHMETAFILE)::SendMessage(this->m_hWnd, STM_SETIMAGE, IMAGE_ENHMETAFILE, (LPARAM)hMetaFile);\n\t}\n\n\tCBitmapHandle GetBitmap() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CBitmapHandle((HBITMAP)::SendMessage(this->m_hWnd, STM_GETIMAGE, IMAGE_BITMAP, 0L));\n\t}\n\n\tCBitmapHandle SetBitmap(HBITMAP hBitmap)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CBitmapHandle((HBITMAP)::SendMessage(this->m_hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap));\n\t}\n\n\tHCURSOR GetCursor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HCURSOR)::SendMessage(this->m_hWnd, STM_GETIMAGE, IMAGE_CURSOR, 0L);\n\t}\n\n\tHCURSOR SetCursor(HCURSOR hCursor)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HCURSOR)::SendMessage(this->m_hWnd, STM_SETIMAGE, IMAGE_CURSOR, (LPARAM)hCursor);\n\t}\n};\n\ntypedef CStaticT<ATL::CWindow>   CStatic;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CButton - client side for a Windows BUTTON control\n\ntemplate <class TBase>\nclass CButtonT : public TBase\n{\npublic:\n// Constructors\n\tCButtonT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCButtonT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn _T(\"BUTTON\");\n\t}\n\n\tUINT GetState() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, BM_GETSTATE, 0, 0L);\n\t}\n\n\tvoid SetState(BOOL bHighlight)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, BM_SETSTATE, bHighlight, 0L);\n\t}\n\n\tint GetCheck() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, BM_GETCHECK, 0, 0L);\n\t}\n\n\tvoid SetCheck(int nCheck)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, BM_SETCHECK, nCheck, 0L);\n\t}\n\n\tUINT GetButtonStyle() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::GetWindowLong(this->m_hWnd, GWL_STYLE) & 0xFFFF;\n\t}\n\n\tvoid SetButtonStyle(UINT nStyle, BOOL bRedraw = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, BM_SETSTYLE, nStyle, (LPARAM)bRedraw);\n\t}\n\n\tHICON GetIcon() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HICON)::SendMessage(this->m_hWnd, BM_GETIMAGE, IMAGE_ICON, 0L);\n\t}\n\n\tHICON SetIcon(HICON hIcon)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HICON)::SendMessage(this->m_hWnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);\n\t}\n\n\tCBitmapHandle GetBitmap() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CBitmapHandle((HBITMAP)::SendMessage(this->m_hWnd, BM_GETIMAGE, IMAGE_BITMAP, 0L));\n\t}\n\n\tCBitmapHandle SetBitmap(HBITMAP hBitmap)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CBitmapHandle((HBITMAP)::SendMessage(this->m_hWnd, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap));\n\t}\n\n\tBOOL GetIdealSize(LPSIZE lpSize) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, BCM_GETIDEALSIZE, 0, (LPARAM)lpSize);\n\t}\n\n\tBOOL GetImageList(PBUTTON_IMAGELIST pButtonImagelist) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, BCM_GETIMAGELIST, 0, (LPARAM)pButtonImagelist);\n\t}\n\n\tBOOL SetImageList(PBUTTON_IMAGELIST pButtonImagelist)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, BCM_SETIMAGELIST, 0, (LPARAM)pButtonImagelist);\n\t}\n\n\tBOOL GetTextMargin(LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, BCM_GETTEXTMARGIN, 0, (LPARAM)lpRect);\n\t}\n\n\tBOOL SetTextMargin(LPRECT lpRect)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, BCM_SETTEXTMARGIN, 0, (LPARAM)lpRect);\n\t}\n\n#if (WINVER >= 0x0600)\n\tvoid SetDontClick(BOOL bDontClick)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, BM_SETDONTCLICK, (WPARAM)bDontClick, 0L);\n\t}\n#endif // (WINVER >= 0x0600)\n\n#if (_WIN32_WINNT >= 0x0600)\n\tBOOL SetDropDownState(BOOL bDropDown)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (BS_SPLITBUTTON | BS_DEFSPLITBUTTON)) != 0);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, BCM_SETDROPDOWNSTATE, (WPARAM)bDropDown, 0L);\n\t}\n\n\tBOOL GetSplitInfo(PBUTTON_SPLITINFO pSplitInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (BS_SPLITBUTTON | BS_DEFSPLITBUTTON)) != 0);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, BCM_GETSPLITINFO, 0, (LPARAM)pSplitInfo);\n\t}\n\n\tBOOL SetSplitInfo(PBUTTON_SPLITINFO pSplitInfo)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (BS_SPLITBUTTON | BS_DEFSPLITBUTTON)) != 0);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, BCM_SETSPLITINFO, 0, (LPARAM)pSplitInfo);\n\t}\n\n\tint GetNoteLength() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (BS_COMMANDLINK | BS_DEFCOMMANDLINK)) != 0);\n\t\treturn (int)::SendMessage(this->m_hWnd, BCM_GETNOTELENGTH, 0, 0L);\n\t}\n\n\tBOOL GetNote(LPWSTR lpstrNoteText, int cchNoteText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (BS_COMMANDLINK | BS_DEFCOMMANDLINK)) != 0);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, BCM_GETNOTE, cchNoteText, (LPARAM)lpstrNoteText);\n\t}\n\n\tBOOL SetNote(LPCWSTR lpstrNoteText)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (BS_COMMANDLINK | BS_DEFCOMMANDLINK)) != 0);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, BCM_SETNOTE, 0, (LPARAM)lpstrNoteText);\n\t}\n\n\tLRESULT SetElevationRequiredState(BOOL bSet)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ::SendMessage(this->m_hWnd, BCM_SETSHIELD, 0, (LPARAM)bSet);\n\t}\n#endif // (_WIN32_WINNT >= 0x0600)\n\n// Operations\n\tvoid Click()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, BM_CLICK, 0, 0L);\n\t}\n};\n\ntypedef CButtonT<ATL::CWindow>   CButton;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CListBox - client side for a Windows LISTBOX control\n\ntemplate <class TBase>\nclass CListBoxT : public TBase\n{\npublic:\n// Constructors\n\tCListBoxT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCListBoxT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn _T(\"LISTBOX\");\n\t}\n\n\t// for entire listbox\n\tint GetCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_GETCOUNT, 0, 0L);\n\t}\n\n\tint SetCount(int cItems)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(((this->GetStyle() & LBS_NODATA) != 0) && ((this->GetStyle() & LBS_HASSTRINGS) == 0));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_SETCOUNT, cItems, 0L);\n\t}\n\n\tint GetHorizontalExtent() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_GETHORIZONTALEXTENT, 0, 0L);\n\t}\n\n\tvoid SetHorizontalExtent(int cxExtent)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, LB_SETHORIZONTALEXTENT, cxExtent, 0L);\n\t}\n\n\tint GetTopIndex() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_GETTOPINDEX, 0, 0L);\n\t}\n\n\tint SetTopIndex(int nIndex)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_SETTOPINDEX, nIndex, 0L);\n\t}\n\n\tLCID GetLocale() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (LCID)::SendMessage(this->m_hWnd, LB_GETLOCALE, 0, 0L);\n\t}\n\n\tLCID SetLocale(LCID nNewLocale)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (LCID)::SendMessage(this->m_hWnd, LB_SETLOCALE, (WPARAM)nNewLocale, 0L);\n\t}\n\n\tDWORD GetListBoxInfo() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, LB_GETLISTBOXINFO, 0, 0L);\n\t}\n\n\t// for single-selection listboxes\n\tint GetCurSel() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == 0);\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_GETCURSEL, 0, 0L);\n\t}\n\n\tint SetCurSel(int nSelect)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == 0);\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_SETCURSEL, nSelect, 0L);\n\t}\n\n\t// for multiple-selection listboxes\n\tint GetSel(int nIndex) const           // also works for single-selection\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_GETSEL, nIndex, 0L);\n\t}\n\n\tint SetSel(int nIndex, BOOL bSelect = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_SETSEL, bSelect, nIndex);\n\t}\n\n\tint GetSelCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_GETSELCOUNT, 0, 0L);\n\t}\n\n\tint GetSelItems(int nMaxItems, LPINT rgIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_GETSELITEMS, nMaxItems, (LPARAM)rgIndex);\n\t}\n\n\tint GetAnchorIndex() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_GETANCHORINDEX, 0, 0L);\n\t}\n\n\tvoid SetAnchorIndex(int nIndex)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);\n\t\t::SendMessage(this->m_hWnd, LB_SETANCHORINDEX, nIndex, 0L);\n\t}\n\n\tint GetCaretIndex() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_GETCARETINDEX, 0, 0);\n\t}\n\n\tint SetCaretIndex(int nIndex, BOOL bScroll = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_SETCARETINDEX, nIndex, MAKELONG(bScroll, 0));\n\t}\n\n\t// for listbox items\n\tDWORD_PTR GetItemData(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD_PTR)::SendMessage(this->m_hWnd, LB_GETITEMDATA, nIndex, 0L);\n\t}\n\n\tint SetItemData(int nIndex, DWORD_PTR dwItemData)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_SETITEMDATA, nIndex, (LPARAM)dwItemData);\n\t}\n\n\tvoid* GetItemDataPtr(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (void*)::SendMessage(this->m_hWnd, LB_GETITEMDATA, nIndex, 0L);\n\t}\n\n\tint SetItemDataPtr(int nIndex, void* pData)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn SetItemData(nIndex, (DWORD_PTR)pData);\n\t}\n\n\tint GetItemRect(int nIndex, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_GETITEMRECT, nIndex, (LPARAM)lpRect);\n\t}\n\n\tint GetText(int nIndex, LPTSTR lpszBuffer) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_GETTEXT, nIndex, (LPARAM)lpszBuffer);\n\t}\n\n#ifdef _OLEAUTO_H_\n\tBOOL GetTextBSTR(int nIndex, BSTR& bstrText) const\n\t{\n\t\tUSES_CONVERSION;\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(bstrText == NULL);\n\n\t\tint nLen = GetTextLen(nIndex);\n\t\tif(nLen == LB_ERR)\n\t\t\treturn FALSE;\n\n\t\tATL::CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tLPTSTR lpstrText = buff.Allocate(nLen + 1);\n\t\tif(lpstrText == NULL)\n\t\t\treturn FALSE;\n\n\t\tif(GetText(nIndex, lpstrText) == LB_ERR)\n\t\t\treturn FALSE;\n\n\t\tbstrText = ::SysAllocString(T2OLE(lpstrText));\n\t\treturn (bstrText != NULL) ? TRUE : FALSE;\n\t}\n#endif // _OLEAUTO_H_\n\n#ifdef __ATLSTR_H__\n\tint GetText(int nIndex, ATL::CString& strText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tint cchLen = GetTextLen(nIndex);\n\t\tif(cchLen == LB_ERR)\n\t\t\treturn LB_ERR;\n\t\tint nRet = LB_ERR;\n\t\tLPTSTR lpstr = strText.GetBufferSetLength(cchLen);\n\t\tif(lpstr != NULL)\n\t\t{\n\t\t\tnRet = GetText(nIndex, lpstr);\n\t\t\tstrText.ReleaseBuffer();\n\t\t}\n\t\treturn nRet;\n\t}\n#endif // __ATLSTR_H__\n\n\tint GetTextLen(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_GETTEXTLEN, nIndex, 0L);\n\t}\n\n\tint GetItemHeight(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_GETITEMHEIGHT, nIndex, 0L);\n\t}\n\n\tint SetItemHeight(int nIndex, UINT cyItemHeight)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0));\n\t}\n\n\t// Settable only attributes\n\tvoid SetColumnWidth(int cxWidth)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, LB_SETCOLUMNWIDTH, cxWidth, 0L);\n\t}\n\n\tBOOL SetTabStops(int nTabStops, LPINT rgTabStops)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & LBS_USETABSTOPS) != 0);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LB_SETTABSTOPS, nTabStops, (LPARAM)rgTabStops);\n\t}\n\n\tBOOL SetTabStops()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & LBS_USETABSTOPS) != 0);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LB_SETTABSTOPS, 0, 0L);\n\t}\n\n\tBOOL SetTabStops(const int& cxEachStop)    // takes an 'int'\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & LBS_USETABSTOPS) != 0);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LB_SETTABSTOPS, 1, (LPARAM)(LPINT)&cxEachStop);\n\t}\n\n// Operations\n\tint InitStorage(int nItems, UINT nBytes)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_INITSTORAGE, (WPARAM)nItems, nBytes);\n\t}\n\n\tvoid ResetContent()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, LB_RESETCONTENT, 0, 0L);\n\t}\n\n\tUINT ItemFromPoint(POINT pt, BOOL& bOutside) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dw = (DWORD)::SendMessage(this->m_hWnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x, pt.y));\n\t\tbOutside = (BOOL)HIWORD(dw);\n\t\treturn (UINT)LOWORD(dw);\n\t}\n\n\t// manipulating listbox items\n\tint AddString(LPCTSTR lpszItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_ADDSTRING, 0, (LPARAM)lpszItem);\n\t}\n\n\tint DeleteString(UINT nIndex)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_DELETESTRING, nIndex, 0L);\n\t}\n\n\tint InsertString(int nIndex, LPCTSTR lpszItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_INSERTSTRING, nIndex, (LPARAM)lpszItem);\n\t}\n\n\tint Dir(UINT attr, LPCTSTR lpszWildCard)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_DIR, attr, (LPARAM)lpszWildCard);\n\t}\n\n\tint AddFile(LPCTSTR lpstrFileName)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_ADDFILE, 0, (LPARAM)lpstrFileName);\n\t}\n\n\t// selection helpers\n\tint FindString(int nStartAfter, LPCTSTR lpszItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_FINDSTRING, nStartAfter, (LPARAM)lpszItem);\n\t}\n\n\tint FindStringExact(int nIndexStart, LPCTSTR lpszFind) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_FINDSTRINGEXACT, nIndexStart, (LPARAM)lpszFind);\n\t}\n\n\tint SelectString(int nStartAfter, LPCTSTR lpszItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LB_SELECTSTRING, nStartAfter, (LPARAM)lpszItem);\n\t}\n\n\tint SelItemRange(BOOL bSelect, int nFirstItem, int nLastItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);\n\t\tATLASSERT(nFirstItem <= nLastItem);\n\t\treturn bSelect ? (int)::SendMessage(this->m_hWnd, LB_SELITEMRANGEEX, nFirstItem, nLastItem) : (int)::SendMessage(this->m_hWnd, LB_SELITEMRANGEEX, nLastItem, nFirstItem);\n\t}\n};\n\ntypedef CListBoxT<ATL::CWindow>   CListBox;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CComboBox - client side for a Windows COMBOBOX control\n\ntemplate <class TBase>\nclass CComboBoxT : public TBase\n{\npublic:\n// Constructors\n\tCComboBoxT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCComboBoxT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn _T(\"COMBOBOX\");\n\t}\n\n\t// for entire combo box\n\tint GetCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_GETCOUNT, 0, 0L);\n\t}\n\n\tint GetCurSel() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_GETCURSEL, 0, 0L);\n\t}\n\n\tint SetCurSel(int nSelect)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_SETCURSEL, nSelect, 0L);\n\t}\n\n\tLCID GetLocale() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (LCID)::SendMessage(this->m_hWnd, CB_GETLOCALE, 0, 0L);\n\t}\n\n\tLCID SetLocale(LCID nNewLocale)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (LCID)::SendMessage(this->m_hWnd, CB_SETLOCALE, (WPARAM)nNewLocale, 0L);\n\t}\n\n\tint GetTopIndex() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_GETTOPINDEX, 0, 0L);\n\t}\n\n\tint SetTopIndex(int nIndex)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_SETTOPINDEX, nIndex, 0L);\n\t}\n\n\tUINT GetHorizontalExtent() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, CB_GETHORIZONTALEXTENT, 0, 0L);\n\t}\n\n\tvoid SetHorizontalExtent(UINT nExtent)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, CB_SETHORIZONTALEXTENT, nExtent, 0L);\n\t}\n\n\tint GetDroppedWidth() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_GETDROPPEDWIDTH, 0, 0L);\n\t}\n\n\tint SetDroppedWidth(UINT nWidth)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_SETDROPPEDWIDTH, nWidth, 0L);\n\t}\n\n\tBOOL GetComboBoxInfo(PCOMBOBOXINFO pComboBoxInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)pComboBoxInfo);\n\t}\n\n\t// for edit control\n\tDWORD GetEditSel() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, CB_GETEDITSEL, 0, 0L);\n\t}\n\n\tBOOL SetEditSel(int nStartChar, int nEndChar)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, CB_SETEDITSEL, 0, MAKELONG(nStartChar, nEndChar));\n\t}\n\n\t// for combobox item\n\tDWORD_PTR GetItemData(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD_PTR)::SendMessage(this->m_hWnd, CB_GETITEMDATA, nIndex, 0L);\n\t}\n\n\tint SetItemData(int nIndex, DWORD_PTR dwItemData)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_SETITEMDATA, nIndex, (LPARAM)dwItemData);\n\t}\n\n\tvoid* GetItemDataPtr(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (void*)GetItemData(nIndex);\n\t}\n\n\tint SetItemDataPtr(int nIndex, void* pData)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn SetItemData(nIndex, (DWORD_PTR)pData);\n\t}\n\n\tint GetLBText(int nIndex, LPTSTR lpszText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_GETLBTEXT, nIndex, (LPARAM)lpszText);\n\t}\n\n\tBOOL GetLBTextBSTR(int nIndex, BSTR& bstrText) const\n\t{\n\t\tUSES_CONVERSION;\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(bstrText == NULL);\n\n\t\tint nLen = GetLBTextLen(nIndex);\n\t\tif(nLen == CB_ERR)\n\t\t\treturn FALSE;\n\n\t\tATL::CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tLPTSTR lpstrText = buff.Allocate(nLen + 1);\n\t\tif(lpstrText == NULL)\n\t\t\treturn FALSE;\n\n\t\tif(GetLBText(nIndex, lpstrText) == CB_ERR)\n\t\t\treturn FALSE;\n\n\t\tbstrText = ::SysAllocString(T2OLE(lpstrText));\n\t\treturn (bstrText != NULL) ? TRUE : FALSE;\n\t}\n\n#ifdef __ATLSTR_H__\n\tint GetLBText(int nIndex, ATL::CString& strText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tint cchLen = GetLBTextLen(nIndex);\n\t\tif(cchLen == CB_ERR)\n\t\t\treturn CB_ERR;\n\t\tint nRet = CB_ERR;\n\t\tLPTSTR lpstr = strText.GetBufferSetLength(cchLen);\n\t\tif(lpstr != NULL)\n\t\t{\n\t\t\tnRet = GetLBText(nIndex, lpstr);\n\t\t\tstrText.ReleaseBuffer();\n\t\t}\n\t\treturn nRet;\n\t}\n#endif // __ATLSTR_H__\n\n\tint GetLBTextLen(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_GETLBTEXTLEN, nIndex, 0L);\n\t}\n\n\tint GetItemHeight(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_GETITEMHEIGHT, nIndex, 0L);\n\t}\n\n\tint SetItemHeight(int nIndex, UINT cyItemHeight)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0));\n\t}\n\n\tBOOL GetExtendedUI() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, CB_GETEXTENDEDUI, 0, 0L);\n\t}\n\n\tint SetExtendedUI(BOOL bExtended = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_SETEXTENDEDUI, bExtended, 0L);\n\t}\n\n\tvoid GetDroppedControlRect(LPRECT lprect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)lprect);\n\t}\n\n\tBOOL GetDroppedState() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, CB_GETDROPPEDSTATE, 0, 0L);\n\t}\n\n\tint GetMinVisible() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_GETMINVISIBLE, 0, 0L);\n\t}\n\n\tBOOL SetMinVisible(int nMinVisible)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, CB_SETMINVISIBLE, nMinVisible, 0L);\n\t}\n\n\t// Vista only\n\tBOOL GetCueBannerText(LPWSTR lpwText, int cchText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, CB_GETCUEBANNER, (WPARAM)lpwText, cchText);\n\t}\n\n\t// Vista only\n\tBOOL SetCueBannerText(LPCWSTR lpcwText)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, CB_SETCUEBANNER, 0, (LPARAM)lpcwText);\n\t}\n\n// Operations\n\tint InitStorage(int nItems, UINT nBytes)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_INITSTORAGE, (WPARAM)nItems, nBytes);\n\t}\n\n\tvoid ResetContent()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, CB_RESETCONTENT, 0, 0L);\n\t}\n\n\t// for edit control\n\tBOOL LimitText(int nMaxChars)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, CB_LIMITTEXT, nMaxChars, 0L);\n\t}\n\n\t// for drop-down combo boxes\n\tvoid ShowDropDown(BOOL bShowIt = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, CB_SHOWDROPDOWN, bShowIt, 0L);\n\t}\n\n\t// manipulating listbox items\n\tint AddString(LPCTSTR lpszString)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_ADDSTRING, 0, (LPARAM)lpszString);\n\t}\n\n\tint DeleteString(UINT nIndex)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_DELETESTRING, nIndex, 0L);\n\t}\n\n\tint InsertString(int nIndex, LPCTSTR lpszString)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_INSERTSTRING, nIndex, (LPARAM)lpszString);\n\t}\n\n\tint Dir(UINT attr, LPCTSTR lpszWildCard)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_DIR, attr, (LPARAM)lpszWildCard);\n\t}\n\n\t// selection helpers\n\tint FindString(int nStartAfter, LPCTSTR lpszString) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_FINDSTRING, nStartAfter, (LPARAM)lpszString);\n\t}\n\n\tint FindStringExact(int nIndexStart, LPCTSTR lpszFind) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_FINDSTRINGEXACT, nIndexStart, (LPARAM)lpszFind);\n\t}\n\n\tint SelectString(int nStartAfter, LPCTSTR lpszString)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CB_SELECTSTRING, nStartAfter, (LPARAM)lpszString);\n\t}\n\n\t// Clipboard operations\n\tvoid Clear()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, WM_CLEAR, 0, 0L);\n\t}\n\n\tvoid Copy()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, WM_COPY, 0, 0L);\n\t}\n\n\tvoid Cut()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, WM_CUT, 0, 0L);\n\t}\n\n\tvoid Paste()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, WM_PASTE, 0, 0L);\n\t}\n};\n\ntypedef CComboBoxT<ATL::CWindow>   CComboBox;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CEdit - client side for a Windows EDIT control\n\ntemplate <class TBase>\nclass CEditT : public TBase\n{\npublic:\n// Constructors\n\tCEditT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCEditT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn _T(\"EDIT\");\n\t}\n\n\tBOOL CanUndo() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_CANUNDO, 0, 0L);\n\t}\n\n\tint GetLineCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETLINECOUNT, 0, 0L);\n\t}\n\n\tBOOL GetModify() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_GETMODIFY, 0, 0L);\n\t}\n\n\tvoid SetModify(BOOL bModified = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETMODIFY, bModified, 0L);\n\t}\n\n\tvoid GetRect(LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_GETRECT, 0, (LPARAM)lpRect);\n\t}\n\n\tDWORD GetSel() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_GETSEL, 0, 0L);\n\t}\n\n\tvoid GetSel(int& nStartChar, int& nEndChar) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_GETSEL, (WPARAM)&nStartChar, (LPARAM)&nEndChar);\n\t}\n\n\tHLOCAL GetHandle() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HLOCAL)::SendMessage(this->m_hWnd, EM_GETHANDLE, 0, 0L);\n\t}\n\n\tvoid SetHandle(HLOCAL hBuffer)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETHANDLE, (WPARAM)hBuffer, 0L);\n\t}\n\n\tDWORD GetMargins() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_GETMARGINS, 0, 0L);\n\t}\n\n\tvoid GetMargins(UINT& nLeft, UINT& nRight) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, EM_GETMARGINS, 0, 0L);\n\t\tnLeft = LOWORD(dwRet);\n\t\tnRight = HIWORD(dwRet);\n\t}\n\n\tvoid SetMargins(UINT nLeft, UINT nRight, WORD wFlags = EC_LEFTMARGIN | EC_RIGHTMARGIN)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETMARGINS, wFlags, MAKELONG(nLeft, nRight));\n\t}\n\n\tUINT GetLimitText() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, EM_GETLIMITTEXT, 0, 0L);\n\t}\n\n\tvoid SetLimitText(UINT nMax)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETLIMITTEXT, nMax, 0L);\n\t}\n\n\tPOINT PosFromChar(UINT nChar) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, EM_POSFROMCHAR, nChar, 0);\n\t\tPOINT point = { GET_X_LPARAM(dwRet), GET_Y_LPARAM(dwRet) };\n\t\treturn point;\n\t}\n\n\tint CharFromPos(POINT pt, int* pLine = NULL) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, EM_CHARFROMPOS, 0, MAKELPARAM(pt.x, pt.y));\n\t\tif(pLine != NULL)\n\t\t\t*pLine = (int)(short)HIWORD(dwRet);\n\t\treturn (int)(short)LOWORD(dwRet);\n\t}\n\n\t// NOTE: first word in lpszBuffer must contain the size of the buffer!\n\tint GetLine(int nIndex, LPTSTR lpszBuffer) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);\n\t}\n\n\tint GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t*(LPWORD)lpszBuffer = (WORD)nMaxLength;\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);\n\t}\n\n\tTCHAR GetPasswordChar() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (TCHAR)::SendMessage(this->m_hWnd, EM_GETPASSWORDCHAR, 0, 0L);\n\t}\n\n\tvoid SetPasswordChar(TCHAR ch)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETPASSWORDCHAR, ch, 0L);\n\t}\n\n\tEDITWORDBREAKPROC GetWordBreakProc() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (EDITWORDBREAKPROC)::SendMessage(this->m_hWnd, EM_GETWORDBREAKPROC, 0, 0L);\n\t}\n\n\tvoid SetWordBreakProc(EDITWORDBREAKPROC ewbprc)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETWORDBREAKPROC, 0, (LPARAM)ewbprc);\n\t}\n\n\tint GetFirstVisibleLine() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETFIRSTVISIBLELINE, 0, 0L);\n\t}\n\n\tint GetThumb() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & ES_MULTILINE) != 0);\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETTHUMB, 0, 0L);\n\t}\n\n\tBOOL SetReadOnly(BOOL bReadOnly = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETREADONLY, bReadOnly, 0L);\n\t}\n\n\tUINT GetImeStatus(UINT uStatus) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, EM_GETIMESTATUS, uStatus, 0L);\n\t}\n\n\tUINT SetImeStatus(UINT uStatus, UINT uData)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, EM_SETIMESTATUS, uStatus, uData);\n\t}\n\n\tBOOL GetCueBannerText(LPCWSTR lpstrText, int cchText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_GETCUEBANNER, (WPARAM)lpstrText, cchText);\n\t}\n\n\t// bKeepWithFocus - Vista only\n\tBOOL SetCueBannerText(LPCWSTR lpstrText, BOOL bKeepWithFocus = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETCUEBANNER, (WPARAM)bKeepWithFocus, (LPARAM)(lpstrText));\n\t}\n\n// Operations\n\tvoid EmptyUndoBuffer()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_EMPTYUNDOBUFFER, 0, 0L);\n\t}\n\n\tBOOL FmtLines(BOOL bAddEOL)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_FMTLINES, bAddEOL, 0L);\n\t}\n\n\tvoid LimitText(int nChars = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_LIMITTEXT, nChars, 0L);\n\t}\n\n\tint LineFromChar(int nIndex = -1) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_LINEFROMCHAR, nIndex, 0L);\n\t}\n\n\tint LineIndex(int nLine = -1) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_LINEINDEX, nLine, 0L);\n\t}\n\n\tint LineLength(int nLine = -1) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_LINELENGTH, nLine, 0L);\n\t}\n\n\tvoid LineScroll(int nLines, int nChars = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_LINESCROLL, nChars, nLines);\n\t}\n\n\tvoid ReplaceSel(LPCTSTR lpszNewText, BOOL bCanUndo = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_REPLACESEL, (WPARAM) bCanUndo, (LPARAM)lpszNewText);\n\t}\n\n\tvoid SetRect(LPCRECT lpRect)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETRECT, 0, (LPARAM)lpRect);\n\t}\n\n\tvoid SetRectNP(LPCRECT lpRect)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETRECTNP, 0, (LPARAM)lpRect);\n\t}\n\n\tvoid SetSel(DWORD dwSelection, BOOL bNoScroll = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETSEL, LOWORD(dwSelection), HIWORD(dwSelection));\n\t\tif(!bNoScroll)\n\t\t\t::SendMessage(this->m_hWnd, EM_SCROLLCARET, 0, 0L);\n\t}\n\n\tvoid SetSel(int nStartChar, int nEndChar, BOOL bNoScroll = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETSEL, nStartChar, nEndChar);\n\t\tif(!bNoScroll)\n\t\t\t::SendMessage(this->m_hWnd, EM_SCROLLCARET, 0, 0L);\n\t}\n\n\tvoid SetSelAll(BOOL bNoScroll = FALSE)\n\t{\n\t\tSetSel(0, -1, bNoScroll);\n\t}\n\n\tvoid SetSelNone(BOOL bNoScroll = FALSE)\n\t{\n\t\tSetSel(-1, 0, bNoScroll);\n\t}\n\n\tBOOL SetTabStops(int nTabStops, LPINT rgTabStops)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETTABSTOPS, nTabStops, (LPARAM)rgTabStops);\n\t}\n\n\tBOOL SetTabStops()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETTABSTOPS, 0, 0L);\n\t}\n\n\tBOOL SetTabStops(const int& cxEachStop)    // takes an 'int'\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETTABSTOPS, 1, (LPARAM)(LPINT)&cxEachStop);\n\t}\n\n\tvoid ScrollCaret()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SCROLLCARET, 0, 0L);\n\t}\n\n\tint Scroll(int nScrollAction)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & ES_MULTILINE) != 0);\n\t\tLRESULT lRet = ::SendMessage(this->m_hWnd, EM_SCROLL, nScrollAction, 0L);\n\t\tif(!(BOOL)HIWORD(lRet))\n\t\t\treturn -1;   // failed\n\t\treturn (int)(short)LOWORD(lRet);\n\t\t\n\t}\n\n\tvoid InsertText(int nInsertAfterChar, LPCTSTR lpstrText, BOOL bNoScroll = FALSE, BOOL bCanUndo = FALSE)\n\t{\n\t\tSetSel(nInsertAfterChar, nInsertAfterChar, bNoScroll);\n\t\tReplaceSel(lpstrText, bCanUndo);\n\t}\n\n\tvoid AppendText(LPCTSTR lpstrText, BOOL bNoScroll = FALSE, BOOL bCanUndo = FALSE)\n\t{\n\t\tInsertText(this->GetWindowTextLength(), lpstrText, bNoScroll, bCanUndo);\n\t}\n\n\tBOOL ShowBalloonTip(PEDITBALLOONTIP pEditBaloonTip)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SHOWBALLOONTIP, 0, (LPARAM)pEditBaloonTip);\n\t}\n\n\tBOOL HideBalloonTip()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_HIDEBALLOONTIP, 0, 0L);\n\t}\n\n#if (_WIN32_WINNT >= 0x0600)\n\tDWORD GetHilite() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_GETHILITE, 0, 0L);\n\t}\n\n\tvoid GetHilite(int& nStartChar, int& nEndChar) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, EM_GETHILITE, 0, 0L);\n\t\tnStartChar = (int)(short)LOWORD(dwRet);\n\t\tnEndChar = (int)(short)HIWORD(dwRet);\n\t}\n\n\tvoid SetHilite(int nStartChar, int nEndChar)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETHILITE, nStartChar, nEndChar);\n\t}\n#endif // (_WIN32_WINNT >= 0x0600)\n\n\t// Clipboard operations\n\tBOOL Undo()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_UNDO, 0, 0L);\n\t}\n\n\tvoid Clear()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, WM_CLEAR, 0, 0L);\n\t}\n\n\tvoid Copy()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, WM_COPY, 0, 0L);\n\t}\n\n\tvoid Cut()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, WM_CUT, 0, 0L);\n\t}\n\n\tvoid Paste()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, WM_PASTE, 0, 0L);\n\t}\n\n\t// New messages added in Windows 10.0.17763\n#if defined(NTDDI_VERSION) && defined(NTDDI_WIN10_RS5) && (NTDDI_VERSION >= NTDDI_WIN10_RS5)\n\tDWORD SetExtendedStyle(DWORD dwStyle, DWORD dwMask)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ::SendMessage(this->m_hWnd, EM_SETEXTENDEDSTYLE, dwMask, dwStyle);\n\t}\n\n\tDWORD GetExtendedStyle() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ::SendMessage(this->m_hWnd, EM_GETEXTENDEDSTYLE, 0, 0L);\n\t}\n\n\tBOOL SetEndOfLine(EC_ENDOFLINE eolType)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETENDOFLINE, eolType, 0L);\n\t}\n\n\tEC_ENDOFLINE GetEndOfLine() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (EC_ENDOFLINE)::SendMessage(this->m_hWnd, EM_GETENDOFLINE, 0, 0L);\n\t}\n\n\tBOOL EnableSearchWeb(BOOL bEnable)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_ENABLESEARCHWEB, (WPARAM)bEnable, 0L);\n\t}\n\n\tvoid SearchWeb()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SEARCHWEB, 0, 0L);\n\t}\n\n\tBOOL SetCaretIndex(DWORD dwCaretIndex)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETCARETINDEX, dwCaretIndex, 0L);\n\t}\n\n\tDWORD GetCaretIndex() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ::SendMessage(this->m_hWnd, EM_GETCARETINDEX, 0, 0L);\n\t}\n\n\tBOOL GetZoom(int& nNum, int& nDen) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_GETZOOM, (WPARAM)&nNum, (LPARAM)&nDen);\n\t}\n\n\tBOOL SetZoom(int nNum, int nDen)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((nNum >= 0) && (nNum <= 64));\n\t\tATLASSERT((nDen >= 0) && (nDen <= 64));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETZOOM, nNum, nDen);\n\t}\n\n\tDWORD GetFileLineFromChar(DWORD dwCharIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ::SendMessage(this->m_hWnd, EM_FILELINEFROMCHAR, dwCharIndex, 0L);\n\t}\n\n\tDWORD GetFileLineIndex(DWORD dwLineNum) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ::SendMessage(this->m_hWnd, EM_FILELINEINDEX, dwLineNum, 0L);\n\t}\n\n\tDWORD GetFileLineLength(DWORD dwCharIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ::SendMessage(this->m_hWnd, EM_FILELINELENGTH, dwCharIndex, 0L);\n\t}\n\n\tDWORD GetFileLine(DWORD dwLineNum, LPTSTR lpstrLine, WORD wLen) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tWORD* pw = (WORD*)lpstrLine;\n\t\t*pw = wLen;\n\t\treturn ::SendMessage(this->m_hWnd, EM_GETFILELINE, dwLineNum, (LPARAM)lpstrLine);\n\t}\n\n#ifdef __ATLSTR_H__\n\tATL::CString GetFileLine(DWORD dwLineNum) const\n\t{\n\t\tATL::CString strLine;\n\t\tDWORD dwCharIndex = GetFileLineIndex(dwLineNum);\n\t\tif(dwCharIndex != (DWORD)-1)\n\t\t{\n\t\t\tDWORD dwLen = GetFileLineLength(dwCharIndex);\n\t\t\tif(dwLen > 0)\n\t\t\t{\n\t\t\t\tLPTSTR lpstrLine = strLine.GetBufferSetLength(dwLen);\n\t\t\t\tATLVERIFY(GetFileLine(dwLineNum, lpstrLine, (WORD)dwLen) == dwLen);\n\t\t\t\tstrLine.ReleaseBuffer();\n\t\t\t}\n\t\t}\n\n\t\treturn strLine;\n\t}\n#endif // __ATLSTR_H__\n\n\tDWORD GetFileLineCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ::SendMessage(this->m_hWnd, EM_GETFILELINECOUNT, 0, 0L);\n\t}\n#endif // defined(NTDDI_VERSION) && defined(NTDDI_WIN10_RS5) && (NTDDI_VERSION >= NTDDI_WIN10_RS5)\n};\n\ntypedef CEditT<ATL::CWindow>   CEdit;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CEditCommands - message handlers for standard EDIT commands\n\n// Chain to CEditCommands message map. Your class must also derive from CEdit.\n// Example:\n// class CMyEdit : public CWindowImpl<CMyEdit, CEdit>,\n//                 public CEditCommands<CMyEdit>\n// {\n// public:\n//      BEGIN_MSG_MAP(CMyEdit)\n//              // your handlers...\n//              CHAIN_MSG_MAP_ALT(CEditCommands<CMyEdit>, 1)\n//      END_MSG_MAP()\n//      // other stuff...\n// };\n\ntemplate <class T>\nclass CEditCommands\n{\npublic:\n\tBEGIN_MSG_MAP(CEditCommands< T >)\n\tALT_MSG_MAP(1)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_CLEAR, OnEditClear)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_CLEAR_ALL, OnEditClearAll)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_COPY, OnEditCopy)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_CUT, OnEditCut)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_PASTE, OnEditPaste)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_SELECT_ALL, OnEditSelectAll)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_UNDO, OnEditUndo)\n\tEND_MSG_MAP()\n\n\tLRESULT OnEditClear(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Clear();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnEditClearAll(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->SetSel(0, -1);\n\t\tpT->Clear();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnEditCopy(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Copy();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnEditCut(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Cut();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnEditPaste(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Paste();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnEditSelectAll(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->SetSel(0, -1);\n\t\treturn 0;\n\t}\n\n\tLRESULT OnEditUndo(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Undo();\n\t\treturn 0;\n\t}\n\n// State (update UI) helpers\n\tBOOL CanCut() const\n\t{ return HasSelection(); }\n\n\tBOOL CanCopy() const\n\t{ return HasSelection(); }\n\n\tBOOL CanClear() const\n\t{ return HasSelection(); }\n\n\tBOOL CanSelectAll() const\n\t{ return HasText(); }\n\n\tBOOL CanFind() const\n\t{ return HasText(); }\n\n\tBOOL CanRepeat() const\n\t{ return HasText(); }\n\n\tBOOL CanReplace() const\n\t{ return HasText(); }\n\n\tBOOL CanClearAll() const\n\t{ return HasText(); }\n\n// Implementation\n\tBOOL HasSelection() const\n\t{\n\t\tconst T* pT = static_cast<const T*>(this);\n\t\tint nMin = 0, nMax = 0;\n\t\t::SendMessage(pT->m_hWnd, EM_GETSEL, (WPARAM)&nMin, (LPARAM)&nMax);\n\t\treturn (nMin != nMax);\n\t}\n\n\tBOOL HasText() const\n\t{\n\t\tconst T* pT = static_cast<const T*>(this);\n\t\treturn (pT->GetWindowTextLength() > 0);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CScrollBar - client side for a Windows SCROLLBAR control\n\ntemplate <class TBase>\nclass CScrollBarT : public TBase\n{\npublic:\n// Constructors\n\tCScrollBarT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCScrollBarT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn _T(\"SCROLLBAR\");\n\t}\n\n\tint GetScrollPos() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ::GetScrollPos(this->m_hWnd, SB_CTL);\n\t}\n\n\tint SetScrollPos(int nPos, BOOL bRedraw = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ::SetScrollPos(this->m_hWnd, SB_CTL, nPos, bRedraw);\n\t}\n\n\tvoid GetScrollRange(LPINT lpMinPos, LPINT lpMaxPos) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::GetScrollRange(this->m_hWnd, SB_CTL, lpMinPos, lpMaxPos);\n\t}\n\n\tvoid SetScrollRange(int nMinPos, int nMaxPos, BOOL bRedraw = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SetScrollRange(this->m_hWnd, SB_CTL, nMinPos, nMaxPos, bRedraw);\n\t}\n\n\tBOOL GetScrollInfo(LPSCROLLINFO lpScrollInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ::GetScrollInfo(this->m_hWnd, SB_CTL, lpScrollInfo);\n\t}\n\n\tint SetScrollInfo(LPSCROLLINFO lpScrollInfo, BOOL bRedraw = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ::SetScrollInfo(this->m_hWnd, SB_CTL, lpScrollInfo, bRedraw);\n\t}\n\n\tint GetScrollLimit() const\n\t{\n\t\tSCROLLINFO info = { sizeof(SCROLLINFO), SIF_RANGE | SIF_PAGE };\n\t\t::GetScrollInfo(this->m_hWnd, SB_CTL, &info);\n\t\tif(info.nPage > 1)\n\t\t\tinfo.nMax -= info.nPage - 1;\n\n\t\treturn info.nMax;\n\t}\n\n\tBOOL GetScrollBarInfo(PSCROLLBARINFO pScrollBarInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, SBM_GETSCROLLBARINFO, 0, (LPARAM)pScrollBarInfo);\n\t}\n\n// Operations\n\tvoid ShowScrollBar(BOOL bShow = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::ShowScrollBar(this->m_hWnd, SB_CTL, bShow);\n\t}\n\n\tBOOL EnableScrollBar(UINT nArrowFlags = ESB_ENABLE_BOTH)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ::EnableScrollBar(this->m_hWnd, SB_CTL, nArrowFlags);\n\t}\n};\n\ntypedef CScrollBarT<ATL::CWindow>   CScrollBar;\n\n\n// --- Windows Common Controls ---\n\n///////////////////////////////////////////////////////////////////////////////\n// CImageList\n\n// forward declarations\ntemplate <bool t_bManaged> class CImageListT;\ntypedef CImageListT<false>   CImageList;\ntypedef CImageListT<true>    CImageListManaged;\n\n\ntemplate <bool t_bManaged>\nclass CImageListT\n{\npublic:\n// Data members\n\tHIMAGELIST m_hImageList;\n\n// Constructor/destructor/operators\n\tCImageListT(HIMAGELIST hImageList = NULL) : m_hImageList(hImageList)\n\t{ }\n\n\t~CImageListT()\n\t{\n\t\tif(t_bManaged && (m_hImageList != NULL))\n\t\t\tDestroy();\n\t}\n\n\tCImageListT<t_bManaged>& operator =(HIMAGELIST hImageList)\n\t{\n\t\tAttach(hImageList);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HIMAGELIST hImageList)\n\t{\n\t\tif(t_bManaged && (m_hImageList != NULL) && (m_hImageList != hImageList))\n\t\t\tImageList_Destroy(m_hImageList);\n\t\tm_hImageList = hImageList;\n\t}\n\n\tHIMAGELIST Detach()\n\t{\n\t\tHIMAGELIST hImageList = m_hImageList;\n\t\tm_hImageList = NULL;\n\t\treturn hImageList;\n\t}\n\n\toperator HIMAGELIST() const { return m_hImageList; }\n\n\tbool IsNull() const { return (m_hImageList == NULL); }\n\n// Attributes\n\tint GetImageCount() const\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_GetImageCount(m_hImageList);\n\t}\n\n\tCOLORREF GetBkColor() const\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_GetBkColor(m_hImageList);\n\t}\n\n\tCOLORREF SetBkColor(COLORREF cr)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_SetBkColor(m_hImageList, cr);\n\t}\n\n\tBOOL GetImageInfo(int nImage, IMAGEINFO* pImageInfo) const\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_GetImageInfo(m_hImageList, nImage, pImageInfo);\n\t}\n\n\tHICON GetIcon(int nIndex, UINT uFlags = ILD_NORMAL) const\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_GetIcon(m_hImageList, nIndex, uFlags);\n\t}\n\n\tBOOL GetIconSize(int& cx, int& cy) const\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_GetIconSize(m_hImageList, &cx, &cy);\n\t}\n\n\tBOOL GetIconSize(SIZE& size) const\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_GetIconSize(m_hImageList, (int*)&size.cx, (int*)&size.cy);\n\t}\n\n\tBOOL SetIconSize(int cx, int cy)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_SetIconSize(m_hImageList, cx, cy);\n\t}\n\n\tBOOL SetIconSize(SIZE size)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_SetIconSize(m_hImageList, size.cx, size.cy);\n\t}\n\n\tBOOL SetImageCount(UINT uNewCount)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_SetImageCount(m_hImageList, uNewCount);\n\t}\n\n\tBOOL SetOverlayImage(int nImage, int nOverlay)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_SetOverlayImage(m_hImageList, nImage, nOverlay);\n\t}\n\n// Operations\n\tBOOL Create(int cx, int cy, UINT nFlags, int nInitial, int nGrow)\n\t{\n\t\tATLASSERT(m_hImageList == NULL);\n\t\tm_hImageList = ImageList_Create(cx, cy, nFlags, nInitial, nGrow);\n\t\treturn (m_hImageList != NULL) ? TRUE : FALSE;\n\t}\n\n\tBOOL Create(ATL::_U_STRINGorID bitmap, int cx, int nGrow, COLORREF crMask)\n\t{\n\t\tATLASSERT(m_hImageList == NULL);\n\t\tm_hImageList = ImageList_LoadBitmap(ModuleHelper::GetResourceInstance(), bitmap.m_lpstr, cx, nGrow, crMask);\n\t\treturn (m_hImageList != NULL) ? TRUE : FALSE;\n\t}\n\n\tBOOL CreateFromImage(ATL::_U_STRINGorID image, int cx, int nGrow, COLORREF crMask, UINT uType, UINT uFlags = LR_DEFAULTCOLOR | LR_DEFAULTSIZE)\n\t{\n\t\tATLASSERT(m_hImageList == NULL);\n\t\tm_hImageList = ImageList_LoadImage(ModuleHelper::GetResourceInstance(), image.m_lpstr, cx, nGrow, crMask, uType, uFlags);\n\t\treturn (m_hImageList != NULL) ? TRUE : FALSE;\n\t}\n\n\tBOOL Merge(HIMAGELIST hImageList1, int nImage1, HIMAGELIST hImageList2, int nImage2, int dx, int dy)\n\t{\n\t\tATLASSERT(m_hImageList == NULL);\n\t\tm_hImageList = ImageList_Merge(hImageList1, nImage1, hImageList2, nImage2, dx, dy);\n\t\treturn (m_hImageList != NULL) ? TRUE : FALSE;\n\t}\n\n#ifdef __IStream_INTERFACE_DEFINED__\n\tBOOL CreateFromStream(LPSTREAM lpStream)\n\t{\n\t\tATLASSERT(m_hImageList == NULL);\n\t\tm_hImageList = ImageList_Read(lpStream);\n\t\treturn (m_hImageList != NULL) ? TRUE : FALSE;\n\t}\n#endif // __IStream_INTERFACE_DEFINED__\n\n\tBOOL Destroy()\n\t{\n\t\tif (m_hImageList == NULL)\n\t\t\treturn FALSE;\n\t\tBOOL bRet = ImageList_Destroy(m_hImageList);\n\t\tif(bRet)\n\t\t\tm_hImageList = NULL;\n\t\treturn bRet;\n\t}\n\n\tint Add(HBITMAP hBitmap, HBITMAP hBitmapMask = NULL)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_Add(m_hImageList, hBitmap, hBitmapMask);\n\t}\n\n\tint Add(HBITMAP hBitmap, COLORREF crMask)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_AddMasked(m_hImageList, hBitmap, crMask);\n\t}\n\n\tBOOL Remove(int nImage)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_Remove(m_hImageList, nImage);\n\t}\n\n\tBOOL RemoveAll()\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_RemoveAll(m_hImageList);\n\t}\n\n\tBOOL Replace(int nImage, HBITMAP hBitmap, HBITMAP hBitmapMask)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_Replace(m_hImageList, nImage, hBitmap, hBitmapMask);\n\t}\n\n\tint AddIcon(HICON hIcon)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_AddIcon(m_hImageList, hIcon);\n\t}\n\n\tint ReplaceIcon(int nImage, HICON hIcon)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_ReplaceIcon(m_hImageList, nImage, hIcon);\n\t}\n\n\tHICON ExtractIcon(int nImage)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_ExtractIcon(NULL, m_hImageList, nImage);\n\t}\n\n\tBOOL Draw(HDC hDC, int nImage, int x, int y, UINT nStyle)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\tATLASSERT(hDC != NULL);\n\t\treturn ImageList_Draw(m_hImageList, nImage, hDC, x, y, nStyle);\n\t}\n\n\tBOOL Draw(HDC hDC, int nImage, POINT pt, UINT nStyle)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\tATLASSERT(hDC != NULL);\n\t\treturn ImageList_Draw(m_hImageList, nImage, hDC, pt.x, pt.y, nStyle);\n\t}\n\n\tBOOL DrawEx(int nImage, HDC hDC, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\tATLASSERT(hDC != NULL);\n\t\treturn ImageList_DrawEx(m_hImageList, nImage, hDC, x, y, dx, dy, rgbBk, rgbFg, fStyle);\n\t}\n\n\tBOOL DrawEx(int nImage, HDC hDC, RECT& rect, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\tATLASSERT(hDC != NULL);\n\t\treturn ImageList_DrawEx(m_hImageList, nImage, hDC, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, rgbBk, rgbFg, fStyle);\n\t}\n\n\tstatic BOOL DrawIndirect(IMAGELISTDRAWPARAMS* pimldp)\n\t{\n\t\treturn ImageList_DrawIndirect(pimldp);\n\t}\n\n\tBOOL Copy(int nSrc, int nDst, UINT uFlags = ILCF_MOVE)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_Copy(m_hImageList, nDst, m_hImageList, nSrc, uFlags);\n\t}\n\n#ifdef __IStream_INTERFACE_DEFINED__\n\tstatic HIMAGELIST Read(LPSTREAM lpStream)\n\t{\n\t\treturn ImageList_Read(lpStream);\n\t}\n\n\tBOOL Write(LPSTREAM lpStream)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_Write(m_hImageList, lpStream);\n\t}\n\n\tstatic HRESULT ReadEx(DWORD dwFlags, LPSTREAM lpStream, REFIID riid, PVOID* ppv)\n\t{\n\t\treturn ImageList_ReadEx(dwFlags, lpStream, riid, ppv);\n\t}\n\n\tHRESULT WriteEx(DWORD dwFlags, LPSTREAM lpStream)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_WriteEx(m_hImageList, dwFlags, lpStream);\n\t}\n#endif // __IStream_INTERFACE_DEFINED__\n\n\t// Drag operations\n\tBOOL BeginDrag(int nImage, POINT ptHotSpot)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_BeginDrag(m_hImageList, nImage, ptHotSpot.x, ptHotSpot.y);\n\t}\n\n\tBOOL BeginDrag(int nImage, int xHotSpot, int yHotSpot)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_BeginDrag(m_hImageList, nImage, xHotSpot, yHotSpot);\n\t}\n\n\tstatic void EndDrag()\n\t{\n\t\tImageList_EndDrag();\n\t}\n\n\tstatic BOOL DragMove(POINT pt)\n\t{\n\t\treturn ImageList_DragMove(pt.x, pt.y);\n\t}\n\n\tstatic BOOL DragMove(int x, int y)\n\t{\n\t\treturn ImageList_DragMove(x, y);\n\t}\n\n\tBOOL SetDragCursorImage(int nDrag, POINT ptHotSpot)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_SetDragCursorImage(m_hImageList, nDrag, ptHotSpot.x, ptHotSpot.y);\n\t}\n\n\tBOOL SetDragCursorImage(int nDrag, int xHotSpot, int yHotSpot)\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn ImageList_SetDragCursorImage(m_hImageList, nDrag, xHotSpot, yHotSpot);\n\t}\n\n\tstatic BOOL DragShowNolock(BOOL bShow = TRUE)\n\t{\n\t\treturn ImageList_DragShowNolock(bShow);\n\t}\n\n\tstatic CImageList GetDragImage(LPPOINT lpPoint, LPPOINT lpPointHotSpot)\n\t{\n\t\treturn CImageList(ImageList_GetDragImage(lpPoint, lpPointHotSpot));\n\t}\n\n\tstatic BOOL DragEnter(HWND hWnd, POINT point)\n\t{\n\t\treturn ImageList_DragEnter(hWnd, point.x, point.y);\n\t}\n\n\tstatic BOOL DragEnter(HWND hWnd, int x, int y)\n\t{\n\t\treturn ImageList_DragEnter(hWnd, x, y);\n\t}\n\n\tstatic BOOL DragLeave(HWND hWnd)\n\t{\n\t\treturn ImageList_DragLeave(hWnd);\n\t}\n\n\tCImageList Duplicate() const\n\t{\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn CImageList(ImageList_Duplicate(m_hImageList));\n\t}\n\n\tstatic CImageList Duplicate(HIMAGELIST hImageList)\n\t{\n\t\tATLASSERT(hImageList != NULL);\n\t\treturn CImageList(ImageList_Duplicate(hImageList));\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CToolTipCtrl\n\nclass CToolInfo : public TOOLINFO\n{\npublic:\n\tCToolInfo(UINT nFlags, HWND hWnd, UINT_PTR nIDTool = 0, LPRECT lpRect = NULL, LPTSTR lpstrText = LPSTR_TEXTCALLBACK, LPARAM lUserParam = NULL)\n\t{\n\t\tInit(nFlags, hWnd, nIDTool, lpRect, lpstrText, lUserParam);\n\t}\n\n\toperator LPTOOLINFO() { return this; }\n\n\toperator LPARAM() { return (LPARAM)this; }\n\n\tvoid Init(UINT nFlags, HWND hWnd, UINT_PTR nIDTool = 0, LPRECT lpRect = NULL, LPTSTR lpstrText = LPSTR_TEXTCALLBACK, LPARAM lUserParam = NULL)\n\t{\n\t\tATLASSERT(::IsWindow(hWnd));\n\t\tmemset(this, 0, sizeof(TOOLINFO));\n\t\tcbSize = RunTimeHelper::SizeOf_TOOLINFO();\n\t\tuFlags = nFlags;\n\t\tif(nIDTool == 0)\n\t\t{\n\t\t\thwnd = ::GetParent(hWnd);\n\t\t\tuFlags |= TTF_IDISHWND;\n\t\t\tuId = (UINT_PTR)hWnd;\n\t\t}\n\t\telse\n\t\t{\n\t\t\thwnd = hWnd;\n\t\t\tuId = nIDTool;\n\t\t}\n\t\tif(lpRect != NULL)\n\t\t\trect = *lpRect;\n\t\thinst = ModuleHelper::GetResourceInstance();\n\t\tlpszText = lpstrText;\n\t\tlParam = lUserParam;\n\t}\n};\n\ntemplate <class TBase>\nclass CToolTipCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCToolTipCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCToolTipCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn TOOLTIPS_CLASS;\n\t}\n\n\tvoid GetText(LPTOOLINFO lpToolInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_GETTEXT, 0, (LPARAM)&lpToolInfo);\n\t}\n\n\tvoid GetText(LPTSTR lpstrText, HWND hWnd, UINT_PTR nIDTool = 0) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(hWnd != NULL);\n\t\tCToolInfo ti(0, hWnd, nIDTool, NULL, lpstrText);\n\t\t::SendMessage(this->m_hWnd, TTM_GETTEXT, 0, ti);\n\t}\n\n\tBOOL GetToolInfo(LPTOOLINFO lpToolInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TTM_GETTOOLINFO, 0, (LPARAM)lpToolInfo);\n\t}\n\n\tBOOL GetToolInfo(HWND hWnd, UINT_PTR nIDTool, UINT* puFlags, LPRECT lpRect, LPTSTR lpstrText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(hWnd != NULL);\n\t\tATLASSERT(puFlags != NULL);\n\t\tATLASSERT(lpRect != NULL);\n\t\tCToolInfo ti(0, hWnd, nIDTool, NULL, lpstrText);\n\t\tBOOL bRet = (BOOL)::SendMessage(this->m_hWnd, TTM_GETTOOLINFO, 0, ti);\n\t\tif(bRet != FALSE)\n\t\t{\n\t\t\t*puFlags = ti.uFlags;\n\t\t\t*lpRect = ti.rect;\n\t\t}\n\t\treturn bRet;\n\t}\n\n\tvoid SetToolInfo(LPTOOLINFO lpToolInfo)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_SETTOOLINFO, 0, (LPARAM)lpToolInfo);\n\t}\n\n\tvoid SetToolRect(LPTOOLINFO lpToolInfo)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_NEWTOOLRECT, 0, (LPARAM)lpToolInfo);\n\t}\n\n\tvoid SetToolRect(HWND hWnd, UINT_PTR nIDTool, LPCRECT lpRect)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(hWnd != NULL);\n\t\tATLASSERT(nIDTool != 0);\n\n\t\tCToolInfo ti(0, hWnd, nIDTool, (LPRECT)lpRect, NULL);\n\t\t::SendMessage(this->m_hWnd, TTM_NEWTOOLRECT, 0, ti);\n\t}\n\n\tint GetToolCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TTM_GETTOOLCOUNT, 0, 0L);\n\t}\n\n\tint GetDelayTime(DWORD dwType) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TTM_GETDELAYTIME, dwType, 0L);\n\t}\n\n\tvoid SetDelayTime(DWORD dwType, int nTime)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_SETDELAYTIME, dwType, MAKELPARAM(nTime, 0));\n\t}\n\n\tvoid GetMargin(LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_GETMARGIN, 0, (LPARAM)lpRect);\n\t}\n\n\tvoid SetMargin(LPRECT lpRect)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_SETMARGIN, 0, (LPARAM)lpRect);\n\t}\n\n\tint GetMaxTipWidth() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TTM_GETMAXTIPWIDTH, 0, 0L);\n\t}\n\n\tint SetMaxTipWidth(int nWidth)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TTM_SETMAXTIPWIDTH, 0, nWidth);\n\t}\n\n\tCOLORREF GetTipBkColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, TTM_GETTIPBKCOLOR, 0, 0L);\n\t}\n\n\tvoid SetTipBkColor(COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_SETTIPBKCOLOR, (WPARAM)clr, 0L);\n\t}\n\n\tCOLORREF GetTipTextColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, TTM_GETTIPTEXTCOLOR, 0, 0L);\n\t}\n\n\tvoid SetTipTextColor(COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_SETTIPTEXTCOLOR, (WPARAM)clr, 0L);\n\t}\n\n\tBOOL GetCurrentTool(LPTOOLINFO lpToolInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TTM_GETCURRENTTOOL, 0, (LPARAM)lpToolInfo);\n\t}\n\n\tSIZE GetBubbleSize(LPTOOLINFO lpToolInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, TTM_GETBUBBLESIZE, 0, (LPARAM)lpToolInfo);\n\t\tSIZE size = { GET_X_LPARAM(dwRet), GET_Y_LPARAM(dwRet) };\n\t\treturn size;\n\t}\n\n\tBOOL SetTitle(UINT_PTR uIcon, LPCTSTR lpstrTitle)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TTM_SETTITLE, uIcon, (LPARAM)lpstrTitle);\n\t}\n\n\n\tBOOL SetTitle(HICON hIcon, LPCTSTR lpstrTitle)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TTM_SETTITLE, (WPARAM)hIcon, (LPARAM)lpstrTitle);\n\t}\n\n\tvoid GetTitle(PTTGETTITLE pTTGetTitle) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_GETTITLE, 0, (LPARAM)pTTGetTitle);\n\t}\n\n\tvoid SetWindowTheme(LPCWSTR lpstrTheme)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);\n\t}\n\n// Operations\n\tvoid Activate(BOOL bActivate)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_ACTIVATE, bActivate, 0L);\n\t}\n\n\tBOOL AddTool(LPTOOLINFO lpToolInfo)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TTM_ADDTOOL, 0, (LPARAM)lpToolInfo);\n\t}\n\n\tBOOL AddTool(HWND hWnd, ATL::_U_STRINGorID text = LPSTR_TEXTCALLBACK, LPCRECT lpRectTool = NULL, UINT_PTR nIDTool = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(hWnd != NULL);\n\t\t// the toolrect and toolid must both be zero or both valid\n\t\tATLASSERT(((lpRectTool != NULL) && (nIDTool != 0)) || ((lpRectTool == NULL) && (nIDTool == 0)));\n\n\t\tCToolInfo ti(0, hWnd, nIDTool, (LPRECT)lpRectTool, (LPTSTR)text.m_lpstr);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TTM_ADDTOOL, 0, ti);\n\t}\n\n\tvoid DelTool(LPTOOLINFO lpToolInfo)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_DELTOOL, 0, (LPARAM)lpToolInfo);\n\t}\n\n\tvoid DelTool(HWND hWnd, UINT_PTR nIDTool = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(hWnd != NULL);\n\n\t\tCToolInfo ti(0, hWnd, nIDTool, NULL, NULL);\n\t\t::SendMessage(this->m_hWnd, TTM_DELTOOL, 0, ti);\n\t}\n\n\tBOOL HitTest(LPTTHITTESTINFO lpHitTestInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TTM_HITTEST, 0, (LPARAM)lpHitTestInfo);\n\t}\n\n\tBOOL HitTest(HWND hWnd, POINT pt, LPTOOLINFO lpToolInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(hWnd != NULL);\n\t\tATLASSERT(lpToolInfo != NULL);\n\n\t\tTTHITTESTINFO hti = {};\n\t\thti.ti.cbSize = RunTimeHelper::SizeOf_TOOLINFO();\n\t\thti.hwnd = hWnd;\n\t\thti.pt.x = pt.x;\n\t\thti.pt.y = pt.y;\n\t\tif((BOOL)::SendMessage(this->m_hWnd, TTM_HITTEST, 0, (LPARAM)&hti) != FALSE)\n\t\t{\n\t\t\t*lpToolInfo = hti.ti;\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}\n\n\tvoid RelayEvent(LPMSG lpMsg)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_RELAYEVENT, 0, (LPARAM)lpMsg);\n\t}\n\n\tvoid UpdateTipText(LPTOOLINFO lpToolInfo)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_UPDATETIPTEXT, 0, (LPARAM)lpToolInfo);\n\t}\n\n\tvoid UpdateTipText(ATL::_U_STRINGorID text, HWND hWnd, UINT_PTR nIDTool = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(hWnd != NULL);\n\n\t\tCToolInfo ti(0, hWnd, nIDTool, NULL, (LPTSTR)text.m_lpstr);\n\t\t::SendMessage(this->m_hWnd, TTM_UPDATETIPTEXT, 0, ti);\n\t}\n\n\tBOOL EnumTools(UINT_PTR nTool, LPTOOLINFO lpToolInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TTM_ENUMTOOLS, nTool, (LPARAM)lpToolInfo);\n\t}\n\n\tvoid Pop()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_POP, 0, 0L);\n\t}\n\n\tvoid TrackActivate(LPTOOLINFO lpToolInfo, BOOL bActivate)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_TRACKACTIVATE, bActivate, (LPARAM)lpToolInfo);\n\t}\n\n\tvoid TrackActivate(HWND hWnd, UINT_PTR nIDTool, BOOL bActivate)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(hWnd != NULL);\n\n\t\tCToolInfo ti(0, hWnd, nIDTool);\n\t\t::SendMessage(this->m_hWnd, TTM_TRACKACTIVATE, bActivate, ti);\n\t}\n\n\tvoid TrackPosition(int xPos, int yPos)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_TRACKPOSITION, 0, MAKELPARAM(xPos, yPos));\n\t}\n\n\tvoid Update()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_UPDATE, 0, 0L);\n\t}\n\n\tBOOL AdjustRect(LPRECT lpRect, BOOL bLarger /*= TRUE*/)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TTM_ADJUSTRECT, bLarger, (LPARAM)lpRect);\n\t}\n\n\tvoid Popup()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TTM_POPUP, 0, 0L);\n\t}\n};\n\ntypedef CToolTipCtrlT<ATL::CWindow>   CToolTipCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CHeaderCtrl\n\ntemplate <class TBase>\nclass CHeaderCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCHeaderCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCHeaderCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn WC_HEADER;\n\t}\n\n\tint GetItemCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, HDM_GETITEMCOUNT, 0, 0L);\n\t}\n\n\tBOOL GetItem(int nIndex, LPHDITEM pHeaderItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, HDM_GETITEM, nIndex, (LPARAM)pHeaderItem);\n\t}\n\n\tBOOL SetItem(int nIndex, LPHDITEM pHeaderItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, HDM_SETITEM, nIndex, (LPARAM)pHeaderItem);\n\t}\n\n\tCImageList GetImageList() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, HDM_GETIMAGELIST, 0, 0L));\n\t}\n\n\tCImageList SetImageList(HIMAGELIST hImageList)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, HDM_SETIMAGELIST, 0, (LPARAM)hImageList));\n\t}\n\n\tBOOL GetOrderArray(int nSize, int* lpnArray) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, HDM_GETORDERARRAY, nSize, (LPARAM)lpnArray);\n\t}\n\n\tBOOL SetOrderArray(int nSize, int* lpnArray)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, HDM_SETORDERARRAY, nSize, (LPARAM)lpnArray);\n\t}\n\n\tBOOL GetItemRect(int nIndex, LPRECT lpItemRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, HDM_GETITEMRECT, nIndex, (LPARAM)lpItemRect);\n\t}\n\n\tint SetHotDivider(BOOL bPos, DWORD dwInputValue)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, HDM_SETHOTDIVIDER, bPos, dwInputValue);\n\t}\n\n\tBOOL GetUnicodeFormat() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, HDM_GETUNICODEFORMAT, 0, 0L);\n\t}\n\n\tBOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, HDM_SETUNICODEFORMAT, bUnicode, 0L);\n\t}\n\n\tint GetBitmapMargin() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, HDM_GETBITMAPMARGIN, 0, 0L);\n\t}\n\n\tint SetBitmapMargin(int nWidth)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, HDM_SETBITMAPMARGIN, nWidth, 0L);\n\t}\n\n\tint SetFilterChangeTimeout(DWORD dwTimeOut)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, HDM_SETFILTERCHANGETIMEOUT, 0, dwTimeOut);\n\t}\n\n#if (_WIN32_WINNT >= 0x0600)\n\tBOOL GetItemDropDownRect(int nIndex, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, HDM_GETITEMDROPDOWNRECT, nIndex, (LPARAM)lpRect);\n\t}\n\n\tBOOL GetOverflowRect(LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, HDM_GETOVERFLOWRECT, 0, (LPARAM)lpRect);\n\t}\n\n\tint GetFocusedItem() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, HDM_GETFOCUSEDITEM, 0, 0L);\n\t}\n\n\tBOOL SetFocusedItem(int nIndex)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, HDM_SETFOCUSEDITEM, 0, nIndex);\n\t}\n#endif // (_WIN32_WINNT >= 0x0600)\n\n// Operations\n\tint InsertItem(int nIndex, LPHDITEM phdi)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, HDM_INSERTITEM, nIndex, (LPARAM)phdi);\n\t}\n\n\tint AddItem(LPHDITEM phdi)\n\t{\n\t\treturn InsertItem(GetItemCount(), phdi);\n\t}\n\n\tBOOL DeleteItem(int nIndex)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, HDM_DELETEITEM, nIndex, 0L);\n\t}\n\n\tBOOL Layout(HD_LAYOUT* pHeaderLayout)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, HDM_LAYOUT, 0, (LPARAM)pHeaderLayout);\n\t}\n\n\tint HitTest(LPHDHITTESTINFO lpHitTestInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, HDM_HITTEST, 0, (LPARAM)lpHitTestInfo);\n\t}\n\n\tint OrderToIndex(int nOrder)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, HDM_ORDERTOINDEX, nOrder, 0L);\n\t}\n\n\tCImageList CreateDragImage(int nIndex)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, HDM_CREATEDRAGIMAGE, nIndex, 0L));\n\t}\n\n\tint EditFilter(int nColumn, BOOL bDiscardChanges)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, HDM_EDITFILTER, nColumn, MAKELPARAM(bDiscardChanges, 0));\n\t}\n\n\tint ClearFilter(int nColumn)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, HDM_CLEARFILTER, nColumn, 0L);\n\t}\n\n\tint ClearAllFilters()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, HDM_CLEARFILTER, (WPARAM)-1, 0L);\n\t}\n};\n\ntypedef CHeaderCtrlT<ATL::CWindow>   CHeaderCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CListViewCtrl\n\ntemplate <class TBase>\nclass CListViewCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCListViewCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCListViewCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn WC_LISTVIEW;\n\t}\n\n\tCOLORREF GetBkColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, LVM_GETBKCOLOR, 0, 0L);\n\t}\n\n\tBOOL SetBkColor(COLORREF cr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETBKCOLOR, 0, cr);\n\t}\n\n\tCImageList GetImageList(int nImageListType) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, LVM_GETIMAGELIST, nImageListType, 0L));\n\t}\n\n\tCImageList SetImageList(HIMAGELIST hImageList, int nImageList)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd)); \n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, LVM_SETIMAGELIST, nImageList, (LPARAM)hImageList));\n\t}\n\n\tint GetItemCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETITEMCOUNT, 0, 0L);\n\t}\n\n\tBOOL SetItemCount(int nItems)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEMCOUNT, nItems, 0L);\n\t}\n\n\tBOOL GetItem(LPLVITEM pItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETITEM, 0, (LPARAM)pItem);\n\t}\n\n\tBOOL SetItem(const LVITEM* pItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEM, 0, (LPARAM)pItem);\n\t}\n\n\tBOOL SetItem(int nItem, int nSubItem, UINT nMask, LPCTSTR lpszItem,\n\t\tint nImage, UINT nState, UINT nStateMask, LPARAM lParam)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tLVITEM lvi = {};\n\t\tlvi.mask = nMask;\n\t\tlvi.iItem = nItem;\n\t\tlvi.iSubItem = nSubItem;\n\t\tlvi.stateMask = nStateMask;\n\t\tlvi.state = nState;\n\t\tlvi.pszText = (LPTSTR) lpszItem;\n\t\tlvi.iImage = nImage;\n\t\tlvi.lParam = lParam;\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEM, 0, (LPARAM)&lvi);\n\t}\n\n\tUINT GetItemState(int nItem, UINT nMask) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, LVM_GETITEMSTATE, nItem, nMask);\n\t}\n\n\tBOOL SetItemState(int nItem, UINT nState, UINT nStateMask)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tLVITEM lvi = {};\n\t\tlvi.state = nState;\n\t\tlvi.stateMask = nStateMask;\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEMSTATE, nItem, (LPARAM)&lvi);\n\t}\n\n\tBOOL SetItemState(int nItem, LPLVITEM pItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEMSTATE, nItem, (LPARAM)pItem);\n\t}\n\n\tBOOL GetItemText(int nItem, int nSubItem, BSTR& bstrText) const\n\t{\n\t\tUSES_CONVERSION;\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(bstrText == NULL);\n\t\tLVITEM lvi = {};\n\t\tlvi.iSubItem = nSubItem;\n\n\t\tLPTSTR lpstrText = NULL;\n\t\tint nRes = 0;\n\t\tfor(int nLen = 256; ; nLen *= 2)\n\t\t{\n\t\t\tATLTRY(lpstrText = new TCHAR[nLen]);\n\t\t\tif(lpstrText == NULL)\n\t\t\t\tbreak;\n\t\t\tlpstrText[0] = NULL;\n\t\t\tlvi.cchTextMax = nLen;\n\t\t\tlvi.pszText = lpstrText;\n\t\t\tnRes  = (int)::SendMessage(this->m_hWnd, LVM_GETITEMTEXT, (WPARAM)nItem, (LPARAM)&lvi);\n\t\t\tif(nRes < nLen - 1)\n\t\t\t\tbreak;\n\t\t\tdelete [] lpstrText;\n\t\t\tlpstrText = NULL;\n\t\t}\n\n\t\tif(lpstrText != NULL)\n\t\t{\n\t\t\tif(nRes != 0)\n\t\t\t\tbstrText = ::SysAllocString(T2OLE(lpstrText));\n\t\t\tdelete [] lpstrText;\n\t\t}\n\n\t\treturn (bstrText != NULL) ? TRUE : FALSE;\n\t}\n\n#ifdef __ATLSTR_H__\n\tint GetItemText(int nItem, int nSubItem, ATL::CString& strText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tLVITEM lvi = {};\n\t\tlvi.iSubItem = nSubItem;\n\n\t\tstrText.Empty();\n\t\tint nRes = 0;\n\t\tfor(int nLen = 256; ; nLen *= 2)\n\t\t{\n\t\t\tlvi.cchTextMax = nLen;\n\t\t\tlvi.pszText = strText.GetBufferSetLength(nLen);\n\t\t\tif(lvi.pszText == NULL)\n\t\t\t{\n\t\t\t\tnRes = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tnRes  = (int)::SendMessage(this->m_hWnd, LVM_GETITEMTEXT, (WPARAM)nItem, (LPARAM)&lvi);\n\t\t\tif(nRes < nLen - 1)\n\t\t\t\tbreak;\n\t\t}\n\t\tstrText.ReleaseBuffer();\n\t\treturn nRes;\n\t}\n#endif // __ATLSTR_H__\n\n\tint GetItemText(int nItem, int nSubItem, LPTSTR lpszText, int nLen) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tLVITEM lvi = {};\n\t\tlvi.iSubItem = nSubItem;\n\t\tlvi.cchTextMax = nLen;\n\t\tlvi.pszText = lpszText;\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETITEMTEXT, (WPARAM)nItem, (LPARAM)&lvi);\n\t}\n\n\tBOOL SetItemText(int nItem, int nSubItem, LPCTSTR lpszText)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn SetItem(nItem, nSubItem, LVIF_TEXT, lpszText, 0, 0, 0, 0);\n\t}\n\n\tDWORD_PTR GetItemData(int nItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tLVITEM lvi = {};\n\t\tlvi.iItem = nItem;\n\t\tlvi.mask = LVIF_PARAM;\n\t\tBOOL bRet = (BOOL)::SendMessage(this->m_hWnd, LVM_GETITEM, 0, (LPARAM)&lvi);\n\t\treturn (DWORD_PTR)(bRet ? lvi.lParam : NULL);\n\t}\n\n\tBOOL SetItemData(int nItem, DWORD_PTR dwData)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn SetItem(nItem, 0, LVIF_PARAM, NULL, 0, 0, 0, (LPARAM)dwData);\n\t}\n\n\tUINT GetCallbackMask() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, LVM_GETCALLBACKMASK, 0, 0L);\n\t}\n\n\tBOOL SetCallbackMask(UINT nMask)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETCALLBACKMASK, nMask, 0L);\n\t}\n\n\tBOOL GetItemPosition(int nItem, LPPOINT lpPoint) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETITEMPOSITION, nItem, (LPARAM)lpPoint);\n\t}\n\n\tBOOL SetItemPosition(int nItem, POINT pt)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(((this->GetStyle() & LVS_TYPEMASK) == LVS_ICON) || ((this->GetStyle() & LVS_TYPEMASK) == LVS_SMALLICON));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEMPOSITION32, nItem, (LPARAM)&pt);\n\t}\n\n\tBOOL SetItemPosition(int nItem, int x, int y)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(((this->GetStyle() & LVS_TYPEMASK) == LVS_ICON) || ((this->GetStyle() & LVS_TYPEMASK) == LVS_SMALLICON));\n\t\tPOINT pt = { x, y };\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEMPOSITION32, nItem, (LPARAM)&pt);\n\t}\n\n\tint GetStringWidth(LPCTSTR lpsz) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETSTRINGWIDTH, 0, (LPARAM)lpsz);\n\t}\n\n\tCEdit GetEditControl() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CEdit((HWND)::SendMessage(this->m_hWnd, LVM_GETEDITCONTROL, 0, 0L));\n\t}\n\n\tBOOL GetColumn(int nCol, LVCOLUMN* pColumn) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETCOLUMN, nCol, (LPARAM)pColumn);\n\t}\n\n\tBOOL SetColumn(int nCol, const LVCOLUMN* pColumn)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETCOLUMN, nCol, (LPARAM)pColumn);\n\t}\n\n\tint GetColumnWidth(int nCol) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETCOLUMNWIDTH, nCol, 0L);\n\t}\n\n\tBOOL SetColumnWidth(int nCol, int cx)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETCOLUMNWIDTH, nCol, MAKELPARAM(cx, 0));\n\t}\n\n\tBOOL GetViewRect(LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETVIEWRECT, 0, (LPARAM)lpRect);\n\t}\n\n\tCOLORREF GetTextColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, LVM_GETTEXTCOLOR, 0, 0L);\n\t}\n\n\tBOOL SetTextColor(COLORREF cr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETTEXTCOLOR, 0, cr);\n\t}\n\n\tCOLORREF GetTextBkColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, LVM_GETTEXTBKCOLOR, 0, 0L);\n\t}\n\n\tBOOL SetTextBkColor(COLORREF cr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETTEXTBKCOLOR, 0, cr);\n\t}\n\n\tint GetTopIndex() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETTOPINDEX, 0, 0L);\n\t}\n\n\tint GetCountPerPage() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETCOUNTPERPAGE, 0, 0L);\n\t}\n\n\tBOOL GetOrigin(LPPOINT lpPoint) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETORIGIN, 0, (LPARAM)lpPoint);\n\t}\n\n\tUINT GetSelectedCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, LVM_GETSELECTEDCOUNT, 0, 0L);\n\t}\n\n\tBOOL GetItemRect(int nItem, LPRECT lpRect, UINT nCode) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tlpRect->left = nCode;\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETITEMRECT, (WPARAM)nItem, (LPARAM)lpRect);\n\t}\n\n\tHCURSOR GetHotCursor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HCURSOR)::SendMessage(this->m_hWnd, LVM_GETHOTCURSOR, 0, 0L);\n\t}\n\n\tHCURSOR SetHotCursor(HCURSOR hHotCursor)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HCURSOR)::SendMessage(this->m_hWnd, LVM_SETHOTCURSOR, 0, (LPARAM)hHotCursor);\n\t}\n\n\tint GetHotItem() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETHOTITEM, 0, 0L);\n\t}\n\n\tint SetHotItem(int nIndex)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_SETHOTITEM, nIndex, 0L);\n\t}\n\n\tBOOL GetColumnOrderArray(int nCount, int* lpnArray) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETCOLUMNORDERARRAY, nCount, (LPARAM)lpnArray);\n\t}\n\n\tBOOL SetColumnOrderArray(int nCount, int* lpnArray)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETCOLUMNORDERARRAY, nCount, (LPARAM)lpnArray);\n\t}\n\n\tCHeaderCtrl GetHeader() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CHeaderCtrl((HWND)::SendMessage(this->m_hWnd, LVM_GETHEADER, 0, 0L));\n\t}\n\n\tBOOL GetSubItemRect(int nItem, int nSubItem, int nFlag, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & LVS_TYPEMASK) == LVS_REPORT);\n\t\tATLASSERT(lpRect != NULL);\n\t\tlpRect->top = nSubItem;\n\t\tlpRect->left = nFlag;\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETSUBITEMRECT, nItem, (LPARAM)lpRect);\n\t}\n\n\tDWORD SetIconSpacing(int cx, int cy)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & LVS_TYPEMASK) == LVS_ICON);\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, LVM_SETICONSPACING, 0, MAKELPARAM(cx, cy));\n\t}\n\n\tint GetISearchString(LPTSTR lpstr) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETISEARCHSTRING, 0, (LPARAM)lpstr);\n\t}\n\n\tvoid GetItemSpacing(SIZE& sizeSpacing, BOOL bSmallIconView = FALSE) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, LVM_GETITEMSPACING, bSmallIconView, 0L);\n\t\tsizeSpacing.cx = GET_X_LPARAM(dwRet);\n\t\tsizeSpacing.cy = GET_Y_LPARAM(dwRet);\n\t}\n\n\t// single-selection only\n\tint GetSelectedIndex() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & LVS_SINGLESEL) != 0);\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETNEXTITEM, (WPARAM)-1, MAKELPARAM(LVNI_ALL | LVNI_SELECTED, 0));\n\t}\n\n\tBOOL GetSelectedItem(LPLVITEM pItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & LVS_SINGLESEL) != 0);\n\t\tATLASSERT(pItem != NULL);\n\t\tpItem->iItem = (int)::SendMessage(this->m_hWnd, LVM_GETNEXTITEM, (WPARAM)-1, MAKELPARAM(LVNI_ALL | LVNI_SELECTED, 0));\n\t\tif(pItem->iItem == -1)\n\t\t\treturn FALSE;\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETITEM, 0, (LPARAM)pItem);\n\t}\n\n\t// extended list view styles\n\tDWORD GetExtendedListViewStyle() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0L);\n\t}\n\n\t// dwExMask = 0 means all styles\n\tDWORD SetExtendedListViewStyle(DWORD dwExStyle, DWORD dwExMask = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, dwExMask, dwExStyle);\n\t}\n\n\t// checkboxes only\n\tBOOL GetCheckState(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((GetExtendedListViewStyle() & LVS_EX_CHECKBOXES) != 0);\n\t\tUINT uRet = GetItemState(nIndex, LVIS_STATEIMAGEMASK);\n\t\treturn (uRet >> 12) - 1;\n\t}\n\n\tBOOL SetCheckState(int nItem, BOOL bCheck)\n\t{\n\t\tint nCheck = bCheck ? 2 : 1;   // one based index\n\t\treturn SetItemState(nItem, INDEXTOSTATEIMAGEMASK(nCheck), LVIS_STATEIMAGEMASK);\n\t}\n\n\t// view type\n\tDWORD GetViewType() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (this->GetStyle() & LVS_TYPEMASK);\n\t}\n\n\tDWORD SetViewType(DWORD dwType)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((dwType == LVS_ICON) || (dwType == LVS_SMALLICON) || (dwType == LVS_LIST) || (dwType == LVS_REPORT));\n\t\tDWORD dwOldType = GetViewType();\n\t\tif(dwType != dwOldType)\n\t\t\tthis->ModifyStyle(LVS_TYPEMASK, (dwType & LVS_TYPEMASK));\n\t\treturn dwOldType;\n\t}\n\n\tBOOL GetBkImage(LPLVBKIMAGE plvbki) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETBKIMAGE, 0, (LPARAM)plvbki);\n\t}\n\n\tBOOL SetBkImage(LPLVBKIMAGE plvbki)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETBKIMAGE, 0, (LPARAM)plvbki);\n\t}\n\n\tint GetSelectionMark() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETSELECTIONMARK, 0, 0L);\n\t}\n\n\tint SetSelectionMark(int nIndex)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_SETSELECTIONMARK, 0, nIndex);\n\t}\n\n\tBOOL GetWorkAreas(int nWorkAreas, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETWORKAREAS, nWorkAreas, (LPARAM)lpRect);\n\t}\n\n\tBOOL SetWorkAreas(int nWorkAreas, LPRECT lpRect)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETWORKAREAS, nWorkAreas, (LPARAM)lpRect);\n\t}\n\n\tDWORD GetHoverTime() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((GetExtendedListViewStyle() & (LVS_EX_TRACKSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_TWOCLICKACTIVATE)) != 0);\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, LVM_GETHOVERTIME, 0, 0L);\n\t}\n\n\tDWORD SetHoverTime(DWORD dwHoverTime)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((GetExtendedListViewStyle() & (LVS_EX_TRACKSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_TWOCLICKACTIVATE)) != 0);\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, LVM_SETHOVERTIME, 0, dwHoverTime);\n\t}\n\n\tBOOL GetNumberOfWorkAreas(int* pnWorkAreas) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETNUMBEROFWORKAREAS, 0, (LPARAM)pnWorkAreas);\n\t}\n\n\tBOOL SetItemCountEx(int nItems, DWORD dwFlags)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(((this->GetStyle() & LVS_OWNERDATA) != 0) && (((this->GetStyle() & LVS_TYPEMASK) == LVS_REPORT) || ((this->GetStyle() & LVS_TYPEMASK) == LVS_LIST)));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEMCOUNT, nItems, dwFlags);\n\t}\n\n\tCToolTipCtrl GetToolTips() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, LVM_GETTOOLTIPS, 0, 0L));\n\t}\n\n\tCToolTipCtrl SetToolTips(HWND hWndTT)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, LVM_SETTOOLTIPS, (WPARAM)hWndTT, 0L));\n\t}\n\n\tBOOL GetUnicodeFormat() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETUNICODEFORMAT, 0, 0L);\n\t}\n\n\tBOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETUNICODEFORMAT, bUnicode, 0L);\n\t}\n\n\tint GetSelectedColumn() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETSELECTEDCOLUMN, 0, 0L);\n\t}\n\n\tvoid SetSelectedColumn(int nColumn)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, LVM_SETSELECTEDCOLUMN, nColumn, 0L);\n\t}\n\n\tDWORD GetView() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, LVM_GETVIEW, 0, 0L);\n\t}\n\n\tint SetView(DWORD dwView)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_SETVIEW, dwView, 0L);\n\t}\n\n\tBOOL IsGroupViewEnabled() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_ISGROUPVIEWENABLED, 0, 0L);\n\t}\n\n\tint GetGroupInfo(int nGroupID, PLVGROUP pGroup) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETGROUPINFO, nGroupID, (LPARAM)pGroup);\n\t}\n\n\tint SetGroupInfo(int nGroupID, PLVGROUP pGroup)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_SETGROUPINFO, nGroupID, (LPARAM)pGroup);\n\t}\n\n\tvoid GetGroupMetrics(PLVGROUPMETRICS pGroupMetrics) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, LVM_GETGROUPMETRICS, 0, (LPARAM)pGroupMetrics);\n\t}\n\n\tvoid SetGroupMetrics(PLVGROUPMETRICS pGroupMetrics)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, LVM_SETGROUPMETRICS, 0, (LPARAM)pGroupMetrics);\n\t}\n\n\tvoid GetTileViewInfo(PLVTILEVIEWINFO pTileViewInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, LVM_GETTILEVIEWINFO, 0, (LPARAM)pTileViewInfo);\n\t}\n\n\tBOOL SetTileViewInfo(PLVTILEVIEWINFO pTileViewInfo)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETTILEVIEWINFO, 0, (LPARAM)pTileViewInfo);\n\t}\n\n\tvoid GetTileInfo(PLVTILEINFO pTileInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, LVM_GETTILEINFO, 0, (LPARAM)pTileInfo);\n\t}\n\n\tBOOL SetTileInfo(PLVTILEINFO pTileInfo)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETTILEINFO, 0, (LPARAM)pTileInfo);\n\t}\n\n\tBOOL GetInsertMark(LPLVINSERTMARK pInsertMark) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETINSERTMARK, 0, (LPARAM)pInsertMark);\n\t}\n\n\tBOOL SetInsertMark(LPLVINSERTMARK pInsertMark)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETINSERTMARK, 0, (LPARAM)pInsertMark);\n\t}\n\n\tint GetInsertMarkRect(LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETINSERTMARKRECT, 0, (LPARAM)lpRect);\n\t}\n\n\tCOLORREF GetInsertMarkColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, LVM_GETINSERTMARKCOLOR, 0, 0L);\n\t}\n\n\tCOLORREF SetInsertMarkColor(COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, LVM_SETINSERTMARKCOLOR, 0, clr);\n\t}\n\n\tCOLORREF GetOutlineColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, LVM_GETOUTLINECOLOR, 0, 0L);\n\t}\n\n\tCOLORREF SetOutlineColor(COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, LVM_SETOUTLINECOLOR, 0, clr);\n\t}\n\n#if (_WIN32_WINNT >= 0x0600)\n\tint GetGroupCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETGROUPCOUNT, 0, 0L);\n\t}\n\n\tBOOL GetGroupInfoByIndex(int nIndex, PLVGROUP pGroup) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETGROUPINFOBYINDEX, nIndex, (LPARAM)pGroup);\n\t}\n\n\tBOOL GetGroupRect(int nGroupID, int nType, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(lpRect != NULL);\n\t\tif(lpRect != NULL)\n\t\t\tlpRect->top = nType;\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETGROUPRECT, nGroupID, (LPARAM)lpRect);\n\t}\n\n\tUINT GetGroupState(int nGroupID, UINT uMask) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, LVM_GETGROUPSTATE, nGroupID, (LPARAM)uMask);\n\t}\n\n\tint GetFocusedGroup() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETFOCUSEDGROUP, 0, 0L);\n\t}\n\n\tBOOL GetEmptyText(LPWSTR lpstrText, int cchText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETEMPTYTEXT, cchText, (LPARAM)lpstrText);\n\t}\n\n\tBOOL GetFooterRect(LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETFOOTERRECT, 0, (LPARAM)lpRect);\n\t}\n\n\tBOOL GetFooterInfo(LPLVFOOTERINFO lpFooterInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETFOOTERINFO, 0, (LPARAM)lpFooterInfo);\n\t}\n\n\tBOOL GetFooterItemRect(int nItem, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETFOOTERITEMRECT, nItem, (LPARAM)lpRect);\n\t}\n\n\tBOOL GetFooterItem(int nItem, LPLVFOOTERITEM lpFooterItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETFOOTERITEM, nItem, (LPARAM)lpFooterItem);\n\t}\n\n\tBOOL GetItemIndexRect(PLVITEMINDEX pItemIndex, int nSubItem, int nType, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(pItemIndex != NULL);\n\t\tATLASSERT(lpRect != NULL);\n\t\tif(lpRect != NULL)\n\t\t{\n\t\t\tlpRect->top = nSubItem;\n\t\t\tlpRect->left = nType;\n\t\t}\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETITEMINDEXRECT, (WPARAM)pItemIndex, (LPARAM)lpRect);\n\t}\n\n\tBOOL SetItemIndexState(PLVITEMINDEX pItemIndex, UINT uState, UINT dwMask)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tLVITEM lvi = {};\n\t\tlvi.state = uState;\n\t\tlvi.stateMask = dwMask;\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETITEMINDEXSTATE, (WPARAM)pItemIndex, (LPARAM)&lvi);\n\t}\n\n\tBOOL GetNextItemIndex(PLVITEMINDEX pItemIndex, WORD wFlags) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_GETNEXTITEMINDEX, (WPARAM)pItemIndex, MAKELPARAM(wFlags, 0));\n\t}\n#endif // (_WIN32_WINNT >= 0x0600)\n\n// Operations\n\tint InsertColumn(int nCol, const LVCOLUMN* pColumn)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_INSERTCOLUMN, nCol, (LPARAM)pColumn);\n\t}\n\n\tint InsertColumn(int nCol, LPCTSTR lpszColumnHeading, int nFormat = LVCFMT_LEFT, \n\t\t\tint nWidth = -1, int nSubItem = -1, int iImage = -1, int iOrder = -1)\n\t{\n\t\tLVCOLUMN column = {};\n\t\tcolumn.mask = LVCF_TEXT | LVCF_FMT;\n\t\tcolumn.pszText = (LPTSTR)lpszColumnHeading;\n\t\tcolumn.fmt = nFormat;\n\t\tif (nWidth != -1)\n\t\t{\n\t\t\tcolumn.mask |= LVCF_WIDTH;\n\t\t\tcolumn.cx = nWidth;\n\t\t}\n\t\tif (nSubItem != -1)\n\t\t{\n\t\t\tcolumn.mask |= LVCF_SUBITEM;\n\t\t\tcolumn.iSubItem = nSubItem;\n\t\t}\n\t\tif (iImage != -1)\n\t\t{\n\t\t\tcolumn.mask |= LVCF_IMAGE;\n\t\t\tcolumn.iImage = iImage;\n\t\t}\n\t\tif (iOrder != -1)\n\t\t{\n\t\t\tcolumn.mask |= LVCF_ORDER;\n\t\t\tcolumn.iOrder = iOrder;\n\t\t}\n\t\treturn InsertColumn(nCol, &column);\n\t}\n\n\tBOOL DeleteColumn(int nCol)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_DELETECOLUMN, nCol, 0L);\n\t}\n\n\tint InsertItem(UINT nMask, int nItem, LPCTSTR lpszItem, UINT nState, UINT nStateMask, int nImage, LPARAM lParam)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tLVITEM item = {};\n\t\titem.mask = nMask;\n\t\titem.iItem = nItem;\n\t\titem.iSubItem = 0;\n\t\titem.pszText = (LPTSTR)lpszItem;\n\t\titem.state = nState;\n\t\titem.stateMask = nStateMask;\n\t\titem.iImage = nImage;\n\t\titem.lParam = lParam;\n\t\treturn InsertItem(&item);\n\t}\n\n\tint InsertItem(const LVITEM* pItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_INSERTITEM, 0, (LPARAM)pItem);\n\t}\n\n\tint InsertItem(int nItem, LPCTSTR lpszItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn InsertItem(LVIF_TEXT, nItem, lpszItem, 0, 0, 0, 0);\n\t}\n\n\tint InsertItem(int nItem, LPCTSTR lpszItem, int nImage)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn InsertItem(LVIF_TEXT|LVIF_IMAGE, nItem, lpszItem, 0, 0, nImage, 0);\n\t}\n\n\tint GetNextItem(int nItem, int nFlags) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_GETNEXTITEM, nItem, MAKELPARAM(nFlags, 0));\n\t}\n\n\tBOOL DeleteItem(int nItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_DELETEITEM, nItem, 0L);\n\t}\n\n\tBOOL DeleteAllItems()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_DELETEALLITEMS, 0, 0L);\n\t}\n\n\tint FindItem(LVFINDINFO* pFindInfo, int nStart = -1) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_FINDITEM, nStart, (LPARAM)pFindInfo);\n\t}\n\n\tint FindItem(LPCTSTR lpstrFind, bool bPartial = true, bool bWrap = false, int nStart = -1) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tLVFINDINFO lvfi = {};\n\t\tlvfi.flags = LVFI_STRING | (bWrap ? LVFI_WRAP : 0) | (bPartial ? LVFI_PARTIAL : 0);\n\t\tlvfi.psz = lpstrFind;\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_FINDITEM, nStart, (LPARAM)&lvfi);\n\t}\n\n\tint HitTest(LVHITTESTINFO* pHitTestInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_HITTEST, 0, (LPARAM)pHitTestInfo);\n\t}\n\n\tint HitTest(POINT pt, UINT* pFlags) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tLVHITTESTINFO hti = {};\n\t\thti.pt = pt;\n\t\tint nRes = (int)::SendMessage(this->m_hWnd, LVM_HITTEST, 0, (LPARAM)&hti);\n\t\tif (pFlags != NULL)\n\t\t\t*pFlags = hti.flags;\n\t\treturn nRes;\n\t}\n\n\tBOOL EnsureVisible(int nItem, BOOL bPartialOK)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_ENSUREVISIBLE, nItem, MAKELPARAM(bPartialOK, 0));\n\t}\n\n\tBOOL Scroll(int cx, int cy)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SCROLL, cx, cy);\n\t}\n\n\tBOOL Scroll(SIZE size)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SCROLL, size.cx, size.cy);\n\t}\n\n\tBOOL RedrawItems(int nFirst, int nLast)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_REDRAWITEMS, nFirst, nLast);\n\t}\n\n\tBOOL Arrange(UINT nCode)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_ARRANGE, nCode, 0L);\n\t}\n\n\tCEdit EditLabel(int nItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CEdit((HWND)::SendMessage(this->m_hWnd, LVM_EDITLABEL, nItem, 0L));\n\t}\n\n\tBOOL Update(int nItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_UPDATE, nItem, 0L);\n\t}\n\n\tBOOL SortItems(PFNLVCOMPARE pfnCompare, LPARAM lParamSort)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SORTITEMS, (WPARAM)lParamSort, (LPARAM)pfnCompare);\n\t}\n\n\tCImageList RemoveImageList(int nImageList)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, LVM_SETIMAGELIST, (WPARAM)nImageList, NULL));\n\t}\n\n\tCImageList CreateDragImage(int nItem, LPPOINT lpPoint)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, LVM_CREATEDRAGIMAGE, nItem, (LPARAM)lpPoint));\n\t}\n\n\tDWORD ApproximateViewRect(int cx = -1, int cy = -1, int nCount = -1)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, LVM_APPROXIMATEVIEWRECT, nCount, MAKELPARAM(cx, cy));\n\t}\n\n\tint SubItemHitTest(LPLVHITTESTINFO lpInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_SUBITEMHITTEST, 0, (LPARAM)lpInfo);\n\t}\n\n\tint AddColumn(LPCTSTR strColumn, int nItem, int nSubItem = -1,\n\t\t\tint nMask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM,\n\t\t\tint nFmt = LVCFMT_LEFT)\n\t{\n\t\tconst int cxOffset = 15;\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tLVCOLUMN lvc = {};\n\t\tlvc.mask = nMask;\n\t\tlvc.fmt = nFmt;\n\t\tlvc.pszText = (LPTSTR)strColumn;\n\t\tlvc.cx = GetStringWidth(lvc.pszText) + cxOffset;\n\t\tif(nMask & LVCF_SUBITEM)\n\t\t\tlvc.iSubItem = (nSubItem != -1) ? nSubItem : nItem;\n\t\treturn InsertColumn(nItem, &lvc);\n\t}\n\n\tint AddItem(int nItem, int nSubItem, LPCTSTR strItem, int nImageIndex = -3)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tLVITEM lvItem = {};\n\t\tlvItem.mask = LVIF_TEXT;\n\t\tlvItem.iItem = nItem;\n\t\tlvItem.iSubItem = nSubItem;\n\t\tlvItem.pszText = (LPTSTR)strItem;\n\t\tif(nImageIndex != -3)\n\t\t{\n\t\t\tlvItem.mask |= LVIF_IMAGE;\n\t\t\tlvItem.iImage = nImageIndex;\n\t\t}\n\t\tif(nSubItem == 0)\n\t\t\treturn InsertItem(&lvItem);\n\t\treturn SetItem(&lvItem) ? nItem : -1;\n\t}\n\n\tBOOL SortItemsEx(PFNLVCOMPARE pfnCompare, LPARAM lParamSort)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SORTITEMSEX, (WPARAM)lParamSort, (LPARAM)pfnCompare);\n\t}\n\n\tint InsertGroup(int nItem, PLVGROUP pGroup)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_INSERTGROUP, nItem, (LPARAM)pGroup);\n\t}\n\n\tint AddGroup(PLVGROUP pGroup)\n\t{\n\t\treturn InsertGroup(-1, pGroup);\n\t}\n\n\tint RemoveGroup(int nGroupID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_REMOVEGROUP, nGroupID, 0L);\n\t}\n\n\tvoid MoveGroup(int nGroupID, int nItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, LVM_MOVEGROUP, nGroupID, nItem);\n\t}\n\n\tvoid MoveItemToGroup(int nItem, int nGroupID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, LVM_MOVEITEMTOGROUP, nItem, nGroupID);\n\t}\n\n\tint EnableGroupView(BOOL bEnable)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_ENABLEGROUPVIEW, bEnable, 0L);\n\t}\n\n\tint SortGroups(PFNLVGROUPCOMPARE pCompareFunc, LPVOID lpVoid = NULL)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_SORTGROUPS, (WPARAM)pCompareFunc, (LPARAM)lpVoid);\n\t}\n\n\tvoid InsertGroupSorted(PLVINSERTGROUPSORTED pInsertGroupSorted)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, LVM_INSERTGROUPSORTED, (WPARAM)pInsertGroupSorted, 0L);\n\t}\n\n\tvoid RemoveAllGroups()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, LVM_REMOVEALLGROUPS, 0, 0L);\n\t}\n\n\tBOOL HasGroup(int nGroupID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_HASGROUP, nGroupID, 0L);\n\t}\n\n\tBOOL InsertMarkHitTest(LPPOINT lpPoint, LPLVINSERTMARK pInsertMark) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_INSERTMARKHITTEST, (WPARAM)lpPoint, (LPARAM)pInsertMark);\n\t}\n\n\tBOOL SetInfoTip(PLVSETINFOTIP pSetInfoTip)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_SETINFOTIP, 0, (LPARAM)pSetInfoTip);\n\t}\n\n\tvoid CancelEditLabel()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, LVM_CANCELEDITLABEL, 0, 0L);\n\t}\n\n\tUINT MapIndexToID(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, LVM_MAPINDEXTOID, nIndex, 0L);\n\t}\n\n\tint MapIDToIndex(UINT uID) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_MAPIDTOINDEX, uID, 0L);\n\t}\n\n\tBOOL IsItemVisible(int nItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LVM_ISITEMVISIBLE, nItem, 0L);\n\t}\n\n#if (_WIN32_WINNT >= 0x0600)\n\tint HitTestEx(LPLVHITTESTINFO lpHitTestInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_HITTEST, (WPARAM)-1, (LPARAM)lpHitTestInfo);\n\t}\n\n\tint HitTestEx(POINT pt, UINT* pFlags) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tLVHITTESTINFO hti = {};\n\t\thti.pt = pt;\n\t\tint nRes = (int)::SendMessage(this->m_hWnd, LVM_HITTEST, (WPARAM)-1, (LPARAM)&hti);\n\t\tif (pFlags != NULL)\n\t\t\t*pFlags = hti.flags;\n\t\treturn nRes;\n\t}\n\n\tint SubItemHitTestEx(LPLVHITTESTINFO lpHitTestInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LVM_SUBITEMHITTEST, (WPARAM)-1, (LPARAM)lpHitTestInfo);\n\t}\n#endif // (_WIN32_WINNT >= 0x0600)\n\n\t// Note: selects only one item\n\tBOOL SelectItem(int nIndex)   // -1 to select none\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\n\t\tBOOL bRet = FALSE;\n\t\tif(nIndex != -1)\n\t\t{\n\t\t\t// multi-selection only: de-select all items\n\t\t\tif((this->GetStyle() & LVS_SINGLESEL) == 0)\n\t\t\t\tSetItemState(-1, 0, LVIS_SELECTED);\n\n\t\t\tbRet = SetItemState(nIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);\n\t\t\tif(bRet)\n\t\t\t{\n\t\t\t\tSetSelectionMark(nIndex);\n\t\t\t\tbRet = EnsureVisible(nIndex, FALSE);\n\t\t\t}\n\t\t}\n\t\telse   // no item specified, just de-select\n\t\t{\n\t\t\tbRet = SetItemState(-1, 0, LVIS_SELECTED);\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\t// multi-selection only\n\tBOOL SelectAllItems(bool bSelect = true)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & LVS_SINGLESEL) == 0);\n\n\t\treturn SetItemState(-1, bSelect ? LVIS_SELECTED : 0, LVIS_SELECTED);\n\t}\n};\n\ntypedef CListViewCtrlT<ATL::CWindow>   CListViewCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CTreeViewCtrl\n\ntemplate <class TBase>\nclass CTreeViewCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCTreeViewCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCTreeViewCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn WC_TREEVIEW;\n\t}\n\n\tUINT GetCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, TVM_GETCOUNT, 0, 0L);\n\t}\n\n\tUINT GetIndent() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, TVM_GETINDENT, 0, 0L);\n\t}\n\n\tvoid SetIndent(UINT nIndent)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TVM_SETINDENT, nIndent, 0L);\n\t}\n\n\tCImageList GetImageList(int nImageListType = TVSIL_NORMAL) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TVM_GETIMAGELIST, (WPARAM)nImageListType, 0L));\n\t}\n\n\tCImageList SetImageList(HIMAGELIST hImageList, int nImageListType = TVSIL_NORMAL)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TVM_SETIMAGELIST, (WPARAM)nImageListType, (LPARAM)hImageList));\n\t}\n\n\tBOOL GetItem(LPTVITEM pItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)pItem);\n\t}\n\n\tBOOL SetItem(LPTVITEM pItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_SETITEM, 0, (LPARAM)pItem);\n\t}\n\n\tBOOL SetItem(HTREEITEM hItem, UINT nMask, LPCTSTR lpszItem, int nImage,\n\t\tint nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTVITEM item = {};\n\t\titem.hItem = hItem;\n\t\titem.mask = nMask;\n\t\titem.pszText = (LPTSTR) lpszItem;\n\t\titem.iImage = nImage;\n\t\titem.iSelectedImage = nSelectedImage;\n\t\titem.state = nState;\n\t\titem.stateMask = nStateMask;\n\t\titem.lParam = lParam;\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_SETITEM, 0, (LPARAM)&item);\n\t}\n\n\tBOOL GetItemText(HTREEITEM hItem, LPTSTR lpstrText, int nLen) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(lpstrText != NULL);\n\n\t\tTVITEM item = {};\n\t\titem.hItem = hItem;\n\t\titem.mask = TVIF_TEXT;\n\t\titem.pszText = lpstrText;\n\t\titem.cchTextMax = nLen;\n\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);\n\t}\n\n\tBOOL GetItemText(HTREEITEM hItem, BSTR& bstrText) const\n\t{\n\t\tUSES_CONVERSION;\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(bstrText == NULL);\n\t\tTVITEM item = {};\n\t\titem.hItem = hItem;\n\t\titem.mask = TVIF_TEXT;\n\n\t\tLPTSTR lpstrText = NULL;\n\t\tBOOL bRet = FALSE;\n\t\tfor(int nLen = 256; ; nLen *= 2)\n\t\t{\n\t\t\tATLTRY(lpstrText = new TCHAR[nLen]);\n\t\t\tif(lpstrText == NULL)\n\t\t\t\tbreak;\n\t\t\tlpstrText[0] = NULL;\n\t\t\titem.pszText = lpstrText;\n\t\t\titem.cchTextMax = nLen;\n\t\t\tbRet = (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);\n\t\t\tif(!bRet || (lstrlen(item.pszText) < (nLen - 1)))\n\t\t\t\tbreak;\n\t\t\tdelete [] lpstrText;\n\t\t\tlpstrText = NULL;\n\t\t}\n\n\t\tif(lpstrText != NULL)\n\t\t{\n\t\t\tif(bRet)\n\t\t\t\tbstrText = ::SysAllocString(T2OLE(lpstrText));\n\t\t\tdelete [] lpstrText;\n\t\t}\n\n\t\treturn (bstrText != NULL) ? TRUE : FALSE;\n\t}\n\n#ifdef __ATLSTR_H__\n\tBOOL GetItemText(HTREEITEM hItem, ATL::CString& strText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTVITEM item = {};\n\t\titem.hItem = hItem;\n\t\titem.mask = TVIF_TEXT;\n\n\t\tstrText.Empty();\n\t\tBOOL bRet = FALSE;\n\t\tfor(int nLen = 256; ; nLen *= 2)\n\t\t{\n\t\t\titem.pszText = strText.GetBufferSetLength(nLen);\n\t\t\tif(item.pszText == NULL)\n\t\t\t{\n\t\t\t\tbRet = FALSE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\titem.cchTextMax = nLen;\n\t\t\tbRet = (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);\n\t\t\tif(!bRet || (lstrlen(item.pszText) < (nLen - 1)))\n\t\t\t\tbreak;\n\t\t}\n\t\tstrText.ReleaseBuffer();\n\t\treturn bRet;\n\t}\n#endif // __ATLSTR_H__\n\n\tBOOL SetItemText(HTREEITEM hItem, LPCTSTR lpszItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn SetItem(hItem, TVIF_TEXT, lpszItem, 0, 0, 0, 0, NULL);\n\t}\n\n\tBOOL GetItemImage(HTREEITEM hItem, int& nImage, int& nSelectedImage) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTVITEM item = {};\n\t\titem.hItem = hItem;\n\t\titem.mask = TVIF_IMAGE|TVIF_SELECTEDIMAGE;\n\t\tBOOL bRes = (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);\n\t\tif (bRes)\n\t\t{\n\t\t\tnImage = item.iImage;\n\t\t\tnSelectedImage = item.iSelectedImage;\n\t\t}\n\t\treturn bRes;\n\t}\n\n\tBOOL SetItemImage(HTREEITEM hItem, int nImage, int nSelectedImage)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn SetItem(hItem, TVIF_IMAGE|TVIF_SELECTEDIMAGE, NULL, nImage, nSelectedImage, 0, 0, NULL);\n\t}\n\n\tUINT GetItemState(HTREEITEM hItem, UINT nStateMask) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (((UINT)::SendMessage(this->m_hWnd, TVM_GETITEMSTATE, (WPARAM)hItem, (LPARAM)nStateMask)) & nStateMask);\n\t}\n\n\tBOOL SetItemState(HTREEITEM hItem, UINT nState, UINT nStateMask)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn SetItem(hItem, TVIF_STATE, NULL, 0, 0, nState, nStateMask, NULL);\n\t}\n\n\tDWORD_PTR GetItemData(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTVITEM item = {};\n\t\titem.hItem = hItem;\n\t\titem.mask = TVIF_PARAM;\n\t\tBOOL bRet = (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);\n\t\treturn (DWORD_PTR)(bRet ? item.lParam : NULL);\n\t}\n\n\tBOOL SetItemData(HTREEITEM hItem, DWORD_PTR dwData)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn SetItem(hItem, TVIF_PARAM, NULL, 0, 0, 0, 0, (LPARAM)dwData);\n\t}\n\n\tCEdit GetEditControl() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CEdit((HWND)::SendMessage(this->m_hWnd, TVM_GETEDITCONTROL, 0, 0L));\n\t}\n\n\tUINT GetVisibleCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, TVM_GETVISIBLECOUNT, 0, 0L);\n\t}\n\n\tBOOL GetItemRect(HTREEITEM hItem, LPRECT lpRect, BOOL bTextOnly) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t*(HTREEITEM*)lpRect = hItem;\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEMRECT, (WPARAM)bTextOnly, (LPARAM)lpRect);\n\t}\n\n\tBOOL ItemHasChildren(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTVITEM item = {};\n\t\titem.hItem = hItem;\n\t\titem.mask = TVIF_CHILDREN;\n\t\t::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);\n\t\treturn item.cChildren;\n\t}\n\n\tCToolTipCtrl GetToolTips() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, TVM_GETTOOLTIPS, 0, 0L));\n\t}\n\n\tCToolTipCtrl SetToolTips(HWND hWndTT)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, TVM_SETTOOLTIPS, (WPARAM)hWndTT, 0L));\n\t}\n\n\tint GetISearchString(LPTSTR lpstr) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TVM_GETISEARCHSTRING, 0, (LPARAM)lpstr);\n\t}\n\n\t// checkboxes only\n\tBOOL GetCheckState(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & TVS_CHECKBOXES) != 0);\n\t\tUINT uRet = GetItemState(hItem, TVIS_STATEIMAGEMASK);\n\t\treturn (uRet >> 12) - 1;\n\t}\n\n\tBOOL SetCheckState(HTREEITEM hItem, BOOL bCheck)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & TVS_CHECKBOXES) != 0);\n\t\tint nCheck = bCheck ? 2 : 1;   // one based index\n\t\treturn SetItemState(hItem, INDEXTOSTATEIMAGEMASK(nCheck), TVIS_STATEIMAGEMASK);\n\t}\n\n\t// for standard and extended checkboxes (0 = no checkbox, 1 = unchecked, 2 = checked, >2 = optional extended check states)\n\tUINT GetCheckStateEx(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(this->GetImageList(TVSIL_STATE) != NULL);\n\t\tUINT uRet = GetItemState(hItem, TVIS_STATEIMAGEMASK);\n\t\treturn (uRet >> 12);\n\t}\n\n\tBOOL SetCheckStateEx(HTREEITEM hItem, UINT uCheckState)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(this->GetImageList(TVSIL_STATE) != NULL);\n\t\tATLASSERT(uCheckState < (UINT)::ImageList_GetImageCount(this->GetImageList(TVSIL_STATE)));\n\t\treturn SetItemState(hItem, INDEXTOSTATEIMAGEMASK(uCheckState), TVIS_STATEIMAGEMASK);\n\t}\n\n\tCOLORREF GetBkColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, TVM_GETBKCOLOR, 0, 0L);\n\t}\n\n\tCOLORREF SetBkColor(COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, TVM_SETBKCOLOR, 0, (LPARAM)clr);\n\t}\n\n\tCOLORREF GetInsertMarkColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, TVM_GETINSERTMARKCOLOR, 0, 0L);\n\t}\n\n\tCOLORREF SetInsertMarkColor(COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, TVM_SETINSERTMARKCOLOR, 0, (LPARAM)clr);\n\t}\n\n\tint GetItemHeight() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TVM_GETITEMHEIGHT, 0, 0L);\n\t}\n\n\tint SetItemHeight(int cyHeight)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TVM_SETITEMHEIGHT, cyHeight, 0L);\n\t}\n\n\tint GetScrollTime() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TVM_GETSCROLLTIME, 0, 0L);\n\t}\n\n\tint SetScrollTime(int nScrollTime)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TVM_SETSCROLLTIME, nScrollTime, 0L);\n\t}\n\n\tCOLORREF GetTextColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, TVM_GETTEXTCOLOR, 0, 0L);\n\t}\n\n\tCOLORREF SetTextColor(COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, TVM_SETTEXTCOLOR, 0, (LPARAM)clr);\n\t}\n\n\tBOOL GetUnicodeFormat() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_GETUNICODEFORMAT, 0, 0L);\n\t}\n\n\tBOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_SETUNICODEFORMAT, bUnicode, 0L);\n\t}\n\n\tCOLORREF GetLineColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, TVM_GETLINECOLOR, 0, 0L);\n\t}\n\n\tCOLORREF SetLineColor(COLORREF clrNew /*= CLR_DEFAULT*/)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, TVM_SETLINECOLOR, 0, (LPARAM)clrNew);\n\t}\n\n\tBOOL GetItem(LPTVITEMEX pItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEM, 0, (LPARAM)pItem);\n\t}\n\n\tBOOL SetItem(LPTVITEMEX pItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_SETITEM, 0, (LPARAM)pItem);\n\t}\n\n\tDWORD GetExtendedStyle() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, TVM_GETEXTENDEDSTYLE, 0, 0L);\n\t}\n\n\tDWORD SetExtendedStyle(DWORD dwStyle, DWORD dwMask)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, TVM_SETEXTENDEDSTYLE, dwMask, dwStyle);\n\t}\n\n#if (_WIN32_WINNT >= 0x0600)\n\tBOOL SetAutoScrollInfo(UINT uPixPerSec, UINT uUpdateTime)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_SETAUTOSCROLLINFO, (WPARAM)uPixPerSec, (LPARAM)uUpdateTime);\n\t}\n\n\tDWORD GetSelectedCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, TVM_GETSELECTEDCOUNT, 0, 0L);\n\t}\n\n\tBOOL GetItemPartRect(HTREEITEM hItem, TVITEMPART partID, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTVGETITEMPARTRECTINFO gipri = { hItem, lpRect, partID };\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_GETITEMPARTRECT, 0, (LPARAM)&gipri);\n\t}\n#endif // (_WIN32_WINNT >= 0x0600)\n\n// Operations\n\tHTREEITEM InsertItem(LPTVINSERTSTRUCT lpInsertStruct)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_INSERTITEM, 0, (LPARAM)lpInsertStruct);\n\t}\n\n\tHTREEITEM InsertItem(LPCTSTR lpszItem, int nImage,\n\t\tint nSelectedImage, HTREEITEM hParent, HTREEITEM hInsertAfter)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn InsertItem(TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE, lpszItem, nImage, nSelectedImage, 0, 0, 0, hParent, hInsertAfter); \n\t}\n\n\tHTREEITEM InsertItem(LPCTSTR lpszItem, HTREEITEM hParent, HTREEITEM hInsertAfter)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn InsertItem(TVIF_TEXT, lpszItem, 0, 0, 0, 0, 0, hParent, hInsertAfter);\n\t}\n\n\tHTREEITEM InsertItem(UINT nMask, LPCTSTR lpszItem, int nImage,\n\t\tint nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam,\n\t\tHTREEITEM hParent, HTREEITEM hInsertAfter)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTVINSERTSTRUCT tvis = {};\n\t\ttvis.hParent = hParent;\n\t\ttvis.hInsertAfter = hInsertAfter;\n\t\ttvis.item.mask = nMask;\n\t\ttvis.item.pszText = (LPTSTR) lpszItem;\n\t\ttvis.item.iImage = nImage;\n\t\ttvis.item.iSelectedImage = nSelectedImage;\n\t\ttvis.item.state = nState;\n\t\ttvis.item.stateMask = nStateMask;\n\t\ttvis.item.lParam = lParam;\n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_INSERTITEM, 0, (LPARAM)&tvis);\n\t}\n\n\tBOOL DeleteItem(HTREEITEM hItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_DELETEITEM, 0, (LPARAM)hItem);\n\t}\n\n\tBOOL DeleteAllItems()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT);\n\t}\n\n\tBOOL Expand(HTREEITEM hItem, UINT nCode = TVE_EXPAND)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_EXPAND, nCode, (LPARAM)hItem);\n\t}\n\n\tHTREEITEM GetNextItem(HTREEITEM hItem, UINT nCode) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd)); \n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, nCode, (LPARAM)hItem);\n\t}\n\n\tHTREEITEM GetChildItem(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd)); \n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)hItem);\n\t}\n\n\tHTREEITEM GetNextSiblingItem(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd)); \n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)hItem); \n\t}\n\n\tHTREEITEM GetPrevSiblingItem(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd)); \n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUS, (LPARAM)hItem);\n\t}\n\n\tHTREEITEM GetParentItem(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd)); \n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hItem); \n\t}\n\n\tHTREEITEM GetFirstVisibleItem() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd)); \n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_FIRSTVISIBLE, 0L);\n\t}\n\n\tHTREEITEM GetNextVisibleItem(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTVISIBLE, (LPARAM)hItem);\n\t}\n\n\tHTREEITEM GetPrevVisibleItem(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUSVISIBLE, (LPARAM)hItem);\n\t}\n\n\tHTREEITEM GetSelectedItem() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_CARET, 0L);\n\t}\n\n\tHTREEITEM GetDropHilightItem() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_DROPHILITE, 0L);\n\t}\n\n\tHTREEITEM GetRootItem() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_ROOT, 0L);\n\t}\n\n\tHTREEITEM GetLastVisibleItem() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_LASTVISIBLE, 0L);\n\t}\n\n\tHTREEITEM GetNextSelectedItem(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTSELECTED, (LPARAM)hItem);\n\t}\n\n\tBOOL Select(HTREEITEM hItem, UINT nCode)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_SELECTITEM, nCode, (LPARAM)hItem);\n\t}\n\n\tBOOL SelectItem(HTREEITEM hItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hItem);\n\t}\n\n\tBOOL SelectDropTarget(HTREEITEM hItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_SELECTITEM, TVGN_DROPHILITE, (LPARAM)hItem);\n\t}\n\n\tBOOL SelectSetFirstVisible(HTREEITEM hItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_SELECTITEM, TVGN_FIRSTVISIBLE, (LPARAM)hItem);\n\t}\n\n\tCEdit EditLabel(HTREEITEM hItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CEdit((HWND)::SendMessage(this->m_hWnd, TVM_EDITLABEL, 0, (LPARAM)hItem));\n\t}\n\n\tBOOL EndEditLabelNow(BOOL bCancel)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_ENDEDITLABELNOW, bCancel, 0L);\n\t}\n\n\tHTREEITEM HitTest(TVHITTESTINFO* pHitTestInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_HITTEST, 0, (LPARAM)pHitTestInfo);\n\t}\n\n\tHTREEITEM HitTest(POINT pt, UINT* pFlags) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTVHITTESTINFO hti = {};\n\t\thti.pt = pt;\n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_HITTEST, 0, (LPARAM)&hti);\n\t\tif (pFlags != NULL)\n\t\t\t*pFlags = hti.flags;\n\t\treturn hTreeItem;\n\t}\n\n\tBOOL SortChildren(HTREEITEM hItem, BOOL bRecurse = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_SORTCHILDREN, (WPARAM)bRecurse, (LPARAM)hItem);\n\t}\n\n\tBOOL EnsureVisible(HTREEITEM hItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_ENSUREVISIBLE, 0, (LPARAM)hItem);\n\t}\n\n\tBOOL SortChildrenCB(LPTVSORTCB pSort, BOOL bRecurse = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_SORTCHILDRENCB, (WPARAM)bRecurse, (LPARAM)pSort);\n\t}\n\n\tCImageList RemoveImageList(int nImageList)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TVM_SETIMAGELIST, (WPARAM)nImageList, NULL));\n\t}\n\n\tCImageList CreateDragImage(HTREEITEM hItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TVM_CREATEDRAGIMAGE, 0, (LPARAM)hItem));\n\t}\n\n\tBOOL SetInsertMark(HTREEITEM hTreeItem, BOOL bAfter)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_SETINSERTMARK, bAfter, (LPARAM)hTreeItem);\n\t}\n\n\tBOOL RemoveInsertMark()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TVM_SETINSERTMARK, 0, 0L);\n\t}\n\n\tHTREEITEM MapAccIDToHTREEITEM(UINT uID) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HTREEITEM)::SendMessage(this->m_hWnd, TVM_MAPACCIDTOHTREEITEM, uID, 0L);\n\t}\n\n\tUINT MapHTREEITEMToAccID(HTREEITEM hTreeItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, TVM_MAPHTREEITEMTOACCID, (WPARAM)hTreeItem, 0L);\n\t}\n\n#if (_WIN32_WINNT >= 0x0600)\n\tvoid ShowInfoTip(HTREEITEM hItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TVM_SHOWINFOTIP, 0, (LPARAM)hItem);\n\t}\n#endif // (_WIN32_WINNT >= 0x0600)\n};\n\ntypedef CTreeViewCtrlT<ATL::CWindow>   CTreeViewCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CTreeViewCtrlEx\n\n// forward declaration\ntemplate <class TBase> class CTreeViewCtrlExT;\n\n// Note: TBase here is for CTreeViewCtrlExT, and not for CTreeItemT itself\ntemplate <class TBase>\nclass CTreeItemT\n{\npublic:\n\tHTREEITEM m_hTreeItem;\n\tCTreeViewCtrlExT<TBase>* m_pTreeView;\n\n// Construction\n\tCTreeItemT(HTREEITEM hTreeItem = NULL, CTreeViewCtrlExT<TBase>* pTreeView = NULL) : m_hTreeItem(hTreeItem), m_pTreeView(pTreeView)\n\t{ }\n \n\tCTreeItemT(const CTreeItemT<TBase>& posSrc)\n\t{\n\t\t*this = posSrc;\n\t}\n\n\toperator HTREEITEM() { return m_hTreeItem; }\n\n\tCTreeItemT<TBase>& operator =(const CTreeItemT<TBase>& itemSrc)\n\t{\n\t\tm_hTreeItem = itemSrc.m_hTreeItem;\n\t\tm_pTreeView = itemSrc.m_pTreeView;\n\t\treturn *this;\n\t}\n\n// Attributes\n\tCTreeViewCtrlExT<TBase>* GetTreeView() const { return m_pTreeView; }\n\n\tBOOL operator !() const { return m_hTreeItem == NULL; }\n\n\tBOOL IsNull() const { return m_hTreeItem == NULL; }\n\t\n\tBOOL GetRect(LPRECT lpRect, BOOL bTextOnly) const;\n\tBOOL GetText(LPTSTR lpstrText, int nLen) const;\n\tBOOL GetText(BSTR& bstrText) const;\n#ifdef __ATLSTR_H__\n\tBOOL GetText(ATL::CString& strText) const;\n#endif // __ATLSTR_H__\n\tBOOL SetText(LPCTSTR lpszItem);\n\tBOOL GetImage(int& nImage, int& nSelectedImage) const;\n\tBOOL SetImage(int nImage, int nSelectedImage);\n\tUINT GetState(UINT nStateMask) const;\n\tBOOL SetState(UINT nState, UINT nStateMask);\n\tDWORD_PTR GetData() const;\n\tBOOL SetData(DWORD_PTR dwData);\n\tBOOL SetItem(UINT nMask, LPCTSTR lpszItem, int nImage, int nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam);\n\n// Operations\n\tCTreeItemT<TBase> InsertAfter(LPCTSTR lpstrItem, HTREEITEM hItemAfter, int nImageIndex)\n\t{\n\t\treturn _Insert(lpstrItem, nImageIndex, hItemAfter);\n\t}\n\n\tCTreeItemT<TBase> AddHead(LPCTSTR lpstrItem, int nImageIndex)\n\t{\n\t\treturn _Insert(lpstrItem, nImageIndex, TVI_FIRST);\n\t}\n\n\tCTreeItemT<TBase> AddTail(LPCTSTR lpstrItem, int nImageIndex)\n\t{\n\t\treturn _Insert(lpstrItem, nImageIndex, TVI_LAST);\n\t}\n\n\tCTreeItemT<TBase> GetChild() const;\n\tCTreeItemT<TBase> GetNext(UINT nCode) const;\n\tCTreeItemT<TBase> GetNextSibling() const;\n\tCTreeItemT<TBase> GetPrevSibling() const;\n\tCTreeItemT<TBase> GetParent() const;\n\tCTreeItemT<TBase> GetFirstVisible() const;\n\tCTreeItemT<TBase> GetNextVisible() const;\n\tCTreeItemT<TBase> GetPrevVisible() const;\n\tCTreeItemT<TBase> GetSelected() const;\n\tCTreeItemT<TBase> GetDropHilight() const;\n\tCTreeItemT<TBase> GetRoot() const;\n\tCTreeItemT<TBase> GetLastVisible() const;\n\tCTreeItemT<TBase> GetNextSelected() const;\n\tBOOL HasChildren() const;\n\tBOOL Delete();\n\tBOOL Expand(UINT nCode = TVE_EXPAND);\n\tBOOL Select(UINT nCode);\n\tBOOL Select();\n\tBOOL SelectDropTarget();\n\tBOOL SelectSetFirstVisible();\n\tHWND EditLabel();\n\tHIMAGELIST CreateDragImage();\n\tBOOL SortChildren(BOOL bRecurse = FALSE);\n\tBOOL EnsureVisible();\n\tCTreeItemT<TBase> _Insert(LPCTSTR lpstrItem, int nImageIndex, HTREEITEM hItemAfter);\n\tint GetImageIndex() const;\n\tBOOL SetInsertMark(BOOL bAfter);\n\tUINT MapHTREEITEMToAccID() const;\n#if (_WIN32_WINNT >= 0x0600)\n\tvoid ShowInfoTip();\n\tBOOL GetPartRect(TVITEMPART partID, LPRECT lpRect) const;\n#endif // (_WIN32_WINNT >= 0x0600)\n};\n\ntypedef CTreeItemT<ATL::CWindow>   CTreeItem;\n\n\ntemplate <class TBase>\nclass CTreeViewCtrlExT : public CTreeViewCtrlT< TBase >\n{\npublic:\n// Constructors\n\tCTreeViewCtrlExT(HWND hWnd = NULL) : CTreeViewCtrlT< TBase >(hWnd)\n\t{ }\n\n\tCTreeViewCtrlExT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n// Operations (overides that return CTreeItem)\n\tCTreeItemT<TBase> InsertItem(LPTVINSERTSTRUCT lpInsertStruct)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_INSERTITEM, 0, (LPARAM)lpInsertStruct);\n\t\treturn CTreeItemT<TBase>(hTreeItem, this);\n\t}\n\n\tCTreeItemT<TBase> InsertItem(LPCTSTR lpszItem, int nImage,\n\t\tint nSelectedImage, HTREEITEM hParent, HTREEITEM hInsertAfter)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn InsertItem(TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE, lpszItem, nImage, nSelectedImage, 0, 0, 0, hParent, hInsertAfter); \n\t}\n\n\tCTreeItemT<TBase> InsertItem(LPCTSTR lpszItem, HTREEITEM hParent, HTREEITEM hInsertAfter)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn InsertItem(TVIF_TEXT, lpszItem, 0, 0, 0, 0, 0, hParent, hInsertAfter);\n\t}\n\n\tCTreeItemT<TBase> GetNextItem(HTREEITEM hItem, UINT nCode) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd)); \n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, nCode, (LPARAM)hItem);\n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n\n\tCTreeItemT<TBase> GetChildItem(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd)); \n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)hItem);\n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this); \n\t}\n\n\tCTreeItemT<TBase> GetNextSiblingItem(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd)); \n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)hItem); \n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n\n\tCTreeItemT<TBase> GetPrevSiblingItem(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd)); \n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUS, (LPARAM)hItem);\n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n\n\tCTreeItemT<TBase> GetParentItem(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd)); \n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hItem); \n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n\n\tCTreeItemT<TBase> GetFirstVisibleItem() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd)); \n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_FIRSTVISIBLE, 0L);\n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n\n\tCTreeItemT<TBase> GetNextVisibleItem(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTVISIBLE, (LPARAM)hItem);\n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n\n\tCTreeItemT<TBase> GetPrevVisibleItem(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUSVISIBLE, (LPARAM)hItem);\n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n\n\tCTreeItemT<TBase> GetSelectedItem() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_CARET, 0L);\n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n\n\tCTreeItemT<TBase> GetDropHilightItem() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_DROPHILITE, 0L);\n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n\n\tCTreeItemT<TBase> GetRootItem() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_ROOT, 0L);\n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n\n\tCTreeItemT<TBase> GetLastVisibleItem() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_LASTVISIBLE, 0L);\n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n\n\tCTreeItemT<TBase> GetNextSelectedItem(HTREEITEM hItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTSELECTED, (LPARAM)hItem);\n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n\n\tCTreeItemT<TBase> HitTest(TVHITTESTINFO* pHitTestInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_HITTEST, 0, (LPARAM)pHitTestInfo);\n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n\n\tCTreeItemT<TBase> InsertItem(UINT nMask, LPCTSTR lpszItem, int nImage,\n\t\tint nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam,\n\t\tHTREEITEM hParent, HTREEITEM hInsertAfter)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTVINSERTSTRUCT tvis = {};\n\t\ttvis.hParent = hParent;\n\t\ttvis.hInsertAfter = hInsertAfter;\n\t\ttvis.item.mask = nMask;\n\t\ttvis.item.pszText = (LPTSTR) lpszItem;\n\t\ttvis.item.iImage = nImage;\n\t\ttvis.item.iSelectedImage = nSelectedImage;\n\t\ttvis.item.state = nState;\n\t\ttvis.item.stateMask = nStateMask;\n\t\ttvis.item.lParam = lParam;\n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_INSERTITEM, 0, (LPARAM)&tvis);\n\t\treturn CTreeItemT<TBase>(hTreeItem, this);\n\t}\n\n\tCTreeItemT<TBase> HitTest(POINT pt, UINT* pFlags) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTVHITTESTINFO hti = {};\n\t\thti.pt = pt;\n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_HITTEST, 0, (LPARAM)&hti);\n\t\tif (pFlags != NULL)\n\t\t\t*pFlags = hti.flags;\n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n\n\tCTreeItemT<TBase> MapAccIDToHTREEITEM(UINT uID) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tHTREEITEM hTreeItem = (HTREEITEM)::SendMessage(this->m_hWnd, TVM_MAPACCIDTOHTREEITEM, uID, 0L);\n\t\treturn CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\n\t}\n};\n\ntypedef CTreeViewCtrlExT<ATL::CWindow>   CTreeViewCtrlEx;\n\n\n// CTreeItem inline methods\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::GetRect(LPRECT lpRect, BOOL bTextOnly) const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetItemRect(m_hTreeItem,lpRect,bTextOnly);\n}\n\ntemplate <class TBase>\ninline CTreeItemT<TBase> CTreeItemT<TBase>::GetNext(UINT nCode) const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetNextItem(m_hTreeItem,nCode);\n}\n\ntemplate <class TBase>\ninline CTreeItemT<TBase> CTreeItemT<TBase>::GetChild() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetChildItem(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline CTreeItemT<TBase> CTreeItemT<TBase>::GetNextSibling() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetNextSiblingItem(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline CTreeItemT<TBase> CTreeItemT<TBase>::GetPrevSibling() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetPrevSiblingItem(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline CTreeItemT<TBase> CTreeItemT<TBase>::GetParent() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetParentItem(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline CTreeItemT<TBase> CTreeItemT<TBase>::GetFirstVisible() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetFirstVisibleItem();\n}\n\ntemplate <class TBase>\ninline CTreeItemT<TBase> CTreeItemT<TBase>::GetNextVisible() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetNextVisibleItem(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline CTreeItemT<TBase> CTreeItemT<TBase>::GetPrevVisible() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetPrevVisibleItem(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline CTreeItemT<TBase> CTreeItemT<TBase>::GetSelected() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetSelectedItem();\n}\n\ntemplate <class TBase>\ninline CTreeItemT<TBase> CTreeItemT<TBase>::GetDropHilight() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetDropHilightItem();\n}\n\ntemplate <class TBase>\ninline CTreeItemT<TBase> CTreeItemT<TBase>::GetRoot() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetRootItem();\n}\n\ntemplate <class TBase>\ninline CTreeItemT<TBase> CTreeItemT<TBase>::GetLastVisible() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetLastVisibleItem();\n}\n\ntemplate <class TBase>\ninline CTreeItemT<TBase> CTreeItemT<TBase>::GetNextSelected() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetNextSelectedItem(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::GetText(LPTSTR lpstrText, int nLen) const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetItemText(m_hTreeItem, lpstrText, nLen);\n}\n\n#ifdef _OLEAUTO_H_\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::GetText(BSTR& bstrText) const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetItemText(m_hTreeItem, bstrText);\n}\n#endif // _OLEAUTO_H_\n\n#ifdef __ATLSTR_H__\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::GetText(ATL::CString& strText) const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetItemText(m_hTreeItem, strText);\n}\n#endif // __ATLSTR_H__\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::GetImage(int& nImage, int& nSelectedImage) const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetItemImage(m_hTreeItem,nImage,nSelectedImage);\n}\n\ntemplate <class TBase>\ninline UINT CTreeItemT<TBase>::GetState(UINT nStateMask) const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetItemState(m_hTreeItem,nStateMask);\n}\n\ntemplate <class TBase>\ninline DWORD_PTR CTreeItemT<TBase>::GetData() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetItemData(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::SetItem(UINT nMask, LPCTSTR lpszItem, int nImage,\n\t\tint nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam)\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->SetItem(m_hTreeItem, nMask, lpszItem, nImage, nSelectedImage, nState, nStateMask, lParam);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::SetText(LPCTSTR lpszItem)\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->SetItemText(m_hTreeItem,lpszItem);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::SetImage(int nImage, int nSelectedImage)\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->SetItemImage(m_hTreeItem,nImage,nSelectedImage);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::SetState(UINT nState, UINT nStateMask)\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->SetItemState(m_hTreeItem,nState,nStateMask);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::SetData(DWORD_PTR dwData)\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->SetItemData(m_hTreeItem,dwData);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::HasChildren() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->ItemHasChildren(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::Delete()\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->DeleteItem(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::Expand(UINT nCode /*= TVE_EXPAND*/)\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->Expand(m_hTreeItem,nCode);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::Select(UINT nCode)\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->Select(m_hTreeItem,nCode);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::Select()\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->SelectItem(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::SelectDropTarget()\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->SelectDropTarget(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::SelectSetFirstVisible()\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->SelectSetFirstVisible(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline HWND CTreeItemT<TBase>::EditLabel()\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->EditLabel(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline HIMAGELIST CTreeItemT<TBase>::CreateDragImage()\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->CreateDragImage(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::SortChildren(BOOL bRecurse /*= FALSE*/)\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->SortChildren(m_hTreeItem, bRecurse);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::EnsureVisible()\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->EnsureVisible(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline CTreeItemT<TBase> CTreeItemT<TBase>::_Insert(LPCTSTR lpstrItem, int nImageIndex, HTREEITEM hItemAfter)\n{\n\tATLASSERT(m_pTreeView != NULL);\n\tTVINSERTSTRUCT ins = {};\n\tins.hParent = m_hTreeItem;\n\tins.hInsertAfter = hItemAfter;\n\tins.item.mask = TVIF_TEXT;\n\tins.item.pszText = (LPTSTR)lpstrItem;\n\tif(nImageIndex != -1)\n\t{\n\t\tins.item.mask |= TVIF_IMAGE | TVIF_SELECTEDIMAGE;\n\t\tins.item.iImage = nImageIndex;\n\t\tins.item.iSelectedImage = nImageIndex;\n\t}\n\treturn CTreeItemT<TBase>(m_pTreeView->InsertItem(&ins), m_pTreeView);\n}\n\ntemplate <class TBase>\ninline int CTreeItemT<TBase>::GetImageIndex() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\tTVITEM item = {};\n\titem.mask = TVIF_HANDLE | TVIF_IMAGE;\n\titem.hItem = m_hTreeItem;\n\tm_pTreeView->GetItem(&item);\n\treturn item.iImage;\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::SetInsertMark(BOOL bAfter)\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->SetInsertMark(m_hTreeItem, bAfter);\n}\n\ntemplate <class TBase>\ninline UINT CTreeItemT<TBase>::MapHTREEITEMToAccID() const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->MapHTREEITEMToAccID(m_hTreeItem);\n}\n\n#if (_WIN32_WINNT >= 0x0600)\ntemplate <class TBase>\ninline void CTreeItemT<TBase>::ShowInfoTip()\n{\n\tATLASSERT(m_pTreeView != NULL);\n\tm_pTreeView->ShowInfoTip(m_hTreeItem);\n}\n\ntemplate <class TBase>\ninline BOOL CTreeItemT<TBase>::GetPartRect(TVITEMPART partID, LPRECT lpRect) const\n{\n\tATLASSERT(m_pTreeView != NULL);\n\treturn m_pTreeView->GetItemPartRect(m_hTreeItem, partID, lpRect);\n}\n#endif // (_WIN32_WINNT >= 0x0600)\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CToolBarCtrl\n\ntemplate <class TBase>\nclass CToolBarCtrlT : public TBase\n{\npublic:\n// Construction\n\tCToolBarCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCToolBarCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn TOOLBARCLASSNAME;\n\t}\n\n\tBOOL IsButtonEnabled(int nID) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_ISBUTTONENABLED, nID, 0L);\n\t}\n\n\tBOOL IsButtonChecked(int nID) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_ISBUTTONCHECKED, nID, 0L);\n\t}\n\n\tBOOL IsButtonPressed(int nID) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_ISBUTTONPRESSED, nID, 0L);\n\t}\n\n\tBOOL IsButtonHidden(int nID) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn(BOOL) ::SendMessage(this->m_hWnd, TB_ISBUTTONHIDDEN, nID, 0L);\n\t}\n\n\tBOOL IsButtonIndeterminate(int nID) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_ISBUTTONINDETERMINATE, nID, 0L);\n\t}\n\n\tint GetState(int nID) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_GETSTATE, nID, 0L);\n\t}\n\n\tBOOL SetState(int nID, UINT nState)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_SETSTATE, nID, MAKELPARAM(nState, 0));\n\t}\n\n\tBOOL GetButton(int nIndex, LPTBBUTTON lpButton) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_GETBUTTON, nIndex, (LPARAM)lpButton);\n\t}\n\n\tint GetButtonCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_BUTTONCOUNT, 0, 0L);\n\t}\n\n\tBOOL GetItemRect(int nIndex, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_GETITEMRECT, nIndex, (LPARAM)lpRect);\n\t}\n\n\tvoid SetButtonStructSize(int nSize = sizeof(TBBUTTON))\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TB_BUTTONSTRUCTSIZE, nSize, 0L);\n\t}\n\n\tBOOL SetButtonSize(SIZE size)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_SETBUTTONSIZE, 0, MAKELPARAM(size.cx, size.cy));\n\t}\n\n\tBOOL SetButtonSize(int cx, int cy)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_SETBUTTONSIZE, 0, MAKELPARAM(cx, cy));\n\t}\n\n\tBOOL SetBitmapSize(SIZE size)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_SETBITMAPSIZE, 0, MAKELPARAM(size.cx, size.cy));\n\t}\n\n\tBOOL SetBitmapSize(int cx, int cy)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_SETBITMAPSIZE, 0, MAKELPARAM(cx, cy));\n\t}\n\n\tCToolTipCtrl GetToolTips() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, TB_GETTOOLTIPS, 0, 0L));\n\t}\n\n\tvoid SetToolTips(HWND hWndToolTip)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TB_SETTOOLTIPS, (WPARAM)hWndToolTip, 0L);\n\t}\n\n\tvoid SetNotifyWnd(HWND hWnd)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TB_SETPARENT, (WPARAM)hWnd, 0L);\n\t}\n\n\tint GetRows() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_GETROWS, 0, 0L);\n\t}\n\n\tvoid SetRows(int nRows, BOOL bLarger, LPRECT lpRect)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TB_SETROWS, MAKELPARAM(nRows, bLarger), (LPARAM)lpRect);\n\t}\n\n\tBOOL SetCmdID(int nIndex, UINT nID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_SETCMDID, nIndex, nID);\n\t}\n\n\tDWORD GetBitmapFlags() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, TB_GETBITMAPFLAGS, 0, 0L);\n\t}\n\n\tint GetBitmap(int nID) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_GETBITMAP, nID, 0L);\n\t}\n\n\tint GetButtonText(int nID, LPTSTR lpstrText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_GETBUTTONTEXT, nID, (LPARAM)lpstrText);\n\t}\n\n\t// nIndex - IE5 or higher only\n\tCImageList GetImageList(int nIndex = 0) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_GETIMAGELIST, nIndex, 0L));\n\t}\n\n\t// nIndex - IE5 or higher only\n\tCImageList SetImageList(HIMAGELIST hImageList, int nIndex = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_SETIMAGELIST, nIndex, (LPARAM)hImageList));\n\t}\n\n\t// nIndex - IE5 or higher only\n\tCImageList GetDisabledImageList(int nIndex = 0) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_GETDISABLEDIMAGELIST, nIndex, 0L));\n\t}\n\n\t// nIndex - IE5 or higher only\n\tCImageList SetDisabledImageList(HIMAGELIST hImageList, int nIndex = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_SETDISABLEDIMAGELIST, nIndex, (LPARAM)hImageList));\n\t}\n\n\t// nIndex - IE5 or higher only\n\tCImageList GetHotImageList(int nIndex = 0) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_GETHOTIMAGELIST, nIndex, 0L));\n\t}\n\n\t// nIndex - IE5 or higher only\n\tCImageList SetHotImageList(HIMAGELIST hImageList, int nIndex = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_SETHOTIMAGELIST, nIndex, (LPARAM)hImageList));\n\t}\n\n\tDWORD GetStyle() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, TB_GETSTYLE, 0, 0L);\n\t}\n\n\tvoid SetStyle(DWORD dwStyle)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TB_SETSTYLE, 0, dwStyle);\n\t}\n\n\tDWORD GetButtonSize() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, TB_GETBUTTONSIZE, 0, 0L);\n\t}\n\n\tvoid GetButtonSize(SIZE& size) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, TB_GETBUTTONSIZE, 0, 0L);\n\t\tsize.cx = LOWORD(dwRet);\n\t\tsize.cy = HIWORD(dwRet);\n\t}\n\n\tBOOL GetRect(int nID, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_GETRECT, nID, (LPARAM)lpRect);\n\t}\n\n\tint GetTextRows() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_GETTEXTROWS, 0, 0L);\n\t}\n\n\tBOOL SetButtonWidth(int cxMin, int cxMax)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_SETBUTTONWIDTH, 0, MAKELPARAM(cxMin, cxMax));\n\t}\n\n\tBOOL SetIndent(int nIndent)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_SETINDENT, nIndent, 0L);\n\t}\n\n\tBOOL SetMaxTextRows(int nMaxTextRows)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_SETMAXTEXTROWS, nMaxTextRows, 0L);\n\t}\n\n\tBOOL GetAnchorHighlight() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_GETANCHORHIGHLIGHT, 0, 0L);\n\t}\n\n\tBOOL SetAnchorHighlight(BOOL bEnable = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_SETANCHORHIGHLIGHT, bEnable, 0L);\n\t}\n\n\tint GetButtonInfo(int nID, LPTBBUTTONINFO lptbbi) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_GETBUTTONINFO, nID, (LPARAM)lptbbi);\n\t}\n\n\tBOOL SetButtonInfo(int nID, LPTBBUTTONINFO lptbbi)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_SETBUTTONINFO, nID, (LPARAM)lptbbi);\n\t}\n\n\tBOOL SetButtonInfo(int nID, DWORD dwMask, BYTE Style, BYTE State, LPCTSTR lpszItem, \n\t                   int iImage, WORD cx, int iCommand, DWORD_PTR lParam)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTBBUTTONINFO tbbi = {};\n\t\ttbbi.cbSize = sizeof(TBBUTTONINFO);\n\t\ttbbi.dwMask = dwMask;\n\t\ttbbi.idCommand = iCommand;\n\t\ttbbi.iImage = iImage;\n\t\ttbbi.fsState = State;\n\t\ttbbi.fsStyle = Style;\n\t\ttbbi.cx = cx;\n\t\ttbbi.pszText = (LPTSTR) lpszItem;\n\t\ttbbi.lParam = lParam;\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_SETBUTTONINFO, nID, (LPARAM)&tbbi);\n\t}\n\n\tint GetHotItem() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_GETHOTITEM, 0, 0L);\n\t}\n\n\tint SetHotItem(int nItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_SETHOTITEM, nItem, 0L);\n\t}\n\n\tBOOL IsButtonHighlighted(int nButtonID) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_ISBUTTONHIGHLIGHTED, nButtonID, 0L);\n\t}\n\n\tDWORD SetDrawTextFlags(DWORD dwMask, DWORD dwFlags)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, TB_SETDRAWTEXTFLAGS, dwMask, dwFlags);\n\t}\n\n\tBOOL GetColorScheme(LPCOLORSCHEME lpcs) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_GETCOLORSCHEME, 0, (LPARAM)lpcs);\n\t}\n\n\tvoid SetColorScheme(LPCOLORSCHEME lpcs)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TB_SETCOLORSCHEME, 0, (LPARAM)lpcs);\n\t}\n\n\tDWORD GetExtendedStyle() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, TB_GETEXTENDEDSTYLE, 0, 0L);\n\t}\n\n\tDWORD SetExtendedStyle(DWORD dwStyle)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, TB_SETEXTENDEDSTYLE, 0, dwStyle);\n\t}\n\n\tvoid GetInsertMark(LPTBINSERTMARK lptbim) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TB_GETINSERTMARK, 0, (LPARAM)lptbim);\n\t}\n\n\tvoid SetInsertMark(LPTBINSERTMARK lptbim)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TB_SETINSERTMARK, 0, (LPARAM)lptbim);\n\t}\n\n\tCOLORREF GetInsertMarkColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, TB_GETINSERTMARKCOLOR, 0, 0L);\n\t}\n\n\tCOLORREF SetInsertMarkColor(COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, TB_SETINSERTMARKCOLOR, 0, (LPARAM)clr);\n\t}\n\n\tBOOL GetMaxSize(LPSIZE lpSize) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_GETMAXSIZE, 0, (LPARAM)lpSize);\n\t}\n\n\tvoid GetPadding(LPSIZE lpSizePadding) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(lpSizePadding != NULL);\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, TB_GETPADDING, 0, 0L);\n\t\tlpSizePadding->cx = GET_X_LPARAM(dwRet);\n\t\tlpSizePadding->cy = GET_Y_LPARAM(dwRet);\n\t}\n\n\tvoid SetPadding(int cx, int cy, LPSIZE lpSizePadding = NULL)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, TB_SETPADDING, 0, MAKELPARAM(cx, cy));\n\t\tif(lpSizePadding != NULL)\n\t\t{\n\t\t\tlpSizePadding->cx = GET_X_LPARAM(dwRet);\n\t\t\tlpSizePadding->cy = GET_Y_LPARAM(dwRet);\n\t\t}\n\t}\n\n\tBOOL GetUnicodeFormat() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_GETUNICODEFORMAT, 0, 0L);\n\t}\n\n\tBOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_SETUNICODEFORMAT, bUnicode, 0L);\n\t}\n\n\tint GetString(int nString, LPTSTR lpstrString, int cchMaxLen) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_GETSTRING, MAKEWPARAM(cchMaxLen, nString), (LPARAM)lpstrString);\n\t}\n\n\tint GetStringBSTR(int nString, BSTR& bstrString) const\n\t{\n\t\tUSES_CONVERSION;\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(bstrString == NULL);\n\t\tint nLength = (int)(short)LOWORD(::SendMessage(this->m_hWnd, TB_GETSTRING, MAKEWPARAM(0, nString), NULL));\n\t\tif(nLength != -1)\n\t\t{\n\t\t\tATL::CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\t\tLPTSTR lpstrText = buff.Allocate(nLength + 1);\n\t\t\tif(lpstrText != NULL)\n\t\t\t{\n\t\t\t\tnLength = (int)::SendMessage(this->m_hWnd, TB_GETSTRING, MAKEWPARAM(nLength + 1, nString), (LPARAM)lpstrText);\n\t\t\t\tif(nLength != -1)\n\t\t\t\t\tbstrString = ::SysAllocString(T2OLE(lpstrText));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tnLength = -1;\n\t\t\t}\n\t\t}\n\n\t\treturn nLength;\n\t}\n\n#ifdef __ATLSTR_H__\n\tint GetString(int nString, ATL::CString& str) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tint nLength = (int)(short)LOWORD(::SendMessage(this->m_hWnd, TB_GETSTRING, MAKEWPARAM(0, nString), NULL));\n\t\tif(nLength != -1)\n\t\t{\n\t\t\tLPTSTR lpstr = str.GetBufferSetLength(nLength + 1);\n\t\t\tif(lpstr != NULL)\n\t\t\t\tnLength = (int)::SendMessage(this->m_hWnd, TB_GETSTRING, MAKEWPARAM(nLength + 1, nString), (LPARAM)lpstr);\n\t\t\telse\n\t\t\t\tnLength = -1;\n\t\t\tstr.ReleaseBuffer();\n\t\t}\n\t\treturn nLength;\n\t}\n#endif // __ATLSTR_H__\n\n\tvoid GetMetrics(LPTBMETRICS lptbm) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TB_GETMETRICS, 0, (LPARAM)lptbm);\n\t}\n\n\tvoid SetMetrics(LPTBMETRICS lptbm)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TB_SETMETRICS, 0, (LPARAM)lptbm);\n\t}\n\n\tvoid SetWindowTheme(LPCWSTR lpstrTheme)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TB_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);\n\t}\n\n#if (_WIN32_WINNT >= 0x0600)\n\tCImageList GetPressedImageList(int nIndex = 0) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_GETPRESSEDIMAGELIST, nIndex, 0L));\n\t}\n\n\tCImageList SetPressedImageList(HIMAGELIST hImageList, int nIndex = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TB_SETPRESSEDIMAGELIST, nIndex, (LPARAM)hImageList));\n\t}\n\n\tvoid GetItemDropDownRect(int nIndex, LPRECT lpRect) const\n\t{\n#ifndef TB_GETITEMDROPDOWNRECT\n\t\tconst int TB_GETITEMDROPDOWNRECT = WM_USER + 103;\n#endif\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tBOOL bRet = (BOOL)::SendMessage(this->m_hWnd, TB_GETITEMDROPDOWNRECT, nIndex, (LPARAM)lpRect);\n\t\t(void)bRet;   // avoid level 4 warning\n\t\tATLASSERT(bRet != FALSE);\n\t}\n#endif // (_WIN32_WINNT >= 0x0600)\n\n// Operations\n\tBOOL EnableButton(int nID, BOOL bEnable = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_ENABLEBUTTON, nID, MAKELPARAM(bEnable, 0));\n\t}\n\n\tBOOL CheckButton(int nID, BOOL bCheck = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_CHECKBUTTON, nID, MAKELPARAM(bCheck, 0));\n\t}\n\n\tBOOL PressButton(int nID, BOOL bPress = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_PRESSBUTTON, nID, MAKELPARAM(bPress, 0));\n\t}\n\n\tBOOL HideButton(int nID, BOOL bHide = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_HIDEBUTTON, nID, MAKELPARAM(bHide, 0));\n\t}\n\n\tBOOL Indeterminate(int nID, BOOL bIndeterminate = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_INDETERMINATE, nID, MAKELPARAM(bIndeterminate, 0));\n\t}\n\n\tint AddBitmap(int nNumButtons, UINT nBitmapID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTBADDBITMAP tbab = {};\n\t\ttbab.hInst = ModuleHelper::GetResourceInstance();\n\t\tATLASSERT(tbab.hInst != NULL);\n\t\ttbab.nID = nBitmapID;\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_ADDBITMAP, (WPARAM)nNumButtons, (LPARAM)&tbab);\n\t}\n\n\tint AddBitmap(int nNumButtons, HBITMAP hBitmap)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTBADDBITMAP tbab = {};\n\t\ttbab.hInst = NULL;\n\t\ttbab.nID = (UINT_PTR)hBitmap;\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_ADDBITMAP, (WPARAM)nNumButtons, (LPARAM)&tbab);\n\t}\n\n\tBOOL AddButtons(int nNumButtons, LPCTBBUTTON lpButtons)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_ADDBUTTONS, nNumButtons, (LPARAM)lpButtons);\n\t}\n\n\tBOOL InsertButton(int nIndex, LPCTBBUTTON lpButton)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_INSERTBUTTON, nIndex, (LPARAM)lpButton);\n\t}\n\n\tBOOL InsertButton(int nIndex, int iCommand, BYTE Style, BYTE State, int iBitmap, \n\t                  INT_PTR iString, DWORD_PTR lParam)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTBBUTTON tbb = {};\n\t\ttbb.fsStyle = Style;\n\t\ttbb.fsState = State;\n\t\ttbb.idCommand = iCommand;\n\t\ttbb.iBitmap = iBitmap;\n\t\ttbb.iString = iString;\n\t\ttbb.dwData = lParam;\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_INSERTBUTTON, nIndex, (LPARAM)&tbb);\n\t}\n\n\tBOOL InsertButton(int nIndex, int iCommand, BYTE Style, BYTE State, int iBitmap, \n\t                  LPCTSTR lpszItem, DWORD_PTR lParam)\n\t{\n\t\treturn InsertButton(nIndex, iCommand, Style, State, iBitmap, (INT_PTR)lpszItem, lParam);\n\t}\n\n\tBOOL AddButton(LPTBBUTTON lpButton)\n\t{\n\t\treturn InsertButton(-1, lpButton);\n\t}\n\n\tBOOL AddButton(int iCommand, BYTE Style, BYTE State, int iBitmap, INT_PTR iString, DWORD_PTR lParam)\n\t{\n\t\treturn InsertButton(-1, iCommand, Style, State, iBitmap, iString, lParam);\n\t}\n\n\tBOOL AddButton(int iCommand, BYTE Style, BYTE State, int iBitmap, LPCTSTR lpszItem, DWORD_PTR lParam)\n\t{\n\t\treturn InsertButton(-1, iCommand, Style, State, iBitmap, lpszItem, lParam);\n\t}\n\n\tBOOL DeleteButton(int nIndex)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_DELETEBUTTON, nIndex, 0L);\n\t}\n\n\tBOOL InsertSeparator(int nIndex, int cxWidth = 8)\n\t{\n\t\treturn InsertButton(nIndex, 0, BTNS_SEP, 0, cxWidth, (INT_PTR)0, 0);\n\t}\n\n\tBOOL AddSeparator(int cxWidth = 8)\n\t{\n\t\treturn AddButton(0, BTNS_SEP, 0, cxWidth, (INT_PTR)0, 0);\n\t}\n\n\tint CommandToIndex(UINT nID) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_COMMANDTOINDEX, nID, 0L);\n\t}\n\n\tvoid SaveState(HKEY hKeyRoot, LPCTSTR lpszSubKey, LPCTSTR lpszValueName)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTBSAVEPARAMS tbs = {};\n\t\ttbs.hkr = hKeyRoot;\n\t\ttbs.pszSubKey = lpszSubKey;\n\t\ttbs.pszValueName = lpszValueName;\n\t\t::SendMessage(this->m_hWnd, TB_SAVERESTORE, (WPARAM)TRUE, (LPARAM)&tbs);\n\t}\n\n\tvoid RestoreState(HKEY hKeyRoot, LPCTSTR lpszSubKey, LPCTSTR lpszValueName)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTBSAVEPARAMS tbs = {};\n\t\ttbs.hkr = hKeyRoot;\n\t\ttbs.pszSubKey = lpszSubKey;\n\t\ttbs.pszValueName = lpszValueName;\n\t\t::SendMessage(this->m_hWnd, TB_SAVERESTORE, (WPARAM)FALSE, (LPARAM)&tbs);\n\t}\n\n\tvoid Customize()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TB_CUSTOMIZE, 0, 0L);\n\t}\n\n\tint AddString(UINT nStringID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_ADDSTRING, (WPARAM)ModuleHelper::GetResourceInstance(), (LPARAM)nStringID);\n\t}\n\n\tint AddStrings(LPCTSTR lpszStrings)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_ADDSTRING, 0, (LPARAM)lpszStrings);\n\t}\n\n\tvoid AutoSize()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TB_AUTOSIZE, 0, 0L);\n\t}\n\n\tBOOL ChangeBitmap(int nID, int nBitmap)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_CHANGEBITMAP, nID, MAKELPARAM(nBitmap, 0));\n\t}\n\n\tint LoadImages(int nBitmapID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_LOADIMAGES, nBitmapID, (LPARAM)ModuleHelper::GetResourceInstance());\n\t}\n\n\tint LoadStdImages(int nBitmapID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_LOADIMAGES, nBitmapID, (LPARAM)HINST_COMMCTRL);\n\t}\n\n\tBOOL ReplaceBitmap(LPTBREPLACEBITMAP ptbrb)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_REPLACEBITMAP, 0, (LPARAM)ptbrb);\n\t}\n\n\tint HitTest(LPPOINT lpPoint) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TB_HITTEST, 0, (LPARAM)lpPoint);\n\t}\n\n\tBOOL InsertMarkHitTest(LPPOINT lpPoint, LPTBINSERTMARK lptbim) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_INSERTMARKHITTEST, (WPARAM)lpPoint, (LPARAM)lptbim);\n\t}\n\n\tBOOL InsertMarkHitTest(int x, int y, LPTBINSERTMARK lptbim) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tPOINT pt = { x, y };\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_INSERTMARKHITTEST, (WPARAM)&pt, (LPARAM)lptbim);\n\t}\n\n\tBOOL MapAccelerator(TCHAR chAccel, int& nID) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_MAPACCELERATOR, (WPARAM)chAccel, (LPARAM)&nID);\n\t}\n\n\tBOOL MarkButton(int nID, BOOL bHighlight = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_MARKBUTTON, nID, MAKELPARAM(bHighlight, 0));\n\t}\n\n\tBOOL MoveButton(int nOldPos, int nNewPos)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TB_MOVEBUTTON, nOldPos, nNewPos);\n\t}\n\n\tHRESULT GetObject(REFIID iid, LPVOID* ppvObject)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HRESULT)::SendMessage(this->m_hWnd, TB_GETOBJECT, (WPARAM)&iid, (LPARAM)ppvObject);\n\t}\n};\n\ntypedef CToolBarCtrlT<ATL::CWindow>   CToolBarCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CStatusBarCtrl\n\ntemplate <class TBase>\nclass CStatusBarCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCStatusBarCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCStatusBarCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Methods\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn STATUSCLASSNAME;\n\t}\n\n\tint GetParts(int nParts, int* pParts) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, SB_GETPARTS, nParts, (LPARAM)pParts);\n\t}\n\n\tBOOL SetParts(int nParts, int* pWidths)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, SB_SETPARTS, nParts, (LPARAM)pWidths);\n\t}\n\n\tint GetTextLength(int nPane, int* pType = NULL) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(nPane < 256);\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, SB_GETTEXTLENGTH, (WPARAM)nPane, 0L);\n\t\tif (pType != NULL)\n\t\t\t*pType = (int)(short)HIWORD(dwRet);\n\t\treturn (int)(short)LOWORD(dwRet);\n\t}\n\n\tint GetText(int nPane, LPTSTR lpszText, int* pType = NULL) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(nPane < 256);\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, SB_GETTEXT, (WPARAM)nPane, (LPARAM)lpszText);\n\t\tif(pType != NULL)\n\t\t\t*pType = (int)(short)HIWORD(dwRet);\n\t\treturn (int)(short)LOWORD(dwRet);\n\t}\n\n\tBOOL GetTextBSTR(int nPane, BSTR& bstrText, int* pType = NULL) const\n\t{\n\t\tUSES_CONVERSION;\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(nPane < 256);\n\t\tATLASSERT(bstrText == NULL);\n\t\tint nLength = (int)(short)LOWORD(::SendMessage(this->m_hWnd, SB_GETTEXTLENGTH, (WPARAM)nPane, 0L));\n\t\tif(nLength == 0)\n\t\t\treturn FALSE;\n\n\t\tATL::CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tLPTSTR lpstrText = buff.Allocate(nLength + 1);\n\t\tif(lpstrText == NULL)\n\t\t\treturn FALSE;\n\n\t\tif(!GetText(nPane, lpstrText, pType))\n\t\t\treturn FALSE;\n\n\t\tbstrText = ::SysAllocString(T2OLE(lpstrText));\n\t\treturn (bstrText != NULL) ? TRUE : FALSE;\n\t}\n\n#ifdef __ATLSTR_H__\n\tint GetText(int nPane, ATL::CString& strText, int* pType = NULL) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(nPane < 256);\n\t\tint nLength = (int)(short)LOWORD(::SendMessage(this->m_hWnd, SB_GETTEXTLENGTH, (WPARAM)nPane, 0L));\n\t\tif(nLength == 0)\n\t\t\treturn 0;\n\n\t\tLPTSTR lpstr = strText.GetBufferSetLength(nLength);\n\t\tif(lpstr == NULL)\n\t\t\treturn 0;\n\t\treturn GetText(nPane, lpstr, pType);\n\t}\n#endif // __ATLSTR_H__\n\n\tBOOL SetText(int nPane, LPCTSTR lpszText, int nType = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(nPane < 256);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, SB_SETTEXT, (nPane | nType), (LPARAM)lpszText);\n\t}\n\n\tBOOL GetRect(int nPane, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(nPane < 256);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, SB_GETRECT, nPane, (LPARAM)lpRect);\n\t}\n\n\tBOOL GetBorders(int* pBorders) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, SB_GETBORDERS, 0, (LPARAM)pBorders);\n\t}\n\n\tBOOL GetBorders(int& nHorz, int& nVert, int& nSpacing) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tint borders[3] = {};\n\t\tBOOL bResult = (BOOL)::SendMessage(this->m_hWnd, SB_GETBORDERS, 0, (LPARAM)&borders);\n\t\tif(bResult)\n\t\t{\n\t\t\tnHorz = borders[0];\n\t\t\tnVert = borders[1];\n\t\t\tnSpacing = borders[2];\n\t\t}\n\t\treturn bResult;\n\t}\n\n\tvoid SetMinHeight(int nMin)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, SB_SETMINHEIGHT, nMin, 0L);\n\t}\n\n\tBOOL SetSimple(BOOL bSimple = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, SB_SIMPLE, bSimple, 0L);\n\t}\n\n\tBOOL IsSimple() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, SB_ISSIMPLE, 0, 0L);\n\t}\n\n\tBOOL GetUnicodeFormat() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, SB_GETUNICODEFORMAT, 0, 0L);\n\t}\n\n\tBOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, SB_SETUNICODEFORMAT, bUnicode, 0L);\n\t}\n\n\tvoid GetTipText(int nPane, LPTSTR lpstrText, int nSize) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(nPane < 256);\n\t\t::SendMessage(this->m_hWnd, SB_GETTIPTEXT, MAKEWPARAM(nPane, nSize), (LPARAM)lpstrText);\n\t}\n\n\tvoid SetTipText(int nPane, LPCTSTR lpstrText)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(nPane < 256);\n\t\t::SendMessage(this->m_hWnd, SB_SETTIPTEXT, nPane, (LPARAM)lpstrText);\n\t}\n\n\tCOLORREF SetBkColor(COLORREF clrBk)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, SB_SETBKCOLOR, 0, (LPARAM)clrBk);\n\t}\n\n\tHICON GetIcon(int nPane) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(nPane < 256);\n\t\treturn (HICON)::SendMessage(this->m_hWnd, SB_GETICON, nPane, 0L);\n\t}\n\n\tBOOL SetIcon(int nPane, HICON hIcon)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(nPane < 256);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, SB_SETICON, nPane, (LPARAM)hIcon);\n\t}\n};\n\ntypedef CStatusBarCtrlT<ATL::CWindow>   CStatusBarCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CTabCtrl\n\ntemplate <class TBase>\nclass CTabCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCTabCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCTabCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn WC_TABCONTROL;\n\t}\n\n\tCImageList GetImageList() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TCM_GETIMAGELIST, 0, 0L));\n\t}\n\n\tCImageList SetImageList(HIMAGELIST hImageList)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, TCM_SETIMAGELIST, 0, (LPARAM)hImageList));\n\t}\n\n\tint GetItemCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TCM_GETITEMCOUNT, 0, 0L);\n\t}\n\n\tBOOL GetItem(int nItem, LPTCITEM pTabCtrlItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TCM_GETITEM, nItem, (LPARAM)pTabCtrlItem);\n\t}\n\n\tBOOL SetItem(int nItem, LPTCITEM pTabCtrlItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TCM_SETITEM, nItem, (LPARAM)pTabCtrlItem);\n\t}\n\n\tint SetItem(int nItem, UINT mask, LPCTSTR lpszItem, DWORD dwState, DWORD dwStateMask, int iImage, LPARAM lParam)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTCITEM tci = {};\n\t\ttci.mask = mask;\n\t\ttci.pszText = (LPTSTR) lpszItem;\n\t\ttci.dwState = dwState;\n\t\ttci.dwStateMask = dwStateMask;\n\t\ttci.iImage = iImage;\n\t\ttci.lParam = lParam;\n\t\treturn (int)::SendMessage(this->m_hWnd, TCM_SETITEM, nItem, (LPARAM)&tci);\n\t}\n\n\tBOOL GetItemRect(int nItem, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TCM_GETITEMRECT, nItem, (LPARAM)lpRect);\n\t}\n\n\tint GetCurSel() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TCM_GETCURSEL, 0, 0L);\n\t}\n\n\tint SetCurSel(int nItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TCM_SETCURSEL, nItem, 0L);\n\t}\n\n\tSIZE SetItemSize(SIZE size)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dwSize = (DWORD)::SendMessage(this->m_hWnd, TCM_SETITEMSIZE, 0, MAKELPARAM(size.cx, size.cy));\n\t\tSIZE sizeRet = { GET_X_LPARAM(dwSize), GET_Y_LPARAM(dwSize) };\n\t\treturn sizeRet;\n\t}\n\n\tvoid SetItemSize(int cx, int cy)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TCM_SETITEMSIZE, 0, MAKELPARAM(cx, cy));\n\t}\n\n\tvoid SetPadding(SIZE size)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TCM_SETPADDING, 0, MAKELPARAM(size.cx, size.cy));\n\t}\n\n\tint GetRowCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TCM_GETROWCOUNT, 0, 0L);\n\t}\n\n\tCToolTipCtrl GetToolTips() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, TCM_GETTOOLTIPS, 0, 0L));\n\t}\n\n\t// this method is deprecated, please use GetToolTips\n\tCToolTipCtrl GetTooltips() const { return GetToolTips(); }\n\n\tvoid SetToolTips(HWND hWndToolTip)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TCM_SETTOOLTIPS, (WPARAM)hWndToolTip, 0L);\n\t}\n\n\t// this method is deprecated, please use SetToolTips\n\tvoid SetTooltips(HWND hWndToolTip) { SetToolTips(hWndToolTip); }\n\n\tint GetCurFocus() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TCM_GETCURFOCUS, 0, 0L);\n\t}\n\n\tvoid SetCurFocus(int nItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TCM_SETCURFOCUS, nItem, 0L);\n\t}\n\n\tBOOL SetItemExtra(int cbExtra)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(GetItemCount() == 0);   // must be empty\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TCM_SETITEMEXTRA, cbExtra, 0L);\n\t}\n\n\tint SetMinTabWidth(int nWidth = -1)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TCM_SETMINTABWIDTH, 0, nWidth);\n\t}\n\n\tDWORD GetExtendedStyle() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, TCM_GETEXTENDEDSTYLE, 0, 0L);\n\t}\n\n\tDWORD SetExtendedStyle(DWORD dwExMask, DWORD dwExStyle)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, TCM_SETEXTENDEDSTYLE, dwExMask, dwExStyle);\n\t}\n\n\tBOOL GetUnicodeFormat() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TCM_GETUNICODEFORMAT, 0, 0L);\n\t}\n\n\tBOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TCM_SETUNICODEFORMAT, bUnicode, 0L);\n\t}\n\n// Operations\n\tint InsertItem(int nItem, LPTCITEM pTabCtrlItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TCM_INSERTITEM, nItem, (LPARAM)pTabCtrlItem);\n\t}\n\n\tint InsertItem(int nItem, UINT mask, LPCTSTR lpszItem, int iImage, LPARAM lParam)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTCITEM tci = {};\n\t\ttci.mask = mask;\n\t\ttci.pszText = (LPTSTR) lpszItem;\n\t\ttci.iImage = iImage;\n\t\ttci.lParam = lParam;\n\t\treturn (int)::SendMessage(this->m_hWnd, TCM_INSERTITEM, nItem, (LPARAM)&tci);\n\t}\n\n\tint InsertItem(int nItem, LPCTSTR lpszItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTCITEM tci = {};\n\t\ttci.mask = TCIF_TEXT;\n\t\ttci.pszText = (LPTSTR) lpszItem;\n\t\treturn (int)::SendMessage(this->m_hWnd, TCM_INSERTITEM, nItem, (LPARAM)&tci);\n\t}\n\n\tint AddItem(LPTCITEM pTabCtrlItem)\n\t{\n\t\treturn InsertItem(GetItemCount(), pTabCtrlItem);\n\t}\n\n\tint AddItem(UINT mask, LPCTSTR lpszItem, int iImage, LPARAM lParam)\n\t{\n\t\treturn InsertItem(GetItemCount(), mask, lpszItem, iImage, lParam);\n\t}\n\n\tint AddItem(LPCTSTR lpszItem)\n\t{\n\t\treturn InsertItem(GetItemCount(), lpszItem);\n\t}\n\n\tBOOL DeleteItem(int nItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TCM_DELETEITEM, nItem, 0L);\n\t}\n\n\tBOOL DeleteAllItems()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TCM_DELETEALLITEMS, 0, 0L);\n\t}\n\n\tvoid AdjustRect(BOOL bLarger, LPRECT lpRect)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TCM_ADJUSTRECT, bLarger, (LPARAM)lpRect);\n\t}\n\n\tvoid RemoveImage(int nImage)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TCM_REMOVEIMAGE, nImage, 0L);\n\t}\n\n\tint HitTest(TC_HITTESTINFO* pHitTestInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TCM_HITTEST, 0, (LPARAM)pHitTestInfo);\n\t}\n\n\tvoid DeselectAll(BOOL bExcludeFocus = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TCM_DESELECTALL, bExcludeFocus, 0L);\n\t}\n\n\tBOOL HighlightItem(int nIndex, BOOL bHighlight = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TCM_HIGHLIGHTITEM, nIndex, MAKELPARAM(bHighlight, 0));\n\t}\n};\n\ntypedef CTabCtrlT<ATL::CWindow>   CTabCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CTrackBarCtrl\n\ntemplate <class TBase>\nclass CTrackBarCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCTrackBarCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCTrackBarCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn TRACKBAR_CLASS;\n\t}\n\n\tint GetLineSize() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TBM_GETLINESIZE, 0, 0L);\n\t}\n\n\tint SetLineSize(int nSize)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TBM_SETLINESIZE, 0, nSize);\n\t}\n\n\tint GetPageSize() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TBM_GETPAGESIZE, 0, 0L);\n\t}\n\n\tint SetPageSize(int nSize)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TBM_SETPAGESIZE, 0, nSize);\n\t}\n\n\tint GetRangeMin() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TBM_GETRANGEMIN, 0, 0L);\n\t}\n\n\tvoid SetRangeMin(int nMin, BOOL bRedraw = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TBM_SETRANGEMIN, bRedraw, nMin);\n\t}\n\n\tint GetRangeMax() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TBM_GETRANGEMAX, 0, 0L);\n\t}\n\n\tvoid SetRangeMax(int nMax, BOOL bRedraw = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TBM_SETRANGEMAX, bRedraw, nMax);\n\t}\n\n\tvoid GetRange(int& nMin, int& nMax) const\n\t{\n\t\tnMin = GetRangeMin();\n\t\tnMax = GetRangeMax();\n\t}\n\n\tvoid SetRange(int nMin, int nMax, BOOL bRedraw = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TBM_SETRANGE, bRedraw, MAKELPARAM(nMin, nMax));\n\t}\n\n\tint GetSelStart() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TBM_GETSELSTART, 0, 0L);\n\t}\n\n\tvoid SetSelStart(int nMin, BOOL bRedraw = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TBM_SETSELSTART, bRedraw, (LPARAM)nMin);\n\t}\n\n\tint GetSelEnd() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TBM_GETSELEND, 0, 0L);\n\t}\n\n\tvoid SetSelEnd(int nMax, BOOL bRedraw = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TBM_SETSELEND, bRedraw, (LPARAM)nMax);\n\t}\n\n\tvoid GetSelection(int& nMin, int& nMax) const\n\t{\n\t\tnMin = GetSelStart();\n\t\tnMax = GetSelEnd();\n\t}\n\n\tvoid SetSelection(int nMin, int nMax, BOOL bRedraw = TRUE)\n\t{\n\t\tSetSelStart(nMin, FALSE);\n\t\tSetSelEnd(nMax, bRedraw);\n\t}\n\n\tvoid GetChannelRect(LPRECT lprc) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TBM_GETCHANNELRECT, 0, (LPARAM)lprc);\n\t}\n\n\tvoid GetThumbRect(LPRECT lprc) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TBM_GETTHUMBRECT, 0, (LPARAM)lprc);\n\t}\n\n\tint GetPos() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TBM_GETPOS, 0, 0L);\n\t}\n\n\tvoid SetPos(int nPos)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TBM_SETPOS, TRUE, nPos);\n\t}\n\n\tUINT GetNumTics() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, TBM_GETNUMTICS, 0, 0L);\n\t}\n\n\tDWORD* GetTicArray() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD*)::SendMessage(this->m_hWnd, TBM_GETPTICS, 0, 0L);\n\t}\n\n\tint GetTic(int nTic) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TBM_GETTIC, nTic, 0L);\n\t}\n\n\tBOOL SetTic(int nTic)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TBM_SETTIC, 0, nTic);\n\t}\n\n\tint GetTicPos(int nTic) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TBM_GETTICPOS, nTic, 0L);\n\t}\n\n\tvoid SetTicFreq(int nFreq)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TBM_SETTICFREQ, nFreq, 0L);\n\t}\n\n\tint GetThumbLength() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TBM_GETTHUMBLENGTH, 0, 0L);\n\t}\n\n\tvoid SetThumbLength(int nLength)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TBM_SETTHUMBLENGTH, nLength, 0L);\n\t}\n\n\tvoid SetSel(int nStart, int nEnd, BOOL bRedraw = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & TBS_ENABLESELRANGE) != 0);\n\t\t::SendMessage(this->m_hWnd, TBM_SETSEL, bRedraw, MAKELPARAM(nStart, nEnd));\n\t}\n\n\tATL::CWindow GetBuddy(BOOL bLeft = TRUE) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ATL::CWindow((HWND)::SendMessage(this->m_hWnd, TBM_GETBUDDY, bLeft, 0L));\n\t}\n\n\tATL::CWindow SetBuddy(HWND hWndBuddy, BOOL bLeft = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ATL::CWindow((HWND)::SendMessage(this->m_hWnd, TBM_SETBUDDY, bLeft, (LPARAM)hWndBuddy));\n\t}\n\n\tCToolTipCtrl GetToolTips() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, TBM_GETTOOLTIPS, 0, 0L));\n\t}\n\n\tvoid SetToolTips(HWND hWndTT)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TBM_SETTOOLTIPS, (WPARAM)hWndTT, 0L);\n\t}\n\n\tint SetTipSide(int nSide)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, TBM_SETTIPSIDE, nSide, 0L);\n\t}\n\n\tBOOL GetUnicodeFormat() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TBM_GETUNICODEFORMAT, 0, 0L);\n\t}\n\n\tBOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, TBM_SETUNICODEFORMAT, bUnicode, 0L);\n\t}\n\n// Operations\n\tvoid ClearSel(BOOL bRedraw = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TBM_CLEARSEL, bRedraw, 0L);\n\t}\n\n\tvoid VerifyPos()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TBM_SETPOS, FALSE, 0L);\n\t}\n\n\tvoid ClearTics(BOOL bRedraw = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, TBM_CLEARTICS, bRedraw, 0L);\n\t}\n};\n\ntypedef CTrackBarCtrlT<ATL::CWindow>   CTrackBarCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CUpDownCtrl\n\ntemplate <class TBase>\nclass CUpDownCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCUpDownCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCUpDownCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn UPDOWN_CLASS;\n\t}\n\n\tUINT GetAccel(int nAccel, UDACCEL* pAccel) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)LOWORD(::SendMessage(this->m_hWnd, UDM_GETACCEL, nAccel, (LPARAM)pAccel));\n\t}\n\n\tBOOL SetAccel(int nAccel, UDACCEL* pAccel)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)LOWORD(::SendMessage(this->m_hWnd, UDM_SETACCEL, nAccel, (LPARAM)pAccel));\n\t}\n\n\tUINT GetBase() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)LOWORD(::SendMessage(this->m_hWnd, UDM_GETBASE, 0, 0L));\n\t}\n\n\tint SetBase(int nBase)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, UDM_SETBASE, nBase, 0L);\n\t}\n\n\tATL::CWindow GetBuddy() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ATL::CWindow((HWND)::SendMessage(this->m_hWnd, UDM_GETBUDDY, 0, 0L));\n\t}\n\n\tATL::CWindow SetBuddy(HWND hWndBuddy)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ATL::CWindow((HWND)::SendMessage(this->m_hWnd, UDM_SETBUDDY, (WPARAM)hWndBuddy, 0L));\n\t}\n\n\tint GetPos(LPBOOL lpbError = NULL) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, UDM_GETPOS, 0, 0L);\n\t\t// Note: Seems that Windows always sets error to TRUE if\n\t\t// UDS_SETBUDDYINT style is not used\n\t\tif(lpbError != NULL)\n\t\t\t*lpbError = (HIWORD(dwRet) != 0) ? TRUE : FALSE;\n\t\treturn (int)(short)LOWORD(dwRet);\n\t}\n\n\tint SetPos(int nPos)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)(short)LOWORD(::SendMessage(this->m_hWnd, UDM_SETPOS, 0, MAKELPARAM(nPos, 0)));\n\t}\n\n\tDWORD GetRange() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, UDM_GETRANGE, 0, 0L);\n\t}\n\n\tvoid GetRange(int& nLower, int& nUpper) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, UDM_GETRANGE, 0, 0L);\n\t\tnLower = (int)(short)HIWORD(dwRet);\n\t\tnUpper = (int)(short)LOWORD(dwRet);\n\t}\n\n\tvoid SetRange(int nLower, int nUpper)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, UDM_SETRANGE, 0, MAKELPARAM(nUpper, nLower));\n\t}\n\n\tvoid SetRange32(int nLower, int nUpper)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, UDM_SETRANGE32, nLower, nUpper);\n\t}\n\n\tvoid GetRange32(int& nLower, int& nUpper) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, UDM_GETRANGE32, (WPARAM)&nLower, (LPARAM)&nUpper);\n\t}\n\n\tBOOL GetUnicodeFormat() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, UDM_GETUNICODEFORMAT, 0, 0L);\n\t}\n\n\tBOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, UDM_SETUNICODEFORMAT, bUnicode, 0L);\n\t}\n\n\tint GetPos32(LPBOOL lpbError = NULL) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t// Note: Seems that Windows always sets error to TRUE if\n\t\t// UDS_SETBUDDYINT style is not used\n\t\treturn (int)::SendMessage(this->m_hWnd, UDM_GETPOS32, 0, (LPARAM)lpbError);\n\t}\n\n\tint SetPos32(int nPos)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, UDM_SETPOS32, 0, (LPARAM)nPos);\n\t}\n};\n\ntypedef CUpDownCtrlT<ATL::CWindow>   CUpDownCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CProgressBarCtrl\n\ntemplate <class TBase>\nclass CProgressBarCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCProgressBarCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCProgressBarCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn PROGRESS_CLASS;\n\t}\n\n\tDWORD SetRange(int nLower, int nUpper)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, PBM_SETRANGE, 0, MAKELPARAM(nLower, nUpper));\n\t}\n\n\tint SetPos(int nPos)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)(short)LOWORD(::SendMessage(this->m_hWnd, PBM_SETPOS, nPos, 0L));\n\t}\n\n\tint OffsetPos(int nPos)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)(short)LOWORD(::SendMessage(this->m_hWnd, PBM_DELTAPOS, nPos, 0L));\n\t}\n\n\tint SetStep(int nStep)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)(short)LOWORD(::SendMessage(this->m_hWnd, PBM_SETSTEP, nStep, 0L));\n\t}\n\n\tUINT GetPos() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, PBM_GETPOS, 0, 0L);\n\t}\n\n\tvoid GetRange(PPBRANGE pPBRange) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(pPBRange != NULL);\n\t\t::SendMessage(this->m_hWnd, PBM_GETRANGE, TRUE, (LPARAM)pPBRange);\n\t}\n\n\tvoid GetRange(int& nLower, int& nUpper) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tPBRANGE range = {};\n\t\t::SendMessage(this->m_hWnd, PBM_GETRANGE, TRUE, (LPARAM)&range);\n\t\tnLower = range.iLow;\n\t\tnUpper = range.iHigh;\n\t}\n\n\tint GetRangeLimit(BOOL bLowLimit) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, PBM_GETRANGE, bLowLimit, (LPARAM)NULL);\n\t}\n\n\tDWORD SetRange32(int nMin, int nMax)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, PBM_SETRANGE32, nMin, nMax);\n\t}\n\n\tCOLORREF SetBarColor(COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, PBM_SETBARCOLOR, 0, (LPARAM)clr);\n\t}\n\n\tCOLORREF SetBkColor(COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, PBM_SETBKCOLOR, 0, (LPARAM)clr);\n\t}\n\n#ifdef PBM_SETMARQUEE\n\tBOOL SetMarquee(BOOL bMarquee, UINT uUpdateTime = 0U)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, PBM_SETMARQUEE, (WPARAM)bMarquee, (LPARAM)uUpdateTime);\n\t}\n#endif\n\n#if (_WIN32_WINNT >= 0x0600)\n\tint GetStep() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, PBM_GETSTEP, 0, 0L);\n\t}\n\n\tCOLORREF GetBkColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, PBM_GETBKCOLOR, 0, 0L);\n\t}\n\n\tCOLORREF GetBarColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, PBM_GETBARCOLOR, 0, 0L);\n\t}\n\n\tint GetState() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, PBM_GETSTATE, 0, 0L);\n\t}\n\n\tint SetState(int nState)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, PBM_SETSTATE, nState, 0L);\n\t}\n#endif // (_WIN32_WINNT >= 0x0600)\n\n// Operations\n\tint StepIt()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)(short)LOWORD(::SendMessage(this->m_hWnd, PBM_STEPIT, 0, 0L));\n\t}\n};\n\ntypedef CProgressBarCtrlT<ATL::CWindow>   CProgressBarCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CHotKeyCtrl\n\ntemplate <class TBase>\nclass CHotKeyCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCHotKeyCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCHotKeyCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn HOTKEY_CLASS;\n\t}\n\n\tDWORD GetHotKey() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, HKM_GETHOTKEY, 0, 0L);\n\t}\n\n\tvoid GetHotKey(WORD &wVirtualKeyCode, WORD &wModifiers) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dw = (DWORD)::SendMessage(this->m_hWnd, HKM_GETHOTKEY, 0, 0L);\n\t\twVirtualKeyCode = LOBYTE(LOWORD(dw));\n\t\twModifiers = HIBYTE(LOWORD(dw));\n\t}\n\n\tvoid SetHotKey(WORD wVirtualKeyCode, WORD wModifiers)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, HKM_SETHOTKEY, MAKEWORD(wVirtualKeyCode, wModifiers), 0L);\n\t}\n\n\tvoid SetRules(WORD wInvalidComb, WORD wModifiers)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, HKM_SETRULES, wInvalidComb, MAKELPARAM(wModifiers, 0));\n\t}\n};\n\ntypedef CHotKeyCtrlT<ATL::CWindow>   CHotKeyCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CAnimateCtrl\n\ntemplate <class TBase>\nclass CAnimateCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCAnimateCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCAnimateCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn ANIMATE_CLASS;\n\t}\n\n// Operations\n\tBOOL Open(ATL::_U_STRINGorID FileName)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, ACM_OPEN, 0, (LPARAM)FileName.m_lpstr);\n\t}\n\n\tBOOL Play(UINT nFrom, UINT nTo, UINT nRep)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, ACM_PLAY, nRep, MAKELPARAM(nFrom, nTo));\n\t}\n\n\tBOOL Stop()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, ACM_STOP, 0, 0L);\n\t}\n\n\tBOOL Close()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, ACM_OPEN, 0, 0L);\n\t}\n\n\tBOOL Seek(UINT nTo)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, ACM_PLAY, 0, MAKELPARAM(nTo, nTo));\n\t}\n\n\t// Vista only\n\tBOOL IsPlaying() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, ACM_ISPLAYING, 0, 0L);\n\t}\n};\n\ntypedef CAnimateCtrlT<ATL::CWindow>   CAnimateCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CRichEditCtrl\n\n#if !defined(_UNICODE) && (_RICHEDIT_VER >= 0x0500)\n  #undef MSFTEDIT_CLASS\n  #define MSFTEDIT_CLASS\t\"RICHEDIT50W\"\n#endif\n\ntemplate <class TBase>\nclass CRichEditCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCRichEditCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCRichEditCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n#if (_RICHEDIT_VER >= 0x0500)\n\t\treturn MSFTEDIT_CLASS;\n#else\n\t\treturn RICHEDIT_CLASS;\n#endif\n\t}\n\n\tstatic LPCTSTR GetLibraryName()\n\t{\n#if (_RICHEDIT_VER >= 0x0500)\n\t\treturn _T(\"MSFTEDIT.DLL\");\n#else\n\t\treturn _T(\"RICHED20.DLL\");\n#endif\n\t}\n\n\tint GetLineCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETLINECOUNT, 0, 0L);\n\t}\n\n\tBOOL GetModify() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_GETMODIFY, 0, 0L);\n\t}\n\n\tvoid SetModify(BOOL bModified = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETMODIFY, bModified, 0L);\n\t}\n\n\tvoid GetRect(LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_GETRECT, 0, (LPARAM)lpRect);\n\t}\n\n\tDWORD GetOptions() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_GETOPTIONS, 0, 0L);\n\t}\n\n\tDWORD SetOptions(WORD wOperation, DWORD dwOptions)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_SETOPTIONS, wOperation, dwOptions);\n\t}\n\n\t// NOTE: first word in lpszBuffer must contain the size of the buffer!\n\tint GetLine(int nIndex, LPTSTR lpszBuffer) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);\n\t}\n\n\tint GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t*(LPWORD)lpszBuffer = (WORD)nMaxLength;\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);\n\t}\n\n\tBOOL CanUndo() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_CANUNDO, 0, 0L);\n\t}\n\n\tBOOL CanPaste(UINT nFormat = 0) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_CANPASTE, nFormat, 0L);\n\t}\n\n\tvoid GetSel(LONG& nStartChar, LONG& nEndChar) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tCHARRANGE cr = {};\n\t\t::SendMessage(this->m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);\n\t\tnStartChar = cr.cpMin;\n\t\tnEndChar = cr.cpMax;\n\t}\n\n\tvoid GetSel(CHARRANGE &cr) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);\n\t}\n\n\tint SetSel(LONG nStartChar, LONG nEndChar)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tCHARRANGE cr = { nStartChar, nEndChar };\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_EXSETSEL, 0, (LPARAM)&cr);\n\t}\n\n\tint SetSel(CHARRANGE &cr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_EXSETSEL, 0, (LPARAM)&cr);\n\t}\n\n\tint SetSelAll()\n\t{\n\t\treturn SetSel(0, -1);\n\t}\n\n\tint SetSelNone()\n\t{\n\t\treturn SetSel(-1, 0);\n\t}\n\n\tDWORD GetDefaultCharFormat(CHARFORMAT& cf) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tcf.cbSize = sizeof(CHARFORMAT);\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_GETCHARFORMAT, 0, (LPARAM)&cf);\n\t}\n\n\tDWORD GetSelectionCharFormat(CHARFORMAT& cf) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tcf.cbSize = sizeof(CHARFORMAT);\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_GETCHARFORMAT, 1, (LPARAM)&cf);\n\t}\n\n\tDWORD GetEventMask() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_GETEVENTMASK, 0, 0L);\n\t}\n\n\tLONG GetLimitText() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (LONG)::SendMessage(this->m_hWnd, EM_GETLIMITTEXT, 0, 0L);\n\t}\n\n\tDWORD GetParaFormat(PARAFORMAT& pf) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tpf.cbSize = sizeof(PARAFORMAT);\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_GETPARAFORMAT, 0, (LPARAM)&pf);\n\t}\n\n\tLONG GetSelText(LPTSTR lpstrBuff) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (LONG)::SendMessage(this->m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrBuff);\n\t}\n\n\tBOOL GetSelTextBSTR(BSTR& bstrText) const\n\t{\n\t\tUSES_CONVERSION;\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(bstrText == NULL);\n\n\t\tCHARRANGE cr = {};\n\t\t::SendMessage(this->m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);\n\n\t\tATL::CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tLPTSTR lpstrText = buff.Allocate(cr.cpMax - cr.cpMin + 1);\n\t\tif(lpstrText == NULL)\n\t\t\treturn FALSE;\n\t\tif(::SendMessage(this->m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrText) == 0)\n\t\t\treturn FALSE;\n\n\t\tbstrText = ::SysAllocString(T2W(lpstrText));\n\n\t\treturn (bstrText != NULL) ? TRUE : FALSE;\n\t}\n\n#ifdef __ATLSTR_H__\n\tLONG GetSelText(ATL::CString& strText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\n\t\tCHARRANGE cr = {};\n\t\t::SendMessage(this->m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);\n\n\t\tLONG lLen = 0;\n\t\tLPTSTR lpstrText = strText.GetBufferSetLength(cr.cpMax - cr.cpMin);\n\t\tif(lpstrText != NULL)\n\t\t{\n\t\t\tlLen = (LONG)::SendMessage(this->m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrText);\n\t\t\tstrText.ReleaseBuffer();\n\t\t}\n\n\t\treturn lLen;\n\t}\n#endif // __ATLSTR_H__\n\n\tWORD GetSelectionType() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (WORD)::SendMessage(this->m_hWnd, EM_SELECTIONTYPE, 0, 0L);\n\t}\n\n\tCOLORREF SetBackgroundColor(COLORREF cr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, EM_SETBKGNDCOLOR, 0, cr);\n\t}\n\n\tCOLORREF SetBackgroundColor()   // sets to system background\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, EM_SETBKGNDCOLOR, 1, 0);\n\t}\n\n\tBOOL SetCharFormat(CHARFORMAT& cf, WORD wFlags)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tcf.cbSize = sizeof(CHARFORMAT);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, (WPARAM)wFlags, (LPARAM)&cf);\n\t}\n\n\tBOOL SetDefaultCharFormat(CHARFORMAT& cf)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tcf.cbSize = sizeof(CHARFORMAT);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, 0, (LPARAM)&cf);\n\t}\n\n\tBOOL SetSelectionCharFormat(CHARFORMAT& cf)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tcf.cbSize = sizeof(CHARFORMAT);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);\n\t}\n\n\tBOOL SetWordCharFormat(CHARFORMAT& cf)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tcf.cbSize = sizeof(CHARFORMAT);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION | SCF_WORD, (LPARAM)&cf);\n\t}\n\n\tDWORD SetEventMask(DWORD dwEventMask)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_SETEVENTMASK, 0, dwEventMask);\n\t}\n\n\tBOOL SetParaFormat(PARAFORMAT& pf)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tpf.cbSize = sizeof(PARAFORMAT);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETPARAFORMAT, 0, (LPARAM)&pf);\n\t}\n\n\tBOOL SetTargetDevice(HDC hDC, int cxLineWidth)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETTARGETDEVICE, (WPARAM)hDC, cxLineWidth);\n\t}\n\n\tint GetTextLength() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, WM_GETTEXTLENGTH, 0, 0L);\n\t}\n\n\tBOOL SetReadOnly(BOOL bReadOnly = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETREADONLY, bReadOnly, 0L);\n\t}\n\n\tint GetFirstVisibleLine() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETFIRSTVISIBLELINE, 0, 0L);\n\t}\n\n\tint GetTextRange(TEXTRANGE* pTextRange) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETTEXTRANGE, 0, (LPARAM)pTextRange);\n\t}\n\n\tint GetTextRange(LONG nStartChar, LONG nEndChar, LPTSTR lpstrText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tTEXTRANGE tr = {};\n\t\ttr.chrg.cpMin = nStartChar;\n\t\ttr.chrg.cpMax = nEndChar;\n\t\ttr.lpstrText = lpstrText;\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETTEXTRANGE, 0, (LPARAM)&tr);\n\t}\n\n\tDWORD GetDefaultCharFormat(CHARFORMAT2& cf) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tcf.cbSize = sizeof(CHARFORMAT2);\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_GETCHARFORMAT, 0, (LPARAM)&cf);\n\t}\n\n\tBOOL SetCharFormat(CHARFORMAT2& cf, WORD wFlags)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tcf.cbSize = sizeof(CHARFORMAT2);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, (WPARAM)wFlags, (LPARAM)&cf);\n\t}\n\n\tBOOL SetDefaultCharFormat(CHARFORMAT2& cf)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tcf.cbSize = sizeof(CHARFORMAT2);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, 0, (LPARAM)&cf);\n\t}\n\n\tDWORD GetSelectionCharFormat(CHARFORMAT2& cf) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tcf.cbSize = sizeof(CHARFORMAT2);\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_GETCHARFORMAT, 1, (LPARAM)&cf);\n\t}\n\n\tBOOL SetSelectionCharFormat(CHARFORMAT2& cf)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tcf.cbSize = sizeof(CHARFORMAT2);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);\n\t}\n\n\tBOOL SetWordCharFormat(CHARFORMAT2& cf)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tcf.cbSize = sizeof(CHARFORMAT2);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION | SCF_WORD, (LPARAM)&cf);\n\t}\n\n\tDWORD GetParaFormat(PARAFORMAT2& pf) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tpf.cbSize = sizeof(PARAFORMAT2);\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_GETPARAFORMAT, 0, (LPARAM)&pf);\n\t}\n\n\tBOOL SetParaFormat(PARAFORMAT2& pf)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tpf.cbSize = sizeof(PARAFORMAT2);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETPARAFORMAT, 0, (LPARAM)&pf);\n\t}\n\n\tTEXTMODE GetTextMode() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (TEXTMODE)::SendMessage(this->m_hWnd, EM_GETTEXTMODE, 0, 0L);\n\t}\n\n\tBOOL SetTextMode(TEXTMODE enumTextMode)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn !(BOOL)::SendMessage(this->m_hWnd, EM_SETTEXTMODE, enumTextMode, 0L);\n\t}\n\n\tUNDONAMEID GetUndoName() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UNDONAMEID)::SendMessage(this->m_hWnd, EM_GETUNDONAME, 0, 0L);\n\t}\n\n\tUNDONAMEID GetRedoName() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UNDONAMEID)::SendMessage(this->m_hWnd, EM_GETREDONAME, 0, 0L);\n\t}\n\n\tBOOL CanRedo() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_CANREDO, 0, 0L);\n\t}\n\n\tBOOL GetAutoURLDetect() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_GETAUTOURLDETECT, 0, 0L);\n\t}\n\n\tBOOL SetAutoURLDetect(BOOL bAutoDetect = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn !(BOOL)::SendMessage(this->m_hWnd, EM_AUTOURLDETECT, bAutoDetect, 0L);\n\t}\n\n\t// this method is deprecated, please use SetAutoURLDetect\n\tBOOL EnableAutoURLDetect(BOOL bEnable = TRUE) { return SetAutoURLDetect(bEnable); }\n\n\tUINT SetUndoLimit(UINT uUndoLimit)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, EM_SETUNDOLIMIT, uUndoLimit, 0L);\n\t}\n\n\tvoid SetPalette(HPALETTE hPalette)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETPALETTE, (WPARAM)hPalette, 0L);\n\t}\n\n\tint GetTextEx(GETTEXTEX* pGetTextEx, LPTSTR lpstrText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETTEXTEX, (WPARAM)pGetTextEx, (LPARAM)lpstrText);\n\t}\n\n\tint GetTextEx(LPTSTR lpstrText, int nTextLen, DWORD dwFlags = GT_DEFAULT, UINT uCodePage = CP_ACP, LPCSTR lpDefaultChar = NULL, LPBOOL lpUsedDefChar = NULL) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tGETTEXTEX gte = {};\n\t\tgte.cb = nTextLen * sizeof(TCHAR);\n\t\tgte.codepage = uCodePage;\n\t\tgte.flags = dwFlags;\n\t\tgte.lpDefaultChar = lpDefaultChar;\n\t\tgte.lpUsedDefChar = lpUsedDefChar;\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETTEXTEX, (WPARAM)&gte, (LPARAM)lpstrText);\n\t}\n\n\tint GetTextLengthEx(GETTEXTLENGTHEX* pGetTextLengthEx) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETTEXTLENGTHEX, (WPARAM)pGetTextLengthEx, 0L);\n\t}\n\n\tint GetTextLengthEx(DWORD dwFlags = GTL_DEFAULT, UINT uCodePage = CP_ACP) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tGETTEXTLENGTHEX gtle = {};\n\t\tgtle.codepage = uCodePage;\n\t\tgtle.flags = dwFlags;\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETTEXTLENGTHEX, (WPARAM)&gtle, 0L);\n\t}\n\n\tEDITWORDBREAKPROC GetWordBreakProc() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (EDITWORDBREAKPROC)::SendMessage(this->m_hWnd, EM_GETWORDBREAKPROC, 0, 0L);\n\t}\n\n\tvoid SetWordBreakProc(EDITWORDBREAKPROC ewbprc)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETWORDBREAKPROC, 0, (LPARAM)ewbprc);\n\t}\n\n\tint SetTextEx(SETTEXTEX* pSetTextEx, LPCTSTR lpstrText)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_SETTEXTEX, (WPARAM)pSetTextEx, (LPARAM)lpstrText);\n\t}\n\n\tint SetTextEx(LPCTSTR lpstrText, DWORD dwFlags = ST_DEFAULT, UINT uCodePage = CP_ACP)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tSETTEXTEX ste = {};\n\t\tste.flags = dwFlags;\n\t\tste.codepage = uCodePage;\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_SETTEXTEX, (WPARAM)&ste, (LPARAM)lpstrText);\n\t}\n\n\tint GetEditStyle() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_GETEDITSTYLE, 0, 0L);\n\t}\n\n\tint SetEditStyle(int nStyle, int nMask = -1)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tif(nMask == -1)\n\t\t\tnMask = nStyle;   // set everything specified\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_SETEDITSTYLE, nStyle, nMask);\n\t}\n\n\tBOOL SetFontSize(int nFontSizeDelta)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((nFontSizeDelta >= -1637) && (nFontSizeDelta <= 1638));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETFONTSIZE, nFontSizeDelta, 0L);\n\t}\n\n\tvoid GetScrollPos(LPPOINT lpPoint) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(lpPoint != NULL);\n\t\t::SendMessage(this->m_hWnd, EM_GETSCROLLPOS, 0, (LPARAM)lpPoint);\n\t}\n\n\tvoid SetScrollPos(LPPOINT lpPoint)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(lpPoint != NULL);\n\t\t::SendMessage(this->m_hWnd, EM_SETSCROLLPOS, 0, (LPARAM)lpPoint);\n\t}\n\n\tBOOL GetZoom(int& nNum, int& nDen) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_GETZOOM, (WPARAM)&nNum, (LPARAM)&nDen);\n\t}\n\n\tBOOL SetZoom(int nNum, int nDen)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((nNum >= 0) && (nNum <= 64));\n\t\tATLASSERT((nDen >= 0) && (nDen <= 64));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETZOOM, nNum, nDen);\n\t}\n\n\tBOOL SetZoomOff()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETZOOM, 0, 0L);\n\t}\n\n\tvoid SetMargins(UINT nLeft, UINT nRight, WORD wFlags = EC_LEFTMARGIN | EC_RIGHTMARGIN)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETMARGINS, wFlags, MAKELONG(nLeft, nRight));\n\t}\n\n\tWORD GetTypographyOptions() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (WORD)::SendMessage(this->m_hWnd, EM_GETTYPOGRAPHYOPTIONS, 0, 0L);\n\t}\n\n\tBOOL SetTypographyOptions(WORD wOptions, WORD wMask) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETTYPOGRAPHYOPTIONS, wOptions, wMask);\n\t}\n\n// Operations\n\tvoid LimitText(LONG nChars = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_EXLIMITTEXT, 0, nChars);\n\t}\n\n\tint LineFromChar(LONG nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_EXLINEFROMCHAR, 0, nIndex);\n\t}\n\n\tPOINT PosFromChar(LONG nChar) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tPOINT point = {};\n\t\t::SendMessage(this->m_hWnd, EM_POSFROMCHAR, (WPARAM)&point, nChar);\n\t\treturn point;\n\t}\n\n\tint CharFromPos(POINT pt) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tPOINTL ptl = { pt.x, pt.y };\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_CHARFROMPOS, 0, (LPARAM)&ptl);\n\t}\n\n\tvoid EmptyUndoBuffer()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_EMPTYUNDOBUFFER, 0, 0L);\n\t}\n\n\tint LineIndex(int nLine = -1) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_LINEINDEX, nLine, 0L);\n\t}\n\n\tint LineLength(int nLine = -1) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, EM_LINELENGTH, nLine, 0L);\n\t}\n\n\tBOOL LineScroll(int nLines)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_LINESCROLL, 0, nLines);\n\t}\n\n\tvoid ReplaceSel(LPCTSTR lpszNewText, BOOL bCanUndo = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_REPLACESEL, (WPARAM) bCanUndo, (LPARAM)lpszNewText);\n\t}\n\n\tvoid SetRect(LPCRECT lpRect)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETRECT, 0, (LPARAM)lpRect);\n\t}\n\n\tBOOL DisplayBand(LPRECT pDisplayRect)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_DISPLAYBAND, 0, (LPARAM)pDisplayRect);\n\t}\n\n\tLONG FindText(DWORD dwFlags, FINDTEXT& ft) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n#ifdef _UNICODE\n\t\treturn (LONG)::SendMessage(this->m_hWnd, EM_FINDTEXTW, dwFlags, (LPARAM)&ft);\n#else\n\t\treturn (LONG)::SendMessage(this->m_hWnd, EM_FINDTEXT, dwFlags, (LPARAM)&ft);\n#endif\n\t}\n\n\tLONG FindText(DWORD dwFlags, FINDTEXTEX& ft) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n#ifdef _UNICODE\n\t\treturn (LONG)::SendMessage(this->m_hWnd, EM_FINDTEXTEXW, dwFlags, (LPARAM)&ft);\n#else\n\t\treturn (LONG)::SendMessage(this->m_hWnd, EM_FINDTEXTEX, dwFlags, (LPARAM)&ft);\n#endif\n\t}\n\n\tLONG FormatRange(FORMATRANGE& fr, BOOL bDisplay = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (LONG)::SendMessage(this->m_hWnd, EM_FORMATRANGE, bDisplay, (LPARAM)&fr);\n\t}\n\n\tLONG FormatRange(FORMATRANGE* pFormatRange, BOOL bDisplay = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (LONG)::SendMessage(this->m_hWnd, EM_FORMATRANGE, bDisplay, (LPARAM)pFormatRange);\n\t}\n\n\tvoid HideSelection(BOOL bHide = TRUE, BOOL bChangeStyle = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_HIDESELECTION, bHide, bChangeStyle);\n\t}\n\n\tvoid PasteSpecial(UINT uClipFormat, DWORD dwAspect = 0, HMETAFILE hMF = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tREPASTESPECIAL reps = { dwAspect, (DWORD_PTR)hMF };\n\t\t::SendMessage(this->m_hWnd, EM_PASTESPECIAL, uClipFormat, (LPARAM)&reps);\n\t}\n\n\tvoid RequestResize()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_REQUESTRESIZE, 0, 0L);\n\t}\n\n\tLONG StreamIn(UINT uFormat, EDITSTREAM& es)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (LONG)::SendMessage(this->m_hWnd, EM_STREAMIN, uFormat, (LPARAM)&es);\n\t}\n\n\tLONG StreamOut(UINT uFormat, EDITSTREAM& es)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (LONG)::SendMessage(this->m_hWnd, EM_STREAMOUT, uFormat, (LPARAM)&es);\n\t}\n\n\tDWORD FindWordBreak(int nCode, LONG nStartChar)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_FINDWORDBREAK, nCode, nStartChar);\n\t}\n\n\t// Additional operations\n\tvoid ScrollCaret()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SCROLLCARET, 0, 0L);\n\t}\n\n\tint InsertText(long nInsertAfterChar, LPCTSTR lpstrText, BOOL bCanUndo = FALSE)\n\t{\n\t\tint nRet = SetSel(nInsertAfterChar, nInsertAfterChar);\n\t\tReplaceSel(lpstrText, bCanUndo);\n\t\treturn nRet;\n\t}\n\n\tint AppendText(LPCTSTR lpstrText, BOOL bCanUndo = FALSE)\n\t{\n\t\treturn InsertText(this->GetWindowTextLength(), lpstrText, bCanUndo);\n\t}\n\n\t// Clipboard operations\n\tBOOL Undo()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_UNDO, 0, 0L);\n\t}\n\n\tvoid Clear()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, WM_CLEAR, 0, 0L);\n\t}\n\n\tvoid Copy()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, WM_COPY, 0, 0L);\n\t}\n\n\tvoid Cut()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, WM_CUT, 0, 0L);\n\t}\n\n\tvoid Paste()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, WM_PASTE, 0, 0L);\n\t}\n\n\t// OLE support\n\tIRichEditOle* GetOleInterface() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tIRichEditOle *pRichEditOle = NULL;\n\t\t::SendMessage(this->m_hWnd, EM_GETOLEINTERFACE, 0, (LPARAM)&pRichEditOle);\n\t\treturn pRichEditOle;\n\t}\n\n\tBOOL SetOleCallback(IRichEditOleCallback* pCallback)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETOLECALLBACK, 0, (LPARAM)pCallback);\n\t}\n\n\tBOOL Redo()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_REDO, 0, 0L);\n\t}\n\n\tvoid StopGroupTyping()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_STOPGROUPTYPING, 0, 0L);\n\t}\n\n\tvoid ShowScrollBar(int nBarType, BOOL bVisible = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SHOWSCROLLBAR, nBarType, bVisible);\n\t}\n\n\tBOOL SetTabStops(int nTabStops, LPINT rgTabStops)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETTABSTOPS, nTabStops, (LPARAM)rgTabStops);\n\t}\n\n\tBOOL SetTabStops()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETTABSTOPS, 0, 0L);\n\t}\n\n\tBOOL SetTabStops(const int& cxEachStop)    // takes an 'int'\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETTABSTOPS, 1, (LPARAM)(LPINT)&cxEachStop);\n\t}\n\n#if (_RICHEDIT_VER >= 0x0800)\n\tAutoCorrectProc GetAutoCorrectProc() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (AutoCorrectProc)::SendMessage(this->m_hWnd, EM_GETAUTOCORRECTPROC, 0, 0L);\n\t}\n\n\tBOOL SetAutoCorrectProc(AutoCorrectProc pfn)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETAUTOCORRECTPROC, (WPARAM)pfn, 0L);\n\t}\n\n\tBOOL CallAutoCorrectProc(WCHAR ch)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_CALLAUTOCORRECTPROC, (WPARAM)ch, 0L);\n\t}\n\n\tDWORD GetEditStyleEx() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_GETEDITSTYLEEX, 0, 0L);\n\t}\n\n\tDWORD SetEditStyleEx(DWORD dwStyleEx, DWORD dwMask)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_SETEDITSTYLEEX, dwStyleEx, dwMask);\n\t}\n\n\tDWORD GetStoryType(int nStoryIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_GETSTORYTYPE, nStoryIndex, 0L);\n\t}\n\n\tDWORD SetStoryType(int nStoryIndex, DWORD dwStoryType)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, EM_SETSTORYTYPE, nStoryIndex, dwStoryType);\n\t}\n\n\tDWORD GetEllipsisMode() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\n\t\tDWORD dwMode = 0;\n\t\tBOOL bRet = (BOOL)::SendMessage(this->m_hWnd, EM_GETELLIPSISMODE, 0, (LPARAM)&dwMode);\n\t\t(void)bRet;   // avoid level 4 warning\n\t\tATLASSERT(bRet != FALSE);\n\n\t\treturn dwMode;\n\t}\n\n\tBOOL SetEllipsisMode(DWORD dwEllipsisMode)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETELLIPSISMODE, 0, dwEllipsisMode);\n\t}\n\n\tBOOL GetEllipsisState() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_GETELLIPSISSTATE, 0, 0L);\n\t}\n\n\tBOOL GetTouchOptions(int nTouchOptions) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_GETTOUCHOPTIONS, nTouchOptions, 0L);\n\t}\n\n\tvoid SetTouchOptions(int nTouchOptions, BOOL bEnable)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, EM_SETTOUCHOPTIONS, nTouchOptions, bEnable);\n\t}\n\n\tHRESULT InsertTable(TABLEROWPARMS* pRowParams, TABLECELLPARMS* pCellParams)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HRESULT)::SendMessage(this->m_hWnd, EM_INSERTTABLE, (WPARAM)pRowParams, (LPARAM)pCellParams);\n\t}\n\n\tHRESULT GetTableParams(TABLEROWPARMS* pRowParams, TABLECELLPARMS* pCellParams) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HRESULT)::SendMessage(this->m_hWnd, EM_GETTABLEPARMS, (WPARAM)pRowParams, (LPARAM)pCellParams);\n\t}\n\n\tHRESULT SetTableParams(TABLEROWPARMS* pRowParams, TABLECELLPARMS* pCellParams)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HRESULT)::SendMessage(this->m_hWnd, EM_SETTABLEPARMS, (WPARAM)pRowParams, (LPARAM)pCellParams);\n\t}\n\n\tHRESULT InsertImage(RICHEDIT_IMAGE_PARAMETERS* pParams)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HRESULT)::SendMessage(this->m_hWnd, EM_INSERTIMAGE, 0, (LPARAM)pParams);\n\t}\n\n\tBOOL SetUiaName(LPCTSTR lpstrName)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, EM_SETUIANAME, 0, (LPARAM)lpstrName);\n\t}\n#endif // (_RICHEDIT_VER >= 0x0800)\n};\n\ntypedef CRichEditCtrlT<ATL::CWindow>   CRichEditCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CRichEditCommands - message handlers for standard EDIT commands\n\n// Chain to CRichEditCommands message map. Your class must also derive from CRichEditCtrl.\n// Example:\n// class CMyRichEdit : public CWindowImpl<CMyRichEdit, CRichEditCtrl>,\n//                     public CRichEditCommands<CMyRichEdit>\n// {\n// public:\n//      BEGIN_MSG_MAP(CMyRichEdit)\n//              // your handlers...\n//              CHAIN_MSG_MAP_ALT(CRichEditCommands<CMyRichEdit>, 1)\n//      END_MSG_MAP()\n//      // other stuff...\n// };\n\ntemplate <class T>\nclass CRichEditCommands : public CEditCommands< T >\n{\npublic:\n\tBEGIN_MSG_MAP(CRichEditCommands< T >)\n\tALT_MSG_MAP(1)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_CLEAR, CEditCommands< T >::OnEditClear)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_CLEAR_ALL, CEditCommands< T >::OnEditClearAll)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_COPY, CEditCommands< T >::OnEditCopy)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_CUT, CEditCommands< T >::OnEditCut)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_PASTE, CEditCommands< T >::OnEditPaste)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_SELECT_ALL, CEditCommands< T >::OnEditSelectAll)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_UNDO, CEditCommands< T >::OnEditUndo)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_REDO, OnEditRedo)\n\tEND_MSG_MAP()\n\n\tLRESULT OnEditRedo(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Redo();\n\t\treturn 0;\n\t}\n\n// State (update UI) helpers\n\tBOOL CanCut() const\n\t{ return HasSelection(); }\n\n\tBOOL CanCopy() const\n\t{ return HasSelection(); }\n\n\tBOOL CanClear() const\n\t{ return HasSelection(); }\n\n// Implementation\n\tBOOL HasSelection() const\n\t{\n\t\tconst T* pT = static_cast<const T*>(this);\n\t\treturn (pT->GetSelectionType() != SEL_EMPTY);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CDragListBox\n\ntemplate <class TBase>\nclass CDragListBoxT : public CListBoxT< TBase >\n{\npublic:\n// Constructors\n\tCDragListBoxT(HWND hWnd = NULL) : CListBoxT< TBase >(hWnd)\n\t{ }\n\n\tCDragListBoxT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\tHWND hWnd = TBase::Create(TBase::GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t\tif(hWnd != NULL)\n\t\t\tMakeDragList();\n\t\treturn hWnd;\n\t}\n\n// Operations\n\tBOOL MakeDragList()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((this->GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == 0);\n\t\treturn ::MakeDragList(this->m_hWnd);\n\t}\n\n\tint LBItemFromPt(POINT pt, BOOL bAutoScroll = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ::LBItemFromPt(this->m_hWnd, pt, bAutoScroll);\n\t}\n\n\tvoid DrawInsert(int nItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::DrawInsert(this->GetParent(), this->m_hWnd, nItem);\n\t}\n\n\tstatic UINT GetDragListMessage()\n\t{\n\t\tstatic UINT uDragListMessage = 0;\n\t\tif(uDragListMessage == 0)\n\t\t{\n\t\t\tCStaticDataInitCriticalSectionLock lock;\n\t\t\tif(FAILED(lock.Lock()))\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CDragListBox::GetDragListMessage.\\n\"));\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif(uDragListMessage == 0)\n\t\t\t\tuDragListMessage = ::RegisterWindowMessage(DRAGLISTMSGSTRING);\n\n\t\t\tlock.Unlock();\n\t\t}\n\t\tATLASSERT(uDragListMessage != 0);\n\t\treturn uDragListMessage;\n\t}\n};\n\ntypedef CDragListBoxT<ATL::CWindow>   CDragListBox;\n\ntemplate <class T>\nclass CDragListNotifyImpl\n{\npublic:\n\tBEGIN_MSG_MAP(CDragListNotifyImpl< T >)\n\t\tMESSAGE_HANDLER(CDragListBox::GetDragListMessage(), OnDragListNotify)\n\tEND_MSG_MAP()\n\n\tLRESULT OnDragListNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\t(void)uMsg;   // avoid level 4 warning\n\t\tATLASSERT(uMsg == CDragListBox::GetDragListMessage());\n\t\tT* pT = static_cast<T*>(this);\n\t\tLPDRAGLISTINFO lpDragListInfo = (LPDRAGLISTINFO)lParam;\n\t\tLRESULT lRet = 0;\n\t\tswitch(lpDragListInfo->uNotification)\n\t\t{\n\t\tcase DL_BEGINDRAG:\n\t\t\tlRet = (LPARAM)pT->OnBeginDrag((int)wParam, lpDragListInfo->hWnd, lpDragListInfo->ptCursor);\n\t\t\tbreak;\n\t\tcase DL_CANCELDRAG:\n\t\t\tpT->OnCancelDrag((int)wParam, lpDragListInfo->hWnd, lpDragListInfo->ptCursor);\n\t\t\tbreak;\n\t\tcase DL_DRAGGING:\n\t\t\tlRet = (LPARAM)pT->OnDragging((int)wParam, lpDragListInfo->hWnd, lpDragListInfo->ptCursor);\n\t\t\tbreak;\n\t\tcase DL_DROPPED:\n\t\t\tpT->OnDropped((int)wParam, lpDragListInfo->hWnd, lpDragListInfo->ptCursor);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"Unknown DragListBox notification\\n\"));\n\t\t\tbHandled = FALSE;   // don't handle it\n\t\t\tbreak;\n\t\t}\n\t\treturn lRet;\n\t}\n\n// Overrideables\n\tBOOL OnBeginDrag(int /*nCtlID*/, HWND /*hWndDragList*/, POINT /*ptCursor*/)\n\t{\n\t\treturn TRUE;   // allow dragging\n\t}\n\n\tvoid OnCancelDrag(int /*nCtlID*/, HWND /*hWndDragList*/, POINT /*ptCursor*/)\n\t{\n\t\t// nothing to do\n\t}\n\n\tint OnDragging(int /*nCtlID*/, HWND /*hWndDragList*/, POINT /*ptCursor*/)\n\t{\n\t\treturn 0;   // don't change cursor\n\t}\n\n\tvoid OnDropped(int /*nCtlID*/, HWND /*hWndDragList*/, POINT /*ptCursor*/)\n\t{\n\t\t// nothing to do\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CReBarCtrl\n\ntemplate <class TBase>\nclass CReBarCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCReBarCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCReBarCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn REBARCLASSNAME;\n\t}\n\n\tUINT GetBandCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, RB_GETBANDCOUNT, 0, 0L);\n\t}\n\n\tBOOL GetBandInfo(int nBand, LPREBARBANDINFO lprbbi) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_GETBANDINFO, nBand, (LPARAM)lprbbi);\n\t}\n\n\tBOOL SetBandInfo(int nBand, LPREBARBANDINFO lprbbi)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_SETBANDINFO, nBand, (LPARAM)lprbbi);\n\t}\n\n\tBOOL GetBarInfo(LPREBARINFO lprbi) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_GETBARINFO, 0, (LPARAM)lprbi);\n\t}\n\n\tBOOL SetBarInfo(LPREBARINFO lprbi)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_SETBARINFO, 0, (LPARAM)lprbi);\n\t}\n\n\tCImageList GetImageList() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tREBARINFO rbi = {};\n\t\trbi.cbSize = sizeof(REBARINFO);\n\t\trbi.fMask = RBIM_IMAGELIST;\n\t\tBOOL bRet = (BOOL)::SendMessage(this->m_hWnd, RB_GETBARINFO, 0, (LPARAM)&rbi);\n\t\treturn CImageList((bRet != FALSE) ? rbi.himl : NULL);\n\t}\n\n\tBOOL SetImageList(HIMAGELIST hImageList)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tREBARINFO rbi = {};\n\t\trbi.cbSize = sizeof(REBARINFO);\n\t\trbi.fMask = RBIM_IMAGELIST;\n\t\trbi.himl = hImageList;\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_SETBARINFO, 0, (LPARAM)&rbi);\n\t}\n\n\tUINT GetRowCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, RB_GETROWCOUNT, 0, 0L);\n\t}\n\n\tUINT GetRowHeight(int nBand) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, RB_GETROWHEIGHT, nBand, 0L);\n\t}\n\n\tCOLORREF GetTextColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, RB_GETTEXTCOLOR, 0, 0L);\n\t}\n\n\tCOLORREF SetTextColor(COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, RB_SETTEXTCOLOR, 0, (LPARAM)clr);\n\t}\n\n\tCOLORREF GetBkColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, RB_GETBKCOLOR, 0, 0L);\n\t}\n\n\tCOLORREF SetBkColor(COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, RB_SETBKCOLOR, 0, (LPARAM)clr);\n\t}\n\n\tUINT GetBarHeight() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (UINT)::SendMessage(this->m_hWnd, RB_GETBARHEIGHT, 0, 0L);\n\t}\n\n\tBOOL GetRect(int nBand, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_GETRECT, nBand, (LPARAM)lpRect);\n\t}\n\n\tCToolTipCtrl GetToolTips() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CToolTipCtrl((HWND)::SendMessage(this->m_hWnd, RB_GETTOOLTIPS, 0, 0L));\n\t}\n\n\tvoid SetToolTips(HWND hwndToolTip)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, RB_SETTOOLTIPS, (WPARAM)hwndToolTip, 0L);\n\t}\n\n\tvoid GetBandBorders(int nBand, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(lpRect != NULL);\n\t\t::SendMessage(this->m_hWnd, RB_GETBANDBORDERS, nBand, (LPARAM)lpRect);\n\t}\n\n\tBOOL GetColorScheme(LPCOLORSCHEME lpColorScheme) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(lpColorScheme != NULL);\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_GETCOLORSCHEME, 0, (LPARAM)lpColorScheme);\n\t}\n\n\tvoid SetColorScheme(LPCOLORSCHEME lpColorScheme)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(lpColorScheme != NULL);\n\t\t::SendMessage(this->m_hWnd, RB_SETCOLORSCHEME, 0, (LPARAM)lpColorScheme);\n\t}\n\n\tHPALETTE GetPalette() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HPALETTE)::SendMessage(this->m_hWnd, RB_GETPALETTE, 0, 0L);\n\t}\n\n\tHPALETTE SetPalette(HPALETTE hPalette)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HPALETTE)::SendMessage(this->m_hWnd, RB_SETPALETTE, 0, (LPARAM)hPalette);\n\t}\n\n\tBOOL GetUnicodeFormat() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_GETUNICODEFORMAT, 0, 0L);\n\t}\n\n\tBOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_SETUNICODEFORMAT, bUnicode, 0L);\n\t}\n\n\t// requires uxtheme.h to be included to use MARGINS struct\n#ifndef _UXTHEME_H_\n\ttypedef struct _MARGINS*   PMARGINS;\n#endif // !_UXTHEME_H_\n\tvoid GetBandMargins(PMARGINS pMargins) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, RB_GETBANDMARGINS, 0, (LPARAM)pMargins);\n\t}\n\n\tvoid SetWindowTheme(LPCWSTR lpstrTheme)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, RB_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);\n\t}\n\n\tDWORD GetExtendedStyle() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, RB_GETEXTENDEDSTYLE, 0, 0L);\n\t}\n\n\tDWORD SetExtendedStyle(DWORD dwStyle, DWORD dwMask)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, RB_SETEXTENDEDSTYLE, dwMask, dwStyle);\n\t}\n\n// Operations\n\tBOOL InsertBand(int nBand, LPREBARBANDINFO lprbbi)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_INSERTBAND, nBand, (LPARAM)lprbbi);\n\t}\n\n\tBOOL AddBand(LPREBARBANDINFO lprbbi)\n\t{\n\t\treturn InsertBand(-1, lprbbi);\n\t}\n\n\tBOOL DeleteBand(int nBand)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_DELETEBAND, nBand, 0L);\n\t}\n\n\tATL::CWindow SetNotifyWnd(HWND hWnd)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn ATL::CWindow((HWND)::SendMessage(this->m_hWnd, RB_SETPARENT, (WPARAM)hWnd, 0L));\n\t}\n\n\tvoid BeginDrag(int nBand, DWORD dwPos)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, RB_BEGINDRAG, nBand, dwPos);\n\t}\n\n\tvoid BeginDrag(int nBand, int xPos, int yPos)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, RB_BEGINDRAG, nBand, MAKELPARAM(xPos, yPos));\n\t}\n\n\tvoid EndDrag()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, RB_ENDDRAG, 0, 0L);\n\t}\n\n\tvoid DragMove(DWORD dwPos)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, RB_DRAGMOVE, 0, dwPos);\n\t}\n\n\tvoid DragMove(int xPos, int yPos)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, RB_DRAGMOVE, 0, MAKELPARAM(xPos, yPos));\n\t}\n\n\tvoid GetDropTarget(IDropTarget** ppDropTarget) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, RB_GETDROPTARGET, 0, (LPARAM)ppDropTarget);\n\t}\n\n\tvoid MaximizeBand(int nBand, BOOL bIdeal = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, RB_MAXIMIZEBAND, nBand, bIdeal);\n\t}\n\n\tvoid MinimizeBand(int nBand)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, RB_MINIMIZEBAND, nBand, 0L);\n\t}\n\n\tBOOL SizeToRect(LPRECT lpRect)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_SIZETORECT, 0, (LPARAM)lpRect);\n\t}\n\n\tint IdToIndex(UINT uBandID) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, RB_IDTOINDEX, uBandID, 0L);\n\t}\n\n\tint HitTest(LPRBHITTESTINFO lprbht) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, RB_HITTEST, 0, (LPARAM)lprbht);\n\t}\n\n\tBOOL ShowBand(int nBand, BOOL bShow)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_SHOWBAND, nBand, bShow);\n\t}\n\n\tBOOL MoveBand(int nBand, int nNewPos)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((nNewPos >= 0) && (nNewPos <= ((int)GetBandCount() - 1)));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_MOVEBAND, nBand, nNewPos);\n\t}\n\n\tvoid PushChevron(int nBand, LPARAM lAppValue)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, RB_PUSHCHEVRON, nBand, lAppValue);\n\t}\n\n// Extra operations\n\tvoid LockBands(bool bLock)\n\t{\n\t\tint nBandCount = GetBandCount();\n\t\tfor(int i =0; i < nBandCount; i++)\n\t\t{\n\t\t\tREBARBANDINFO rbbi = { RunTimeHelper::SizeOf_REBARBANDINFO() };\n\t\t\trbbi.fMask = RBBIM_STYLE;\n\t\t\tBOOL bRet = GetBandInfo(i, &rbbi);\n\t\t\tATLASSERT(bRet);\n\n\t\t\tif((rbbi.fStyle & RBBS_GRIPPERALWAYS) == 0)\n\t\t\t{\n\t\t\t\trbbi.fStyle |= RBBS_GRIPPERALWAYS;\n\t\t\t\tbRet = SetBandInfo(i, &rbbi);\n\t\t\t\tATLASSERT(bRet);\n\t\t\t\trbbi.fStyle &= ~RBBS_GRIPPERALWAYS;\n\t\t\t}\n\n\t\t\tif(bLock)\n\t\t\t\trbbi.fStyle |= RBBS_NOGRIPPER;\n\t\t\telse\n\t\t\t\trbbi.fStyle &= ~RBBS_NOGRIPPER;\n\n\t\t\tbRet = SetBandInfo(i, &rbbi);\n\t\t\tATLASSERT(bRet);\n\t\t}\n\t}\n\n#if (_WIN32_WINNT >= 0x0600)\n\tBOOL SetBandWidth(int nBand, int cxWidth)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, RB_SETBANDWIDTH, nBand, cxWidth);\n\t}\n#endif // (_WIN32_WINNT >= 0x0600)\n};\n\ntypedef CReBarCtrlT<ATL::CWindow>   CReBarCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CComboBoxEx\n\ntemplate <class TBase>\nclass CComboBoxExT : public CComboBoxT< TBase >\n{\npublic:\n// Constructors\n\tCComboBoxExT(HWND hWnd = NULL) : CComboBoxT< TBase >(hWnd)\n\t{ }\n\n\tCComboBoxExT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn WC_COMBOBOXEX;\n\t}\n\n\tCImageList GetImageList() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, CBEM_GETIMAGELIST, 0, 0L));\n\t}\n\n\tCImageList SetImageList(HIMAGELIST hImageList)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CImageList((HIMAGELIST)::SendMessage(this->m_hWnd, CBEM_SETIMAGELIST, 0, (LPARAM)hImageList));\n\t}\n\n\tDWORD GetExtendedStyle() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, CBEM_GETEXTENDEDSTYLE, 0, 0L);\n\t}\n\n\tDWORD SetExtendedStyle(DWORD dwExMask, DWORD dwExStyle)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, CBEM_SETEXTENDEDSTYLE, dwExMask, dwExStyle);\n\t}\n\n\tBOOL GetUnicodeFormat() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, CBEM_GETUNICODEFORMAT, 0, 0L);\n\t}\n\n\tBOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, CBEM_SETUNICODEFORMAT, bUnicode, 0L);\n\t}\n\n\tvoid SetWindowTheme(LPCWSTR lpstrTheme)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, CBEM_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);\n\t}\n\n// Operations\n\tint InsertItem(const COMBOBOXEXITEM* lpcCBItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CBEM_INSERTITEM, 0, (LPARAM)lpcCBItem);\n\t}\n\n\tint InsertItem(UINT nMask, int nIndex, LPCTSTR lpszItem, int nImage, int nSelImage, \n\t               int iIndent, int iOverlay, LPARAM lParam)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tCOMBOBOXEXITEM cbex = {};\n\t\tcbex.mask = nMask;\n\t\tcbex.iItem = nIndex;\n\t\tcbex.pszText = (LPTSTR) lpszItem;\n\t\tcbex.iImage = nImage;\n\t\tcbex.iSelectedImage = nSelImage;\n\t\tcbex.iIndent = iIndent;\n\t\tcbex.iOverlay = iOverlay;\n\t\tcbex.lParam = lParam;\n\t\treturn (int)::SendMessage(this->m_hWnd, CBEM_INSERTITEM, 0, (LPARAM)&cbex);\n\t}\n\n\tint InsertItem(int nIndex, LPCTSTR lpszItem, int nImage, int nSelImage, int iIndent, LPARAM lParam = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tCOMBOBOXEXITEM cbex = {};\n\t\tcbex.mask = CBEIF_TEXT | CBEIF_IMAGE | CBEIF_SELECTEDIMAGE | CBEIF_INDENT | CBEIF_LPARAM;\n\t\tcbex.iItem = nIndex;\n\t\tcbex.pszText = (LPTSTR) lpszItem;\n\t\tcbex.iImage = nImage;\n\t\tcbex.iSelectedImage = nSelImage;\n\t\tcbex.iIndent = iIndent;\n\t\tcbex.lParam = lParam;\n\t\treturn (int)::SendMessage(this->m_hWnd, CBEM_INSERTITEM, 0, (LPARAM)&cbex);\n\t}\n\n\tint AddItem(UINT nMask, LPCTSTR lpszItem, int nImage, int nSelImage, int iIndent, int iOverlay, LPARAM lParam)\n\t{\n\t\treturn InsertItem(nMask, -1, lpszItem, nImage, nSelImage, iIndent, iOverlay, lParam);\n\t}\n\n\tint AddItem(LPCTSTR lpszItem, int nImage, int nSelImage, int iIndent, LPARAM lParam = 0)\n\t{\n\t\treturn InsertItem(-1, lpszItem, nImage, nSelImage, iIndent, lParam);\n\t}\n\n\tint DeleteItem(int nIndex)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, CBEM_DELETEITEM, nIndex, 0L);\n\t}\n\n\tBOOL GetItem(PCOMBOBOXEXITEM pCBItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, CBEM_GETITEM, 0, (LPARAM)pCBItem);\n\t}\n\n\tBOOL SetItem(const COMBOBOXEXITEM* lpcCBItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, CBEM_SETITEM, 0, (LPARAM)lpcCBItem);\n\t}\n\n\tint SetItem(int nIndex, UINT nMask, LPCTSTR lpszItem, int nImage, int nSelImage, \n\t            int iIndent, int iOverlay, LPARAM lParam)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tCOMBOBOXEXITEM cbex = {};\n\t\tcbex.mask = nMask;\n\t\tcbex.iItem = nIndex;\n\t\tcbex.pszText = (LPTSTR) lpszItem;\n\t\tcbex.iImage = nImage;\n\t\tcbex.iSelectedImage = nSelImage;\n\t\tcbex.iIndent = iIndent;\n\t\tcbex.iOverlay = iOverlay;\n\t\tcbex.lParam = lParam;\n\t\treturn (int)::SendMessage(this->m_hWnd, CBEM_SETITEM, 0, (LPARAM)&cbex);\n\t}\n\n\tBOOL GetItemText(int nIndex, LPTSTR lpszItem, int nLen) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(lpszItem != NULL);\n\n\t\tCOMBOBOXEXITEM cbex = {};\n\t\tcbex.mask = CBEIF_TEXT;\n\t\tcbex.iItem = nIndex;\n\t\tcbex.pszText = lpszItem;\n\t\tcbex.cchTextMax = nLen;\n\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, CBEM_GETITEM, 0, (LPARAM)&cbex);\n\t}\n\n\tBOOL GetItemText(int nIndex, BSTR& bstrText) const\n\t{\n\t\tUSES_CONVERSION;\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(bstrText == NULL);\n\n\t\tCOMBOBOXEXITEM cbex = {};\n\t\tcbex.mask = CBEIF_TEXT;\n\t\tcbex.iItem = nIndex;\n\n\t\tLPTSTR lpstrText = NULL;\n\t\tBOOL bRet = FALSE;\n\t\tfor(int nLen = 256; ; nLen *= 2)\n\t\t{\n\t\t\tATLTRY(lpstrText = new TCHAR[nLen]);\n\t\t\tif(lpstrText == NULL)\n\t\t\t\tbreak;\n\t\t\tlpstrText[0] = NULL;\n\t\t\tcbex.pszText = lpstrText;\n\t\t\tcbex.cchTextMax = nLen;\n\t\t\tbRet = (BOOL)::SendMessage(this->m_hWnd, CBEM_GETITEM, 0, (LPARAM)&cbex);\n\t\t\tif(!bRet || (lstrlen(cbex.pszText) < (nLen - 1)))\n\t\t\t\tbreak;\n\t\t\tdelete [] lpstrText;\n\t\t\tlpstrText = NULL;\n\t\t}\n\n\t\tif(lpstrText != NULL)\n\t\t{\n\t\t\tif(bRet)\n\t\t\t\tbstrText = ::SysAllocString(T2OLE(lpstrText));\n\t\t\tdelete [] lpstrText;\n\t\t}\n\n\t\treturn (bstrText != NULL) ? TRUE : FALSE;\n\t}\n\n#ifdef __ATLSTR_H__\n\tBOOL GetItemText(int nIndex, ATL::CString& strText) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\n\t\tCOMBOBOXEXITEM cbex = {};\n\t\tcbex.mask = CBEIF_TEXT;\n\t\tcbex.iItem = nIndex;\n\n\t\tstrText.Empty();\n\t\tBOOL bRet = FALSE;\n\t\tfor(int nLen = 256; ; nLen *= 2)\n\t\t{\n\t\t\tcbex.pszText = strText.GetBufferSetLength(nLen);\n\t\t\tif(cbex.pszText == NULL)\n\t\t\t{\n\t\t\t\tbRet = FALSE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcbex.cchTextMax = nLen;\n\t\t\tbRet = (BOOL)::SendMessage(this->m_hWnd, CBEM_GETITEM, 0, (LPARAM)&cbex);\n\t\t\tif(!bRet || (lstrlen(cbex.pszText) < (nLen - 1)))\n\t\t\t\tbreak;\n\t\t}\n\t\tstrText.ReleaseBuffer();\n\t\treturn bRet;\n\t}\n#endif // __ATLSTR_H__\n\n\tBOOL SetItemText(int nIndex, LPCTSTR lpszItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn SetItem(nIndex, CBEIF_TEXT, lpszItem, 0, 0, 0, 0, 0);\n\t}\n\n\tCComboBox GetComboCtrl() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CComboBox((HWND)::SendMessage(this->m_hWnd, CBEM_GETCOMBOCONTROL, 0, 0L));\n\t}\n\n\tCEdit GetEditCtrl() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CEdit((HWND)::SendMessage(this->m_hWnd, CBEM_GETEDITCONTROL, 0, 0L));\n\t}\n\n\tBOOL HasEditChanged() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, CBEM_HASEDITCHANGED, 0, 0L);\n\t}\n\n// Non-functional\n\tint AddString(LPCTSTR /*lpszItem*/)\n\t{\n\t\tATLASSERT(FALSE);  // Not available in CComboBoxEx; use InsertItem\n\t\treturn 0;\n\t}\n\n\tint InsertString(int /*nIndex*/, LPCTSTR /*lpszString*/)\n\t{\n\t\tATLASSERT(FALSE);  // Not available in CComboBoxEx; use InsertItem\n\t\treturn 0;\n\t}\n\n\tint Dir(UINT /*attr*/, LPCTSTR /*lpszWildCard*/)\n\t{\n\t\tATLASSERT(FALSE);  // Not available in CComboBoxEx\n\t\treturn 0;\n\t}\n\n\tint FindString(int /*nStartAfter*/, LPCTSTR /*lpszString*/) const\n\t{\n\t\tATLASSERT(FALSE);  // Not available in CComboBoxEx; try FindStringExact\n\t\treturn 0;\n\t}\n};\n\ntypedef CComboBoxExT<ATL::CWindow>   CComboBoxEx;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CMonthCalendarCtrl\n\ntemplate <class TBase>\nclass CMonthCalendarCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCMonthCalendarCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCMonthCalendarCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn MONTHCAL_CLASS;\n\t}\n\n\tCOLORREF GetColor(int nColorType) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, MCM_GETCOLOR, nColorType, 0L);\n\t}\n\n\tCOLORREF SetColor(int nColorType, COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, MCM_SETCOLOR, nColorType, clr);\n\t}\n\n\tBOOL GetCurSel(LPSYSTEMTIME lpSysTime) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, MCM_GETCURSEL, 0, (LPARAM)lpSysTime);\n\t}\n\n\tBOOL SetCurSel(LPSYSTEMTIME lpSysTime)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, MCM_SETCURSEL, 0, (LPARAM)lpSysTime);\n\t}\n\n\tint GetFirstDayOfWeek(BOOL* pbLocaleVal = NULL) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, MCM_GETFIRSTDAYOFWEEK, 0, 0L);\n\t\tif(pbLocaleVal != NULL)\n\t\t\t*pbLocaleVal = (BOOL)HIWORD(dwRet);\n\t\treturn (int)(short)LOWORD(dwRet);\n\t}\n\n\tint SetFirstDayOfWeek(int nDay, BOOL* pbLocaleVal = NULL)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tDWORD dwRet = (DWORD)::SendMessage(this->m_hWnd, MCM_SETFIRSTDAYOFWEEK, 0, nDay);\n\t\tif(pbLocaleVal != NULL)\n\t\t\t*pbLocaleVal = (BOOL)HIWORD(dwRet);\n\t\treturn (int)(short)LOWORD(dwRet);\n\t}\n\n\tint GetMaxSelCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, MCM_GETMAXSELCOUNT, 0, 0L);\n\t}\n\n\tBOOL SetMaxSelCount(int nMax)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, MCM_SETMAXSELCOUNT, nMax, 0L);\n\t}\n\n\tint GetMonthDelta() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, MCM_GETMONTHDELTA, 0, 0L);\n\t}\n\n\tint SetMonthDelta(int nDelta)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, MCM_SETMONTHDELTA, nDelta, 0L);\n\t}\n\n\tDWORD GetRange(LPSYSTEMTIME lprgSysTimeArray) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, MCM_GETRANGE, 0, (LPARAM)lprgSysTimeArray);\n\t}\n\n\tBOOL SetRange(DWORD dwFlags, LPSYSTEMTIME lprgSysTimeArray)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, MCM_SETRANGE, dwFlags, (LPARAM)lprgSysTimeArray);\n\t}\n\n\tBOOL GetSelRange(LPSYSTEMTIME lprgSysTimeArray) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, MCM_GETSELRANGE, 0, (LPARAM)lprgSysTimeArray);\n\t}\n\n\tBOOL SetSelRange(LPSYSTEMTIME lprgSysTimeArray)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, MCM_SETSELRANGE, 0, (LPARAM)lprgSysTimeArray);\n\t}\n\n\tBOOL GetToday(LPSYSTEMTIME lpSysTime) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, MCM_GETTODAY, 0, (LPARAM)lpSysTime);\n\t}\n\n\tvoid SetToday(LPSYSTEMTIME lpSysTime)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, MCM_SETTODAY, 0, (LPARAM)lpSysTime);\n\t}\n\n\tBOOL GetMinReqRect(LPRECT lpRectInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, MCM_GETMINREQRECT, 0, (LPARAM)lpRectInfo);\n\t}\n\n\tint GetMaxTodayWidth() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, MCM_GETMAXTODAYWIDTH, 0, 0L);\n\t}\n\n\tBOOL GetUnicodeFormat() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, MCM_GETUNICODEFORMAT, 0, 0L);\n\t}\n\n\tBOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, MCM_SETUNICODEFORMAT, bUnicode, 0L);\n\t}\n\n#if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\n\tDWORD GetCurrentView() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, MCM_GETCURRENTVIEW, 0, 0L);\n\t}\n\n\tBOOL SetCurrentView(DWORD dwView)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, MCM_SETCURRENTVIEW, 0, dwView);\n\t}\n\n\tDWORD GetCalendarCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, MCM_GETCALENDARCOUNT, 0, 0L);\n\t}\n\n\tBOOL GetCalendarGridInfo(PMCGRIDINFO pGridInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, MCM_GETCALENDARGRIDINFO, 0, (LPARAM)pGridInfo);\n\t}\n\n\tCALID GetCALID() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (CALID)::SendMessage(this->m_hWnd, MCM_GETCALID, 0, 0L);\n\t}\n\n\tvoid SetCALID(CALID calid)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, MCM_SETCALID, (LPARAM)calid, 0L);\n\t}\n\n\tint GetCalendarBorder() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, MCM_GETCALENDARBORDER, 0, 0L);\n\t}\n\n\tvoid SetCalendarBorder(int cxyBorder, BOOL bSet = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, MCM_SETCALENDARBORDER, (WPARAM)bSet, (LPARAM)cxyBorder);\n\t}\n#endif // defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\n\n// Operations\n\tint GetMonthRange(DWORD dwFlags, LPSYSTEMTIME lprgSysTimeArray) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, MCM_GETMONTHRANGE, dwFlags, (LPARAM)lprgSysTimeArray);\n\t}\n\n\tBOOL SetDayState(int nMonths, LPMONTHDAYSTATE lpDayStateArray)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, MCM_SETDAYSTATE, nMonths, (LPARAM)lpDayStateArray);\n\t}\n\n\tDWORD HitTest(PMCHITTESTINFO pMCHitTest) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, MCM_HITTEST, 0, (LPARAM)pMCHitTest);\n\t}\n\n#if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\n\tvoid SizeRectToMin(LPRECT lpRect)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, MCM_SIZERECTTOMIN, 0, (LPARAM)lpRect);\n\t}\n#endif // defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\n};\n\ntypedef CMonthCalendarCtrlT<ATL::CWindow>   CMonthCalendarCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CDateTimePickerCtrl\n\ntemplate <class TBase>\nclass CDateTimePickerCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCDateTimePickerCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCDateTimePickerCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Operations\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn DATETIMEPICK_CLASS;\n\t}\n\n\tBOOL SetFormat(LPCTSTR lpszFormat)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, DTM_SETFORMAT, 0, (LPARAM)lpszFormat);\n\t}\n\n\tCOLORREF GetMonthCalColor(int nColorType) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, DTM_GETMCCOLOR, nColorType, 0L);\n\t}\n\n\tCOLORREF SetMonthCalColor(int nColorType, COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, DTM_SETMCCOLOR, nColorType, clr);\n\t}\n\n\tDWORD GetRange(LPSYSTEMTIME lpSysTimeArray) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, DTM_GETRANGE, 0, (LPARAM)lpSysTimeArray);\n\t}\n\n\tBOOL SetRange(DWORD dwFlags, LPSYSTEMTIME lpSysTimeArray)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, DTM_SETRANGE, dwFlags, (LPARAM)lpSysTimeArray);\n\t}\n\n\tDWORD GetSystemTime(LPSYSTEMTIME lpSysTime) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)lpSysTime);\n\t}\n\n\tBOOL SetSystemTime(DWORD dwFlags, LPSYSTEMTIME lpSysTime)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, DTM_SETSYSTEMTIME, dwFlags, (LPARAM)lpSysTime);\n\t}\n\n\tCMonthCalendarCtrl GetMonthCal() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CMonthCalendarCtrl((HWND)::SendMessage(this->m_hWnd, DTM_GETMONTHCAL, 0, 0L));\n\t}\n\n\tCFontHandle GetMonthCalFont() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn CFontHandle((HFONT)::SendMessage(this->m_hWnd, DTM_GETMCFONT, 0, 0L));\n\t}\n\n\tvoid SetMonthCalFont(HFONT hFont, BOOL bRedraw = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, DTM_SETMCFONT, (WPARAM)hFont, MAKELPARAM(bRedraw, 0));\n\t}\n\n#if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\n\tDWORD GetMonthCalStyle() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, DTM_GETMCSTYLE, 0, 0L);\n\t}\n\n\tDWORD SetMonthCalStyle(DWORD dwStyle)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, DTM_SETMCSTYLE, 0, (LPARAM)dwStyle);\n\t}\n\n\tvoid GetDateTimePickerInfo(LPDATETIMEPICKERINFO lpPickerInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, DTM_GETDATETIMEPICKERINFO, 0, (LPARAM)lpPickerInfo);\n\t}\n\n\tBOOL GetIdealSize(LPSIZE lpSize) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, DTM_GETIDEALSIZE, 0, (LPARAM)lpSize);\n\t}\n\n\tvoid CloseMonthCal()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, DTM_CLOSEMONTHCAL, 0, 0L);\n\t}\n#endif // defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\n};\n\ntypedef CDateTimePickerCtrlT<ATL::CWindow>   CDateTimePickerCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CFlatScrollBarImpl - support for flat scroll bars\n\ntemplate <class T>\nclass CFlatScrollBarImpl\n{\npublic:\n// Initialization\n\tBOOL FlatSB_Initialize()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::InitializeFlatSB(pT->m_hWnd);\n\t}\n\n\tHRESULT FlatSB_Uninitialize()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::UninitializeFlatSB(pT->m_hWnd);\n\t}\n\n// Flat scroll bar properties\n\tBOOL FlatSB_GetScrollProp(UINT uIndex, LPINT lpnValue) const\n\t{\n\t\tconst T* pT = static_cast<const T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::FlatSB_GetScrollProp(pT->m_hWnd, uIndex, lpnValue);\n\t}\n\n\tBOOL FlatSB_SetScrollProp(UINT uIndex, int nValue, BOOL bRedraw = TRUE)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::FlatSB_SetScrollProp(pT->m_hWnd, uIndex, nValue, bRedraw);\n\t}\n\n// Attributes\n\tint FlatSB_GetScrollPos(int nBar) const\n\t{\n\t\tconst T* pT = static_cast<const T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::FlatSB_GetScrollPos(pT->m_hWnd, nBar);\n\t}\n\n\tint FlatSB_SetScrollPos(int nBar, int nPos, BOOL bRedraw = TRUE)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::FlatSB_SetScrollPos(pT->m_hWnd, nBar, nPos, bRedraw);\n\t}\n\n\tBOOL FlatSB_GetScrollRange(int nBar, LPINT lpMinPos, LPINT lpMaxPos) const\n\t{\n\t\tconst T* pT = static_cast<const T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::FlatSB_GetScrollRange(pT->m_hWnd, nBar, lpMinPos, lpMaxPos);\n\t}\n\n\tBOOL FlatSB_SetScrollRange(int nBar, int nMinPos, int nMaxPos, BOOL bRedraw = TRUE)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::FlatSB_SetScrollRange(pT->m_hWnd, nBar, nMinPos, nMaxPos, bRedraw);\n\t}\n\n\tBOOL FlatSB_GetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo) const\n\t{\n\t\tconst T* pT = static_cast<const T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::FlatSB_GetScrollInfo(pT->m_hWnd, nBar, lpScrollInfo);\n\t}\n\n\tint FlatSB_SetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw = TRUE)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::FlatSB_SetScrollInfo(pT->m_hWnd, nBar, lpScrollInfo, bRedraw);\n\t}\n\n// Operations\n\tBOOL FlatSB_ShowScrollBar(UINT nBar, BOOL bShow = TRUE)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::FlatSB_ShowScrollBar(pT->m_hWnd, nBar, bShow);\n\t}\n\n\tBOOL FlatSB_EnableScrollBar(UINT uSBFlags, UINT uArrowFlags = ESB_ENABLE_BOTH)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::FlatSB_EnableScrollBar(pT->m_hWnd, uSBFlags, uArrowFlags);\n\t}\n};\n\ntemplate <class TBase>\nclass CFlatScrollBarT : public TBase, public CFlatScrollBarImpl<CFlatScrollBarT< TBase > >\n{\npublic:\n\tCFlatScrollBarT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCFlatScrollBarT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n};\n\ntypedef CFlatScrollBarT<ATL::CWindow>   CFlatScrollBar;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CIPAddressCtrl\n\ntemplate <class TBase>\nclass CIPAddressCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCIPAddressCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCIPAddressCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Atteributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn WC_IPADDRESS;\n\t}\n\n\tBOOL IsBlank() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, IPM_ISBLANK, 0, 0L);\n\t}\n\n\tint GetAddress(LPDWORD lpdwAddress) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, IPM_GETADDRESS, 0, (LPARAM)lpdwAddress);\n\t}\n\n\tvoid SetAddress(DWORD dwAddress)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, IPM_SETADDRESS, 0, dwAddress);\n\t}\n\n\tvoid ClearAddress()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, IPM_CLEARADDRESS, 0, 0L);\n\t}\n\n\tvoid SetRange(int nField, WORD wRange)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, IPM_SETRANGE, nField, wRange);\n\t}\n\n\tvoid SetRange(int nField, BYTE nMin, BYTE nMax)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, IPM_SETRANGE, nField, MAKEIPRANGE(nMin, nMax));\n\t}\n\n\tvoid SetFocus(int nField)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, IPM_SETFOCUS, nField, 0L);\n\t}\n};\n\ntypedef CIPAddressCtrlT<ATL::CWindow>   CIPAddressCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CPagerCtrl\n\ntemplate <class TBase>\nclass CPagerCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCPagerCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCPagerCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n\t\treturn WC_PAGESCROLLER;\n\t}\n\n\tint GetButtonSize() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, PGM_GETBUTTONSIZE, 0, 0L);\n\t}\n\n\tint SetButtonSize(int nButtonSize)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, PGM_SETBUTTONSIZE, 0, nButtonSize);\n\t}\n\n\tDWORD GetButtonState(int nButton) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((nButton == PGB_TOPORLEFT) || (nButton == PGB_BOTTOMORRIGHT));\n\t\treturn (DWORD)::SendMessage(this->m_hWnd, PGM_GETBUTTONSTATE, 0, nButton);\n\t}\n\n\tCOLORREF GetBkColor() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, PGM_GETBKCOLOR, 0, 0L);\n\t}\n\n\tCOLORREF SetBkColor(COLORREF clrBk)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (COLORREF)::SendMessage(this->m_hWnd, PGM_SETBKCOLOR, 0, (LPARAM)clrBk);\n\t}\n\n\tint GetBorder() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, PGM_GETBORDER, 0, 0L);\n\t}\n\n\tint SetBorder(int nBorderSize)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, PGM_SETBORDER, 0, nBorderSize);\n\t}\n\n\tint GetPos() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, PGM_GETPOS, 0, 0L);\n\t}\n\n\tint SetPos(int nPos)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, PGM_SETPOS, 0, nPos);\n\t}\n\n// Operations\n\tvoid SetChild(HWND hWndChild)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, PGM_SETCHILD, 0, (LPARAM)hWndChild);\n\t}\n\n\tvoid ForwardMouse(BOOL bForward = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, PGM_FORWARDMOUSE, bForward, 0L);\n\t}\n\n\tvoid RecalcSize()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\t::SendMessage(this->m_hWnd, PGM_RECALCSIZE, 0, 0L);\n\t}\n\n\tvoid GetDropTarget(IDropTarget** ppDropTarget)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(ppDropTarget != NULL);\n\t\t::SendMessage(this->m_hWnd, PGM_GETDROPTARGET, 0, (LPARAM)ppDropTarget);\n\t}\n};\n\ntypedef CPagerCtrlT<ATL::CWindow>   CPagerCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CLinkCtrl - Windows SYSLINK control\n\ntemplate <class TBase>\nclass CLinkCtrlT : public TBase\n{\npublic:\n// Constructors\n\tCLinkCtrlT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCLinkCtrlT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\n\t{\n\t\treturn TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\n\t}\n\n// Attributes\n\tstatic LPCTSTR GetWndClassName()\n\t{\n#ifdef _UNICODE\n\t\treturn WC_LINK;\n#else // !_UNICODE\n\t\treturn \"SysLink\";\n#endif // !_UNICODE\n\t}\n\n\tint GetIdealHeight(int cxMaxWidth = 0) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LM_GETIDEALHEIGHT, cxMaxWidth, 0L);\n\t}\n\n\tBOOL GetItem(PLITEM pLItem) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LM_GETITEM, 0, (LPARAM)pLItem);\n\t}\n\n\tBOOL SetItem(PLITEM pLItem)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LM_SETITEM, 0, (LPARAM)pLItem);\n\t}\n\n\t// Vista only\n\tint GetIdealSize(SIZE& size, int cxMaxWidth = 0) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (int)::SendMessage(this->m_hWnd, LM_GETIDEALSIZE, cxMaxWidth, (LPARAM)&size);\n\t}\n\n// Operations\n\tBOOL HitTest(PLHITTESTINFO pLHitTestInfo) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (BOOL)::SendMessage(this->m_hWnd, LM_HITTEST, 0, (LPARAM)pLHitTestInfo);\n\t}\n};\n\ntypedef CLinkCtrlT<ATL::CWindow>   CLinkCtrl;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CCustomDraw - MI class for custom-draw support\n\ntemplate <class T>\nclass CCustomDraw\n{\npublic:\n// Message map and handlers\n\tBEGIN_MSG_MAP(CCustomDraw< T >)\n\t\tNOTIFY_CODE_HANDLER(NM_CUSTOMDRAW, OnCustomDraw)\n\tALT_MSG_MAP(1)\n\t\tREFLECTED_NOTIFY_CODE_HANDLER(NM_CUSTOMDRAW, OnCustomDraw)\n\tEND_MSG_MAP()\n\n// message handler\n\tLRESULT OnCustomDraw(int idCtrl, LPNMHDR pnmh, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->SetMsgHandled(TRUE);\n\t\tLPNMCUSTOMDRAW lpNMCustomDraw = (LPNMCUSTOMDRAW)pnmh;\n\t\tDWORD dwRet = 0;\n\t\tswitch(lpNMCustomDraw->dwDrawStage)\n\t\t{\n\t\tcase CDDS_PREPAINT:\n\t\t\tdwRet = pT->OnPrePaint(idCtrl, lpNMCustomDraw);\n\t\t\tbreak;\n\t\tcase CDDS_POSTPAINT:\n\t\t\tdwRet = pT->OnPostPaint(idCtrl, lpNMCustomDraw);\n\t\t\tbreak;\n\t\tcase CDDS_PREERASE:\n\t\t\tdwRet = pT->OnPreErase(idCtrl, lpNMCustomDraw);\n\t\t\tbreak;\n\t\tcase CDDS_POSTERASE:\n\t\t\tdwRet = pT->OnPostErase(idCtrl, lpNMCustomDraw);\n\t\t\tbreak;\n\t\tcase CDDS_ITEMPREPAINT:\n\t\t\tdwRet = pT->OnItemPrePaint(idCtrl, lpNMCustomDraw);\n\t\t\tbreak;\n\t\tcase CDDS_ITEMPOSTPAINT:\n\t\t\tdwRet = pT->OnItemPostPaint(idCtrl, lpNMCustomDraw);\n\t\t\tbreak;\n\t\tcase CDDS_ITEMPREERASE:\n\t\t\tdwRet = pT->OnItemPreErase(idCtrl, lpNMCustomDraw);\n\t\t\tbreak;\n\t\tcase CDDS_ITEMPOSTERASE:\n\t\t\tdwRet = pT->OnItemPostErase(idCtrl, lpNMCustomDraw);\n\t\t\tbreak;\n\t\tcase (CDDS_ITEMPREPAINT | CDDS_SUBITEM):\n\t\t\tdwRet = pT->OnSubItemPrePaint(idCtrl, lpNMCustomDraw);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tpT->SetMsgHandled(FALSE);\n\t\t\tbreak;\n\t\t}\n\t\tbHandled = pT->IsMsgHandled();\n\t\treturn dwRet;\n\t}\n\n// Overrideables\n\tDWORD OnPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\n\t{\n\t\treturn CDRF_DODEFAULT;\n\t}\n\n\tDWORD OnPostPaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\n\t{\n\t\treturn CDRF_DODEFAULT;\n\t}\n\n\tDWORD OnPreErase(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\n\t{\n\t\treturn CDRF_DODEFAULT;\n\t}\n\n\tDWORD OnPostErase(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\n\t{\n\t\treturn CDRF_DODEFAULT;\n\t}\n\n\tDWORD OnItemPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\n\t{\n\t\treturn CDRF_DODEFAULT;\n\t}\n\n\tDWORD OnItemPostPaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\n\t{\n\t\treturn CDRF_DODEFAULT;\n\t}\n\n\tDWORD OnItemPreErase(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\n\t{\n\t\treturn CDRF_DODEFAULT;\n\t}\n\n\tDWORD OnItemPostErase(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\n\t{\n\t\treturn CDRF_DODEFAULT;\n\t}\n\n\tDWORD OnSubItemPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\n\t{\n\t\treturn CDRF_DODEFAULT;\n\t}\n};\n\n} // namespace WTL\n\n#endif // __ATLCTRLS_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlctrlw.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLCTRLW_H__\n#define __ATLCTRLW_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atlctrlw.h requires atlapp.h to be included first\n#endif\n\n#ifndef __ATLCTRLS_H__\n\t#error atlctrlw.h requires atlctrls.h to be included first\n#endif\n\n// Define _WTL_CMDBAR_VISTA_MENUS as 0 to exclude Vista menus support\n#ifndef _WTL_CMDBAR_VISTA_MENUS\n  #define _WTL_CMDBAR_VISTA_MENUS 1\n#endif\n\n// Note: Define _WTL_CMDBAR_VISTA_STD_MENUBAR to use Vista standard menubar look with Vista menus\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CCommandBarCtrlImpl<T, TBase, TWinTraits>\n// CCommandBarCtrl\n// CMDICommandBarCtrlImpl<T, TBase, TWinTraits>\n// CMDICommandBarCtrl\n\n\nnamespace WTL\n{\n\n///////////////////////////////////////////////////////////////////////////////\n// Command Bars\n\n// Window Styles:\n#define CBRWS_TOP\t\tCCS_TOP\n#define CBRWS_BOTTOM\t\tCCS_BOTTOM\n#define CBRWS_NORESIZE\t\tCCS_NORESIZE\n#define CBRWS_NOPARENTALIGN\tCCS_NOPARENTALIGN\n#define CBRWS_NODIVIDER\t\tCCS_NODIVIDER\n\n// Extended styles\n#define CBR_EX_TRANSPARENT\t0x00000001L\n#define CBR_EX_SHAREMENU\t0x00000002L\n#define CBR_EX_ALTFOCUSMODE\t0x00000004L\n#define CBR_EX_TRACKALWAYS\t0x00000008L\n#define CBR_EX_NOVISTAMENUS\t0x00000010L\n\n// standard command bar styles\n#define ATL_SIMPLE_CMDBAR_PANE_STYLE \\\n\t(WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CBRWS_NODIVIDER | CBRWS_NORESIZE | CBRWS_NOPARENTALIGN)\n\n// Messages - support chevrons for frame windows\n#define CBRM_GETCMDBAR\t\t\t(WM_USER + 301) // returns command bar HWND\n#define CBRM_GETMENU\t\t\t(WM_USER + 302) // returns loaded or attached menu\n#define CBRM_TRACKPOPUPMENU\t\t(WM_USER + 303) // displays a popup menu\n\ntypedef struct tagCBRPOPUPMENU\n{\n\tint cbSize;\n\tHMENU hMenu;         // popup menu do display\n\tUINT uFlags;         // TPM_* flags for ::TrackPopupMenuEx\n\tint x;\n\tint y;\n\tLPTPMPARAMS lptpm;   // ptr to TPMPARAMS for ::TrackPopupMenuEx\n} CBRPOPUPMENU, *LPCBRPOPUPMENU;\n\n// helper class\ntemplate <class T>\nclass CSimpleStack : public ATL::CSimpleArray< T >\n{\npublic:\n\tBOOL Push(T t)\n\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - STACK-PUSH (%8.8X) size = %i\\n\"), t, GetSize());\n#endif\n\t\treturn this->Add(t);\n\t}\n\n\tT Pop()\n\t{\n\t\tint nLast = this->GetSize() - 1;\n\t\tif(nLast < 0)\n\t\t\treturn NULL;   // must be able to convert to NULL\n\t\tT t = this->m_aT[nLast];\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - STACK-POP (%8.8X) size = %i\\n\"), t, GetSize());\n#endif\n\t\tif(!this->RemoveAt(nLast))\n\t\t\treturn NULL;\n\t\treturn t;\n\t}\n\n\tT GetCurrent()\n\t{\n\t\tint nLast = this->GetSize() - 1;\n\t\tif(nLast < 0)\n\t\t\treturn NULL;   // must be able to convert to NULL\n\t\treturn this->m_aT[nLast];\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CCommandBarCtrlBase - base class for the Command Bar implementation\n\nclass CCommandBarCtrlBase : public CToolBarCtrl\n{\npublic:\n\tstruct _MsgHookData\n\t{\n\t\tHHOOK hMsgHook;\n\t\tDWORD dwUsage;\n\n\t\t_MsgHookData() : hMsgHook(NULL), dwUsage(0)\n\t\t{ }\n\t};\n\n\ttypedef ATL::CSimpleMap<DWORD, _MsgHookData*>   CMsgHookMap;\n\tstatic CMsgHookMap* s_pmapMsgHook;\n\n\tstatic HHOOK s_hCreateHook;\n\tstatic CCommandBarCtrlBase* s_pCurrentBar;\n\tstatic bool s_bStaticInit;\n\n\tCSimpleStack<HWND> m_stackMenuWnd;\n\tCSimpleStack<HMENU> m_stackMenuHandle;\n\n\tHWND m_hWndHook;\n\tDWORD m_dwMagic;\n\n\n\tCCommandBarCtrlBase() : m_hWndHook(NULL), m_dwMagic(1314)\n\t{\n\t\t// init static variables\n\t\tif(!s_bStaticInit)\n\t\t{\n\t\t\tCStaticDataInitCriticalSectionLock lock;\n\t\t\tif(FAILED(lock.Lock()))\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CCommandBarCtrlBase::CCommandBarCtrlBase.\\n\"));\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(!s_bStaticInit)\n\t\t\t{\n\t\t\t\t// Just in case...\n\t\t\t\tAtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES);\n\t\t\t\t// done\n\t\t\t\ts_bStaticInit = true;\n\t\t\t}\n\n\t\t\tlock.Unlock();\n\t\t}\n\t}\n\n\tbool IsCommandBarBase() const { return m_dwMagic == 1314; }\n};\n\n__declspec(selectany) CCommandBarCtrlBase::CMsgHookMap* CCommandBarCtrlBase::s_pmapMsgHook = NULL;\n__declspec(selectany) HHOOK CCommandBarCtrlBase::s_hCreateHook = NULL;\n__declspec(selectany) CCommandBarCtrlBase* CCommandBarCtrlBase::s_pCurrentBar = NULL;\n__declspec(selectany) bool CCommandBarCtrlBase::s_bStaticInit = false;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CCommandBarCtrl - ATL implementation of Command Bars\n\ntemplate <class T, class TBase = CCommandBarCtrlBase, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >\n{\npublic:\n\tDECLARE_WND_SUPERCLASS2(NULL, T, TBase::GetWndClassName())\n\n// Declarations\n\tstruct _MenuItemData\t// menu item data\n\t{\n\t\tDWORD dwMagic;\n\t\tLPTSTR lpstrText;\n\t\tUINT fType;\n\t\tUINT fState;\n\t\tint iButton;\n\n\t\t_MenuItemData() : dwMagic(0x1313), lpstrText(NULL), fType(0U), fState(0U), iButton(0)\n\t\t{ }\n\n\t\tbool IsCmdBarMenuItem() { return (dwMagic == 0x1313); }\n\t};\n\n\tstruct _ToolBarData\t// toolbar resource data\n\t{\n\t\tWORD wVersion;\n\t\tWORD wWidth;\n\t\tWORD wHeight;\n\t\tWORD wItemCount;\n\t\t//WORD aItems[wItemCount]\n\n\t\tWORD* items()\n\t\t\t{ return (WORD*)(this+1); }\n\t};\n\n// Constants\n\tenum _CmdBarDrawConstants\n\t{\n\t\ts_kcxGap = 1,\n\t\ts_kcxTextMargin = 2,\n\t\ts_kcxButtonMargin = 3,\n\t\ts_kcyButtonMargin = 3\n\t};\n\n\tenum\n\t{\n\t\t_nMaxMenuItemTextLength = 100,\n\t\t_chChevronShortcut = _T('/')\n\t};\n\n// Data members\n\tHMENU m_hMenu;\n\tHIMAGELIST m_hImageList;\n\tATL::CSimpleValArray<WORD> m_arrCommand;\n\n\tDWORD m_dwExtendedStyle;   // Command Bar specific extended styles\n\n\tATL::CContainedWindow m_wndParent;\n\n\tbool m_bMenuActive:1;\n\tbool m_bAttachedMenu:1;\n\tbool m_bImagesVisible:1;\n\tbool m_bPopupItem:1;\n\tbool m_bContextMenu:1;\n\tbool m_bEscapePressed:1;\n\tbool m_bSkipMsg:1;\n\tbool m_bParentActive:1;\n\tbool m_bFlatMenus:1;\n\tbool m_bUseKeyboardCues:1;\n\tbool m_bShowKeyboardCues:1;\n\tbool m_bAllowKeyboardCues:1;\n\tbool m_bKeyboardInput:1;\n\tbool m_bAlphaImages:1;\n\tbool m_bLayoutRTL:1;\n\tbool m_bSkipPostDown:1;\n\tbool m_bVistaMenus:1;\n\n\tint m_nPopBtn;\n\tint m_nNextPopBtn;\n\n\tSIZE m_szBitmap;\n\tSIZE m_szButton;\n\n\tCOLORREF m_clrMask;\n\tCFont m_fontMenu;   // used internally, only to measure text\n\n\tUINT m_uSysKey;\n\n\tHWND m_hWndFocus;   // Alternate focus mode\n\n\tint m_cxExtraSpacing;\n\n#if _WTL_CMDBAR_VISTA_MENUS\n\tATL::CSimpleValArray<HBITMAP> m_arrVistaBitmap;   // Bitmaps for Vista menus\n#endif // _WTL_CMDBAR_VISTA_MENUS\n\n// Constructor/destructor\n\tCCommandBarCtrlImpl() : \n\t\t\tm_hMenu(NULL), \n\t\t\tm_hImageList(NULL), \n\t\t\tm_dwExtendedStyle(CBR_EX_TRANSPARENT | CBR_EX_SHAREMENU | CBR_EX_TRACKALWAYS),\n\t\t\tm_wndParent(this, 1),\n\t\t\tm_bMenuActive(false), \n\t\t\tm_bAttachedMenu(false), \n\t\t\tm_bImagesVisible(true),\n\t\t\tm_bPopupItem(false),\n\t\t\tm_bContextMenu(false),\n\t\t\tm_bEscapePressed(false),\n\t\t\tm_bSkipMsg(false),\n\t\t\tm_bParentActive(true),\n\t\t\tm_bFlatMenus(false),\n\t\t\tm_bUseKeyboardCues(false),\n\t\t\tm_bShowKeyboardCues(false),\n\t\t\tm_bAllowKeyboardCues(true),\n\t\t\tm_bKeyboardInput(false),\n\t\t\tm_bAlphaImages(false),\n\t\t\tm_bLayoutRTL(false),\n\t\t\tm_bSkipPostDown(false),\n\t\t\tm_bVistaMenus(false),\n\t\t\tm_nPopBtn(-1),\n\t\t\tm_nNextPopBtn(-1), \n\t\t\tm_clrMask(RGB(192, 192, 192)),\n\t\t\tm_uSysKey(0),\n\t\t\tm_hWndFocus(NULL),\n\t\t\tm_cxExtraSpacing(0)\n\t{\n\t\tSetImageSize(16, 15);   // default\n \t}\n\n\t~CCommandBarCtrlImpl()\n\t{\n\t\tif(m_wndParent.IsWindow())\n/*scary!*/\t\t\tm_wndParent.UnsubclassWindow();\n\n\t\tif((m_hMenu != NULL) && ((m_dwExtendedStyle & CBR_EX_SHAREMENU) == 0))\n\t\t\t::DestroyMenu(m_hMenu);\n\n\t\tif(m_hImageList != NULL)\n\t\t\t::ImageList_Destroy(m_hImageList);\n\t}\n\n// Attributes\n\tDWORD GetCommandBarExtendedStyle() const\n\t{\n\t\treturn m_dwExtendedStyle;\n\t}\n\n\tDWORD SetCommandBarExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\n\t{\n\t\tDWORD dwPrevStyle = m_dwExtendedStyle;\n\t\tif(dwMask == 0)\n\t\t\tm_dwExtendedStyle = dwExtendedStyle;\n\t\telse\n\t\t\tm_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\n\t\treturn dwPrevStyle;\n\t}\n\n\tCMenuHandle GetMenu() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn m_hMenu;\n\t}\n\n\tCOLORREF GetImageMaskColor() const\n\t{\n\t\treturn m_clrMask;\n\t}\n\n\tCOLORREF SetImageMaskColor(COLORREF clrMask)\n\t{\n\t\tCOLORREF clrOld = m_clrMask;\n\t\tm_clrMask = clrMask;\n\t\treturn clrOld;\n\t}\n\n\tbool GetImagesVisible() const\n\t{\n\t\treturn m_bImagesVisible;\n\t}\n\n\tbool SetImagesVisible(bool bVisible)\n\t{\n\t\tbool bOld = m_bImagesVisible;\n\t\tm_bImagesVisible = bVisible;\n\t\treturn bOld;\n\t}\n\n\tvoid GetImageSize(SIZE& size) const\n\t{\n\t\tsize = m_szBitmap;\n\t}\n\n\tbool SetImageSize(SIZE& size)\n\t{\n\t\treturn SetImageSize(size.cx, size.cy);\n\t}\n\n\tbool SetImageSize(int cx, int cy)\n\t{\n\t\tif(m_hImageList != NULL)\n\t\t{\n\t\t\tif(::ImageList_GetImageCount(m_hImageList) == 0)   // empty\n\t\t\t{\n\t\t\t\t::ImageList_Destroy(m_hImageList);\n\t\t\t\tm_hImageList = NULL;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;   // can't set, image list exists\n\t\t\t}\n\t\t}\n\n\t\tif((cx == 0) || (cy == 0))\n\t\t\treturn false;\n\n\t\tm_szBitmap.cx = cx;\n\t\tm_szBitmap.cy = cy;\n\t\tm_szButton.cx = m_szBitmap.cx + 2 * s_kcxButtonMargin;\n\t\tm_szButton.cy = m_szBitmap.cy + 2 * s_kcyButtonMargin;\n\n\t\treturn true;\n\t}\n\n\tbool GetAlphaImages() const\n\t{\n\t\treturn m_bAlphaImages;\n\t}\n\n\tbool SetAlphaImages(bool bAlphaImages)\n\t{\n\t\tif(m_hImageList != NULL)\n\t\t{\n\t\t\tif(::ImageList_GetImageCount(m_hImageList) == 0)   // empty\n\t\t\t{\n\t\t\t\t::ImageList_Destroy(m_hImageList);\n\t\t\t\tm_hImageList = NULL;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;   // can't set, image list exists\n\t\t\t}\n\t\t}\n\n\t\tm_bAlphaImages = bAlphaImages;\n\t\treturn true;\n\t}\n\n\tHWND GetCmdBar() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn (HWND)::SendMessage(this->m_hWnd, CBRM_GETCMDBAR, 0, 0L);\n\t}\n\n// Methods\n\tHWND Create(HWND hWndParent, RECT& rcPos, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tUINT nID = 0, LPVOID lpCreateParam = NULL)\n\t{\n\t\t// These styles are required for command bars\n\t\tdwStyle |= TBSTYLE_LIST | TBSTYLE_FLAT;\n\t\treturn ATL::CWindowImpl< T, TBase, TWinTraits >::Create(hWndParent, rcPos, szWindowName, dwStyle, dwExStyle, nID, lpCreateParam);\n\t}\n\n\tBOOL AttachToWindow(HWND hWnd)\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);\n\t\tATLASSERT(::IsWindow(hWnd));\n\t\tBOOL bRet = this->SubclassWindow(hWnd);\n\t\tif(bRet)\n\t\t{\n\t\t\tm_bAttachedMenu = true;\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->GetSystemSettings();\n\t\t}\n\t\treturn bRet;\n\t}\n\n\tBOOL LoadMenu(ATL::_U_STRINGorID menu)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\n\t\tif(m_bAttachedMenu)   // doesn't work in this mode\n\t\t\treturn FALSE;\n\t\tif(menu.m_lpstr == NULL)\n\t\t\treturn FALSE;\n\n\t\tHMENU hMenu = ::LoadMenu(ModuleHelper::GetResourceInstance(), menu.m_lpstr);\n\t\tif(hMenu == NULL)\n\t\t\treturn FALSE;\n\n\t\treturn AttachMenu(hMenu);\n\t}\n\n\tBOOL AttachMenu(HMENU hMenu)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((hMenu == NULL) || ::IsMenu(hMenu));\n\t\tif((hMenu != NULL) && !::IsMenu(hMenu))\n\t\t\treturn FALSE;\n\n#if _WTL_CMDBAR_VISTA_MENUS\n\t\t// remove Vista bitmaps if used\n\t\tif(m_bVistaMenus && (m_hMenu != NULL))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->_RemoveVistaBitmapsFromMenu();\n\t\t}\n#endif // _WTL_CMDBAR_VISTA_MENUS\n\n\t\t// destroy old menu, if needed, and set new one\n\t\tif((m_hMenu != NULL) && ((m_dwExtendedStyle & CBR_EX_SHAREMENU) == 0))\n\t\t\t::DestroyMenu(m_hMenu);\n\n\t\tm_hMenu = hMenu;\n\n\t\tif(m_bAttachedMenu)   // Nothing else in this mode\n\t\t\treturn TRUE;\n\n\t\t// Build buttons according to menu\n\t\tthis->SetRedraw(FALSE);\n\n\t\t// Clear all buttons\n\t\tint nCount = this->GetButtonCount();\n\t\tfor(int i = 0; i < nCount; i++)\n\t\t\tATLVERIFY(this->DeleteButton(0) != FALSE);\n\n\t\t// Add buttons for each menu item\n\t\tif(m_hMenu != NULL)\n\t\t{\n\t\t\tint nItems = ::GetMenuItemCount(m_hMenu);\n\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t(void)pT;   // avoid level 4 warning\n\t\t\tTCHAR szString[pT->_nMaxMenuItemTextLength] = {};\n\t\t\tfor(int i = 0; i < nItems; i++)\n\t\t\t{\n\t\t\t\tCMenuItemInfo mii;\n\t\t\t\tmii.fMask = MIIM_TYPE | MIIM_STATE | MIIM_SUBMENU;\n\t\t\t\tmii.fType = MFT_STRING;\n\t\t\t\tmii.dwTypeData = szString;\n\t\t\t\tmii.cch = pT->_nMaxMenuItemTextLength;\n\t\t\t\tBOOL bRet = ::GetMenuItemInfo(m_hMenu, i, TRUE, &mii);\n\t\t\t\tATLASSERT(bRet);\n\t\t\t\t// If we have more than the buffer, we assume we have bitmaps bits\n\t\t\t\tif(lstrlen(szString) > pT->_nMaxMenuItemTextLength - 1)\n\t\t\t\t{\n\t\t\t\t\tmii.fType = MFT_BITMAP;\n\t\t\t\t\t::SetMenuItemInfo(m_hMenu, i, TRUE, &mii);\n\t\t\t\t\tszString[0] = 0;\n\t\t\t\t}\n\n\t\t\t\t// NOTE: Command Bar currently supports only drop-down menu items\n\t\t\t\tATLASSERT(mii.hSubMenu != NULL);\n\n\t\t\t\tTBBUTTON btn = {};\n\t\t\t\tbtn.iBitmap = 0;\n\t\t\t\tbtn.idCommand = i;\n\t\t\t\tbtn.fsState = (BYTE)(((mii.fState & MFS_DISABLED) == 0) ? TBSTATE_ENABLED : 0);\n\t\t\t\tbtn.fsStyle = BTNS_BUTTON | BTNS_AUTOSIZE | BTNS_DROPDOWN;\n\t\t\t\tbtn.dwData = 0;\n\t\t\t\tbtn.iString = 0;\n\n\t\t\t\tbRet = this->InsertButton(-1, &btn);\n\t\t\t\tATLASSERT(bRet);\n\n\t\t\t\tTBBUTTONINFO bi = {};\n\t\t\t\tbi.cbSize = sizeof(TBBUTTONINFO);\n\t\t\t\tbi.dwMask = TBIF_TEXT;\n\t\t\t\tbi.pszText = szString;\n\n\t\t\t\tbRet = this->SetButtonInfo(i, &bi);\n\t\t\t\tATLASSERT(bRet);\n\t\t\t}\n\t\t}\n\n\t\tthis->SetRedraw(TRUE);\n\t\tthis->Invalidate();\n\t\tthis->UpdateWindow();\n\n\t\treturn TRUE;\n\t}\n\n\tBOOL LoadImages(ATL::_U_STRINGorID image)\n\t{\n\t\treturn _LoadImagesHelper(image, false);\n\t}\n\n\tBOOL LoadMappedImages(UINT nIDImage, UINT nFlags = 0, LPCOLORMAP lpColorMap = NULL, int nMapSize = 0)\n\t{\n\t\treturn _LoadImagesHelper(nIDImage, true, nFlags , lpColorMap, nMapSize);\n\t}\n\n\tBOOL _LoadImagesHelper(ATL::_U_STRINGorID image, bool bMapped, UINT nFlags = 0, LPCOLORMAP lpColorMap = NULL, int nMapSize = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tHINSTANCE hInstance = ModuleHelper::GetResourceInstance();\n\n\t\tHRSRC hRsrc = ::FindResource(hInstance, image.m_lpstr, (LPTSTR)RT_TOOLBAR);\n\t\tif(hRsrc == NULL)\n\t\t\treturn FALSE;\n\n\t\tHGLOBAL hGlobal = ::LoadResource(hInstance, hRsrc);\n\t\tif(hGlobal == NULL)\n\t\t\treturn FALSE;\n\n\t\t_ToolBarData* pData = (_ToolBarData*)::LockResource(hGlobal);\n\t\tif(pData == NULL)\n\t\t\treturn FALSE;\n\t\tATLASSERT(pData->wVersion == 1);\n\n\t\tWORD* pItems = pData->items();\n\t\tint nItems = pData->wItemCount;\n\n\t\t// Set internal data\n\t\tSetImageSize(pData->wWidth, pData->wHeight);\n\n\t\t// Create image list if needed\n\t\tif(m_hImageList == NULL)\n\t\t{\n\t\t\t// Check if the bitmap is 32-bit (alpha channel) bitmap (valid for Windows XP only)\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tm_bAlphaImages = AtlIsAlphaBitmapResource(image);\n\n\t\t\tif(!pT->CreateInternalImageList(pData->wItemCount))\n\t\t\t\treturn FALSE;\n\t\t}\n\n#if _WTL_CMDBAR_VISTA_MENUS\n\t\tint nOldImageCount = ::ImageList_GetImageCount(m_hImageList);\n#endif // _WTL_CMDBAR_VISTA_MENUS\n\n\t\t// Add bitmap to our image list\n\t\tCBitmap bmp;\n\t\tif(bMapped)\n\t\t{\n\t\t\tATLASSERT(HIWORD(PtrToUlong(image.m_lpstr)) == 0);   // if mapped, must be a numeric ID\n\t\t\tint nIDImage = (int)(short)LOWORD(PtrToUlong(image.m_lpstr));\n\t\t\tbmp.LoadMappedBitmap(nIDImage, (WORD)nFlags, lpColorMap, nMapSize);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(m_bAlphaImages)\n\t\t\t\tbmp = (HBITMAP)::LoadImage(ModuleHelper::GetResourceInstance(), image.m_lpstr, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_DEFAULTSIZE);\n\t\t\telse\n\t\t\t\tbmp.LoadBitmap(image.m_lpstr);\n\t\t}\n\t\tATLASSERT(bmp.m_hBitmap != NULL);\n\t\tif(bmp.m_hBitmap == NULL)\n\t\t\treturn FALSE;\n\t\tif(::ImageList_AddMasked(m_hImageList, bmp, m_clrMask) == -1)\n\t\t\treturn FALSE;\n\n\t\t// Fill the array with command IDs\n\t\tfor(int i = 0; i < nItems; i++)\n\t\t{\n\t\t\tif(pItems[i] != 0)\n\t\t\t\tm_arrCommand.Add(pItems[i]);\n\t\t}\n\n\t\tint nImageCount = ::ImageList_GetImageCount(m_hImageList);\n\t\tATLASSERT(nImageCount == m_arrCommand.GetSize());\n\t\tif(nImageCount != m_arrCommand.GetSize())\n\t\t\treturn FALSE;\n\n#if _WTL_CMDBAR_VISTA_MENUS\n\t\tif(RunTimeHelper::IsVista())\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->_AddVistaBitmapsFromImageList(nOldImageCount, nImageCount - nOldImageCount);\n\t\t\tATLASSERT(nImageCount == m_arrVistaBitmap.GetSize());\n\t\t}\n#endif // _WTL_CMDBAR_VISTA_MENUS\n\n\t\treturn TRUE;\n\t}\n\n\tBOOL AddBitmap(ATL::_U_STRINGorID bitmap, int nCommandID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tCBitmap bmp;\n\t\tbmp.LoadBitmap(bitmap.m_lpstr);\n\t\tif(bmp.m_hBitmap == NULL)\n\t\t\treturn FALSE;\n\t\treturn AddBitmap(bmp, nCommandID);\n\t}\n\n\tBOOL AddBitmap(HBITMAP hBitmap, UINT nCommandID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tT* pT = static_cast<T*>(this);\n\t\t// Create image list if it doesn't exist\n\t\tif(m_hImageList == NULL)\n\t\t{\n\t\t\tif(!pT->CreateInternalImageList(1))\n\t\t\t\treturn FALSE;\n\t\t}\n\t\t// check bitmap size\n\t\tCBitmapHandle bmp = hBitmap;\n\t\tSIZE size = {};\n\t\tbmp.GetSize(size);\n\t\tif((size.cx != m_szBitmap.cx) || (size.cy != m_szBitmap.cy))\n\t\t{\n\t\t\tATLASSERT(FALSE);   // must match size!\n\t\t\treturn FALSE;\n\t\t}\n\t\t// add bitmap\n\t\tint nRet = ::ImageList_AddMasked(m_hImageList, hBitmap, m_clrMask);\n\t\tif(nRet == -1)\n\t\t\treturn FALSE;\n\t\tBOOL bRet = m_arrCommand.Add((WORD)nCommandID);\n\t\tATLASSERT(::ImageList_GetImageCount(m_hImageList) == m_arrCommand.GetSize());\n#if _WTL_CMDBAR_VISTA_MENUS\n\t\tif(RunTimeHelper::IsVista())\n\t\t{\n\t\t\tpT->_AddVistaBitmapFromImageList(m_arrCommand.GetSize() - 1);\n\t\t\tATLASSERT(m_arrVistaBitmap.GetSize() == m_arrCommand.GetSize());\n\t\t}\n#endif // _WTL_CMDBAR_VISTA_MENUS\n\t\treturn bRet;\n\t}\n\n\tBOOL AddIcon(ATL::_U_STRINGorID icon, UINT nCommandID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tHICON hIcon = ::LoadIcon(ModuleHelper::GetResourceInstance(), icon.m_lpstr);\n\t\tif(hIcon == NULL)\n\t\t\treturn FALSE;\n\t\treturn AddIcon(hIcon, nCommandID);\n\t}\n\n\tBOOL AddIcon(HICON hIcon, UINT nCommandID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tT* pT = static_cast<T*>(this);\n\t\t// create image list if it doesn't exist\n\t\tif(m_hImageList == NULL)\n\t\t{\n\t\t\tif(!pT->CreateInternalImageList(1))\n\t\t\t\treturn FALSE;\n\t\t}\n\n\t\tint nRet = ::ImageList_AddIcon(m_hImageList, hIcon);\n\t\tif(nRet == -1)\n\t\t\treturn FALSE;\n\t\tBOOL bRet = m_arrCommand.Add((WORD)nCommandID);\n\t\tATLASSERT(::ImageList_GetImageCount(m_hImageList) == m_arrCommand.GetSize());\n#if _WTL_CMDBAR_VISTA_MENUS\n\t\tif(RunTimeHelper::IsVista())\n\t\t{\n\t\t\tpT->_AddVistaBitmapFromImageList(m_arrCommand.GetSize() - 1);\n\t\t\tATLASSERT(m_arrVistaBitmap.GetSize() == m_arrCommand.GetSize());\n\t\t}\n#endif // _WTL_CMDBAR_VISTA_MENUS\n\t\treturn bRet;\n\t}\n\n\tBOOL ReplaceBitmap(ATL::_U_STRINGorID bitmap, int nCommandID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tCBitmap bmp;\n\t\tbmp.LoadBitmap(bitmap.m_lpstr);\n\t\tif(bmp.m_hBitmap == NULL)\n\t\t\treturn FALSE;\n\t\treturn ReplaceBitmap(bmp, nCommandID);\n\t}\n\n\tBOOL ReplaceBitmap(HBITMAP hBitmap, UINT nCommandID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tBOOL bRet = FALSE;\n\t\tfor(int i = 0; i < m_arrCommand.GetSize(); i++)\n\t\t{\n\t\t\tif(m_arrCommand[i] == nCommandID)\n\t\t\t{\n\t\t\t\tbRet = ::ImageList_Remove(m_hImageList, i);\n\t\t\t\tif(bRet)\n\t\t\t\t{\n\t\t\t\t\tm_arrCommand.RemoveAt(i);\n#if _WTL_CMDBAR_VISTA_MENUS\n\t\t\t\t\tif(RunTimeHelper::IsVista())\n\t\t\t\t\t{\n\t\t\t\t\t\tif(m_arrVistaBitmap[i] != NULL)\n\t\t\t\t\t\t\t::DeleteObject(m_arrVistaBitmap[i]);\n\t\t\t\t\t\tm_arrVistaBitmap.RemoveAt(i);\n\t\t\t\t\t}\n#endif // _WTL_CMDBAR_VISTA_MENUS\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(bRet)\n\t\t\tbRet = AddBitmap(hBitmap, nCommandID);\n\t\treturn bRet;\n\t}\n\n\tBOOL ReplaceIcon(ATL::_U_STRINGorID icon, UINT nCommandID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tHICON hIcon = ::LoadIcon(ModuleHelper::GetResourceInstance(), icon.m_lpstr);\n\t\tif(hIcon == NULL)\n\t\t\treturn FALSE;\n\t\treturn ReplaceIcon(hIcon, nCommandID);\n\t}\n\n\tBOOL ReplaceIcon(HICON hIcon, UINT nCommandID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tBOOL bRet = FALSE;\n\t\tfor(int i = 0; i < m_arrCommand.GetSize(); i++)\n\t\t{\n\t\t\tif(m_arrCommand[i] == nCommandID)\n\t\t\t{\n\t\t\t\tbRet = (::ImageList_ReplaceIcon(m_hImageList, i, hIcon) != -1);\n#if _WTL_CMDBAR_VISTA_MENUS\n\t\t\t\tif(RunTimeHelper::IsVista() && (bRet != FALSE))\n\t\t\t\t{\n\t\t\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t\t\tpT->_ReplaceVistaBitmapFromImageList(i);\n\t\t\t\t}\n#endif // _WTL_CMDBAR_VISTA_MENUS\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn bRet;\n\t}\n\n\tBOOL RemoveImage(int nCommandID)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\n\t\tBOOL bRet = FALSE;\n\t\tfor(int i = 0; i < m_arrCommand.GetSize(); i++)\n\t\t{\n\t\t\tif(m_arrCommand[i] == nCommandID)\n\t\t\t{\n\t\t\t\tbRet = ::ImageList_Remove(m_hImageList, i);\n\t\t\t\tif(bRet)\n\t\t\t\t{\n\t\t\t\t\tm_arrCommand.RemoveAt(i);\n#if _WTL_CMDBAR_VISTA_MENUS\n\t\t\t\t\tif(RunTimeHelper::IsVista())\n\t\t\t\t\t{\n\t\t\t\t\t\tif(m_arrVistaBitmap[i] != NULL)\n\t\t\t\t\t\t\t::DeleteObject(m_arrVistaBitmap[i]);\n\t\t\t\t\t\tm_arrVistaBitmap.RemoveAt(i);\n\t\t\t\t\t}\n#endif // _WTL_CMDBAR_VISTA_MENUS\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn bRet;\n\t}\n\n\tBOOL RemoveAllImages()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - Removing all images\\n\"));\n\t\tBOOL bRet = ::ImageList_RemoveAll(m_hImageList);\n\t\tif(bRet)\n\t\t{\n\t\t\tm_arrCommand.RemoveAll();\n#if _WTL_CMDBAR_VISTA_MENUS\n\t\t\tfor(int i = 0; i < m_arrVistaBitmap.GetSize(); i++)\n\t\t\t{\n\t\t\t\tif(m_arrVistaBitmap[i] != NULL)\n\t\t\t\t\t::DeleteObject(m_arrVistaBitmap[i]);\n\t\t\t}\n\t\t\tm_arrVistaBitmap.RemoveAll();\n#endif // _WTL_CMDBAR_VISTA_MENUS\n\t\t}\n\t\treturn bRet;\n\t}\n\n\tBOOL TrackPopupMenu(HMENU hMenu, UINT uFlags, int x, int y, LPTPMPARAMS lpParams = NULL)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(::IsMenu(hMenu));\n\t\tif(!::IsMenu(hMenu))\n\t\t\treturn FALSE;\n\t\tm_bContextMenu = true;\n\t\tif(m_bUseKeyboardCues)\n\t\t\tm_bShowKeyboardCues = m_bKeyboardInput;\n\t\tT* pT = static_cast<T*>(this);\n\t\treturn pT->DoTrackPopupMenu(hMenu, uFlags, x, y, lpParams);\n\t}\n\n\tBOOL SetMDIClient(HWND /*hWndMDIClient*/)\n\t{\n\t\t// Use CMDICommandBarCtrl for MDI support\n\t\tATLASSERT(FALSE);\n\t\treturn FALSE;\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CCommandBarCtrlImpl)\n\t\tMESSAGE_HANDLER(WM_CREATE, OnCreate)\n\t\tMESSAGE_HANDLER(WM_DESTROY, OnDestroy)\n\t\tMESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\n\t\tMESSAGE_HANDLER(WM_INITMENU, OnInitMenu)\n\t\tMESSAGE_HANDLER(WM_INITMENUPOPUP, OnInitMenuPopup)\n\t\tMESSAGE_HANDLER(WM_MENUSELECT, OnMenuSelect)\n\t\tMESSAGE_HANDLER(GetAutoPopupMessage(), OnInternalAutoPopup)\n\t\tMESSAGE_HANDLER(GetGetBarMessage(), OnInternalGetBar)\n\t\tMESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)\n\t\tMESSAGE_HANDLER(WM_MENUCHAR, OnMenuChar)\n\t\tMESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus)\n\n\t\tMESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)\n\t\tMESSAGE_HANDLER(WM_KEYUP, OnKeyUp)\n\t\tMESSAGE_HANDLER(WM_CHAR, OnChar)\n\t\tMESSAGE_HANDLER(WM_SYSKEYDOWN, OnSysKeyDown)\n\t\tMESSAGE_HANDLER(WM_SYSKEYUP, OnSysKeyUp)\n\t\tMESSAGE_HANDLER(WM_SYSCHAR, OnSysChar)\n// public API handlers - these stay to support chevrons in atlframe.h\n\t\tMESSAGE_HANDLER(CBRM_GETMENU, OnAPIGetMenu)\n\t\tMESSAGE_HANDLER(CBRM_TRACKPOPUPMENU, OnAPITrackPopupMenu)\n\t\tMESSAGE_HANDLER(CBRM_GETCMDBAR, OnAPIGetCmdBar)\n\n\t\tMESSAGE_HANDLER(WM_DRAWITEM, OnDrawItem)\n\t\tMESSAGE_HANDLER(WM_MEASUREITEM, OnMeasureItem)\n\n\t\tMESSAGE_HANDLER(WM_FORWARDMSG, OnForwardMsg)\n\tALT_MSG_MAP(1)   // Parent window messages\n\t\tNOTIFY_CODE_HANDLER(TBN_HOTITEMCHANGE, OnParentHotItemChange)\n\t\tNOTIFY_CODE_HANDLER(TBN_DROPDOWN, OnParentDropDown)\n\t\tMESSAGE_HANDLER(WM_INITMENUPOPUP, OnParentInitMenuPopup)\n\t\tMESSAGE_HANDLER(GetGetBarMessage(), OnParentInternalGetBar)\n\t\tMESSAGE_HANDLER(WM_SYSCOMMAND, OnParentSysCommand)\n\t\tMESSAGE_HANDLER(CBRM_GETMENU, OnParentAPIGetMenu)\n\t\tMESSAGE_HANDLER(WM_MENUCHAR, OnParentMenuChar)\n\t\tMESSAGE_HANDLER(CBRM_TRACKPOPUPMENU, OnParentAPITrackPopupMenu)\n\t\tMESSAGE_HANDLER(CBRM_GETCMDBAR, OnParentAPIGetCmdBar)\n\t\tMESSAGE_HANDLER(WM_SETTINGCHANGE, OnParentSettingChange)\n\n\t\tMESSAGE_HANDLER(WM_DRAWITEM, OnParentDrawItem)\n\t\tMESSAGE_HANDLER(WM_MEASUREITEM, OnParentMeasureItem)\n\n\t\tMESSAGE_HANDLER(WM_ACTIVATE, OnParentActivate)\n\t\tNOTIFY_CODE_HANDLER(NM_CUSTOMDRAW, OnParentCustomDraw)\n\tALT_MSG_MAP(2)   // MDI client window messages\n\t\t// Use CMDICommandBarCtrl for MDI support\n\tALT_MSG_MAP(3)   // Message hook messages\n\t\tMESSAGE_HANDLER(WM_MOUSEMOVE, OnHookMouseMove)\n\t\tMESSAGE_HANDLER(WM_SYSKEYDOWN, OnHookSysKeyDown)\n\t\tMESSAGE_HANDLER(WM_SYSKEYUP, OnHookSysKeyUp)\n\t\tMESSAGE_HANDLER(WM_SYSCHAR, OnHookSysChar)\n\t\tMESSAGE_HANDLER(WM_KEYDOWN, OnHookKeyDown)\n\t\tMESSAGE_HANDLER(WM_NEXTMENU, OnHookNextMenu)\n\t\tMESSAGE_HANDLER(WM_CHAR, OnHookChar)\n\tEND_MSG_MAP()\n\n\tLRESULT OnForwardMsg(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tLPMSG pMsg = (LPMSG)lParam;\n\t\tif((pMsg->message >= WM_MOUSEFIRST) && (pMsg->message <= WM_MOUSELAST))\n\t\t\tm_bKeyboardInput = false;\n\t\telse if((pMsg->message >= WM_KEYFIRST) && (pMsg->message <= WM_KEYLAST))\n\t\t\tm_bKeyboardInput = true;\n\t\tLRESULT lRet = 0;\n\t\tProcessWindowMessage(pMsg->hwnd, pMsg->message, pMsg->wParam, pMsg->lParam, lRet, 3);\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\t// Let the toolbar initialize itself\n\t\tLRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);\n\t\t// get and use system settings\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->GetSystemSettings();\n\t\t// Parent init\n\t\tATL::CWindow wndParent = this->GetParent();\n\t\tATL::CWindow wndTopLevelParent = wndParent.GetTopLevelParent();\n\t\tm_wndParent.SubclassWindow(wndTopLevelParent);\n\t\t// Toolbar Init\n\t\tthis->SetButtonStructSize();\n\t\tthis->SetImageList(NULL);\n\n\t\t// Create message hook if needed\n\t\tCWindowCreateCriticalSectionLock lock;\n\t\tif(FAILED(lock.Lock()))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CCommandBarCtrlImpl::OnCreate.\\n\"));\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn -1;\n\t\t}\n\n\t\tif(this->s_pmapMsgHook == NULL)\n\t\t{\n\t\t\tATLTRY(this->s_pmapMsgHook = new CCommandBarCtrlBase::CMsgHookMap);\n\t\t\tATLASSERT(this->s_pmapMsgHook != NULL);\n\t\t}\n\n\t\tif(this->s_pmapMsgHook != NULL)\n\t\t{\n\t\t\tDWORD dwThreadID = ::GetCurrentThreadId();\n\t\t\tCCommandBarCtrlBase::_MsgHookData* pData = this->s_pmapMsgHook->Lookup(dwThreadID);\n\t\t\tif(pData == NULL)\n\t\t\t{\n\t\t\t\tATLTRY(pData = new CCommandBarCtrlBase::_MsgHookData);\n\t\t\t\tATLASSERT(pData != NULL);\n\t\t\t\tHHOOK hMsgHook = ::SetWindowsHookEx(WH_GETMESSAGE, MessageHookProc, ModuleHelper::GetModuleInstance(), dwThreadID);\n\t\t\t\tATLASSERT(hMsgHook != NULL);\n\t\t\t\tif((pData != NULL) && (hMsgHook != NULL))\n\t\t\t\t{\n\t\t\t\t\tpData->hMsgHook = hMsgHook;\n\t\t\t\t\tpData->dwUsage = 1;\n\t\t\t\t\tBOOL bRet = this->s_pmapMsgHook->Add(dwThreadID, pData);\n\t\t\t\t\t(void)bRet;   // avoid level 4 warning\n\t\t\t\t\tATLASSERT(bRet);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t(pData->dwUsage)++;\n\t\t\t}\n\t\t}\n\t\tlock.Unlock();\n\n\t\t// Get layout\n\t\tm_bLayoutRTL = ((this->GetExStyle() & WS_EX_LAYOUTRTL) != 0);\n\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tLRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);\n\n#if _WTL_CMDBAR_VISTA_MENUS\n\t\tif(m_bVistaMenus && (m_hMenu != NULL))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->_RemoveVistaBitmapsFromMenu();\n\t\t}\n\n\t\tfor(int i = 0; i < m_arrVistaBitmap.GetSize(); i++)\n\t\t{\n\t\t\tif(m_arrVistaBitmap[i] != NULL)\n\t\t\t\t::DeleteObject(m_arrVistaBitmap[i]);\n\t\t}\n#endif // _WTL_CMDBAR_VISTA_MENUS\n\n\t\tif(m_bAttachedMenu)   // nothing to do in this mode\n\t\t\treturn lRet;\n\n\t\tCWindowCreateCriticalSectionLock lock;\n\t\tif(FAILED(lock.Lock()))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CCommandBarCtrlImpl::OnDestroy.\\n\"));\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn lRet;\n\t\t}\n\n\t\tif(this->s_pmapMsgHook != NULL)\n\t\t{\n\t\t\tDWORD dwThreadID = ::GetCurrentThreadId();\n\t\t\tCCommandBarCtrlBase::_MsgHookData* pData = this->s_pmapMsgHook->Lookup(dwThreadID);\n\t\t\tif(pData != NULL)\n\t\t\t{\n\t\t\t\t(pData->dwUsage)--;\n\t\t\t\tif(pData->dwUsage == 0)\n\t\t\t\t{\n\t\t\t\t\tBOOL bRet = ::UnhookWindowsHookEx(pData->hMsgHook);\n\t\t\t\t\tATLASSERT(bRet);\n\t\t\t\t\tbRet = this->s_pmapMsgHook->Remove(dwThreadID);\n\t\t\t\t\tATLASSERT(bRet);\n\t\t\t\t\tif(bRet)\n\t\t\t\t\t\tdelete pData;\n\t\t\t\t}\n\n\t\t\t\tif(this->s_pmapMsgHook->GetSize() == 0)\n\t\t\t\t{\n\t\t\t\t\tdelete this->s_pmapMsgHook;\n\t\t\t\t\tthis->s_pmapMsgHook = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlock.Unlock();\n\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - OnKeyDown\\n\"));\n#endif\n\t\tif(m_bAttachedMenu)   // nothing to do in this mode\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\t// Simulate Alt+Space for the parent\n\t\tif(wParam == VK_SPACE)\n\t\t{\n\t\t\tm_wndParent.PostMessage(WM_SYSKEYDOWN, wParam, lParam | (1 << 29));\n\t\t\tbHandled = TRUE;\n\t\t}\n\t\telse if((wParam == VK_LEFT) || (wParam == VK_RIGHT))\n\t\t{\n\t\t\tWPARAM wpNext = m_bLayoutRTL ? VK_LEFT : VK_RIGHT;\n\n\t\t\tif(!m_bMenuActive)\n\t\t\t{\n\t\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t\tint nBtn = this->GetHotItem();\n\t\t\t\tint nNextBtn = (wParam == wpNext) ? pT->GetNextMenuItem(nBtn) : pT->GetPreviousMenuItem(nBtn);\n\t\t\t\tif(nNextBtn == -2)\n\t\t\t\t{\n\t\t\t\t\tthis->SetHotItem(-1);\n\t\t\t\t\tif(pT->DisplayChevronMenu())\n\t\t\t\t\t\tbHandled = TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnKeyUp(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - OnKeyUp\\n\"));\n#endif\n\t\tif(m_bAttachedMenu)   // nothing to do in this mode\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\n\t\tif(wParam != VK_SPACE)\n\t\t\tbHandled = FALSE;\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - OnChar\\n\"));\n#endif\n\t\tif(m_bAttachedMenu)   // nothing to do in this mode\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\n\t\tif(wParam != VK_SPACE)\n\t\t\tbHandled = FALSE;\n\t\telse\n\t\t\treturn 0;\n\t\t// Security\n\t\tif(!m_wndParent.IsWindowEnabled() || (::GetFocus() != this->m_hWnd))\n\t\t\treturn 0;\n\n\t\t// Handle mnemonic press when we have focus\n\t\tint nBtn = 0;\n\t\tif((wParam != VK_RETURN) && !this->MapAccelerator((TCHAR)LOWORD(wParam), nBtn))\n\t\t{\n\t\t\tif((TCHAR)LOWORD(wParam) != _chChevronShortcut)\n\t\t\t\t::MessageBeep(0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tRECT rcClient = {};\n\t\t\tthis->GetClientRect(&rcClient);\n\t\t\tRECT rcBtn = {};\n\t\t\tthis->GetItemRect(nBtn, &rcBtn);\n\t\t\tTBBUTTON tbb = {};\n\t\t\tthis->GetButton(nBtn, &tbb);\n\t\t\tif(((tbb.fsState & TBSTATE_ENABLED) != 0) && ((tbb.fsState & TBSTATE_HIDDEN) == 0) && (rcBtn.right <= rcClient.right))\n\t\t\t{\n\t\t\t\tthis->PostMessage(WM_KEYDOWN, VK_DOWN, 0L);\n\t\t\t\tif(wParam != VK_RETURN)\n\t\t\t\t\tthis->SetHotItem(nBtn);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t::MessageBeep(0);\n\t\t\t\tbHandled = TRUE;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSysKeyDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - OnSysKeyDown\\n\"));\n#endif\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSysKeyUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - OnSysKeyUp\\n\"));\n#endif\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSysChar(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - OnSysChar\\n\"));\n#endif\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(m_bAttachedMenu || (m_dwExtendedStyle & CBR_EX_TRANSPARENT))\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 0;\n\t\t}\n\n\t\tCDCHandle dc = (HDC)wParam;\n\t\tRECT rect = {};\n\t\tthis->GetClientRect(&rect);\n\t\tdc.FillRect(&rect, COLOR_MENU);\n\n\t\treturn 1;   // don't do the default erase\n\t}\n\n\tLRESULT OnInitMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tint nIndex = this->GetHotItem();\n\t\tthis->SendMessage(WM_MENUSELECT, MAKEWPARAM(nIndex, MF_POPUP|MF_HILITE), (LPARAM)m_hMenu);\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnInitMenuPopup(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif((BOOL)HIWORD(lParam))   // System menu, do nothing\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\n\t\tif(!(m_bAttachedMenu || m_bMenuActive))   // Not attached or ours, do nothing\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - OnInitMenuPopup\\n\"));\n#endif\n\t\t// forward to the parent or subclassed window, so it can handle update UI\n\t\tLRESULT lRet = 0;\n\t\tif(m_bAttachedMenu)\n\t\t\tlRet = this->DefWindowProc(uMsg, wParam, (lParam || m_bContextMenu) ? lParam : this->GetHotItem());\n\t\telse\n\t\t\tlRet = m_wndParent.DefWindowProc(uMsg, wParam, (lParam || m_bContextMenu) ? lParam : this->GetHotItem());\n\n#if _WTL_CMDBAR_VISTA_MENUS\n\t\t// If Vista menus are active, just set bitmaps and return\n\t\tif(m_bVistaMenus)\n\t\t{\n\t\t\tCMenuHandle menu = (HMENU)wParam;\n\t\t\tATLASSERT(menu.m_hMenu != NULL);\n\n\t\t\tfor(int i = 0; i < menu.GetMenuItemCount(); i++)\n\t\t\t{\n\t\t\t\tWORD nID = (WORD)menu.GetMenuItemID(i);\n\t\t\t\tint nIndex = m_arrCommand.Find(nID);\n\n\t\t\t\tCMenuItemInfo mii;\n\t\t\t\tmii.fMask = MIIM_BITMAP;\n\t\t\t\tmii.hbmpItem = (m_bImagesVisible && (nIndex != -1)) ? m_arrVistaBitmap[nIndex] : NULL;\n\t\t\t\tmenu.SetMenuItemInfo(i, TRUE, &mii);\n\t\t\t}\n\n\t\t\treturn lRet;\n\t\t}\n#endif // _WTL_CMDBAR_VISTA_MENUS\n\n\t\t// Convert menu items to ownerdraw, add our data\n\t\tif(m_bImagesVisible)\n\t\t{\n\t\t\tCMenuHandle menuPopup = (HMENU)wParam;\n\t\t\tATLASSERT(menuPopup.m_hMenu != NULL);\n\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t(void)pT;   // avoid level 4 warning\n\t\t\tTCHAR szString[pT->_nMaxMenuItemTextLength] = {};\n\t\t\tBOOL bRet = FALSE;\n\t\t\tfor(int i = 0; i < menuPopup.GetMenuItemCount(); i++)\n\t\t\t{\n\t\t\t\tCMenuItemInfo mii;\n\t\t\t\tmii.cch = pT->_nMaxMenuItemTextLength;\n\t\t\t\tmii.fMask = MIIM_CHECKMARKS | MIIM_DATA | MIIM_ID | MIIM_STATE | MIIM_SUBMENU | MIIM_TYPE;\n\t\t\t\tmii.dwTypeData = szString;\n\t\t\t\tbRet = menuPopup.GetMenuItemInfo(i, TRUE, &mii);\n\t\t\t\tATLASSERT(bRet);\n\n\t\t\t\tif(!(mii.fType & MFT_OWNERDRAW))   // Not already an ownerdraw item\n\t\t\t\t{\n\t\t\t\t\tmii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_STATE;\n\t\t\t\t\t_MenuItemData* pMI = NULL;\n\t\t\t\t\tATLTRY(pMI = new _MenuItemData);\n\t\t\t\t\tATLASSERT(pMI != NULL);\n\t\t\t\t\tif(pMI != NULL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpMI->fType = mii.fType;\n\t\t\t\t\t\tpMI->fState = mii.fState;\n\t\t\t\t\t\tmii.fType |= MFT_OWNERDRAW;\n\t\t\t\t\t\tpMI->iButton = -1;\n\t\t\t\t\t\tfor(int j = 0; j < m_arrCommand.GetSize(); j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(m_arrCommand[j] == mii.wID)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpMI->iButton = j;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tint cchLen = lstrlen(szString) + 1;\n\t\t\t\t\t\tpMI->lpstrText = NULL;\n\t\t\t\t\t\tATLTRY(pMI->lpstrText = new TCHAR[cchLen]);\n\t\t\t\t\t\tATLASSERT(pMI->lpstrText != NULL);\n\t\t\t\t\t\tif(pMI->lpstrText != NULL)\n\t\t\t\t\t\t\tATL::Checked::tcscpy_s(pMI->lpstrText, cchLen, szString);\n\t\t\t\t\t\tmii.dwItemData = (ULONG_PTR)pMI;\n\t\t\t\t\t\tbRet = menuPopup.SetMenuItemInfo(i, TRUE, &mii);\n\t\t\t\t\t\tATLASSERT(bRet);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add it to the list\n\t\t\tthis->m_stackMenuHandle.Push(menuPopup.m_hMenu);\n\t\t}\n\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnMenuSelect(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif(!m_bAttachedMenu)   // Not attached, do nothing, forward to parent\n\t\t{\n\t\t\tm_bPopupItem = (lParam != NULL) && ((HMENU)lParam != m_hMenu) && (HIWORD(wParam) & MF_POPUP);\n\t\t\tif(m_wndParent.IsWindow())\n\t\t\t\tm_wndParent.SendMessage(uMsg, wParam, lParam);\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\n\t\t// Check if a menu is closing, do a cleanup\n\t\tif((HIWORD(wParam) == 0xFFFF) && (lParam == NULL))   // Menu closing\n\t\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - OnMenuSelect - CLOSING!!!!\\n\"));\n#endif\n\t\t\tATLASSERT(this->m_stackMenuWnd.GetSize() == 0);\n\t\t\t// Restore the menu items to the previous state for all menus that were converted\n\t\t\tif(m_bImagesVisible)\n\t\t\t{\n\t\t\t\tHMENU hMenu = NULL;\n\t\t\t\twhile((hMenu = this->m_stackMenuHandle.Pop()) != NULL)\n\t\t\t\t{\n\t\t\t\t\tCMenuHandle menuPopup = hMenu;\n\t\t\t\t\tATLASSERT(menuPopup.m_hMenu != NULL);\n\t\t\t\t\t// Restore state and delete menu item data\n\t\t\t\t\tBOOL bRet = FALSE;\n\t\t\t\t\tfor(int i = 0; i < menuPopup.GetMenuItemCount(); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tCMenuItemInfo mii;\n\t\t\t\t\t\tmii.fMask = MIIM_DATA | MIIM_TYPE;\n\t\t\t\t\t\tbRet = menuPopup.GetMenuItemInfo(i, TRUE, &mii);\n\t\t\t\t\t\tATLASSERT(bRet);\n\n\t\t\t\t\t\t_MenuItemData* pMI = (_MenuItemData*)mii.dwItemData;\n\t\t\t\t\t\tif(_IsValidMem(pMI) && pMI->IsCmdBarMenuItem())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_STATE;\n\t\t\t\t\t\t\tmii.fType = pMI->fType;\n\t\t\t\t\t\t\tmii.dwTypeData = pMI->lpstrText;\n\t\t\t\t\t\t\tmii.cch = lstrlen(pMI->lpstrText);\n\t\t\t\t\t\t\tmii.dwItemData = NULL;\n\n\t\t\t\t\t\t\tbRet = menuPopup.SetMenuItemInfo(i, TRUE, &mii);\n\t\t\t\t\t\t\tATLASSERT(bRet);\n\n\t\t\t\t\t\t\tdelete [] pMI->lpstrText;\n\t\t\t\t\t\t\tpMI->dwMagic = 0x6666;\n\t\t\t\t\t\t\tdelete pMI;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnInternalAutoPopup(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tint nIndex = (int)wParam;\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->DoPopupMenu(nIndex, false);\n\t\treturn 0;\n\t}\n\n\tLRESULT OnInternalGetBar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\t// Let's make sure we're not embedded in another process\n\t\tif((LPVOID)wParam != NULL)\n\t\t\t*((DWORD*)wParam) = GetCurrentProcessId();\n\t\tif(this->IsWindowVisible())\n\t\t\treturn (LRESULT)static_cast<CCommandBarCtrlBase*>(this);\n\t\telse\n\t\t\treturn NULL;\n\t}\n\n\tLRESULT OnSettingChange(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tif((wParam == SPI_SETNONCLIENTMETRICS) || (wParam == SPI_SETKEYBOARDCUES) || (wParam == SPI_SETFLATMENU))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->GetSystemSettings();\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnWindowPosChanging(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tLRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);\n\n\t\tLPWINDOWPOS lpWP = (LPWINDOWPOS)lParam;\n\t\tint cyMin = ::GetSystemMetrics(SM_CYMENU);\n\t\tif(lpWP->cy < cyMin)\n\t\tlpWP->cy = cyMin;\n\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnMenuChar(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - OnMenuChar\\n\"));\n#endif\n\t\tbHandled = TRUE;\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tLRESULT lRet;\n\t\tif(m_bMenuActive && (LOWORD(wParam) != 0x0D))\n\t\t\tlRet = 0;\n\t\telse\n\t\t\tlRet = MAKELRESULT(1, 1);\n\n\t\tif(m_bMenuActive && (HIWORD(wParam) == MF_POPUP))\n\t\t{\n\t\t\t// Convert character to lower/uppercase and possibly Unicode, using current keyboard layout\n\t\t\tTCHAR ch = (TCHAR)LOWORD(wParam);\n\t\t\tCMenuHandle menu = (HMENU)lParam;\n\t\t\tint nCount = ::GetMenuItemCount(menu);\n\t\t\tint nRetCode = MNC_EXECUTE;\n\t\t\tBOOL bRet = FALSE;\n\t\t\tTCHAR szString[pT->_nMaxMenuItemTextLength] = {};\n\t\t\tWORD wMnem = 0;\n\t\t\tbool bFound = false;\n\t\t\tfor(int i = 0; i < nCount; i++)\n\t\t\t{\n\t\t\t\tCMenuItemInfo mii;\n\t\t\t\tmii.cch = pT->_nMaxMenuItemTextLength;\n\t\t\t\tmii.fMask = MIIM_CHECKMARKS | MIIM_DATA | MIIM_ID | MIIM_STATE | MIIM_SUBMENU | MIIM_TYPE;\n\t\t\t\tmii.dwTypeData = szString;\n\t\t\t\tbRet = menu.GetMenuItemInfo(i, TRUE, &mii);\n\t\t\t\tif(!bRet || (mii.fType & MFT_SEPARATOR))\n\t\t\t\t\tcontinue;\n\t\t\t\t_MenuItemData* pmd = (_MenuItemData*)mii.dwItemData;\n\t\t\t\tif(_IsValidMem(pmd) && pmd->IsCmdBarMenuItem())\n\t\t\t\t{\n\t\t\t\t\tLPTSTR p = pmd->lpstrText;\n\n\t\t\t\t\tif(p != NULL)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(*p && (*p != _T('&')))\n\t\t\t\t\t\t\tp = ::CharNext(p);\n\t\t\t\t\t\tif((p != NULL) && *p)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tDWORD dwP = MAKELONG(*(++p), 0);\n\t\t\t\t\t\t\tDWORD dwC = MAKELONG(ch, 0);\n\t\t\t\t\t\t\tif(::CharLower((LPTSTR)ULongToPtr(dwP)) == ::CharLower((LPTSTR)ULongToPtr(dwC)))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(!bFound)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\twMnem = (WORD)i;\n\t\t\t\t\t\t\t\t\tbFound = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnRetCode = MNC_SELECT;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(bFound)\n\t\t\t{\n\t\t\t\tif(nRetCode == MNC_EXECUTE)\n\t\t\t\t{\n\t\t\t\t\tthis->PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);\n\t\t\t\t\tpT->GiveFocusBack();\n\t\t\t\t}\n\t\t\t\tbHandled = TRUE;\n\t\t\t\tlRet = MAKELRESULT(wMnem, nRetCode);\n\t\t\t}\n\t\t} \n\t\telse if(!m_bMenuActive)\n\t\t{\n\t\t\tint nBtn = 0;\n\t\t\tif(!this->MapAccelerator((TCHAR)LOWORD(wParam), nBtn))\n\t\t\t{\n\t\t\t\tbHandled = FALSE;\n\t\t\t\tthis->PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);\n\t\t\t\tpT->GiveFocusBack();\n\n\t\t\t\t// check if we should display chevron menu\n\t\t\t\tif((TCHAR)LOWORD(wParam) == pT->_chChevronShortcut)\n\t\t\t\t{\n\t\t\t\t\tif(pT->DisplayChevronMenu())\n\t\t\t\t\t\tbHandled = TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(m_wndParent.IsWindowEnabled())\n\t\t\t{\n\t\t\t\tRECT rcClient = {};\n\t\t\t\tthis->GetClientRect(&rcClient);\n\t\t\t\tRECT rcBtn = {};\n\t\t\t\tthis->GetItemRect(nBtn, &rcBtn);\n\t\t\t\tTBBUTTON tbb = {};\n\t\t\t\tthis->GetButton(nBtn, &tbb);\n\t\t\t\tif(((tbb.fsState & TBSTATE_ENABLED) != 0) && ((tbb.fsState & TBSTATE_HIDDEN) == 0) && (rcBtn.right <= rcClient.right))\n\t\t\t\t{\n\t\t\t\t\tif(m_bUseKeyboardCues && !m_bShowKeyboardCues)\n\t\t\t\t\t{\n\t\t\t\t\t\tm_bAllowKeyboardCues = true;\n\t\t\t\t\t\tShowKeyboardCues(true);\n\t\t\t\t\t}\n\t\t\t\t\tpT->TakeFocus();\n\t\t\t\t\tthis->PostMessage(WM_KEYDOWN, VK_DOWN, 0L);\n\t\t\t\t\tthis->SetHotItem(nBtn);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t::MessageBeep(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnKillFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(m_bUseKeyboardCues && m_bShowKeyboardCues)\n\t\t\tShowKeyboardCues(false);\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnDrawItem(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tLPDRAWITEMSTRUCT lpDrawItemStruct = (LPDRAWITEMSTRUCT)lParam;\n\t\t_MenuItemData* pmd = (_MenuItemData*)lpDrawItemStruct->itemData;\n\t\tif((lpDrawItemStruct->CtlType == ODT_MENU) && _IsValidMem(pmd) && pmd->IsCmdBarMenuItem())\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->DrawItem(lpDrawItemStruct);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t}\n\t\treturn (LRESULT)TRUE;\n\t}\n\n\tLRESULT OnMeasureItem(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tLPMEASUREITEMSTRUCT lpMeasureItemStruct = (LPMEASUREITEMSTRUCT)lParam;\n\t\t_MenuItemData* pmd = (_MenuItemData*)lpMeasureItemStruct->itemData;\n\t\tif((lpMeasureItemStruct->CtlType == ODT_MENU) && _IsValidMem(pmd) && pmd->IsCmdBarMenuItem())\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->MeasureItem(lpMeasureItemStruct);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t}\n\t\treturn (LRESULT)TRUE;\n\t}\n\n// API message handlers\n\tLRESULT OnAPIGetMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn (LRESULT)m_hMenu;\n\t}\n\n\tLRESULT OnAPITrackPopupMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tif(lParam == NULL)\n\t\t\treturn FALSE;\n\t\tLPCBRPOPUPMENU lpCBRPopupMenu = (LPCBRPOPUPMENU)lParam;\n\t\tif(lpCBRPopupMenu->cbSize != sizeof(CBRPOPUPMENU))\n\t\t\treturn FALSE;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\treturn pT->TrackPopupMenu(lpCBRPopupMenu->hMenu, lpCBRPopupMenu->uFlags, lpCBRPopupMenu->x, lpCBRPopupMenu->y, lpCBRPopupMenu->lptpm);\n\t}\n\n\tLRESULT OnAPIGetCmdBar(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn (LRESULT)this->m_hWnd;\n\t}\n\n// Parent window message handlers\n\tLRESULT OnParentHotItemChange(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\n\t{\n\t\tLPNMTBHOTITEM lpNMHT = (LPNMTBHOTITEM)pnmh;\n\n\t\t// Check if this comes from us\n\t\tif(pnmh->hwndFrom != this->m_hWnd)\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 0;\n\t\t}\n\n\t\tbool bBlockTracking = false;\n\t\tif((m_dwExtendedStyle & CBR_EX_TRACKALWAYS) == 0)\n\t\t{\n\t\t\tDWORD dwProcessID;\n\t\t\t::GetWindowThreadProcessId(::GetActiveWindow(), &dwProcessID);\n\t\t\tbBlockTracking = (::GetCurrentProcessId() != dwProcessID);\n\t\t}\n\n\t\tif((!m_wndParent.IsWindowEnabled() || bBlockTracking) && (lpNMHT->dwFlags & HICF_MOUSE))\n\t\t\treturn 1;\n\n\t\tbHandled = FALSE;\n\n\t\t// Send WM_MENUSELECT to the app if it needs to display a status text\n\t\tif(!(lpNMHT->dwFlags & HICF_MOUSE) && !(lpNMHT->dwFlags & HICF_ACCELERATOR) && !(lpNMHT->dwFlags & HICF_LMOUSE))\n\t\t{\n\t\t\tif(lpNMHT->dwFlags & HICF_ENTERING)\n\t\t\t\tm_wndParent.SendMessage(WM_MENUSELECT, 0, (LPARAM)m_hMenu);\n\t\t\tif(lpNMHT->dwFlags & HICF_LEAVING)\n\t\t\t\tm_wndParent.SendMessage(WM_MENUSELECT, MAKEWPARAM(0, 0xFFFF), NULL);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnParentDropDown(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\n\t{\n\t\t// Check if this comes from us\n\t\tif(pnmh->hwndFrom != this->m_hWnd)\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(::GetFocus() != this->m_hWnd)\n\t\t\tpT->TakeFocus();\n\t\tLPNMTOOLBAR pNMToolBar = (LPNMTOOLBAR)pnmh;\n\t\tint nIndex = this->CommandToIndex(pNMToolBar->iItem);\n\t\tm_bContextMenu = false;\n\t\tm_bEscapePressed = false;\n\t\tpT->DoPopupMenu(nIndex, true);\n\n\t\treturn TBDDRET_DEFAULT;\n\t}\n\n\tLRESULT OnParentInitMenuPopup(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\treturn OnInitMenuPopup(uMsg, wParam, lParam, bHandled);\n\t}\n\n\tLRESULT OnParentInternalGetBar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\treturn OnInternalGetBar(uMsg, wParam, lParam, bHandled);\n\t}\n\n\tLRESULT OnParentSysCommand(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tbHandled = FALSE;\n\t\tif(((m_uSysKey == VK_MENU) \n\t\t\t|| ((m_uSysKey == VK_F10) && !(::GetKeyState(VK_SHIFT) & 0x80))\n\t\t\t|| (m_uSysKey == VK_SPACE)) \n\t\t\t&& (wParam == SC_KEYMENU))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tif(::GetFocus() == this->m_hWnd)\n\t\t\t{\n\t\t\t\tpT->GiveFocusBack();   // exit menu \"loop\"\n\t\t\t\tthis->PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);\n\t\t\t}\n\t\t\telse if((m_uSysKey != VK_SPACE) && !m_bSkipMsg)\n\t\t\t{\n\t\t\t\tif(m_bUseKeyboardCues && !m_bShowKeyboardCues && m_bAllowKeyboardCues)\n\t\t\t\t\tShowKeyboardCues(true);\n\n\t\t\t\tpT->TakeFocus();      // enter menu \"loop\"\n\t\t\t\tbHandled = TRUE;\n\t\t\t}\n\t\t\telse if(m_uSysKey != VK_SPACE)\n\t\t\t{\n\t\t\t\tbHandled = TRUE;\n\t\t\t}\n\t\t}\n\t\tm_bSkipMsg = false;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnParentAPIGetMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\treturn OnAPIGetMenu(uMsg, wParam, lParam, bHandled);\n\t}\n\n\tLRESULT OnParentMenuChar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\treturn OnMenuChar(uMsg, wParam, lParam, bHandled);\n\t}\n\n\tLRESULT OnParentAPITrackPopupMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\treturn OnAPITrackPopupMenu(uMsg, wParam, lParam, bHandled);\n\t}\n\n\tLRESULT OnParentAPIGetCmdBar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\treturn OnAPIGetCmdBar(uMsg, wParam, lParam, bHandled);\n\t}\n\n\tLRESULT OnParentSettingChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tOnSettingChange(uMsg, wParam, lParam, bHandled);\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnParentDrawItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\treturn OnDrawItem(uMsg, wParam, lParam, bHandled);\n\t}\n\n\tLRESULT OnParentMeasureItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\treturn OnMeasureItem(uMsg, wParam, lParam, bHandled);\n\t}\n\n\tLRESULT OnParentActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tm_bParentActive = (LOWORD(wParam) != WA_INACTIVE);\n\t\tif(!m_bParentActive && m_bUseKeyboardCues && m_bShowKeyboardCues)\n\t\t{\n\t\t\tShowKeyboardCues(false);   // this will repaint our window\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis->Invalidate();\n\t\t\tthis->UpdateWindow();\n\t\t}\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnParentCustomDraw(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\n\t{\n\t\tLRESULT lRet = CDRF_DODEFAULT;\n\t\tbHandled = FALSE;\n\t\tif(pnmh->hwndFrom == this->m_hWnd)\n\t\t{\n\t\t\tLPNMTBCUSTOMDRAW lpTBCustomDraw = (LPNMTBCUSTOMDRAW)pnmh;\n\t\t\tif(lpTBCustomDraw->nmcd.dwDrawStage == CDDS_PREPAINT)\n\t\t\t{\n\t\t\t\tlRet = CDRF_NOTIFYITEMDRAW;\n\t\t\t\tbHandled = TRUE;\n\t\t\t}\n\t\t\telse if(lpTBCustomDraw->nmcd.dwDrawStage == CDDS_ITEMPREPAINT)\n\t\t\t{\n#if _WTL_CMDBAR_VISTA_MENUS && defined(_WTL_CMDBAR_VISTA_STD_MENUBAR)\n\t\t\t\tif(m_bVistaMenus)\n\t\t\t\t{\n\t\t\t\t\t::SetRectEmpty(&lpTBCustomDraw->rcText);\n\t\t\t\t\tlRet = CDRF_NOTIFYPOSTPAINT;\n\t\t\t\t\tbHandled = TRUE;\n\t\t\t\t}\n\t\t\t\telse\n#endif // _WTL_CMDBAR_VISTA_MENUS && defined(_WTL_CMDBAR_VISTA_STD_MENUBAR)\n\t\t\t\t{\n\t\t\t\t\tif(m_bFlatMenus)\n\t\t\t\t\t{\n\t\t\t\t\t\tbool bDisabled = ((lpTBCustomDraw->nmcd.uItemState & CDIS_DISABLED) == CDIS_DISABLED);\n\t\t\t\t\t\tif(!bDisabled && (((lpTBCustomDraw->nmcd.uItemState & CDIS_HOT) == CDIS_HOT) || \n\t\t\t\t\t\t\t(lpTBCustomDraw->nmcd.uItemState & CDIS_SELECTED) == CDIS_SELECTED))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t::FillRect(lpTBCustomDraw->nmcd.hdc, &lpTBCustomDraw->nmcd.rc, ::GetSysColorBrush(COLOR_MENUHILIGHT));\n\t\t\t\t\t\t\t::FrameRect(lpTBCustomDraw->nmcd.hdc, &lpTBCustomDraw->nmcd.rc, ::GetSysColorBrush(COLOR_HIGHLIGHT));\n\t\t\t\t\t\t\tlpTBCustomDraw->clrText = ::GetSysColor(m_bParentActive ? COLOR_HIGHLIGHTTEXT : COLOR_GRAYTEXT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(bDisabled || !m_bParentActive)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlpTBCustomDraw->clrText = ::GetSysColor(COLOR_GRAYTEXT);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_ParentCustomDrawHelper(lpTBCustomDraw);\n\n\t\t\t\t\t\tlRet = CDRF_SKIPDEFAULT;\n\t\t\t\t\t\tbHandled = TRUE;\n\t\t\t\t\t}\n\t\t\t\t\telse if(!m_bParentActive)\n\t\t\t\t\t{\n\t\t\t\t\t\tlpTBCustomDraw->clrText = ::GetSysColor(COLOR_GRAYTEXT);\n\t\t\t\t\t\tbHandled = TRUE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n#if _WTL_CMDBAR_VISTA_MENUS && defined(_WTL_CMDBAR_VISTA_STD_MENUBAR)\n\t\t\telse if (lpTBCustomDraw->nmcd.dwDrawStage == CDDS_ITEMPOSTPAINT)\n\t\t\t{\n\t\t\t\tbool bDisabled = ((lpTBCustomDraw->nmcd.uItemState & CDIS_DISABLED) == CDIS_DISABLED);\n\t\t\t\tif(bDisabled || !m_bParentActive)\n\t\t\t\t\tlpTBCustomDraw->clrText = ::GetSysColor(COLOR_GRAYTEXT);\n\n\t\t\t\t_ParentCustomDrawHelper(lpTBCustomDraw);\n\n\t\t\t\tlRet = CDRF_SKIPDEFAULT;\n\t\t\t\tbHandled = TRUE;\n\t\t\t}\n#endif // _WTL_CMDBAR_VISTA_MENUS && defined(_WTL_CMDBAR_VISTA_STD_MENUBAR)\n\t\t}\n\t\treturn lRet;\n\t}\n\n\tvoid _ParentCustomDrawHelper(LPNMTBCUSTOMDRAW lpTBCustomDraw)\n\t{\n\t\tCDCHandle dc = lpTBCustomDraw->nmcd.hdc;\n\t\tdc.SetTextColor(lpTBCustomDraw->clrText);\n\t\tdc.SetBkMode(lpTBCustomDraw->nStringBkMode);\n\n\t\tHFONT hFont = this->GetFont();\n\t\tHFONT hFontOld = NULL;\n\t\tif(hFont != NULL)\n\t\t\thFontOld = dc.SelectFont(hFont);\n\n\t\tconst int cchText = 200;\n\t\tTCHAR szText[cchText] = {};\n\t\tTBBUTTONINFO tbbi = {};\n\t\ttbbi.cbSize = sizeof(TBBUTTONINFO);\n\t\ttbbi.dwMask = TBIF_TEXT;\n\t\ttbbi.pszText = szText;\n\t\ttbbi.cchText = cchText;\n\t\tthis->GetButtonInfo((int)lpTBCustomDraw->nmcd.dwItemSpec, &tbbi);\n\n\t\tdc.DrawText(szText, -1, &lpTBCustomDraw->nmcd.rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER | (m_bShowKeyboardCues ? 0 : DT_HIDEPREFIX));\n\n\t\tif(hFont != NULL)\n\t\t\tdc.SelectFont(hFontOld);\n\t}\n\n// Message hook handlers\n\tLRESULT OnHookMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tstatic POINT s_point = { -1, -1 };\n\t\tDWORD dwPoint = ::GetMessagePos();\n\t\tPOINT point = { GET_X_LPARAM(dwPoint), GET_Y_LPARAM(dwPoint) };\n\n\t\tbHandled = FALSE;\n\t\tif(m_bMenuActive)\n\t\t{\n\t\t\tif(::WindowFromPoint(point) == this->m_hWnd)\n\t\t\t{\n\t\t\t\tthis->ScreenToClient(&point);\n\t\t\t\tint nHit = this->HitTest(&point);\n\n\t\t\t\tif(((point.x != s_point.x) || (point.y != s_point.y)) && (nHit >= 0) && (nHit < ::GetMenuItemCount(m_hMenu)) && (nHit != m_nPopBtn) && (m_nPopBtn != -1))\n\t\t\t\t{\n\t\t\t\t\tTBBUTTON tbb = {};\n\t\t\t\t\tthis->GetButton(nHit, &tbb);\n\t\t\t\t\tif((tbb.fsState & TBSTATE_ENABLED) != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tm_nNextPopBtn = nHit | 0xFFFF0000;\n\t\t\t\t\t\tHWND hWndMenu = this->m_stackMenuWnd.GetCurrent();\n\t\t\t\t\t\tATLASSERT(hWndMenu != NULL);\n\n\t\t\t\t\t\t// this one is needed to close a menu if mouse button was down\n\t\t\t\t\t\t::PostMessage(hWndMenu, WM_LBUTTONUP, 0, MAKELPARAM(point.x, point.y));\n\t\t\t\t\t\t// this one closes a popup menu\n\t\t\t\t\t\t::PostMessage(hWndMenu, WM_KEYDOWN, VK_ESCAPE, 0L);\n\n\t\t\t\t\t\tbHandled = TRUE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis->ScreenToClient(&point);\n\t\t}\n\n\t\ts_point = point;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnHookSysKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tbHandled = FALSE;\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - Hook WM_SYSKEYDOWN (0x%2.2X)\\n\"), wParam);\n#endif\n\n\t\tif((wParam == VK_MENU) && m_bParentActive && m_bUseKeyboardCues && !m_bShowKeyboardCues && m_bAllowKeyboardCues)\n\t\t\tShowKeyboardCues(true);\n\n\t\tif((wParam != VK_SPACE) && !m_bMenuActive && (::GetFocus() == this->m_hWnd))\n\t\t{\n\t\t\tm_bAllowKeyboardCues = false;\n\t\t\tthis->PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->GiveFocusBack();\n\t\t\tm_bSkipMsg = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif((wParam == VK_SPACE) && m_bUseKeyboardCues && m_bShowKeyboardCues)\n\t\t\t{\n\t\t\t\tm_bAllowKeyboardCues = true;\n\t\t\t\tShowKeyboardCues(false);\n\t\t\t}\n\t\t\tm_uSysKey = (UINT)wParam;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnHookSysKeyUp(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(!m_bAllowKeyboardCues)\n\t\t\tm_bAllowKeyboardCues = true;\n\t\tbHandled = FALSE;\n\t\t(void)wParam;   // avoid level 4 warning\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - Hook WM_SYSKEYUP (0x%2.2X)\\n\"), wParam);\n#endif\n\t\treturn 0;\n\t}\n\n\tLRESULT OnHookSysChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tbHandled = FALSE;\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - Hook WM_SYSCHAR (0x%2.2X)\\n\"), wParam);\n#endif\n\n\t\tif(!m_bMenuActive && (this->m_hWndHook != this->m_hWnd) && (wParam != VK_SPACE))\n\t\t\tbHandled = TRUE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnHookKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - Hook WM_KEYDOWN (0x%2.2X)\\n\"), wParam);\n#endif\n\t\tbHandled = FALSE;\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tif((wParam == VK_ESCAPE) && (this->m_stackMenuWnd.GetSize() <= 1))\n\t\t{\n\t\t\tif(m_bMenuActive && !m_bContextMenu)\n\t\t\t{\n\t\t\t\tint nHot = this->GetHotItem();\n\t\t\t\tif(nHot == -1)\n\t\t\t\t\tnHot = m_nPopBtn;\n\t\t\t\tif(nHot == -1)\n\t\t\t\t\tnHot = 0;\n\t\t\t\tthis->SetHotItem(nHot);\n\t\t\t\tbHandled = TRUE;\n\t\t\t\tpT->TakeFocus();\n\t\t\t\tm_bEscapePressed = true; // To keep focus\n\t\t\t\tm_bSkipPostDown = false;\n\t\t\t}\n\t\t\telse if((::GetFocus() == this->m_hWnd) && m_wndParent.IsWindow())\n\t\t\t{\n\t\t\t\tthis->SetHotItem(-1);\n\t\t\t\tpT->GiveFocusBack();\n\t\t\t\tbHandled = TRUE;\n\t\t\t}\n\t\t}\n\t\telse if((wParam == VK_RETURN) || (wParam == VK_UP) || (wParam == VK_DOWN))\n\t\t{\n\t\t\tif(!m_bMenuActive && (::GetFocus() == this->m_hWnd) && m_wndParent.IsWindow())\n\t\t\t{\n\t\t\t\tint nHot = this->GetHotItem();\n\t\t\t\tif(nHot != -1)\n\t\t\t\t{\n\t\t\t\t\tif(wParam != VK_RETURN)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!m_bSkipPostDown)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis->PostMessage(WM_KEYDOWN, VK_DOWN, 0L);\n\t\t\t\t\t\t\tm_bSkipPostDown = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - skipping posting another VK_DOWN\\n\"));\n\t\t\t\t\t\t\tm_bSkipPostDown = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - Can't find hot button\\n\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif((wParam == VK_RETURN) && m_bMenuActive)\n\t\t\t{\n\t\t\t\tthis->PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);\n\t\t\t\tm_nNextPopBtn = -1;\n\t\t\t\tpT->GiveFocusBack();\n\t\t\t}\n\t\t}\n\t\telse if((wParam == VK_LEFT) || (wParam == VK_RIGHT))\n\t\t{\n\t\t\tWPARAM wpNext = m_bLayoutRTL ? VK_LEFT : VK_RIGHT;\n\t\t\tWPARAM wpPrev = m_bLayoutRTL ? VK_RIGHT : VK_LEFT;\n\n\t\t\tif(m_bMenuActive && !m_bContextMenu && !((wParam == wpNext) && m_bPopupItem))\n\t\t\t{\n\t\t\t\tbool bAction = false;\n\t\t\t\tif((wParam == wpPrev) && (this->s_pCurrentBar->m_stackMenuWnd.GetSize() == 1))\n\t\t\t\t{\n\t\t\t\t\tm_nNextPopBtn = pT->GetPreviousMenuItem(m_nPopBtn);\n\t\t\t\t\tif(m_nNextPopBtn != -1)\n\t\t\t\t\t\tbAction = true;\n\t\t\t\t}\n\t\t\t\telse if(wParam == wpNext)\n\t\t\t\t{\n\t\t\t\t\tm_nNextPopBtn = pT->GetNextMenuItem(m_nPopBtn);\n\t\t\t\t\tif(m_nNextPopBtn != -1)\n\t\t\t\t\t\tbAction = true;\n\t\t\t\t}\n\t\t\t\tHWND hWndMenu = this->m_stackMenuWnd.GetCurrent();\n\t\t\t\tATLASSERT(hWndMenu != NULL);\n\n\t\t\t\t// Close the popup menu\n\t\t\t\tif(bAction)\n\t\t\t\t{\n\t\t\t\t\t::PostMessage(hWndMenu, WM_KEYDOWN, VK_ESCAPE, 0L);\n\t\t\t\t\tif(wParam == wpNext)\n\t\t\t\t\t{\n\t\t\t\t\t\tint cItem = this->m_stackMenuWnd.GetSize() - 1;\n\t\t\t\t\t\twhile(cItem >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thWndMenu = this->m_stackMenuWnd[cItem];\n\t\t\t\t\t\t\tif(hWndMenu != NULL)\n\t\t\t\t\t\t\t\t::PostMessage(hWndMenu, WM_KEYDOWN, VK_ESCAPE, 0L);\n\t\t\t\t\t\t\tcItem--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(m_nNextPopBtn == -2)\n\t\t\t\t\t{\n\t\t\t\t\t\tm_nNextPopBtn = -1;\n\t\t\t\t\t\tpT->DisplayChevronMenu();\n\t\t\t\t\t}\n\t\t\t\t\tbHandled = TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnHookNextMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - Hook WM_NEXTMENU\\n\"));\n#endif\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n \tLRESULT OnHookChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - Hook WM_CHAR (0x%2.2X)\\n\"), wParam);\n#endif\n\t\tbHandled = (wParam == VK_ESCAPE);\n\t\treturn 0;\n\t}\n\n// Implementation - ownerdraw overrideables and helpers\n\tvoid DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(m_bFlatMenus)\n\t\t\tpT->DrawItemFlat(lpDrawItemStruct);\n\t\telse\n\t\t\tpT->DrawItem3D(lpDrawItemStruct);\n\n\t}\n\n\tvoid DrawItem3D(LPDRAWITEMSTRUCT lpDrawItemStruct)\n\t{\n\t\t_MenuItemData* pmd = (_MenuItemData*)lpDrawItemStruct->itemData;\n\t\tCDCHandle dc = lpDrawItemStruct->hDC;\n\t\tconst RECT& rcItem = lpDrawItemStruct->rcItem;\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tif(pmd->fType & MFT_SEPARATOR)\n\t\t{\n\t\t\t// draw separator\n\t\t\tRECT rc = rcItem;\n\t\t\trc.top += (rc.bottom - rc.top) / 2;      // vertical center\n\t\t\tdc.DrawEdge(&rc, EDGE_ETCHED, BF_TOP);   // draw separator line\n\t\t}\n\t\telse\t\t// not a separator\n\t\t{\n\t\t\tBOOL bDisabled = lpDrawItemStruct->itemState & ODS_GRAYED;\n\t\t\tBOOL bSelected = lpDrawItemStruct->itemState & ODS_SELECTED;\n\t\t\tBOOL bChecked = lpDrawItemStruct->itemState & ODS_CHECKED;\n\t\t\tBOOL bHasImage = FALSE;\n\n\t\t\tif(LOWORD(lpDrawItemStruct->itemID) == (WORD)-1)\n\t\t\t\tbSelected = FALSE;\n\t\t\tRECT rcButn = { rcItem.left, rcItem.top, rcItem.left + m_szButton.cx, rcItem.top + m_szButton.cy };   // button rect\n\t\t\t::OffsetRect(&rcButn, 0, ((rcItem.bottom - rcItem.top) - (rcButn.bottom - rcButn.top)) / 2);          // center vertically\n\n\t\t\tint iButton = pmd->iButton;\n\t\t\tif(iButton >= 0)\n\t\t\t{\n\t\t\t\tbHasImage = TRUE;\n\n\t\t\t\t// calc drawing point\n\t\t\t\tSIZE sz = { rcButn.right - rcButn.left - m_szBitmap.cx, rcButn.bottom - rcButn.top - m_szBitmap.cy };\n\t\t\t\tsz.cx /= 2;\n\t\t\t\tsz.cy /= 2;\n\t\t\t\tPOINT point = { rcButn.left + sz.cx, rcButn.top + sz.cy };\n\n\t\t\t\t// fill background depending on state\n\t\t\t\tif(!bChecked || (bSelected && !bDisabled))\n\t\t\t\t{\n\t\t\t\t\tif(!bDisabled)\n\t\t\t\t\t\tdc.FillRect(&rcButn, (bChecked && !bSelected) ? COLOR_3DLIGHT : COLOR_MENU);\n\t\t\t\t\telse\n\t\t\t\t\t\tdc.FillRect(&rcButn, COLOR_MENU);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tCOLORREF crTxt = dc.SetTextColor(::GetSysColor(COLOR_BTNFACE));\n\t\t\t\t\tCOLORREF crBk = dc.SetBkColor(::GetSysColor(COLOR_BTNHILIGHT));\n\t\t\t\t\tCBrush hbr(CDCHandle::GetHalftoneBrush());\n\t\t\t\t\tdc.SetBrushOrg(rcButn.left, rcButn.top);\n\t\t\t\t\tdc.FillRect(&rcButn, hbr);\n\t\t\t\t\tdc.SetTextColor(crTxt);\n\t\t\t\t\tdc.SetBkColor(crBk);\n\t\t\t\t}\n\n\t\t\t\t// draw disabled or normal\n\t\t\t\tif(!bDisabled)\n\t\t\t\t{\n\t\t\t\t\t// draw pushed-in or popped-out edge\n\t\t\t\t\tif(bSelected || bChecked)\n\t\t\t\t\t{\n\t\t\t\t\t\tRECT rc2 = rcButn;\n\t\t\t\t\t\tdc.DrawEdge(&rc2, bChecked ? BDR_SUNKENOUTER : BDR_RAISEDINNER, BF_RECT);\n\t\t\t\t\t}\n\t\t\t\t\t// draw the image\n\t\t\t\t\t::ImageList_Draw(m_hImageList, iButton, dc, point.x, point.y, ILD_TRANSPARENT);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tHBRUSH hBrushBackground = bChecked ? NULL : ::GetSysColorBrush(COLOR_MENU);\n\t\t\t\t\tpT->DrawBitmapDisabled(dc, iButton, point, hBrushBackground);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// no image - look for custom checked/unchecked bitmaps\n\t\t\t\tCMenuItemInfo info;\n\t\t\t\tinfo.fMask = MIIM_CHECKMARKS | MIIM_TYPE;\n\t\t\t\t::GetMenuItemInfo((HMENU)lpDrawItemStruct->hwndItem, lpDrawItemStruct->itemID, MF_BYCOMMAND, &info);\n\t\t\t\tif(bChecked || (info.hbmpUnchecked != NULL))\n\t\t\t\t{\n\t\t\t\t\tBOOL bRadio = ((info.fType & MFT_RADIOCHECK) != 0);\n\t\t\t\t\tbHasImage = pT->DrawCheckmark(dc, rcButn, bSelected, bDisabled, bRadio, bChecked ? info.hbmpChecked : info.hbmpUnchecked);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// draw item text\n\t\t\tint cxButn = m_szButton.cx;\n\t\t\tCOLORREF colorBG = ::GetSysColor(bSelected ? COLOR_HIGHLIGHT : COLOR_MENU);\n\t\t\tif(bSelected || (lpDrawItemStruct->itemAction == ODA_SELECT))\n\t\t\t{\n\t\t\t\tRECT rcBG = rcItem;\n\t\t\t\tif(bHasImage)\n\t\t\t\t\trcBG.left += cxButn + s_kcxGap;\n\t\t\t\tdc.FillRect(&rcBG, bSelected ? COLOR_HIGHLIGHT : COLOR_MENU);\n\t\t\t}\n\n\t\t\t// calc text rectangle and colors\n\t\t\tRECT rcText = rcItem;\n\t\t\trcText.left += cxButn + s_kcxGap + s_kcxTextMargin;\n\t\t\trcText.right -= cxButn;\n\t\t\tdc.SetBkMode(TRANSPARENT);\n\t\t\tCOLORREF colorText = ::GetSysColor(bDisabled ?  (bSelected ? COLOR_GRAYTEXT : COLOR_3DSHADOW) : (bSelected ? COLOR_HIGHLIGHTTEXT : COLOR_MENUTEXT));\n\n\t\t\t// font already selected by Windows\n\t\t\tif(bDisabled && (!bSelected || (colorText == colorBG)))\n\t\t\t{\n\t\t\t\t// disabled - draw shadow text shifted down and right 1 pixel (unles selected)\n\t\t\t\tRECT rcDisabled = rcText;\n\t\t\t\t::OffsetRect(&rcDisabled, 1, 1);\n\t\t\t\tpT->DrawMenuText(dc, rcDisabled, pmd->lpstrText, ::GetSysColor(COLOR_3DHILIGHT));\n\t\t\t}\n\t\t\tpT->DrawMenuText(dc, rcText, pmd->lpstrText, colorText); // finally!\n\t\t}\n\t}\n\n\tvoid DrawItemFlat(LPDRAWITEMSTRUCT lpDrawItemStruct)\n\t{\n\t\t_MenuItemData* pmd = (_MenuItemData*)lpDrawItemStruct->itemData;\n\t\tCDCHandle dc = lpDrawItemStruct->hDC;\n\t\tconst RECT& rcItem = lpDrawItemStruct->rcItem;\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tBOOL bDisabled = lpDrawItemStruct->itemState & ODS_GRAYED;\n\t\tBOOL bSelected = lpDrawItemStruct->itemState & ODS_SELECTED;\n\t\tBOOL bChecked = lpDrawItemStruct->itemState & ODS_CHECKED;\n\n\t\t// paint background\n\t\tif(bSelected || (lpDrawItemStruct->itemAction == ODA_SELECT))\n\t\t{\n\t\t\tif(bSelected)\n\t\t\t{\n\t\t\t\tdc.FillRect(&rcItem, ::GetSysColorBrush(COLOR_MENUHILIGHT));\n\t\t\t\tdc.FrameRect(&rcItem, ::GetSysColorBrush(COLOR_HIGHLIGHT));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdc.FillRect(&rcItem, ::GetSysColorBrush(COLOR_MENU));\n\t\t\t}\n\t\t}\n\n\t\tif(pmd->fType & MFT_SEPARATOR)\n\t\t{\n\t\t\t// draw separator\n\t\t\tRECT rc = rcItem;\n\t\t\trc.top += (rc.bottom - rc.top) / 2;      // vertical center\n\t\t\tdc.DrawEdge(&rc, EDGE_ETCHED, BF_TOP);   // draw separator line\n\t\t}\n\t\telse\t\t// not a separator\n\t\t{\n\t\t\tif(LOWORD(lpDrawItemStruct->itemID) == (WORD)-1)\n\t\t\t\tbSelected = FALSE;\n\t\t\tRECT rcButn = { rcItem.left, rcItem.top, rcItem.left + m_szButton.cx, rcItem.top + m_szButton.cy };   // button rect\n\t\t\t::OffsetRect(&rcButn, 0, ((rcItem.bottom - rcItem.top) - (rcButn.bottom - rcButn.top)) / 2);          // center vertically\n\n\t\t\t// draw background and border for checked items\n\t\t\tif(bChecked)\n\t\t\t{\n\t\t\t\tRECT rcCheck = rcButn;\n\t\t\t\t::InflateRect(&rcCheck, -1, -1);\n\t\t\t\tif(bSelected)\n\t\t\t\t\tdc.FillRect(&rcCheck, ::GetSysColorBrush(COLOR_MENU));\n\t\t\t\tdc.FrameRect(&rcCheck, ::GetSysColorBrush(COLOR_HIGHLIGHT));\n\t\t\t}\n\n\t\t\tint iButton = pmd->iButton;\n\t\t\tif(iButton >= 0)\n\t\t\t{\n\t\t\t\t// calc drawing point\n\t\t\t\tSIZE sz = { rcButn.right - rcButn.left - m_szBitmap.cx, rcButn.bottom - rcButn.top - m_szBitmap.cy };\n\t\t\t\tsz.cx /= 2;\n\t\t\t\tsz.cy /= 2;\n\t\t\t\tPOINT point = { rcButn.left + sz.cx, rcButn.top + sz.cy };\n\n\t\t\t\t// draw disabled or normal\n\t\t\t\tif(!bDisabled)\n\t\t\t\t{\n\t\t\t\t\t::ImageList_Draw(m_hImageList, iButton, dc, point.x, point.y, ILD_TRANSPARENT);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tHBRUSH hBrushBackground = ::GetSysColorBrush((bSelected && !bChecked) ? COLOR_MENUHILIGHT : COLOR_MENU);\n\t\t\t\t\tHBRUSH hBrushDisabledImage = ::GetSysColorBrush(COLOR_3DSHADOW);\n\t\t\t\t\tpT->DrawBitmapDisabled(dc, iButton, point, hBrushBackground, hBrushBackground, hBrushDisabledImage);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// no image - look for custom checked/unchecked bitmaps\n\t\t\t\tCMenuItemInfo info;\n\t\t\t\tinfo.fMask = MIIM_CHECKMARKS | MIIM_TYPE;\n\t\t\t\t::GetMenuItemInfo((HMENU)lpDrawItemStruct->hwndItem, lpDrawItemStruct->itemID, MF_BYCOMMAND, &info);\n\t\t\t\tif(bChecked || (info.hbmpUnchecked != NULL))\n\t\t\t\t{\n\t\t\t\t\tBOOL bRadio = ((info.fType & MFT_RADIOCHECK) != 0);\n\t\t\t\t\tpT->DrawCheckmark(dc, rcButn, bSelected, bDisabled, bRadio, bChecked ? info.hbmpChecked : info.hbmpUnchecked);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// draw item text\n\t\t\tint cxButn = m_szButton.cx;\n\t\t\t// calc text rectangle and colors\n\t\t\tRECT rcText = rcItem;\n\t\t\trcText.left += cxButn + s_kcxGap + s_kcxTextMargin;\n\t\t\trcText.right -= cxButn;\n\t\t\tdc.SetBkMode(TRANSPARENT);\n\t\t\tCOLORREF colorText = ::GetSysColor(bDisabled ?  (bSelected ? COLOR_GRAYTEXT : COLOR_3DSHADOW) : (bSelected ? COLOR_HIGHLIGHTTEXT : COLOR_MENUTEXT));\n\n\t\t\tpT->DrawMenuText(dc, rcText, pmd->lpstrText, colorText); // finally!\n\t\t}\n\t}\n\n\tvoid DrawMenuText(CDCHandle& dc, RECT& rc, LPCTSTR lpstrText, COLORREF color)\n\t{\n\t\tint nTab = -1;\n\t\tconst int nLen = lstrlen(lpstrText);\n\t\tfor(int i = 0; i < nLen; i++)\n\t\t{\n\t\t\tif(lpstrText[i] == _T('\\t'))\n\t\t\t{\n\t\t\t\tnTab = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tdc.SetTextColor(color);\n\t\tdc.DrawText(lpstrText, nTab, &rc, DT_SINGLELINE | DT_LEFT | DT_VCENTER | (m_bShowKeyboardCues ? 0 : DT_HIDEPREFIX));\n\t\tif(nTab != -1)\n\t\t\tdc.DrawText(&lpstrText[nTab + 1], -1, &rc, DT_SINGLELINE | DT_RIGHT | DT_VCENTER | (m_bShowKeyboardCues ? 0 : DT_HIDEPREFIX));\n\t}\n\n\tvoid DrawBitmapDisabled(CDCHandle& dc, int nImage, POINT point,\n\t\t\tHBRUSH hBrushBackground = ::GetSysColorBrush(COLOR_3DFACE),\n\t\t\tHBRUSH hBrush3DEffect = ::GetSysColorBrush(COLOR_3DHILIGHT),\n\t\t\tHBRUSH hBrushDisabledImage = ::GetSysColorBrush(COLOR_3DSHADOW))\n\t{\n\t\tif(m_bAlphaImages)\n\t\t{\n\t\t\tIMAGELISTDRAWPARAMS ildp = {};\n\t\t\tildp.cbSize = sizeof(IMAGELISTDRAWPARAMS);\n\t\t\tildp.himl = m_hImageList;\n\t\t\tildp.i = nImage;\n\t\t\tildp.hdcDst = dc;\n\t\t\tildp.x = point.x;\n\t\t\tildp.y = point.y;\n\t\t\tildp.cx = 0;\n\t\t\tildp.cy = 0;\n\t\t\tildp.xBitmap = 0;\n\t\t\tildp.yBitmap = 0;\n\t\t\tildp.fStyle = ILD_TRANSPARENT;\n\t\t\tildp.fState = ILS_SATURATE;\n\t\t\tildp.Frame = 0;\n\t\t\t::ImageList_DrawIndirect(&ildp);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// create memory DC\n\t\t\tCDC dcMem;\n\t\t\tdcMem.CreateCompatibleDC(dc);\n\t\t\t// create mono or color bitmap\n\t\t\tCBitmap bmp;\n\t\t\tbmp.CreateCompatibleBitmap(dc, m_szBitmap.cx, m_szBitmap.cy);\n\t\t\tATLASSERT(bmp.m_hBitmap != NULL);\n\t\t\t// draw image into memory DC--fill BG white first\n\t\t\tHBITMAP hBmpOld = dcMem.SelectBitmap(bmp);\n\t\t\tdcMem.PatBlt(0, 0, m_szBitmap.cx, m_szBitmap.cy, WHITENESS);\n\t\t\t// If white is the text color, we can't use the normal painting since\n\t\t\t// it would blend with the WHITENESS, but the mask is OK\n\t\t\tUINT uDrawStyle = (::GetSysColor(COLOR_BTNTEXT) == RGB(255, 255, 255)) ? ILD_MASK : ILD_NORMAL;\n\t\t\t::ImageList_Draw(m_hImageList, nImage, dcMem, 0, 0, uDrawStyle);\n\t\t\tdc.DitherBlt(point.x, point.y, m_szBitmap.cx, m_szBitmap.cy, dcMem, NULL, 0, 0, hBrushBackground, hBrush3DEffect, hBrushDisabledImage);\n\t\t\tdcMem.SelectBitmap(hBmpOld);   // restore\n\t\t}\n\t}\n\n\t// old name\n\tBOOL Draw3DCheckmark(CDCHandle& dc, const RECT& rc, BOOL bSelected, BOOL bDisabled, BOOL bRadio, HBITMAP hBmpCheck)\n\t{\n\t\treturn DrawCheckmark(dc, rc, bSelected, bDisabled, bRadio, hBmpCheck);\n\t}\n\n\tBOOL DrawCheckmark(CDCHandle& dc, const RECT& rc, BOOL bSelected, BOOL bDisabled, BOOL bRadio, HBITMAP hBmpCheck)\n\t{\n\t\t// get checkmark bitmap, if none, use Windows standard\n\t\tSIZE size = {};\n\t\tCBitmapHandle bmp = hBmpCheck;\n\t\tif(hBmpCheck != NULL)\n\t\t{\n\t\t\tbmp.GetSize(size);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsize.cx = ::GetSystemMetrics(SM_CXMENUCHECK); \n\t\t\tsize.cy = ::GetSystemMetrics(SM_CYMENUCHECK); \n\t\t\tbmp.CreateCompatibleBitmap(dc, size.cx, size.cy);\n\t\t\tATLASSERT(bmp.m_hBitmap != NULL);\n\t\t}\n\t\t// center bitmap in caller's rectangle\n\t\tRECT rcDest = rc;\n\t\tif((rc.right - rc.left) > size.cx)\n\t\t{\n\t\t\trcDest.left = rc.left + (rc.right - rc.left - size.cx) / 2;\n\t\t\trcDest.right = rcDest.left + size.cx;\n\t\t}\n\t\tif((rc.bottom - rc.top) > size.cy)\n\t\t{\n\t\t\trcDest.top = rc.top + (rc.bottom - rc.top - size.cy) / 2;\n\t\t\trcDest.bottom = rcDest.top + size.cy;\n\t\t}\n\t\t// paint background\n\t\tif(!m_bFlatMenus)\n\t\t{\n\t\t\tif(bSelected && !bDisabled)\n\t\t\t{\n\t\t\t\tdc.FillRect(&rcDest, COLOR_MENU);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tCOLORREF clrTextOld = dc.SetTextColor(::GetSysColor(COLOR_BTNFACE));\n\t\t\t\tCOLORREF clrBkOld = dc.SetBkColor(::GetSysColor(COLOR_BTNHILIGHT));\n\t\t\t\tCBrush hbr(CDCHandle::GetHalftoneBrush());\n\t\t\t\tdc.SetBrushOrg(rcDest.left, rcDest.top);\n\t\t\t\tdc.FillRect(&rcDest, hbr);\n\t\t\t\tdc.SetTextColor(clrTextOld);\n\t\t\t\tdc.SetBkColor(clrBkOld);\n\t\t\t}\n\t\t}\n\n\t\t// create source image\n\t\tCDC dcSource;\n\t\tdcSource.CreateCompatibleDC(dc);\n\t\tHBITMAP hBmpOld = dcSource.SelectBitmap(bmp);\n\t\t// set colors\n\t\tconst COLORREF clrBlack = RGB(0, 0, 0);\n\t\tconst COLORREF clrWhite = RGB(255, 255, 255);\n\t\tCOLORREF clrTextOld = dc.SetTextColor(clrBlack);\n\t\tCOLORREF clrBkOld = dc.SetBkColor(clrWhite);\n\t\t// create mask\n\t\tCDC dcMask;\n\t\tdcMask.CreateCompatibleDC(dc);\n\t\tCBitmap bmpMask;\n\t\tbmpMask.CreateBitmap(size.cx, size.cy, 1, 1, NULL);\n\t\tHBITMAP hBmpOld1 = dcMask.SelectBitmap(bmpMask);\n\n\t\t// draw the checkmark transparently\n\t\tint cx = rcDest.right - rcDest.left;\n\t\tint cy = rcDest.bottom - rcDest.top;\n\t\tif(hBmpCheck != NULL)\n\t\t{\n\t\t\t// build mask based on transparent color\t\n\t\t\tdcSource.SetBkColor(m_clrMask);\n\t\t\tdcMask.SetBkColor(clrBlack);\n\t\t\tdcMask.SetTextColor(clrWhite);\n\t\t\tdcMask.BitBlt(0, 0, size.cx, size.cy, dcSource, 0, 0, SRCCOPY);\n\t\t\t// draw bitmap using the mask\n\t\t\tdc.BitBlt(rcDest.left, rcDest.top, cx, cy, dcSource, 0, 0, SRCINVERT);\n\t\t\tdc.BitBlt(rcDest.left, rcDest.top, cx, cy, dcMask, 0, 0, SRCAND);\n\t\t\tdc.BitBlt(rcDest.left, rcDest.top, cx, cy, dcSource, 0, 0, SRCINVERT);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconst DWORD ROP_DSno = 0x00BB0226L;\n\t\t\tconst DWORD ROP_DSa = 0x008800C6L;\n\t\t\tconst DWORD ROP_DSo = 0x00EE0086L;\n\t\t\tconst DWORD ROP_DSna = 0x00220326L;\n\n\t\t\t// draw mask\n\t\t\tRECT rcSource = { 0, 0, __min(size.cx, rc.right - rc.left), __min(size.cy, rc.bottom - rc.top) };\n\t\t\tdcMask.DrawFrameControl(&rcSource, DFC_MENU, bRadio ? DFCS_MENUBULLET : DFCS_MENUCHECK);\n\n\t\t\t// draw shadow if disabled\n\t\t\tif(!m_bFlatMenus && bDisabled)\n\t\t\t{\n\t\t\t\t// offset by one pixel\n\t\t\t\tint x = rcDest.left + 1;\n\t\t\t\tint y = rcDest.top + 1;\n\t\t\t\t// paint source bitmap\n\t\t\t\tconst int nColor = COLOR_3DHILIGHT;\n\t\t\t\tdcSource.FillRect(&rcSource, nColor);\n\t\t\t\t// draw checkmark - special case black and white colors\n\t\t\t\tCOLORREF clrCheck = ::GetSysColor(nColor);\n\t\t\t\tif(clrCheck == clrWhite)\n\t\t\t\t{\n\t\t\t\t\tdc.BitBlt(x, y, cx, cy, dcMask,  0, 0,   ROP_DSno);\n\t\t\t\t\tdc.BitBlt(x, y, cx, cy, dcSource, 0, 0, ROP_DSa);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(clrCheck != clrBlack)\n\t\t\t\t\t{\n\t\t\t\t\t\tATLASSERT(dcSource.GetTextColor() == clrBlack);\n\t\t\t\t\t\tATLASSERT(dcSource.GetBkColor() == clrWhite);\n\t\t\t\t\t\tdcSource.BitBlt(0, 0, size.cx, size.cy, dcMask, 0, 0, ROP_DSna);\n\t\t\t\t\t}\n\t\t\t\t\tdc.BitBlt(x, y, cx, cy, dcMask,  0,  0,  ROP_DSa);\n\t\t\t\t\tdc.BitBlt(x, y, cx, cy, dcSource, 0, 0, ROP_DSo);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// paint source bitmap\n\t\t\tconst int nColor = bDisabled ? COLOR_BTNSHADOW : COLOR_MENUTEXT;\n\t\t\tdcSource.FillRect(&rcSource, nColor);\n\t\t\t// draw checkmark - special case black and white colors\n\t\t\tCOLORREF clrCheck = ::GetSysColor(nColor);\n\t\t\tif(clrCheck == clrWhite)\n\t\t\t{\n\t\t\t\tdc.BitBlt(rcDest.left, rcDest.top, cx, cy, dcMask,  0, 0,   ROP_DSno);\n\t\t\t\tdc.BitBlt(rcDest.left, rcDest.top, cx, cy, dcSource, 0, 0, ROP_DSa);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(clrCheck != clrBlack)\n\t\t\t\t{\n\t\t\t\t\tATLASSERT(dcSource.GetTextColor() == clrBlack);\n\t\t\t\t\tATLASSERT(dcSource.GetBkColor() == clrWhite);\n\t\t\t\t\tdcSource.BitBlt(0, 0, size.cx, size.cy, dcMask, 0, 0, ROP_DSna);\n\t\t\t\t}\n\t\t\t\tdc.BitBlt(rcDest.left, rcDest.top, cx, cy, dcMask,  0,  0,  ROP_DSa);\n\t\t\t\tdc.BitBlt(rcDest.left, rcDest.top, cx, cy, dcSource, 0, 0, ROP_DSo);\n\t\t\t}\n\t\t}\n\t\t// restore all\n\t\tdc.SetTextColor(clrTextOld);\n\t\tdc.SetBkColor(clrBkOld);\n\t\tdcSource.SelectBitmap(hBmpOld);\n\t\tdcMask.SelectBitmap(hBmpOld1);\n\t\tif(hBmpCheck == NULL)\n\t\t\tbmp.DeleteObject();\n\t\t// draw pushed-in hilight\n\t\tif(!m_bFlatMenus && !bDisabled)\n\t\t{\n\t\t\tif(rc.right - rc.left > size.cx)\n\t\t\t\t::InflateRect(&rcDest, 1,1);   // inflate checkmark by one pixel all around\n\t\t\tdc.DrawEdge(&rcDest, BDR_SUNKENOUTER, BF_RECT);\n\t\t}\n\n\t\treturn TRUE;\n\t}\n\n\tvoid MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)\n\t{\n\t\t_MenuItemData* pmd = (_MenuItemData*)lpMeasureItemStruct->itemData;\n\n\t\tif(pmd->fType & MFT_SEPARATOR)   // separator - use half system height and zero width\n\t\t{\n\t\t\tlpMeasureItemStruct->itemHeight = ::GetSystemMetrics(SM_CYMENU) / 2;\n\t\t\tlpMeasureItemStruct->itemWidth  = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// compute size of text - use DrawText with DT_CALCRECT\n\t\t\tCWindowDC dc(NULL);\n\t\t\tCFont fontBold;\n\t\t\tHFONT hOldFont = NULL;\n\t\t\tif(pmd->fState & MFS_DEFAULT)\n\t\t\t{\n\t\t\t\t// need bold version of font\n\t\t\t\tLOGFONT lf = {};\n\t\t\t\tm_fontMenu.GetLogFont(lf);\n\t\t\t\tlf.lfWeight += 200;\n\t\t\t\tfontBold.CreateFontIndirect(&lf);\n\t\t\t\tATLASSERT(fontBold.m_hFont != NULL);\n\t\t\t\thOldFont = dc.SelectFont(fontBold);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\thOldFont = dc.SelectFont(m_fontMenu);\n\t\t\t}\n\n\t\t\tRECT rcText = {};\n\t\t\tdc.DrawText(pmd->lpstrText, -1, &rcText, DT_SINGLELINE | DT_LEFT | DT_VCENTER | DT_CALCRECT);\n\t\t\tint cx = rcText.right - rcText.left;\n\t\t\tdc.SelectFont(hOldFont);\n\n\t\t\tLOGFONT lf = {};\n\t\t\tm_fontMenu.GetLogFont(lf);\n\t\t\tint cy = lf.lfHeight;\n\t\t\tif(cy < 0)\n\t\t\t\tcy = -cy;\n\t\t\tconst int cyMargin = 8;\n\t\t\tcy += cyMargin;\n\n\t\t\t// height of item is the bigger of these two\n\t\t\tlpMeasureItemStruct->itemHeight = __max(cy, (int)m_szButton.cy);\n\n\t\t\t// width is width of text plus a bunch of stuff\n\t\t\tcx += 2 * s_kcxTextMargin;   // L/R margin for readability\n\t\t\tcx += s_kcxGap;              // space between button and menu text\n\t\t\tcx += 2 * m_szButton.cx;     // button width (L=button; R=empty margin)\n\t\t\tcx += m_cxExtraSpacing;      // extra between item text and accelerator keys\n\n\t\t\t// Windows adds 1 to returned value\n\t\t\tcx -= ::GetSystemMetrics(SM_CXMENUCHECK) - 1;\n\t\t\tlpMeasureItemStruct->itemWidth = cx;   // done deal\n\t\t}\n\t}\n\n// Implementation - Hook procs\n\tstatic LRESULT CALLBACK CreateHookProc(int nCode, WPARAM wParam, LPARAM lParam)\n\t{\n\t\tconst int cchClassName = 7;\n\t\tTCHAR szClassName[cchClassName] = {};\n\n\t\tif(nCode == HCBT_CREATEWND)\n\t\t{\n\t\t\tHWND hWndMenu = (HWND)wParam;\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - HCBT_CREATEWND (HWND = %8.8X)\\n\"), hWndMenu);\n#endif\n\n\t\t\t::GetClassName(hWndMenu, szClassName, cchClassName);\n\t\t\tif(!lstrcmp(_T(\"#32768\"), szClassName))\n\t\t\t\tCCommandBarCtrlBase::s_pCurrentBar->m_stackMenuWnd.Push(hWndMenu);\n\t\t}\n\t\telse if(nCode == HCBT_DESTROYWND)\n\t\t{\n\t\t\tHWND hWndMenu = (HWND)wParam;\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - HCBT_DESTROYWND (HWND = %8.8X)\\n\"), hWndMenu);\n#endif\n\n\t\t\t::GetClassName(hWndMenu, szClassName, cchClassName);\n\t\t\tif(!lstrcmp(_T(\"#32768\"), szClassName))\n\t\t\t{\n\t\t\t\tATLASSERT(hWndMenu == CCommandBarCtrlBase::s_pCurrentBar->m_stackMenuWnd.GetCurrent());\n\t\t\t\tCCommandBarCtrlBase::s_pCurrentBar->m_stackMenuWnd.Pop();\n\t\t\t}\n\t\t}\n\n\t\treturn ::CallNextHookEx(CCommandBarCtrlBase::s_hCreateHook, nCode, wParam, lParam);\n\t}\n\n\tstatic LRESULT CALLBACK MessageHookProc(int nCode, WPARAM wParam, LPARAM lParam)\n\t{\n\t\tLPMSG pMsg = (LPMSG)lParam;\n\n\t\tif((nCode == HC_ACTION) && (wParam == PM_REMOVE) && (pMsg->message != GetGetBarMessage()) && (pMsg->message != WM_FORWARDMSG))\n\t\t{\n\t\t\tCCommandBarCtrlBase* pCmdBar = NULL;\n\t\t\tHWND hWnd = pMsg->hwnd;\n\t\t\tDWORD dwPID = 0;\n\t\t\twhile((pCmdBar == NULL) && (hWnd != NULL))\n\t\t\t{\n\t\t\t\tpCmdBar = (CCommandBarCtrlBase*)::SendMessage(hWnd, GetGetBarMessage(), (WPARAM)&dwPID, 0L);\n\t\t\t\thWnd = ::GetParent(hWnd);\n\t\t\t}\n\n\t\t\tif((pCmdBar != NULL) && (dwPID == GetCurrentProcessId()))\n\t\t\t{\n\t\t\t\tpCmdBar->m_hWndHook = pMsg->hwnd;\n\t\t\t\tATLASSERT(pCmdBar->IsCommandBarBase());\n\n\t\t\t\tif(::IsWindow(pCmdBar->m_hWnd))\n\t\t\t\t\tpCmdBar->SendMessage(WM_FORWARDMSG, 0, (LPARAM)pMsg);\n\t\t\t\telse\n\t\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - Hook skipping message, can't find command bar!\\n\"));\n\t\t\t}\n\t\t}\n\n\t\tLRESULT lRet = 0;\n\t\tATLASSERT(CCommandBarCtrlBase::s_pmapMsgHook != NULL);\n\t\tif(CCommandBarCtrlBase::s_pmapMsgHook != NULL)\n\t\t{\n\t\t\tDWORD dwThreadID = ::GetCurrentThreadId();\n\t\t\tCCommandBarCtrlBase::_MsgHookData* pData = CCommandBarCtrlBase::s_pmapMsgHook->Lookup(dwThreadID);\n\t\t\tif(pData != NULL)\n\t\t\t{\n\t\t\t\tlRet = ::CallNextHookEx(pData->hMsgHook, nCode, wParam, lParam);\n\t\t\t}\n\t\t}\n\t\treturn lRet;\n\t}\n\n// Implementation\n\tvoid DoPopupMenu(int nIndex, bool bAnimate)\n\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - DoPopupMenu, bAnimate = %s\\n\"), bAnimate ? \"true\" : \"false\");\n#endif\n\t\tT* pT = static_cast<T*>(this);\n\n\t\t// get popup menu and it's position\n\t\tRECT rect = {};\n\t\tthis->GetItemRect(nIndex, &rect);\n\t\tPOINT pt = { rect.left, rect.bottom };\n\t\tthis->MapWindowPoints(NULL, &pt, 1);\n\t\tthis->MapWindowPoints(NULL, &rect);\n\t\tTPMPARAMS TPMParams = {};\n\t\tTPMParams.cbSize = sizeof(TPMPARAMS);\n\t\tTPMParams.rcExclude = rect;\n\t\tHMENU hMenuPopup = ::GetSubMenu(m_hMenu, nIndex);\n\t\tATLASSERT(hMenuPopup != NULL);\n\n\t\t// get button ID\n\t\tTBBUTTON tbb = {};\n\t\tthis->GetButton(nIndex, &tbb);\n\t\tint nCmdID = tbb.idCommand;\n\n\t\tm_nPopBtn = nIndex;   // remember current button's index\n\n\t\t// press button and display popup menu\n\t\tthis->PressButton(nCmdID, TRUE);\n\t\tthis->SetHotItem(nCmdID);\n\t\tpT->DoTrackPopupMenu(hMenuPopup, TPM_LEFTBUTTON | TPM_VERTICAL | TPM_LEFTALIGN | TPM_TOPALIGN |\n\t\t\t(bAnimate ? TPM_VERPOSANIMATION : TPM_NOANIMATION), pt.x, pt.y, &TPMParams);\n\t\tthis->PressButton(nCmdID, FALSE);\n\t\tif(::GetFocus() != this->m_hWnd)\n\t\t\tthis->SetHotItem(-1);\n\n\t\tm_nPopBtn = -1;   // restore\n\n\t\t// eat next message if click is on the same button\n\t\tMSG msg = {};\n\t\tif(::PeekMessage(&msg, this->m_hWnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_NOREMOVE) && ::PtInRect(&rect, msg.pt))\n\t\t\t::PeekMessage(&msg, this->m_hWnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_REMOVE);\n\n\t\t// check if another popup menu should be displayed\n\t\tif(m_nNextPopBtn != -1)\n\t\t{\n\t\t\tthis->PostMessage(GetAutoPopupMessage(), m_nNextPopBtn & 0xFFFF);\n\t\t\tif(!(m_nNextPopBtn & 0xFFFF0000) && !m_bPopupItem)\n\t\t\t\tthis->PostMessage(WM_KEYDOWN, VK_DOWN, 0);\n\t\t\tm_nNextPopBtn = -1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_bContextMenu = false;\n\t\t\t// If user didn't hit escape, give focus back\n\t\t\tif(!m_bEscapePressed)\n\t\t\t{\n\t\t\t\tif(m_bUseKeyboardCues && m_bShowKeyboardCues)\n\t\t\t\t\tm_bAllowKeyboardCues = false;\n\t\t\t\tpT->GiveFocusBack();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis->SetHotItem(nCmdID);\n\t\t\t\tthis->SetAnchorHighlight(TRUE);\n\t\t\t}\n\t\t}\n\t}\n\n\tBOOL DoTrackPopupMenu(HMENU hMenu, UINT uFlags, int x, int y, LPTPMPARAMS lpParams = NULL)\n\t{\n\t\tCMenuHandle menuPopup = hMenu;\n\n\t\tCWindowCreateCriticalSectionLock lock;\n\t\tif(FAILED(lock.Lock()))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CCommandBarCtrlImpl::DoTrackPopupMenu.\\n\"));\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tATLASSERT(this->s_hCreateHook == NULL);\n\n\t\tthis->s_pCurrentBar = static_cast<CCommandBarCtrlBase*>(this);\n\n\t\tthis->s_hCreateHook = ::SetWindowsHookEx(WH_CBT, CreateHookProc, ModuleHelper::GetModuleInstance(), GetCurrentThreadId());\n\t\tATLASSERT(this->s_hCreateHook != NULL);\n\n\t\tm_bPopupItem = false;\n\t\tm_bMenuActive = true;\n\n\t\tBOOL bTrackRet = menuPopup.TrackPopupMenuEx(uFlags, x, y, this->m_hWnd, lpParams);\n\t\tm_bMenuActive = false;\n\n\t\t::UnhookWindowsHookEx(this->s_hCreateHook);\n\n\t\tthis->s_hCreateHook = NULL;\n\t\tthis->s_pCurrentBar = NULL;\n\n\t\tlock.Unlock();\n\n\t\t// cleanup - convert menus back to original state\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - TrackPopupMenu - cleanup\\n\"));\n#endif\n\n\t\tATLASSERT(this->m_stackMenuWnd.GetSize() == 0);\n\n\t\tthis->UpdateWindow();\n\t\tATL::CWindow wndTL = this->GetTopLevelParent();\n\t\twndTL.UpdateWindow();\n\n\t\t// restore the menu items to the previous state for all menus that were converted\n\t\tif(m_bImagesVisible)\n\t\t{\n\t\t\tHMENU hMenuSav = NULL;\n\t\t\twhile((hMenuSav = this->m_stackMenuHandle.Pop()) != NULL)\n\t\t\t{\n\t\t\t\tmenuPopup = hMenuSav;\n\t\t\t\tBOOL bRet = FALSE;\n\t\t\t\t// restore state and delete menu item data\n\t\t\t\tfor(int i = 0; i < menuPopup.GetMenuItemCount(); i++)\n\t\t\t\t{\n\t\t\t\t\tCMenuItemInfo mii;\n\t\t\t\t\tmii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID;\n\t\t\t\t\tbRet = menuPopup.GetMenuItemInfo(i, TRUE, &mii);\n\t\t\t\t\tATLASSERT(bRet);\n\n\t\t\t\t\t_MenuItemData* pMI = (_MenuItemData*)mii.dwItemData;\n\t\t\t\t\tif(_IsValidMem(pMI) && pMI->IsCmdBarMenuItem())\n\t\t\t\t\t{\n\t\t\t\t\t\tmii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_STATE;\n\t\t\t\t\t\tmii.fType = pMI->fType;\n\t\t\t\t\t\tmii.fState = pMI->fState;\n\t\t\t\t\t\tmii.dwTypeData = pMI->lpstrText;\n\t\t\t\t\t\tmii.cch = lstrlen(pMI->lpstrText);\n\t\t\t\t\t\tmii.dwItemData = NULL;\n\n\t\t\t\t\t\tbRet = menuPopup.SetMenuItemInfo(i, TRUE, &mii);\n\t\t\t\t\t\t// this one triggers WM_MEASUREITEM\n\t\t\t\t\t\tmenuPopup.ModifyMenu(i, MF_BYPOSITION | mii.fType | mii.fState, mii.wID, pMI->lpstrText);\n\t\t\t\t\t\tATLASSERT(bRet);\n\n\t\t\t\t\t\tdelete [] pMI->lpstrText;\n\t\t\t\t\t\tdelete pMI;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn bTrackRet;\n\t}\n\n\tint GetPreviousMenuItem(int nBtn) const\n\t{\n\t\tif(nBtn == -1)\n\t\t\treturn -1;\n\t\tRECT rcClient = {};\n\t\tthis->GetClientRect(&rcClient);\n\t\tint nNextBtn;\n\t\tfor(nNextBtn = nBtn - 1; nNextBtn != nBtn; nNextBtn--)\n\t\t{\n\t\t\tif(nNextBtn < 0)\n\t\t\t\tnNextBtn = ::GetMenuItemCount(m_hMenu) - 1;\n\t\t\tTBBUTTON tbb = {};\n\t\t\tthis->GetButton(nNextBtn, &tbb);\n\t\t\tRECT rcBtn = {};\n\t\t\tthis->GetItemRect(nNextBtn, &rcBtn);\n\t\t\tif(rcBtn.right > rcClient.right)\n\t\t\t{\n\t\t\t\tnNextBtn = -2;   // chevron\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(((tbb.fsState & TBSTATE_ENABLED) != 0) && ((tbb.fsState & TBSTATE_HIDDEN) == 0))\n\t\t\t\tbreak;\n\t\t}\n\t\treturn (nNextBtn != nBtn) ? nNextBtn : -1;\n\t}\n\n\tint GetNextMenuItem(int nBtn) const\n\t{\n\t\tif(nBtn == -1)\n\t\t\treturn -1;\n\t\tRECT rcClient = {};\n\t\tthis->GetClientRect(&rcClient);\n\t\tint nNextBtn = 0;\n\t\tint nCount = ::GetMenuItemCount(m_hMenu);\n\t\tfor(nNextBtn = nBtn + 1; nNextBtn != nBtn; nNextBtn++)\n\t\t{\n\t\t\tif(nNextBtn >= nCount)\n\t\t\t\tnNextBtn = 0;\n\t\t\tTBBUTTON tbb = {};\n\t\t\tthis->GetButton(nNextBtn, &tbb);\n\t\t\tRECT rcBtn = {};\n\t\t\tthis->GetItemRect(nNextBtn, &rcBtn);\n\t\t\tif(rcBtn.right > rcClient.right)\n\t\t\t{\n\t\t\t\tnNextBtn = -2;   // chevron\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(((tbb.fsState & TBSTATE_ENABLED) != 0) && ((tbb.fsState & TBSTATE_HIDDEN) == 0))\n\t\t\t\tbreak;\n\t\t}\n\t\treturn (nNextBtn != nBtn) ? nNextBtn : -1;\n\t}\n\n\tbool DisplayChevronMenu()\n\t{\n\t\t// assume we are in a rebar\n\t\tHWND hWndReBar = this->GetParent();\n\t\tint nCount = (int)::SendMessage(hWndReBar, RB_GETBANDCOUNT, 0, 0L);\n\t\tbool bRet = false;\n\t\tfor(int i = 0; i < nCount; i++)\n\t\t{\n\t\t\tREBARBANDINFO rbbi = { RunTimeHelper::SizeOf_REBARBANDINFO(), RBBIM_CHILD | RBBIM_STYLE };\n\t\t\tBOOL bRetBandInfo = (BOOL)::SendMessage(hWndReBar, RB_GETBANDINFO, i, (LPARAM)&rbbi);\n\t\t\tif(bRetBandInfo && (rbbi.hwndChild == this->m_hWnd))\n\t\t\t{\n\t\t\t\tif((rbbi.fStyle & RBBS_USECHEVRON) != 0)\n\t\t\t\t{\n\t\t\t\t\t::PostMessage(hWndReBar, RB_PUSHCHEVRON, i, 0L);\n\t\t\t\t\tthis->PostMessage(WM_KEYDOWN, VK_DOWN, 0L);\n\t\t\t\t\tbRet = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn bRet;\n\t}\n\n\tvoid GetSystemSettings()\n\t{\n\t\t// refresh our font\n\t\tNONCLIENTMETRICS info = { RunTimeHelper::SizeOf_NONCLIENTMETRICS() };\n\t\tBOOL bRet = ::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(info), &info, 0);\n\t\tATLASSERT(bRet);\n\t\tif(bRet)\n\t\t{\n\t\t\tLOGFONT logfont = {};\n\t\t\tif(m_fontMenu.m_hFont != NULL)\n\t\t\t\tm_fontMenu.GetLogFont(logfont);\n\t\t\tif((logfont.lfHeight != info.lfMenuFont.lfHeight) ||\n\t\t\t   (logfont.lfWidth != info.lfMenuFont.lfWidth) ||\n\t\t\t   (logfont.lfEscapement != info.lfMenuFont.lfEscapement) ||\n\t\t\t   (logfont.lfOrientation != info.lfMenuFont.lfOrientation) ||\n\t\t\t   (logfont.lfWeight != info.lfMenuFont.lfWeight) ||\n\t\t\t   (logfont.lfItalic != info.lfMenuFont.lfItalic) ||\n\t\t\t   (logfont.lfUnderline != info.lfMenuFont.lfUnderline) ||\n\t\t\t   (logfont.lfStrikeOut != info.lfMenuFont.lfStrikeOut) ||\n\t\t\t   (logfont.lfCharSet != info.lfMenuFont.lfCharSet) ||\n\t\t\t   (logfont.lfOutPrecision != info.lfMenuFont.lfOutPrecision) ||\n\t\t\t   (logfont.lfClipPrecision != info.lfMenuFont.lfClipPrecision) ||\n\t\t\t   (logfont.lfQuality != info.lfMenuFont.lfQuality) ||\n\t\t\t   (logfont.lfPitchAndFamily != info.lfMenuFont.lfPitchAndFamily) ||\n\t\t\t   (lstrcmp(logfont.lfFaceName, info.lfMenuFont.lfFaceName) != 0))\n\t\t\t{\n\t\t\t\tHFONT hFontMenu = ::CreateFontIndirect(&info.lfMenuFont);\n\t\t\t\tATLASSERT(hFontMenu != NULL);\n\t\t\t\tif(hFontMenu != NULL)\n\t\t\t\t{\n\t\t\t\t\tif(m_fontMenu.m_hFont != NULL)\n\t\t\t\t\t\tm_fontMenu.DeleteObject();\n\t\t\t\t\tm_fontMenu.Attach(hFontMenu);\n\t\t\t\t\tthis->SetFont(m_fontMenu);\n\t\t\t\t\tthis->AddStrings(_T(\"NS\\0\"));   // for proper item height\n\t\t\t\t\tthis->AutoSize();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// check if we need extra spacing for menu item text\n\t\tCWindowDC dc(this->m_hWnd);\n\t\tHFONT hFontOld = dc.SelectFont(m_fontMenu);\n\t\tRECT rcText = {};\n\t\tdc.DrawText(_T(\"\\t\"), -1, &rcText, DT_SINGLELINE | DT_LEFT | DT_VCENTER | DT_CALCRECT);\n\t\tif((rcText.right - rcText.left) < 4)\n\t\t{\n\t\t\t::SetRectEmpty(&rcText);\n\t\t\tdc.DrawText(_T(\"x\"), -1, &rcText, DT_SINGLELINE | DT_LEFT | DT_VCENTER | DT_CALCRECT);\n\t\t\tm_cxExtraSpacing = rcText.right - rcText.left;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_cxExtraSpacing = 0;\n\t\t}\n\t\tdc.SelectFont(hFontOld);\n\n\t\t// get Windows version\n#ifndef _versionhelpers_H_INCLUDED_\n\t\tOSVERSIONINFO ovi = { sizeof(OSVERSIONINFO) };\n\t\t::GetVersionEx(&ovi);\n#endif // !_versionhelpers_H_INCLUDED_\n\n\t\t// query keyboard cues mode (Windows 2000 or later)\n#ifdef _versionhelpers_H_INCLUDED_\n\t\tif(::IsWindowsVersionOrGreater(5, 0, 0))\n#else // !_versionhelpers_H_INCLUDED_\n\t\tif (ovi.dwMajorVersion >= 5)\n#endif // _versionhelpers_H_INCLUDED_\n\t\t{\n\t\t\tBOOL bRetVal = TRUE;\n\t\t\tbRet = ::SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &bRetVal, 0);\n\t\t\tm_bUseKeyboardCues = (bRet && !bRetVal);\n\t\t\tm_bAllowKeyboardCues = true;\n\t\t\tShowKeyboardCues(!m_bUseKeyboardCues);\n\t\t}\n\n\t\t// query flat menu mode (Windows XP or later)\n#ifdef _versionhelpers_H_INCLUDED_\n\t\tif(::IsWindowsXPOrGreater())\n#else // !_versionhelpers_H_INCLUDED_\n\t\tif (((ovi.dwMajorVersion == 5) && (ovi.dwMinorVersion >= 1)) || (ovi.dwMajorVersion > 5))\n#endif // _versionhelpers_H_INCLUDED_\n\t\t{\n\t\t\tBOOL bRetVal = FALSE;\n\t\t\tbRet = ::SystemParametersInfo(SPI_GETFLATMENU, 0, &bRetVal, 0);\n\t\t\tm_bFlatMenus = (bRet && bRetVal);\n\t\t}\n\n#if _WTL_CMDBAR_VISTA_MENUS\n\t\t// check if we should use Vista menus\n\t\tbool bVistaMenus = (((m_dwExtendedStyle & CBR_EX_NOVISTAMENUS) == 0) && RunTimeHelper::IsVista() && RunTimeHelper::IsThemeAvailable());\n\t\tif(!bVistaMenus && m_bVistaMenus && (m_hMenu != NULL) && (m_arrCommand.GetSize() > 0))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->_RemoveVistaBitmapsFromMenu();\n\t\t}\n\n\t\tm_bVistaMenus = bVistaMenus;\n#endif // _WTL_CMDBAR_VISTA_MENUS\n\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CmdBar - GetSystemSettings:\\n     m_bFlatMenus = %s\\n     m_bUseKeyboardCues = %s     m_bVistaMenus = %s\\n\"),\n\t\t\tm_bFlatMenus ? \"true\" : \"false\", m_bUseKeyboardCues ? \"true\" : \"false\", m_bVistaMenus ? \"true\" : \"false\");\n#endif\n\t}\n\n// Implementation - alternate focus mode support\n\tvoid TakeFocus()\n\t{\n\t\tif((m_dwExtendedStyle & CBR_EX_ALTFOCUSMODE) && (m_hWndFocus == NULL))\n\t\t\tm_hWndFocus = ::GetFocus();\n\t\tthis->SetFocus();\n\t}\n\n\tvoid GiveFocusBack()\n\t{\n\t\tif(m_bParentActive)\n\t\t{\n\t\t\tif((m_dwExtendedStyle & CBR_EX_ALTFOCUSMODE) && ::IsWindow(m_hWndFocus))\n\t\t\t\t::SetFocus(m_hWndFocus);\n\t\t\telse if(!(m_dwExtendedStyle & CBR_EX_ALTFOCUSMODE) && m_wndParent.IsWindow())\n\t\t\t\tm_wndParent.SetFocus();\n\t\t}\n\t\tm_hWndFocus = NULL;\n\t\tthis->SetAnchorHighlight(FALSE);\n\t\tif(m_bUseKeyboardCues && m_bShowKeyboardCues)\n\t\t\tthis->ShowKeyboardCues(false);\n\t\tm_bSkipPostDown = false;\n\t}\n\n\tvoid ShowKeyboardCues(bool bShow)\n\t{\n\t\tm_bShowKeyboardCues = bShow;\n\t\tthis->SetDrawTextFlags(DT_HIDEPREFIX, m_bShowKeyboardCues ? 0 : DT_HIDEPREFIX);\n\t\tthis->Invalidate();\n\t\tthis->UpdateWindow();\n\t}\n\n// Implementation - internal message helpers\n\tstatic UINT GetAutoPopupMessage()\n\t{\n\t\tstatic UINT uAutoPopupMessage = 0;\n\t\tif(uAutoPopupMessage == 0)\n\t\t{\n\t\t\tCStaticDataInitCriticalSectionLock lock;\n\t\t\tif(FAILED(lock.Lock()))\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CCommandBarCtrlImpl::GetAutoPopupMessage.\\n\"));\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif(uAutoPopupMessage == 0)\n\t\t\t\tuAutoPopupMessage = ::RegisterWindowMessage(_T(\"WTL_CmdBar_InternalAutoPopupMsg\"));\n\n\t\t\tlock.Unlock();\n\t\t}\n\t\tATLASSERT(uAutoPopupMessage != 0);\n\t\treturn uAutoPopupMessage;\n\t}\n\n\tstatic UINT GetGetBarMessage()\n\t{\n\t\tstatic UINT uGetBarMessage = 0;\n\t\tif(uGetBarMessage == 0)\n\t\t{\n\t\t\tCStaticDataInitCriticalSectionLock lock;\n\t\t\tif(FAILED(lock.Lock()))\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CCommandBarCtrlImpl::GetGetBarMessage.\\n\"));\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif(uGetBarMessage == 0)\n\t\t\t\tuGetBarMessage = ::RegisterWindowMessage(_T(\"WTL_CmdBar_InternalGetBarMsg\"));\n\n\t\t\tlock.Unlock();\n\t\t}\n\t\tATLASSERT(uGetBarMessage != 0);\n\t\treturn uGetBarMessage;\n\t}\n\n// Implementation\n\tbool CreateInternalImageList(int cImages)\n\t{\n\t\tUINT uFlags = (m_bAlphaImages ? ILC_COLOR32 : ILC_COLOR24) | ILC_MASK;\n\t\tm_hImageList = ::ImageList_Create(m_szBitmap.cx, m_szBitmap.cy, uFlags, cImages, 1);\n\t\tATLASSERT(m_hImageList != NULL);\n\t\treturn (m_hImageList != NULL);\n\t}\n\n// Implementation - support for Vista menus\n#if _WTL_CMDBAR_VISTA_MENUS\n\tvoid _AddVistaBitmapsFromImageList(int nStartIndex, int nCount)\n\t{\n\t\t// Create display compatible memory DC\n\t\tCClientDC dc(NULL);\n\t\tCDC dcMem;\n\t\tdcMem.CreateCompatibleDC(dc);\n\t\tHBITMAP hBitmapSave = dcMem.GetCurrentBitmap();\n\n\t\tT* pT = static_cast<T*>(this);\n\t\t// Create bitmaps for all menu items\n\t\tfor(int i = 0; i < nCount; i++)\n\t\t{\n\t\t\tHBITMAP hBitmap = pT->_CreateVistaBitmapHelper(nStartIndex + i, dc, dcMem);\n\t\t\tdcMem.SelectBitmap(hBitmapSave);\n\t\t\tm_arrVistaBitmap.Add(hBitmap);\n\t\t}\n\t}\n\n\tvoid _AddVistaBitmapFromImageList(int nIndex)\n\t{\n\t\t// Create display compatible memory DC\n\t\tCClientDC dc(NULL);\n\t\tCDC dcMem;\n\t\tdcMem.CreateCompatibleDC(dc);\n\t\tHBITMAP hBitmapSave = dcMem.GetCurrentBitmap();\n\n\t\t// Create bitmap for menu item\n\t\tT* pT = static_cast<T*>(this);\n\t\tHBITMAP hBitmap = pT->_CreateVistaBitmapHelper(nIndex, dc, dcMem);\n\n\t\t// Select saved bitmap back and add bitmap to the array\n\t\tdcMem.SelectBitmap(hBitmapSave);\n\t\tm_arrVistaBitmap.Add(hBitmap);\n\t}\n\n\tvoid _ReplaceVistaBitmapFromImageList(int nIndex)\n\t{\n\t\t// Delete existing bitmap\n\t\tif(m_arrVistaBitmap[nIndex] != NULL)\n\t\t\t::DeleteObject(m_arrVistaBitmap[nIndex]);\n\n\t\t// Create display compatible memory DC\n\t\tCClientDC dc(NULL);\n\t\tCDC dcMem;\n\t\tdcMem.CreateCompatibleDC(dc);\n\t\tHBITMAP hBitmapSave = dcMem.GetCurrentBitmap();\n\n\t\t// Create bitmap for menu item\n\t\tT* pT = static_cast<T*>(this);\n\t\tHBITMAP hBitmap = pT->_CreateVistaBitmapHelper(nIndex, dc, dcMem);\n\n\t\t// Select saved bitmap back and replace bitmap in the array\n\t\tdcMem.SelectBitmap(hBitmapSave);\n\t\tm_arrVistaBitmap.SetAtIndex(nIndex, hBitmap);\n\t}\n\n\tHBITMAP _CreateVistaBitmapHelper(int nIndex, HDC hDCSource, HDC hDCTarget)\n\t{\n\t\t// Create 32-bit bitmap\n\t\tBITMAPINFO bi = {};\n\t\tbi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);\n\t\tbi.bmiHeader.biWidth = m_szBitmap.cx;\n\t\tbi.bmiHeader.biHeight = m_szBitmap.cy;\n\t\tbi.bmiHeader.biPlanes = 1;\n\t\tbi.bmiHeader.biBitCount = 32;\n\t\tbi.bmiHeader.biCompression = BI_RGB;\n\t\tbi.bmiHeader.biSizeImage = 0;\n\t\tbi.bmiHeader.biXPelsPerMeter = 0;\n\t\tbi.bmiHeader.biYPelsPerMeter = 0;\n\t\tbi.bmiHeader.biClrUsed = 0;\n\t\tbi.bmiHeader.biClrImportant = 0;\n\t\tHBITMAP hBitmap = ::CreateDIBSection(hDCSource, &bi, DIB_RGB_COLORS, NULL, NULL, 0);\n\t\tATLASSERT(hBitmap != NULL);\n\n\t\t// Select bitmap into target DC and draw from image list to it\n\t\tif(hBitmap != NULL)\n\t\t{\n\t\t\t::SelectObject(hDCTarget, hBitmap);\n\n\t\t\tIMAGELISTDRAWPARAMS ildp = {};\n\t\t\tildp.cbSize = sizeof(IMAGELISTDRAWPARAMS);\n\t\t\tildp.himl = m_hImageList;\n\t\t\tildp.i = nIndex;\n\t\t\tildp.hdcDst = hDCTarget;\n\t\t\tildp.x = 0;\n\t\t\tildp.y = 0;\n\t\t\tildp.cx = 0;\n\t\t\tildp.cy = 0;\n\t\t\tildp.xBitmap = 0;\n\t\t\tildp.yBitmap = 0;\n\t\t\tildp.fStyle = ILD_TRANSPARENT;\n\t\t\tildp.fState = ILS_ALPHA;\n\t\t\tildp.Frame = 255;\n\t\t\t::ImageList_DrawIndirect(&ildp);\n\t\t}\n\n\t\treturn hBitmap;\n\t}\n\n\tvoid _RemoveVistaBitmapsFromMenu()\n\t{\n\t\tCMenuHandle menu = m_hMenu;\n\t\tfor(int i = 0; i < m_arrCommand.GetSize(); i++)\n\t\t{\n\t\t\tCMenuItemInfo mii;\n\t\t\tmii.fMask = MIIM_BITMAP;\n\t\t\tmii.hbmpItem = NULL;\n\t\t\tmenu.SetMenuItemInfo(m_arrCommand[i], FALSE, &mii);\n\t\t}\n\t}\n#endif // _WTL_CMDBAR_VISTA_MENUS\n\n// Implementation helper\n\tstatic bool _IsValidMem(void* pMem)\n\t{\n\t\tbool bRet = false;\n\t\tif(pMem != NULL)\n\t\t{\n\t\t\tMEMORY_BASIC_INFORMATION mbi = {};\n\t\t\t::VirtualQuery(pMem, &mbi, sizeof(MEMORY_BASIC_INFORMATION));\n\t\t\tbRet = (mbi.BaseAddress != NULL) && ((mbi.Protect & (PAGE_READONLY | PAGE_READWRITE)) != 0);\n\t\t}\n\n\t\treturn bRet;\n\t}\n};\n\n\nclass CCommandBarCtrl : public CCommandBarCtrlImpl<CCommandBarCtrl>\n{\npublic:\n\tDECLARE_WND_SUPERCLASS(_T(\"WTL_CommandBar\"), GetWndClassName())\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CMDICommandBarCtrl - ATL implementation of Command Bars for MDI apps\n\ntemplate <class T, class TBase = CCommandBarCtrlBase, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBase, TWinTraits>\n{\npublic:\n// Data members\n\tATL::CContainedWindow m_wndMDIClient;\n\tbool m_bChildMaximized;\n\tHWND m_hWndChildMaximized;\n\tHICON m_hIconChildMaximized;\n\tint m_nBtnPressed;\n\tint m_nBtnWasPressed;\n\n\tint m_cxyOffset;      // offset between nonclient elements\n\tint m_cxIconWidth;    // small icon width\n\tint m_cyIconHeight;   // small icon height\n\tint m_cxBtnWidth;     // nonclient button width\n\tint m_cyBtnHeight;    // nonclient button height\n\tint m_cxLeft;         // left nonclient area width\n\tint m_cxRight;        // right nonclient area width\n\n\tHTHEME m_hTheme;\n\n// Constructor/destructor\n\tCMDICommandBarCtrlImpl() : \n\t\t\tm_wndMDIClient(this, 2), m_bChildMaximized(false), \n\t\t\tm_hWndChildMaximized(NULL), m_hIconChildMaximized(NULL), \n\t\t\tm_nBtnPressed(-1), m_nBtnWasPressed(-1),\n\t\t\tm_cxyOffset(2),\n\t\t\tm_cxIconWidth(16), m_cyIconHeight(16),\n\t\t\tm_cxBtnWidth(16), m_cyBtnHeight(14),\n\t\t\tm_cxLeft(20), m_cxRight(55), \n\t\t\tm_hTheme(NULL)\n\t{ }\n\n\t~CMDICommandBarCtrlImpl()\n\t{\n\t\tif(m_wndMDIClient.IsWindow())\n/*scary!*/\t\t\tm_wndMDIClient.UnsubclassWindow();\n\t}\n\n// Operations\n\tBOOL SetMDIClient(HWND hWndMDIClient)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(::IsWindow(hWndMDIClient));\n\t\tif(!::IsWindow(hWndMDIClient))\n\t\t\treturn FALSE;\n\n#ifdef _DEBUG\n\t\t// BLOCK: Test if the passed window is MDICLIENT\n\t\t{\n\t\t\tLPCTSTR lpszMDIClientClass = _T(\"MDICLIENT\");\n\t\t\tconst int nNameLen = 9 + 1;   // \"MDICLIENT\" + NULL\n\t\t\tTCHAR szClassName[nNameLen] = {};\n\t\t\t::GetClassName(hWndMDIClient, szClassName, nNameLen);\n\t\t\tATLASSERT(lstrcmpi(szClassName, lpszMDIClientClass) == 0);\n\t\t}\n#endif // _DEBUG\n\n\t\tif(m_wndMDIClient.IsWindow())\n/*scary!*/\t\tm_wndMDIClient.UnsubclassWindow();\n\n\t\treturn m_wndMDIClient.SubclassWindow(hWndMDIClient);\n\t}\n\n// Message maps\n\ttypedef CCommandBarCtrlImpl< T, TBase, TWinTraits >   _baseClass;\n\tBEGIN_MSG_MAP(CMDICommandBarCtrlImpl)\n\t\tMESSAGE_HANDLER(WM_CREATE, OnCreate)\n\t\tMESSAGE_HANDLER(WM_DESTROY, OnDestroy)\n\t\tMESSAGE_HANDLER(WM_THEMECHANGED, OnThemeChanged)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\t\tMESSAGE_HANDLER(WM_NCCALCSIZE, OnNcCalcSize)\n\t\tMESSAGE_HANDLER(WM_NCPAINT, OnNcPaint)\n\t\tMESSAGE_HANDLER(WM_NCHITTEST, OnNcHitTest)\n\t\tMESSAGE_HANDLER(WM_NCLBUTTONDOWN, OnNcLButtonDown)\n\t\tMESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)\n\t\tMESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)\n\t\tMESSAGE_HANDLER(WM_NCLBUTTONDBLCLK, OnNcLButtonDblClk)\n\t\tMESSAGE_HANDLER(WM_CAPTURECHANGED, OnCaptureChanged)\n\t\tCHAIN_MSG_MAP(_baseClass)\n\tALT_MSG_MAP(1)   // Parent window messages\n\t\tMESSAGE_HANDLER(WM_ACTIVATE, OnParentActivate)\n\t\tCHAIN_MSG_MAP_ALT(_baseClass, 1)\n\tALT_MSG_MAP(2)   // MDI client window messages\n\t\tMESSAGE_HANDLER(WM_MDISETMENU, OnMDISetMenu)\n\t\t// no chaining needed since this was moved from the base class here\n\tALT_MSG_MAP(3)   // Message hook messages\n\t\tMESSAGE_RANGE_HANDLER(0, 0xFFFF, OnAllHookMessages)\n\t\tCHAIN_MSG_MAP_ALT(_baseClass, 3)\n\tEND_MSG_MAP()\n\n// Additional MDI message handlers\n\tLRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tLRESULT lRet = _baseClass::OnCreate(uMsg, wParam, lParam, bHandled);\n\t\tif(lRet == (LRESULT)-1)\n\t\t\treturn lRet;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->_OpenThemeData();\n\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tLRESULT lRet = _baseClass::OnDestroy(uMsg, wParam, lParam, bHandled);\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->_CloseThemeData();\n\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnThemeChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->_CloseThemeData();\n\t\tpT->_OpenThemeData();\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tLRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->_AdjustBtnSize(GET_Y_LPARAM(lParam));\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tLRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);\n\n\t\tif(m_bChildMaximized && (BOOL)wParam)\n\t\t{\n\t\t\tLPNCCALCSIZE_PARAMS lpParams = (LPNCCALCSIZE_PARAMS)lParam;\n\t\t\tif(this->m_bLayoutRTL)\n\t\t\t{\n\t\t\t\tlpParams->rgrc[0].left += m_cxRight;\n\t\t\t\tlpParams->rgrc[0].right -= m_cxLeft;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlpParams->rgrc[0].left += m_cxLeft;\n\t\t\t\tlpParams->rgrc[0].right -= m_cxRight;\n\t\t\t}\n\t\t}\n\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tLRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);\n\n\t\tif(!m_bChildMaximized)\n\t\t\treturn lRet;\n\n\t\tATLASSERT((m_hWndChildMaximized != NULL) && (m_hIconChildMaximized != NULL));\n\n\t\t// get DC and window rectangle\n\t\tCWindowDC dc(this->m_hWnd);\n\t\tRECT rect = {};\n\t\tthis->GetWindowRect(&rect);\n\t\tint cxWidth = rect.right - rect.left;\n\t\tint cyHeight = rect.bottom - rect.top;\n\n\t\t// paint left side nonclient background and draw icon\n\t\t::SetRect(&rect, 0, 0, m_cxLeft, cyHeight);\n\t\tif(m_hTheme != NULL)\n\t\t{\n\t\t\t::DrawThemeParentBackground(this->m_hWnd, dc, &rect);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif((this->m_dwExtendedStyle & CBR_EX_TRANSPARENT) != 0)\n\t\t\t\tdc.FillRect(&rect, COLOR_3DFACE);\n\t\t\telse\n\t\t\t\tdc.FillRect(&rect, COLOR_MENU);\n\t\t}\n\n\t\tRECT rcIcon = {};\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->_CalcIconRect(cxWidth, cyHeight, rcIcon);\n\t\tdc.DrawIconEx(rcIcon.left, rcIcon.top, m_hIconChildMaximized, m_cxIconWidth, m_cyIconHeight);\n\n\t\t// paint right side nonclient background\n\t\t::SetRect(&rect, cxWidth - m_cxRight, 0, cxWidth, cyHeight);\n\t\tif(m_hTheme != NULL)\n\t\t{\n\t\t\t// this is to account for the left non-client area\n\t\t\tPOINT ptOrg = {};\n\t\t\tdc.GetViewportOrg(&ptOrg);\n\t\t\tdc.SetViewportOrg(ptOrg.x + m_cxLeft, ptOrg.y);\n\t\t\t::OffsetRect(&rect, -m_cxLeft, 0);\n\n\t\t\t::DrawThemeParentBackground(this->m_hWnd, dc, &rect);\n\n\t\t\t// restore\n\t\t\tdc.SetViewportOrg(ptOrg);\n\t\t\t::OffsetRect(&rect, m_cxLeft, 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif((this->m_dwExtendedStyle & CBR_EX_TRANSPARENT) != 0)\n\t\t\t\tdc.FillRect(&rect, COLOR_3DFACE);\n\t\t\telse\n\t\t\t\tdc.FillRect(&rect, COLOR_MENU);\n\t\t}\n\n\t\t// draw buttons\n\t\tRECT arrRect[3] = {};\n\t\tpT->_CalcBtnRects(cxWidth, cyHeight, arrRect);\n\t\tpT->_DrawMDIButton(dc, arrRect, -1);   // draw all buttons\n\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tLRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);\n\t\tif(m_bChildMaximized)\n\t\t{\n\t\t\tRECT rect = {};\n\t\t\tthis->GetWindowRect(&rect);\n\t\t\tPOINT pt = { GET_X_LPARAM(lParam) - rect.left, GET_Y_LPARAM(lParam) - rect.top };\n\t\t\tif(this->m_bLayoutRTL)\n\t\t\t{\n\t\t\t\tif((pt.x < m_cxRight) || (pt.x > ((rect.right - rect.left) - m_cxLeft)))\n\t\t\t\t\tlRet = HTBORDER;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif((pt.x < m_cxLeft) || (pt.x > ((rect.right - rect.left) - m_cxRight)))\n\t\t\t\t\tlRet = HTBORDER;\n\t\t\t}\n\t\t}\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnNcLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif(!m_bChildMaximized)\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\n\t\tATLASSERT(_DebugCheckChild());\n\n\t\tPOINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\t\tRECT rect = {};\n\t\tthis->GetWindowRect(&rect);\n\t\tpt.x -= rect.left;\n\t\tpt.y -= rect.top;\n\n\t\tRECT rcIcon = {};\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->_CalcIconRect(rect.right - rect.left, rect.bottom - rect.top, rcIcon, this->m_bLayoutRTL);\n\t\tRECT arrRect[3] = {};\n\t\tpT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, this->m_bLayoutRTL);\n\n\t\tif(::PtInRect(&rcIcon, pt))\n\t\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"MDI CmdBar - LButtonDown: icon\\n\"));\n#endif\n\t\t\tCMenuHandle menu = ::GetSystemMenu(m_hWndChildMaximized, FALSE);\n\t\t\tUINT uRet = (UINT)menu.TrackPopupMenu(TPM_LEFTBUTTON | TPM_VERTICAL | TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RETURNCMD |  \n\t\t\t\tTPM_VERPOSANIMATION, this->m_bLayoutRTL ? rect.right : rect.left, rect.bottom, m_hWndChildMaximized);\n\n\t\t\t// eat next message if click is on the same button\n\t\t\t::OffsetRect(&rcIcon, rect.left, rect.top);\n\t\t\tMSG msg = {};\n\t\t\tif(::PeekMessage(&msg, this->m_hWnd, WM_NCLBUTTONDOWN, WM_NCLBUTTONDOWN, PM_NOREMOVE) && ::PtInRect(&rcIcon, msg.pt))\n\t\t\t\t::PeekMessage(&msg, this->m_hWnd, WM_NCLBUTTONDOWN, WM_NCLBUTTONDOWN, PM_REMOVE);\n\n\t\t\tif(uRet != 0)\n\t\t\t\t::SendMessage(m_hWndChildMaximized, WM_SYSCOMMAND, uRet, 0L);\n\t\t}\n\t\telse if(::PtInRect(&arrRect[0], pt))\n\t\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"MDI CmdBar - LButtonDown: close button\\n\"));\n#endif\n\t\t\tm_nBtnWasPressed = m_nBtnPressed = 0;\n\t\t}\n\t\telse if(::PtInRect(&arrRect[1], pt))\n\t\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"MDI CmdBar - LButtonDown: restore button\\n\"));\n#endif\n\t\t\tm_nBtnWasPressed = m_nBtnPressed = 1;\n\t\t}\n\t\telse if(::PtInRect(&arrRect[2], pt))\n\t\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"MDI CmdBar - LButtonDown: minimize button\\n\"));\n#endif\n\t\t\tm_nBtnWasPressed = m_nBtnPressed = 2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t}\n\n\t\t// draw the button state if it was pressed\n\t\tif(m_nBtnPressed != -1)\n\t\t{\n\t\t\tthis->SetCapture();\n\t\t\tCWindowDC dc(this->m_hWnd);\n\t\t\tpT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect);\n\t\t\tpT->_DrawMDIButton(dc, arrRect, m_nBtnPressed);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif(!m_bChildMaximized || (::GetCapture() != this->m_hWnd) || (m_nBtnWasPressed == -1))\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\n\t\tPOINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\t\tthis->ClientToScreen(&pt);\n\t\tRECT rect = {};\n\t\tthis->GetWindowRect(&rect);\n\t\tpt.x -= rect.left;\n\t\tpt.y -= rect.top;\n\t\tRECT arrRect[3] = {};\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, this->m_bLayoutRTL);\n\t\tint nOldBtnPressed = m_nBtnPressed;\n\t\tm_nBtnPressed = ::PtInRect(&arrRect[m_nBtnWasPressed], pt) ? m_nBtnWasPressed : -1;\n\t\tif(nOldBtnPressed != m_nBtnPressed)\n\t\t{\n\t\t\tCWindowDC dc(this->m_hWnd);\n\t\t\tpT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect);\n\t\t\tpT->_DrawMDIButton(dc, arrRect, (m_nBtnPressed != -1) ? m_nBtnPressed : nOldBtnPressed);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif(!m_bChildMaximized || (::GetCapture() != this->m_hWnd) || (m_nBtnWasPressed == -1))\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\n\t\tATLASSERT(_DebugCheckChild());\n\n\t\tPOINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\t\tthis->ClientToScreen(&pt);\n\t\tRECT rect = {};\n\t\tthis->GetWindowRect(&rect);\n\t\tpt.x -= rect.left;\n\t\tpt.y -= rect.top;\n\n\t\tint nBtn = m_nBtnWasPressed;\n\t\tReleaseCapture();\n\n\t\tRECT arrRect[3] = {};\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, this->m_bLayoutRTL);\n\t\tif(::PtInRect(&arrRect[nBtn], pt))\n\t\t{\n\t\t\tswitch(nBtn)\n\t\t\t{\n\t\t\tcase 0:\t\t// close\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"MDI CmdBar - LButtonUp: close button\\n\"));\n#endif\n\t\t\t\t::SendMessage(m_hWndChildMaximized, WM_SYSCOMMAND, SC_CLOSE, 0L);\n\t\t\t\tbreak;\n\t\t\tcase 1:\t\t// restore\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"MDI CmdBar - LButtonUp: restore button\\n\"));\n#endif\n\t\t\t\t::SendMessage(m_hWndChildMaximized, WM_SYSCOMMAND, SC_RESTORE, 0L);\n\t\t\t\tbreak;\n\t\t\tcase 2:\t\t// minimize\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"MDI CmdBar - LButtonUp: minimize button\\n\"));\n#endif\n\t\t\t\t::SendMessage(m_hWndChildMaximized, WM_SYSCOMMAND, SC_MINIMIZE, 0L);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnNcLButtonDblClk(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif(!m_bChildMaximized || (m_nBtnWasPressed != -1))\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\n\t\tATLASSERT(_DebugCheckChild());\n\n\t\tPOINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\t\tRECT rect = {};\n\t\tthis->GetWindowRect(&rect);\n\t\tpt.x -= rect.left;\n\t\tpt.y -= rect.top;\n\n\t\tRECT rcIcon = {};\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->_CalcIconRect(rect.right - rect.left, rect.bottom - rect.top, rcIcon, this->m_bLayoutRTL);\n\t\tRECT arrRect[3] = {};\n\t\tpT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, this->m_bLayoutRTL);\n\n\t\tif(::PtInRect(&rcIcon, pt))\n\t\t{\n\t\t\tCMenuHandle menu = ::GetSystemMenu(m_hWndChildMaximized, FALSE);\n\t\t\tUINT uDefID = menu.GetMenuDefaultItem();\n\t\t\tif(uDefID == (UINT)-1)\n\t\t\t\tuDefID = SC_CLOSE;\n\t\t\t::SendMessage(m_hWndChildMaximized, WM_SYSCOMMAND, uDefID, 0L);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnCaptureChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(m_bChildMaximized)\n\t\t{\n\t\t\tif(m_nBtnPressed != -1)\n\t\t\t{\n\t\t\t\tATLASSERT(m_nBtnPressed == m_nBtnWasPressed);   // must be\n\t\t\t\tm_nBtnPressed = -1;\n\t\t\t\tRECT rect = {};\n\t\t\t\tthis->GetWindowRect(&rect);\n\t\t\t\tRECT arrRect[3] = {};\n\t\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t\tpT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect);\n\t\t\t\tCWindowDC dc(this->m_hWnd);\n\t\t\t\tpT->_DrawMDIButton(dc, arrRect, m_nBtnWasPressed);\n\t\t\t}\n\t\t\tm_nBtnWasPressed = -1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t}\n\t\treturn 0;\n\t}\n\n// Parent window message handlers\n\tLRESULT OnParentActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tthis->m_bParentActive = (LOWORD(wParam) != WA_INACTIVE);\n\t\tthis->RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW);\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n// MDI client window message handlers\n\tLRESULT OnMDISetMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tm_wndMDIClient.DefWindowProc(uMsg, NULL, lParam);\n\t\tHMENU hOldMenu = this->GetMenu();\n\t\tBOOL bRet = this->AttachMenu((HMENU)wParam);\n\t\t(void)bRet;   // avoid level 4 warning\n\t\tATLASSERT(bRet);\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->UpdateRebarBandIdealSize();\n\n\t\treturn (LRESULT)hOldMenu;\n\t}\n\n// All messages from the message hook\n\tLRESULT OnAllHookMessages(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->_ProcessAllHookMessages(uMsg, wParam, lParam);\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n// Overrideables\n\t// override this to provide different ideal size\n\tvoid UpdateRebarBandIdealSize()\n\t{\n\t\t// assuming we are in a rebar, change ideal size to our size\n\t\t// we hope that if we are not in a rebar, nCount will be 0\n\t\tATL::CWindow wndParent = this->GetParent();\n\t\tint nCount = (int)wndParent.SendMessage(RB_GETBANDCOUNT, 0, 0L);\n\t\tfor(int i = 0; i < nCount; i++)\n\t\t{\n\t\t\tREBARBANDINFO rbi = { RunTimeHelper::SizeOf_REBARBANDINFO(), RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE };\n\t\t\twndParent.SendMessage(RB_GETBANDINFO, i, (LPARAM)&rbi);\n\t\t\tif(rbi.hwndChild == this->m_hWnd)\n\t\t\t{\n\t\t\t\trbi.fMask = RBBIM_IDEALSIZE;\n\t\t\t\trbi.cxIdeal = m_bChildMaximized ? m_cxLeft + m_cxRight : 0;\n\t\t\t\tint nBtnCount = this->GetButtonCount();\n\t\t\t\tif(nBtnCount > 0)\n\t\t\t\t{\n\t\t\t\t\tRECT rect = {};\n\t\t\t\t\tthis->GetItemRect(nBtnCount - 1, &rect);\n\t\t\t\t\trbi.cxIdeal += rect.right;\n\t\t\t\t}\n\t\t\t\twndParent.SendMessage(RB_SETBANDINFO, i, (LPARAM)&rbi);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// all hook messages - check for the maximized MDI child window change\n\tvoid _ProcessAllHookMessages(UINT uMsg, WPARAM /*wParam*/, LPARAM /*lParam*/)\n\t{\n\t\tif((uMsg == WM_MDIGETACTIVE) || (uMsg == WM_MDISETMENU))\n\t\t\treturn;\n\n\t\tBOOL bMaximized = FALSE;\n\t\tHWND hWndChild = (HWND)::SendMessage(m_wndMDIClient, WM_MDIGETACTIVE, 0, (LPARAM)&bMaximized);\n\t\tbool bMaxOld = m_bChildMaximized;\n\t\tm_bChildMaximized = ((hWndChild != NULL) && bMaximized);\n\t\tHICON hIconOld = m_hIconChildMaximized;\n\n\t\tif(m_bChildMaximized)\n\t\t{\n\t\t\tif(m_hWndChildMaximized != hWndChild)\n\t\t\t{\n\t\t\t\tATL::CWindow wnd = m_hWndChildMaximized = hWndChild;\n\t\t\t\tm_hIconChildMaximized = wnd.GetIcon(FALSE);\n\t\t\t\tif(m_hIconChildMaximized == NULL)\n\t\t\t\t{\n\t\t\t\t\tm_hIconChildMaximized = wnd.GetIcon(TRUE);\n\t\t\t\t\tif(m_hIconChildMaximized == NULL)   // no icon set with WM_SETICON, get the class one\n\t\t\t\t\t\tm_hIconChildMaximized = (HICON)::GetClassLongPtr(wnd, GCLP_HICONSM);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_hWndChildMaximized = NULL;\n\t\t\tm_hIconChildMaximized = NULL;\n\t\t}\n\n\t\tif(bMaxOld != m_bChildMaximized)\n\t\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"MDI CmdBar - All messages hook change: m_bChildMaximized = %s\\n\"), m_bChildMaximized ? \"true\" : \"false\");\n#endif\n\t\t\t// assuming we are in a rebar, change our size to accomodate new state\n\t\t\t// we hope that if we are not in a rebar, nCount will be 0\n\t\t\tATL::CWindow wndParent = this->GetParent();\n\t\t\tint nCount = (int)wndParent.SendMessage(RB_GETBANDCOUNT, 0, 0L);\n\t\t\tint cxDiff = (m_bChildMaximized ? 1 : -1) * (m_cxLeft + m_cxRight);\n\t\t\tfor(int i = 0; i < nCount; i++)\n\t\t\t{\n\t\t\t\tREBARBANDINFO rbi = { RunTimeHelper::SizeOf_REBARBANDINFO(), RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE | RBBIM_STYLE };\n\t\t\t\twndParent.SendMessage(RB_GETBANDINFO, i, (LPARAM)&rbi);\n\t\t\t\tif(rbi.hwndChild == this->m_hWnd)\n\t\t\t\t{\n\t\t\t\t\tif((rbi.fStyle & RBBS_USECHEVRON) != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\trbi.fMask = RBBIM_CHILDSIZE | RBBIM_IDEALSIZE;\n\t\t\t\t\t\trbi.cxMinChild += cxDiff;\n\t\t\t\t\t\trbi.cxIdeal += cxDiff;\n\t\t\t\t\t\twndParent.SendMessage(RB_SETBANDINFO, i, (LPARAM)&rbi);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif((bMaxOld != m_bChildMaximized) || (hIconOld != m_hIconChildMaximized))\n\t\t{\n\t\t\t// force size change and redraw everything\n\t\t\tRECT rect = {};\n\t\t\tthis->GetWindowRect(&rect);\n\t\t\t::MapWindowPoints(NULL, this->GetParent(), (LPPOINT)&rect, 2);\n\t\t\tthis->SetRedraw(FALSE);\n\t\t\tthis->SetWindowPos(NULL, 0, 0, 1, 1, SWP_NOZORDER | SWP_NOMOVE);\n\t\t\tthis->SetWindowPos(NULL, &rect, SWP_NOZORDER | SWP_NOMOVE);\n\t\t\tthis->SetRedraw(TRUE);\n\t\t\tthis->RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);\n\t\t}\n\t}\n\n// Implementation\n\tvoid GetSystemSettings()\n\t{\n#ifdef _CMDBAR_EXTRA_TRACE\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"MDI CmdBar - GetSystemSettings\\n\"));\n#endif\n\t\t_baseClass::GetSystemSettings();\n\n\t\tNONCLIENTMETRICS info = { RunTimeHelper::SizeOf_NONCLIENTMETRICS() };\n\t\tBOOL bRet = ::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(info), &info, 0);\n\t\tATLASSERT(bRet);\n\t\tif(bRet)\n\t\t{\n\t\t\tm_cxIconWidth = ::GetSystemMetrics(SM_CXSMICON);\n\t\t\tm_cyIconHeight = ::GetSystemMetrics(SM_CYSMICON);\n\t\t\tm_cxLeft = m_cxIconWidth;\n\n\t\t\tif(m_hTheme != NULL)\n\t\t\t{\n\t\t\t\tm_cxBtnWidth = info.iCaptionWidth - 2 * m_cxyOffset;\n\t\t\t\tm_cyBtnHeight = info.iCaptionHeight - 2 * m_cxyOffset;\n\t\t\t\tm_cxRight = 3 * m_cxBtnWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_cxBtnWidth = info.iCaptionWidth - m_cxyOffset;\n\t\t\t\tm_cyBtnHeight = info.iCaptionHeight - 2 * m_cxyOffset;\n\t\t\t\tm_cxRight = 3 * m_cxBtnWidth + m_cxyOffset;\n\t\t\t}\n\t\t}\n\n\t\tRECT rect = {};\n\t\tthis->GetClientRect(&rect);\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->_AdjustBtnSize(rect.bottom);\n\t}\n\n\tvoid _AdjustBtnSize(int cyHeight)\n\t{\n\t\tif((cyHeight > 1) && (m_cyBtnHeight > cyHeight))\n\t\t{\n\t\t\tif(m_hTheme != NULL)\n\t\t\t{\n\t\t\t\tm_cyBtnHeight = cyHeight;\n\t\t\t\tm_cxBtnWidth = cyHeight;\n\t\t\t\tm_cxRight = 3 * m_cxBtnWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_cyBtnHeight = cyHeight;\n\t\t\t\tm_cxBtnWidth = cyHeight + m_cxyOffset;\n\t\t\t\tm_cxRight = 3 * m_cxBtnWidth + m_cxyOffset;\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid _CalcIconRect(int cxWidth, int cyHeight, RECT& rect, bool bInvertX = false) const\n\t{\n\t\tint xStart = (m_cxLeft - m_cxIconWidth) / 2;\n\t\tif(xStart < 0)\n\t\t\txStart = 0;\n\t\tint yStart = (cyHeight - m_cyIconHeight) / 2;\n\t\tif(yStart < 0)\n\t\t\tyStart = 0;\n\n\t\tif(bInvertX)\n\t\t\t::SetRect(&rect, cxWidth - (xStart + m_cxBtnWidth), yStart, cxWidth - xStart, yStart + m_cyBtnHeight);\n\t\telse\n\t\t\t::SetRect(&rect, xStart, yStart, xStart + m_cxBtnWidth, yStart + m_cyBtnHeight);\n\t}\n\n\tvoid _CalcBtnRects(int cxWidth, int cyHeight, RECT arrRect[3], bool bInvertX = false) const\n\t{\n\t\tint yStart = (cyHeight - m_cyBtnHeight) / 2;\n\t\tif(yStart < 0)\n\t\t\tyStart = 0;\n\n\t\tRECT rcBtn = { cxWidth - m_cxBtnWidth, yStart, cxWidth, yStart + m_cyBtnHeight };\n\t\tint nDirection = -1;\n\t\tif(bInvertX)\n\t\t{\n\t\t\t::SetRect(&rcBtn, 0, yStart, m_cxBtnWidth, yStart + m_cyBtnHeight);\n\t\t\tnDirection = 1;\n\t\t}\n\n\t\tarrRect[0] = rcBtn;\n\t\tif(m_hTheme != NULL)\n\t\t\t::OffsetRect(&rcBtn, nDirection * m_cxBtnWidth, 0);\n\t\telse\n\t\t\t::OffsetRect(&rcBtn, nDirection * (m_cxBtnWidth + m_cxyOffset), 0);\n\t\tarrRect[1] = rcBtn;\n\t\t::OffsetRect(&rcBtn, nDirection * m_cxBtnWidth, 0);\n\t\tarrRect[2] = rcBtn;\n\t}\n\n\tvoid _DrawMDIButton(CWindowDC& dc, LPRECT pRects, int nBtn)\n\t{\n\t\tif(m_hTheme != NULL)\n\t\t{\n#ifndef __VSSYM32_H__\n\t\t\tconst int WP_MDICLOSEBUTTON = 20;\n\t\t\tconst int CBS_NORMAL = 1;\n\t\t\tconst int CBS_PUSHED = 3;\n\t\t\tconst int CBS_DISABLED = 4;\n\t\t\tconst int WP_MDIRESTOREBUTTON = 22;\n\t\t\tconst int RBS_NORMAL = 1;\n\t\t\tconst int RBS_PUSHED = 3;\n\t\t\tconst int RBS_DISABLED = 4;\n\t\t\tconst int WP_MDIMINBUTTON = 16;\n\t\t\tconst int MINBS_NORMAL = 1;\n\t\t\tconst int MINBS_PUSHED = 3;\n\t\t\tconst int MINBS_DISABLED = 4;\n#endif // __VSSYM32_H__\n\t\t\tif((nBtn == -1) || (nBtn == 0))\n\t\t\t\t::DrawThemeBackground(m_hTheme, dc, WP_MDICLOSEBUTTON, this->m_bParentActive ? ((m_nBtnPressed == 0) ? CBS_PUSHED : CBS_NORMAL) : CBS_DISABLED, &pRects[0], NULL);\n\t\t\tif((nBtn == -1) || (nBtn == 1))\n\t\t\t\t::DrawThemeBackground(m_hTheme, dc, WP_MDIRESTOREBUTTON, this->m_bParentActive ? ((m_nBtnPressed == 1) ? RBS_PUSHED : RBS_NORMAL) : RBS_DISABLED, &pRects[1], NULL);\n\t\t\tif((nBtn == -1) || (nBtn == 2))\n\t\t\t\t::DrawThemeBackground(m_hTheme, dc, WP_MDIMINBUTTON, this->m_bParentActive ? ((m_nBtnPressed == 2) ? MINBS_PUSHED : MINBS_NORMAL) : MINBS_DISABLED, &pRects[2], NULL);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif((nBtn == -1) || (nBtn == 0))\n\t\t\t\tdc.DrawFrameControl(&pRects[0], DFC_CAPTION, DFCS_CAPTIONCLOSE | ((m_nBtnPressed == 0) ? DFCS_PUSHED : 0));\n\t\t\tif((nBtn == -1) || (nBtn == 1))\n\t\t\t\tdc.DrawFrameControl(&pRects[1], DFC_CAPTION, DFCS_CAPTIONRESTORE | ((m_nBtnPressed == 1) ? DFCS_PUSHED : 0));\n\t\t\tif((nBtn == -1) || (nBtn == 2))\n\t\t\t\tdc.DrawFrameControl(&pRects[2], DFC_CAPTION, DFCS_CAPTIONMIN | ((m_nBtnPressed == 2) ? DFCS_PUSHED : 0));\n\t\t}\n\t}\n\n\tvoid _OpenThemeData()\n\t{\n\t\tif(RunTimeHelper::IsThemeAvailable())\n\t\t\tm_hTheme = ::OpenThemeData(this->m_hWnd, L\"Window\");\n\t}\n\n\tvoid _CloseThemeData()\n\t{\n\t\tif(m_hTheme != NULL)\n\t\t{\n\t\t\t::CloseThemeData(m_hTheme);\n\t\t\tm_hTheme = NULL;\n\t\t}\n\t}\n\n\tbool _DebugCheckChild()\n\t{\n#ifdef _DEBUG\n\t\tBOOL bMaximized = FALSE;\n\t\tHWND hWndChild = (HWND)::SendMessage(m_wndMDIClient, WM_MDIGETACTIVE, 0, (LPARAM)&bMaximized);\n\t\treturn (bMaximized && (hWndChild == m_hWndChildMaximized));\n#else // !_DEBUG\n\t\treturn true;\n#endif // !_DEBUG\n\t}\n};\n\nclass CMDICommandBarCtrl : public CMDICommandBarCtrlImpl<CMDICommandBarCtrl>\n{\npublic:\n\tDECLARE_WND_SUPERCLASS(_T(\"WTL_MDICommandBar\"), GetWndClassName())\n};\n\n} // namespace WTL\n\n#endif // __ATLCTRLW_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlctrlx.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLCTRLX_H__\n#define __ATLCTRLX_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atlctrlx.h requires atlapp.h to be included first\n#endif\n\n#ifndef __ATLCTRLS_H__\n\t#error atlctrlx.h requires atlctrls.h to be included first\n#endif\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CBitmapButtonImpl<T, TBase, TWinTraits>\n// CBitmapButton\n// CCheckListViewCtrlImpl<T, TBase, TWinTraits>\n// CCheckListViewCtrl\n// CHyperLinkImpl<T, TBase, TWinTraits>\n// CHyperLink\n// CWaitCursor\n// CCustomWaitCursor\n// CMultiPaneStatusBarCtrlImpl<T, TBase>\n// CMultiPaneStatusBarCtrl\n// CPaneContainerImpl<T, TBase, TWinTraits>\n// CPaneContainer\n// CSortListViewImpl<T>\n// CSortListViewCtrlImpl<T, TBase, TWinTraits>\n// CSortListViewCtrl\n// CTabViewImpl<T, TBase, TWinTraits>\n// CTabView\n\nnamespace WTL\n{\n\n///////////////////////////////////////////////////////////////////////////////\n// CBitmapButton - bitmap button implementation\n\n// bitmap button extended styles\n#define BMPBTN_HOVER            0x00000001\n#define BMPBTN_AUTO3D_SINGLE    0x00000002\n#define BMPBTN_AUTO3D_DOUBLE    0x00000004\n#define BMPBTN_AUTOSIZE         0x00000008\n#define BMPBTN_SHAREIMAGELISTS  0x00000010\n#define BMPBTN_AUTOFIRE         0x00000020\n#define BMPBTN_CHECK            0x00000040\n#define BMPBTN_AUTOCHECK        0x00000080\n\n// Note: BMPBTN_CHECK/BMPBTN_AUTOCHECK disables BN_DOUBLECLICKED,\n// BMPBTN_AUTOFIRE doesn't work with BMPBTN_CHECK/BMPBTN_AUTOCHECK\n\ntemplate <class T, class TBase = CButton, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >\n{\npublic:\n\tDECLARE_WND_SUPERCLASS2(NULL, T, TBase::GetWndClassName())\n\n\tenum\n\t{\n\t\t_nImageNormal = 0,\n\t\t_nImagePushed,\n\t\t_nImageFocusOrHover,\n\t\t_nImageDisabled,\n\n\t\t_nImageCount = 4,\n\t};\n\n\tenum\n\t{\n\t\tID_TIMER_FIRST = 1000,\n\t\tID_TIMER_REPEAT = 1001\n\t};\n\n\t// Bitmap button specific extended styles\n\tDWORD m_dwExtendedStyle;\n\n\tCImageList m_ImageList;\n\tint m_nImage[_nImageCount];\n\n\tCToolTipCtrl m_tip;\n\tLPTSTR m_lpstrToolTipText;\n\n\t// Internal states\n\tunsigned m_fMouseOver:1;\n\tunsigned m_fFocus:1;\n\tunsigned m_fPressed:1;\n\tunsigned m_fChecked:1;\n\n\n// Constructor/Destructor\n\tCBitmapButtonImpl(DWORD dwExtendedStyle = BMPBTN_AUTOSIZE, HIMAGELIST hImageList = NULL) : \n\t                  m_dwExtendedStyle(dwExtendedStyle), m_ImageList(hImageList), \n\t                  m_lpstrToolTipText(NULL),\n\t                  m_fMouseOver(0), m_fFocus(0), m_fPressed(0), m_fChecked(0)\n\t{\n\t\tm_nImage[_nImageNormal] = -1;\n\t\tm_nImage[_nImagePushed] = -1;\n\t\tm_nImage[_nImageFocusOrHover] = -1;\n\t\tm_nImage[_nImageDisabled] = -1;\n\n#ifdef _DEBUG\n\t\tif(((m_dwExtendedStyle & BMPBTN_AUTOFIRE) != 0) && IsCheckMode())\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"CBitmapButtonImpl - Check mode and BMPBTN_AUTOFIRE cannot be used together, BMPBTN_AUTOFIRE will be ignored.\\n\"));\n#endif // _DEBUG\n\t}\n\n\t~CBitmapButtonImpl()\n\t{\n\t\tif((m_dwExtendedStyle & BMPBTN_SHAREIMAGELISTS) == 0)\n\t\t\tm_ImageList.Destroy();\n\t\tdelete [] m_lpstrToolTipText;\n\t}\n\n\t// overridden to provide proper initialization\n\tBOOL SubclassWindow(HWND hWnd)\n\t{\n\t\tBOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits >::SubclassWindow(hWnd);\n\t\tif(bRet != FALSE)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->Init();\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n// Attributes\n\tDWORD GetBitmapButtonExtendedStyle() const\n\t{\n\t\treturn m_dwExtendedStyle;\n\t}\n\n\tDWORD SetBitmapButtonExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\n\t{\n\t\tDWORD dwPrevStyle = m_dwExtendedStyle;\n\t\tif(dwMask == 0)\n\t\t\tm_dwExtendedStyle = dwExtendedStyle;\n\t\telse\n\t\t\tm_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\n\n#ifdef _DEBUG\n\t\tif(((m_dwExtendedStyle & BMPBTN_AUTOFIRE) != 0) && IsCheckMode())\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"CBitmapButtonImpl - Check mode and BMPBTN_AUTOFIRE cannot be used together, BMPBTN_AUTOFIRE will be ignored.\\n\"));\n#endif // _DEBUG\n\n\t\treturn dwPrevStyle;\n\t}\n\n\tHIMAGELIST GetImageList() const\n\t{\n\t\treturn m_ImageList;\n\t}\n\n\tHIMAGELIST SetImageList(HIMAGELIST hImageList)\n\t{\n\t\tHIMAGELIST hImageListPrev = m_ImageList;\n\t\tm_ImageList = hImageList;\n\t\tif(((m_dwExtendedStyle & BMPBTN_AUTOSIZE) != 0) && ::IsWindow(this->m_hWnd))\n\t\t\tSizeToImage();\n\n\t\treturn hImageListPrev;\n\t}\n\n\tint GetToolTipTextLength() const\n\t{\n\t\treturn (m_lpstrToolTipText == NULL) ? -1 : lstrlen(m_lpstrToolTipText);\n\t}\n\n\tbool GetToolTipText(LPTSTR lpstrText, int nLength) const\n\t{\n\t\tATLASSERT(lpstrText != NULL);\n\t\tif(m_lpstrToolTipText == NULL)\n\t\t\treturn false;\n\n\t\terrno_t nRet = ATL::Checked::tcsncpy_s(lpstrText, nLength, m_lpstrToolTipText, _TRUNCATE);\n\n\t\treturn ((nRet == 0) || (nRet == STRUNCATE));\n\t}\n\n\tbool SetToolTipText(LPCTSTR lpstrText)\n\t{\n\t\tif(m_lpstrToolTipText != NULL)\n\t\t{\n\t\t\tdelete [] m_lpstrToolTipText;\n\t\t\tm_lpstrToolTipText = NULL;\n\t\t}\n\n\t\tif(lpstrText == NULL)\n\t\t{\n\t\t\tif(m_tip.IsWindow())\n\t\t\t\tm_tip.Activate(FALSE);\n\t\t\treturn true;\n\t\t}\n\n\t\tint cchLen = lstrlen(lpstrText) + 1;\n\t\tATLTRY(m_lpstrToolTipText = new TCHAR[cchLen]);\n\t\tif(m_lpstrToolTipText == NULL)\n\t\t\treturn false;\n\n\t\tATL::Checked::tcscpy_s(m_lpstrToolTipText, cchLen, lpstrText);\n\t\tif(m_tip.IsWindow())\n\t\t{\n\t\t\tm_tip.Activate(TRUE);\n\t\t\tm_tip.AddTool(this->m_hWnd, m_lpstrToolTipText);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tbool GetCheck() const\n\t{\n\t\treturn (m_fChecked == 1);\n\t}\n\n\tvoid SetCheck(bool bCheck, bool bUpdate = true)\n\t{\n\t\tm_fChecked = bCheck ? 1 : 0;\n\n\t\tif(bUpdate)\n\t\t{\n\t\t\tthis->Invalidate();\n\t\t\tthis->UpdateWindow();\n\t\t}\n\t}\n\n// Operations\n\tvoid SetImages(int nNormal, int nPushed = -1, int nFocusOrHover = -1, int nDisabled = -1)\n\t{\n\t\tif(nNormal != -1)\n\t\t\tm_nImage[_nImageNormal] = nNormal;\n\t\tif(nPushed != -1)\n\t\t\tm_nImage[_nImagePushed] = nPushed;\n\t\tif(nFocusOrHover != -1)\n\t\t\tm_nImage[_nImageFocusOrHover] = nFocusOrHover;\n\t\tif(nDisabled != -1)\n\t\t\tm_nImage[_nImageDisabled] = nDisabled;\n\t}\n\n\tBOOL SizeToImage()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd) && (m_ImageList.m_hImageList != NULL));\n\t\tint cx = 0;\n\t\tint cy = 0;\n\t\tif(!m_ImageList.GetIconSize(cx, cy))\n\t\t\treturn FALSE;\n\t\treturn this->ResizeClient(cx, cy);\n\t}\n\n// Overrideables\n\tvoid DoPaint(CDCHandle dc)\n\t{\n\t\tATLASSERT(m_ImageList.m_hImageList != NULL);   // image list must be set\n\t\tATLASSERT(m_nImage[0] != -1);                  // main bitmap must be set\n\n\t\t// set bitmap according to the current button state\n\t\tbool bHover = IsHoverMode();\n\t\tbool bPressed = (m_fPressed == 1) || (IsCheckMode() && (m_fChecked == 1));\n\t\tint nImage = -1;\n\t\tif(!this->IsWindowEnabled())\n\t\t\tnImage = m_nImage[_nImageDisabled];\n\t\telse if(bPressed)\n\t\t\tnImage = m_nImage[_nImagePushed];\n\t\telse if((!bHover && (m_fFocus == 1)) || (bHover && (m_fMouseOver == 1)))\n\t\t\tnImage = m_nImage[_nImageFocusOrHover];\n\n\t\t// if none is set, use default one\n\t\tif(nImage == -1)\n\t\t\tnImage = m_nImage[_nImageNormal];\n\n\t\t// draw the button image\n\t\tbool bAuto3D = (m_dwExtendedStyle & (BMPBTN_AUTO3D_SINGLE | BMPBTN_AUTO3D_DOUBLE)) != 0;\n\t\tint xyPos = (bPressed && bAuto3D && (m_nImage[_nImagePushed] == -1)) ? 1 : 0;\n\t\tm_ImageList.Draw(dc, nImage, xyPos, xyPos, ILD_NORMAL);\n\n\t\t// draw 3D border if required\n\t\tif(bAuto3D)\n\t\t{\n\t\t\tRECT rect = {};\n\t\t\tthis->GetClientRect(&rect);\n\n\t\t\tif(bPressed)\n\t\t\t\tdc.DrawEdge(&rect, ((m_dwExtendedStyle & BMPBTN_AUTO3D_SINGLE) != 0) ? BDR_SUNKENOUTER : EDGE_SUNKEN, BF_RECT);\n\t\t\telse if(!bHover || (m_fMouseOver == 1))\n\t\t\t\tdc.DrawEdge(&rect, ((m_dwExtendedStyle & BMPBTN_AUTO3D_SINGLE) != 0) ? BDR_RAISEDINNER : EDGE_RAISED, BF_RECT);\n\n\t\t\tif(!bHover && (m_fFocus == 1))\n\t\t\t{\n\t\t\t\t::InflateRect(&rect, -2 * ::GetSystemMetrics(SM_CXEDGE), -2 * ::GetSystemMetrics(SM_CYEDGE));\n\t\t\t\tdc.DrawFocusRect(&rect);\n\t\t\t}\n\t\t}\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CBitmapButtonImpl)\n\t\tMESSAGE_HANDLER(WM_CREATE, OnCreate)\n\t\tMESSAGE_HANDLER(WM_DESTROY, OnDestroy)\n\t\tMESSAGE_RANGE_HANDLER(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseMessage)\n\t\tMESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\n\t\tMESSAGE_HANDLER(WM_PAINT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_SETFOCUS, OnFocus)\n\t\tMESSAGE_HANDLER(WM_KILLFOCUS, OnFocus)\n\t\tMESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)\n\t\tMESSAGE_HANDLER(WM_LBUTTONDBLCLK, OnLButtonDblClk)\n\t\tMESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)\n\t\tMESSAGE_HANDLER(WM_CAPTURECHANGED, OnCaptureChanged)\n\t\tMESSAGE_HANDLER(WM_ENABLE, OnEnable)\n\t\tMESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)\n\t\tMESSAGE_HANDLER(WM_MOUSELEAVE, OnMouseLeave)\n\t\tMESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)\n\t\tMESSAGE_HANDLER(WM_KEYUP, OnKeyUp)\n\t\tMESSAGE_HANDLER(WM_TIMER, OnTimer)\n\t\tMESSAGE_HANDLER(WM_UPDATEUISTATE, OnUpdateUiState)\n\tEND_MSG_MAP()\n\n\tLRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Init();\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(m_tip.IsWindow())\n\t\t{\n\t\t\tm_tip.DestroyWindow();\n\t\t\tm_tip.m_hWnd = NULL;\n\t\t}\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnMouseMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tMSG msg = { this->m_hWnd, uMsg, wParam, lParam };\n\t\tif(m_tip.IsWindow())\n\t\t\tm_tip.RelayEvent(&msg);\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn 1;   // no background needed\n\t}\n\n\tLRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(wParam != NULL)\n\t\t{\n\t\t\tpT->DoPaint((HDC)wParam);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCPaintDC dc(this->m_hWnd);\n\t\t\tpT->DoPaint(dc.m_hDC);\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnFocus(UINT uMsg, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tm_fFocus = (uMsg == WM_SETFOCUS) ? 1 : 0;\n\t\tthis->Invalidate();\n\t\tthis->UpdateWindow();\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tLRESULT lRet = 0;\n\t\tif(IsHoverMode())\n\t\t\tthis->SetCapture();\n\t\telse\n\t\t\tlRet = this->DefWindowProc(uMsg, wParam, lParam);\n\t\tif(::GetCapture() == this->m_hWnd)\n\t\t{\n\t\t\tm_fPressed = 1;\n\t\t\tthis->Invalidate();\n\t\t\tthis->UpdateWindow();\n\t\t}\n\t\tif(((m_dwExtendedStyle & BMPBTN_AUTOFIRE) != 0) && !IsCheckMode())\n\t\t{\n\t\t\tint nElapse = 250;\n\t\t\tint nDelay = 0;\n\t\t\tif(::SystemParametersInfo(SPI_GETKEYBOARDDELAY, 0, &nDelay, 0))\n\t\t\t\tnElapse += nDelay * 250;   // all milli-seconds\n\t\t\tthis->SetTimer(ID_TIMER_FIRST, nElapse);\n\t\t}\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnLButtonDblClk(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tLRESULT lRet = 0;\n\t\tif(!IsHoverMode() && !IsCheckMode())\n\t\t\tlRet = this->DefWindowProc(uMsg, wParam, lParam);\n\t\tif(::GetCapture() != this->m_hWnd)\n\t\t\tthis->SetCapture();\n\t\tif(m_fPressed == 0)\n\t\t{\n\t\t\tm_fPressed = 1;\n\t\t\tthis->Invalidate();\n\t\t\tthis->UpdateWindow();\n\t\t}\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tif(((m_dwExtendedStyle & BMPBTN_AUTOCHECK) != 0) && (m_fPressed == 1))\n\t\t\tSetCheck(!GetCheck(), false);\n\n\t\tLRESULT lRet = 0;\n\t\tif(!IsHoverMode() && !IsCheckMode())\n\t\t\tlRet = this->DefWindowProc(uMsg, wParam, lParam);\n\t\tif(::GetCapture() == this->m_hWnd)\n\t\t{\n\t\t\tif((IsHoverMode() || IsCheckMode()) && (m_fPressed == 1))\n\t\t\t\tthis->GetParent().SendMessage(WM_COMMAND, MAKEWPARAM(this->GetDlgCtrlID(), BN_CLICKED), (LPARAM)this->m_hWnd);\n\t\t\t::ReleaseCapture();\n\t\t}\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnCaptureChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(m_fPressed == 1)\n\t\t{\n\t\t\tm_fPressed = 0;\n\t\t\tthis->Invalidate();\n\t\t\tthis->UpdateWindow();\n\t\t}\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnEnable(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tthis->Invalidate();\n\t\tthis->UpdateWindow();\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif(::GetCapture() == this->m_hWnd)\n\t\t{\n\t\t\tPOINT ptCursor = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\t\t\tthis->ClientToScreen(&ptCursor);\n\t\t\tRECT rect = {};\n\t\t\tthis->GetWindowRect(&rect);\n\t\t\tunsigned int uPressed = ::PtInRect(&rect, ptCursor) ? 1 : 0;\n\t\t\tif(m_fPressed != uPressed)\n\t\t\t{\n\t\t\t\tm_fPressed = uPressed;\n\t\t\t\tthis->Invalidate();\n\t\t\t\tthis->UpdateWindow();\n\t\t\t}\n\t\t}\n\t\telse if(IsHoverMode() && m_fMouseOver == 0)\n\t\t{\n\t\t\tm_fMouseOver = 1;\n\t\t\tthis->Invalidate();\n\t\t\tthis->UpdateWindow();\n\t\t\tStartTrackMouseLeave();\n\t\t}\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnMouseLeave(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tif(m_fMouseOver == 1)\n\t\t{\n\t\t\tm_fMouseOver = 0;\n\t\t\tthis->Invalidate();\n\t\t\tthis->UpdateWindow();\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif((wParam == VK_SPACE) && IsHoverMode())\n\t\t\treturn 0;   // ignore if in hover mode\n\t\tif((wParam == VK_SPACE) && (m_fPressed == 0))\n\t\t{\n\t\t\tm_fPressed = 1;\n\t\t\tthis->Invalidate();\n\t\t\tthis->UpdateWindow();\n\t\t}\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnKeyUp(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif((wParam == VK_SPACE) && IsHoverMode())\n\t\t\treturn 0;   // ignore if in hover mode\n\t\tif((wParam == VK_SPACE) && (m_fPressed == 1))\n\t\t{\n\t\t\tm_fPressed = 0;\n\t\t\tif((m_dwExtendedStyle & BMPBTN_AUTOCHECK) != 0)\n\t\t\t\tSetCheck(!GetCheck(), false);\n\t\t\tthis->Invalidate();\n\t\t\tthis->UpdateWindow();\n\t\t}\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnTimer(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tATLASSERT((m_dwExtendedStyle & BMPBTN_AUTOFIRE) != 0);\n\t\tswitch(wParam)   // timer ID\n\t\t{\n\t\tcase ID_TIMER_FIRST:\n\t\t\tthis->KillTimer(ID_TIMER_FIRST);\n\t\t\tif(m_fPressed == 1)\n\t\t\t{\n\t\t\t\tthis->GetParent().SendMessage(WM_COMMAND, MAKEWPARAM(this->GetDlgCtrlID(), BN_CLICKED), (LPARAM)this->m_hWnd);\n\t\t\t\tint nElapse = 250;\n\t\t\t\tint nRepeat = 40;\n\t\t\t\tif(::SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &nRepeat, 0))\n\t\t\t\t\tnElapse = 10000 / (10 * nRepeat + 25);   // milli-seconds, approximated\n\t\t\t\tthis->SetTimer(ID_TIMER_REPEAT, nElapse);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ID_TIMER_REPEAT:\n\t\t\tif(m_fPressed == 1)\n\t\t\t\tthis->GetParent().SendMessage(WM_COMMAND, MAKEWPARAM(this->GetDlgCtrlID(), BN_CLICKED), (LPARAM)this->m_hWnd);\n\t\t\telse if(::GetCapture() != this->m_hWnd)\n\t\t\t\tthis->KillTimer(ID_TIMER_REPEAT);\n\t\t\tbreak;\n\t\tdefault:\t// not our timer\n\t\t\tbreak;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnUpdateUiState(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\t// If the control is subclassed or superclassed, this message can cause\n\t\t// repainting without WM_PAINT. We don't use this state, so just do nothing.\n\t\treturn 0;\n\t}\n\n// Implementation\n\tvoid Init()\n\t{\n\t\t// We need this style to prevent Windows from painting the button\n\t\tthis->ModifyStyle(0, BS_OWNERDRAW);\n\n\t\t// create a tool tip\n\t\tm_tip.Create(this->m_hWnd);\n\t\tATLASSERT(m_tip.IsWindow());\n\t\tif(m_tip.IsWindow() && (m_lpstrToolTipText != NULL))\n\t\t{\n\t\t\tm_tip.Activate(TRUE);\n\t\t\tm_tip.AddTool(this->m_hWnd, m_lpstrToolTipText);\n\t\t}\n\n\t\tif((m_ImageList.m_hImageList != NULL) && ((m_dwExtendedStyle & BMPBTN_AUTOSIZE) != 0))\n\t\t\tSizeToImage();\n\t}\n\n\tBOOL StartTrackMouseLeave()\n\t{\n\t\tTRACKMOUSEEVENT tme = {};\n\t\ttme.cbSize = sizeof(tme);\n\t\ttme.dwFlags = TME_LEAVE;\n\t\ttme.hwndTrack = this->m_hWnd;\n\t\treturn ::TrackMouseEvent(&tme);\n\t}\n\n\tbool IsHoverMode() const\n\t{\n\t\treturn ((m_dwExtendedStyle & BMPBTN_HOVER) != 0);\n\t}\n\n\tbool IsCheckMode() const\n\t{\n\t\treturn ((m_dwExtendedStyle & (BMPBTN_CHECK | BMPBTN_AUTOCHECK)) != 0);\n\t}\n};\n\nclass CBitmapButton : public CBitmapButtonImpl<CBitmapButton>\n{\npublic:\n\tDECLARE_WND_SUPERCLASS(_T(\"WTL_BitmapButton\"), GetWndClassName())\n\n\tCBitmapButton(DWORD dwExtendedStyle = BMPBTN_AUTOSIZE, HIMAGELIST hImageList = NULL) : \n\t\tCBitmapButtonImpl<CBitmapButton>(dwExtendedStyle, hImageList)\n\t{ }\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CCheckListCtrlView - list view control with check boxes\n\ntemplate <DWORD t_dwStyle, DWORD t_dwExStyle, DWORD t_dwExListViewStyle>\nclass CCheckListViewCtrlImplTraits\n{\npublic:\n\tstatic DWORD GetWndStyle(DWORD dwStyle)\n\t{\n\t\treturn (dwStyle == 0) ? t_dwStyle : dwStyle;\n\t}\n\n\tstatic DWORD GetWndExStyle(DWORD dwExStyle)\n\t{\n\t\treturn (dwExStyle == 0) ? t_dwExStyle : dwExStyle;\n\t}\n\n\tstatic DWORD GetExtendedLVStyle()\n\t{\n\t\treturn t_dwExListViewStyle;\n\t}\n};\n\ntypedef CCheckListViewCtrlImplTraits<WS_CHILD | WS_VISIBLE | LVS_REPORT | LVS_SHOWSELALWAYS, WS_EX_CLIENTEDGE, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT>   CCheckListViewCtrlTraits;\n\ntemplate <class T, class TBase = CListViewCtrl, class TWinTraits = CCheckListViewCtrlTraits>\nclass ATL_NO_VTABLE CCheckListViewCtrlImpl : public ATL::CWindowImpl<T, TBase, TWinTraits >\n{\npublic:\n\tDECLARE_WND_SUPERCLASS2(NULL, T, TBase::GetWndClassName())\n\n// Attributes\n\tstatic DWORD GetExtendedLVStyle()\n\t{\n\t\treturn TWinTraits::GetExtendedLVStyle();\n\t}\n\n// Operations\n\tBOOL SubclassWindow(HWND hWnd)\n\t{\n\t\tBOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits >::SubclassWindow(hWnd);\n\t\tif(bRet != FALSE)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->Init();\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\tvoid CheckSelectedItems(int nCurrItem)\n\t{\n\t\t// first check if this item is selected\n\t\tLVITEM lvi = {};\n\t\tlvi.iItem = nCurrItem;\n\t\tlvi.iSubItem = 0;\n\t\tlvi.mask = LVIF_STATE;\n\t\tlvi.stateMask = LVIS_SELECTED;\n\t\tthis->GetItem(&lvi);\n\t\t// if item is not selected, don't do anything\n\t\tif(!(lvi.state & LVIS_SELECTED))\n\t\t\treturn;\n\t\t// new check state will be reverse of the current state,\n\t\tBOOL bCheck = !this->GetCheckState(nCurrItem);\n\t\tint nItem = -1;\n\t\tint nOldItem = -1;\n\t\twhile((nItem = this->GetNextItem(nOldItem, LVNI_SELECTED)) != -1)\n\t\t{\n\t\t\tif(nItem != nCurrItem)\n\t\t\t\tthis->SetCheckState(nItem, bCheck);\n\t\t\tnOldItem = nItem;\n\t\t}\n\t}\n\n// Implementation\n\tvoid Init()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\t(void)pT;   // avoid level 4 warning\n\t\tATLASSERT((pT->GetExtendedLVStyle() & LVS_EX_CHECKBOXES) != 0);\n\t\tthis->SetExtendedListViewStyle(pT->GetExtendedLVStyle());\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CCheckListViewCtrlImpl)\n\t\tMESSAGE_HANDLER(WM_CREATE, OnCreate)\n\t\tMESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)\n\t\tMESSAGE_HANDLER(WM_LBUTTONDBLCLK, OnLButtonDown)\n\t\tMESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)\n\tEND_MSG_MAP()\n\n\tLRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\t// first let list view control initialize everything\n\t\tLRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);\n\t\tif(lRet == 0)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->Init();\n\t\t}\n\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tPOINT ptMsg = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\t\tLVHITTESTINFO lvh = {};\n\t\tlvh.pt = ptMsg;\n\t\tif((this->HitTest(&lvh) != -1) && (lvh.flags == LVHT_ONITEMSTATEICON) && (::GetKeyState(VK_CONTROL) >= 0))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->CheckSelectedItems(lvh.iItem);\n\t\t}\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(wParam == VK_SPACE)\n\t\t{\n\t\t\tint nCurrItem = this->GetNextItem(-1, LVNI_FOCUSED);\n\t\t\tif((nCurrItem != -1)  && (::GetKeyState(VK_CONTROL) >= 0))\n\t\t\t{\n\t\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t\tpT->CheckSelectedItems(nCurrItem);\n\t\t\t}\n\t\t}\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n};\n\nclass CCheckListViewCtrl : public CCheckListViewCtrlImpl<CCheckListViewCtrl>\n{\npublic:\n\tDECLARE_WND_SUPERCLASS(_T(\"WTL_CheckListView\"), GetWndClassName())\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CHyperLink - hyper link control implementation\n\n#define HLINK_UNDERLINED           0x00000000\n#define HLINK_NOTUNDERLINED        0x00000001\n#define HLINK_UNDERLINEHOVER       0x00000002\n#define HLINK_COMMANDBUTTON        0x00000004\n#define HLINK_NOTIFYBUTTON         0x0000000C\n#define HLINK_USETAGS              0x00000010\n#define HLINK_USETAGSBOLD          0x00000030\n#define HLINK_NOTOOLTIP            0x00000040\n#define HLINK_AUTOCREATELINKFONT   0x00000080\n#define HLINK_SINGLELINE           0x00000100\n\n// Notes:\n// - HLINK_USETAGS and HLINK_USETAGSBOLD are always left-aligned\n// - When HLINK_USETAGSBOLD is used, the underlined styles will be ignored\n\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >\n{\npublic:\n\tLPTSTR m_lpstrLabel;\n\tLPTSTR m_lpstrHyperLink;\n\n\tHCURSOR m_hCursor;\n\tHFONT m_hFontLink;\n\tHFONT m_hFontNormal;\n\n\tRECT m_rcLink;\n\tCToolTipCtrl m_tip;\n\n\tCOLORREF m_clrLink;\n\tCOLORREF m_clrVisited;\n\n\tDWORD m_dwExtendedStyle;   // Hyper Link specific extended styles\n\n\tbool m_bPaintLabel:1;\n\tbool m_bVisited:1;\n\tbool m_bHover:1;\n\tbool m_bInternalLinkFont:1;\n\tbool m_bInternalNormalFont:1;\n\n\n// Constructor/Destructor\n\tCHyperLinkImpl(DWORD dwExtendedStyle = HLINK_UNDERLINED) : \n\t\t\tm_lpstrLabel(NULL), m_lpstrHyperLink(NULL),\n\t\t\tm_hCursor(NULL), m_hFontLink(NULL), m_hFontNormal(NULL),\n\t\t\tm_clrLink(RGB(0, 0, 255)), m_clrVisited(RGB(128, 0, 128)),\n\t\t\tm_dwExtendedStyle(dwExtendedStyle),\n\t\t\tm_bPaintLabel(true), m_bVisited(false),\n\t\t\tm_bHover(false), m_bInternalLinkFont(false), m_bInternalNormalFont(false)\n\t{\n\t\t::SetRectEmpty(&m_rcLink);\n\t}\n\n\t~CHyperLinkImpl()\n\t{\n\t\tdelete [] m_lpstrLabel;\n\t\tdelete [] m_lpstrHyperLink;\n\t}\n\n// Attributes\n\tDWORD GetHyperLinkExtendedStyle() const\n\t{\n\t\treturn m_dwExtendedStyle;\n\t}\n\n\tDWORD SetHyperLinkExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\n\t{\n\t\tDWORD dwPrevStyle = m_dwExtendedStyle;\n\t\tif(dwMask == 0)\n\t\t\tm_dwExtendedStyle = dwExtendedStyle;\n\t\telse\n\t\t\tm_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\n\t\treturn dwPrevStyle;\n\t}\n\n\tbool GetLabel(LPTSTR lpstrBuffer, int nLength) const\n\t{\n\t\tif(m_lpstrLabel == NULL)\n\t\t\treturn false;\n\t\tATLASSERT(lpstrBuffer != NULL);\n\t\tif(nLength <= lstrlen(m_lpstrLabel))\n\t\t\treturn false;\n\n\t\tATL::Checked::tcscpy_s(lpstrBuffer, nLength, m_lpstrLabel);\n\n\t\treturn true;\n\t}\n\n\tbool SetLabel(LPCTSTR lpstrLabel)\n\t{\n\t\tdelete [] m_lpstrLabel;\n\t\tm_lpstrLabel = NULL;\n\t\tint cchLen = lstrlen(lpstrLabel) + 1;\n\t\tATLTRY(m_lpstrLabel = new TCHAR[cchLen]);\n\t\tif(m_lpstrLabel == NULL)\n\t\t\treturn false;\n\n\t\tATL::Checked::tcscpy_s(m_lpstrLabel, cchLen, lpstrLabel);\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->CalcLabelRect();\n\n\t\tif(this->m_hWnd != NULL)\n\t\t\tthis->SetWindowText(lpstrLabel);   // Set this for accessibility\n\n\t\treturn true;\n\t}\n\n\tbool GetHyperLink(LPTSTR lpstrBuffer, int nLength) const\n\t{\n\t\tif(m_lpstrHyperLink == NULL)\n\t\t\treturn false;\n\t\tATLASSERT(lpstrBuffer != NULL);\n\t\tif(nLength <= lstrlen(m_lpstrHyperLink))\n\t\t\treturn false;\n\n\t\tATL::Checked::tcscpy_s(lpstrBuffer, nLength, m_lpstrHyperLink);\n\n\t\treturn true;\n\t}\n\n\tbool SetHyperLink(LPCTSTR lpstrLink)\n\t{\n\t\tdelete [] m_lpstrHyperLink;\n\t\tm_lpstrHyperLink = NULL;\n\t\tint cchLen = lstrlen(lpstrLink) + 1;\n\t\tATLTRY(m_lpstrHyperLink = new TCHAR[cchLen]);\n\t\tif(m_lpstrHyperLink == NULL)\n\t\t\treturn false;\n\n\t\tATL::Checked::tcscpy_s(m_lpstrHyperLink, cchLen, lpstrLink);\n\t\tif(m_lpstrLabel == NULL)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->CalcLabelRect();\n\t\t}\n\n\t\tif(m_tip.IsWindow())\n\t\t{\n\t\t\tm_tip.Activate(TRUE);\n\t\t\tm_tip.AddTool(this->m_hWnd, m_lpstrHyperLink, &m_rcLink, 1);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tHFONT GetLinkFont() const\n\t{\n\t\treturn m_hFontLink;\n\t}\n\n\tvoid SetLinkFont(HFONT hFont)\n\t{\n\t\tif(m_bInternalLinkFont)\n\t\t{\n\t\t\t::DeleteObject(m_hFontLink);\n\t\t\tm_bInternalLinkFont = false;\n\t\t}\n\n\t\tm_hFontLink = hFont;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->CalcLabelRect();\n\t}\n\n\tint GetIdealHeight() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tif((m_lpstrLabel == NULL) && (m_lpstrHyperLink == NULL))\n\t\t\treturn -1;\n\t\tif(!m_bPaintLabel)\n\t\t\treturn -1;\n\n\t\tUINT uFormat = IsSingleLine() ? DT_SINGLELINE : DT_WORDBREAK;\n\n\t\tCClientDC dc(this->m_hWnd);\n\t\tRECT rect = {};\n\t\tthis->GetClientRect(&rect);\n\t\tHFONT hFontOld = dc.SelectFont(m_hFontNormal);\n\t\tRECT rcText = rect;\n\t\tdc.DrawText(_T(\"NS\"), -1, &rcText, DT_LEFT | uFormat | DT_CALCRECT);\n\t\tdc.SelectFont(m_hFontLink);\n\t\tRECT rcLink = rect;\n\t\tdc.DrawText(_T(\"NS\"), -1, &rcLink, DT_LEFT | uFormat | DT_CALCRECT);\n\t\tdc.SelectFont(hFontOld);\n\t\treturn __max(rcText.bottom - rcText.top, rcLink.bottom - rcLink.top);\n\t}\n\n\tbool GetIdealSize(SIZE& size) const\n\t{\n\t\tint cx = 0, cy = 0;\n\t\tbool bRet = GetIdealSize(cx, cy);\n\t\tif(bRet)\n\t\t{\n\t\t\tsize.cx = cx;\n\t\t\tsize.cy = cy;\n\t\t}\n\t\treturn bRet;\n\t}\n\n\tbool GetIdealSize(int& cx, int& cy) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tif((m_lpstrLabel == NULL) && (m_lpstrHyperLink == NULL))\n\t\t\treturn false;\n\t\tif(!m_bPaintLabel)\n\t\t\treturn false;\n\n\t\tCClientDC dc(this->m_hWnd);\n\t\tRECT rcClient = {};\n\t\tthis->GetClientRect(&rcClient);\n\t\tRECT rcAll = rcClient;\n\n\t\tif(IsUsingTags())\n\t\t{\n\t\t\t// find tags and label parts\n\t\t\tLPTSTR lpstrLeft = NULL;\n\t\t\tint cchLeft = 0;\n\t\t\tLPTSTR lpstrLink = NULL;\n\t\t\tint cchLink = 0;\n\t\t\tLPTSTR lpstrRight = NULL;\n\t\t\tint cchRight = 0;\n\n\t\t\tconst T* pT = static_cast<const T*>(this);\n\t\t\tpT->CalcLabelParts(lpstrLeft, cchLeft, lpstrLink, cchLink, lpstrRight, cchRight);\n\n\t\t\t// get label part rects\n\t\t\tUINT uFormat = IsSingleLine() ? DT_SINGLELINE : DT_WORDBREAK;\n\n\t\t\tHFONT hFontOld = dc.SelectFont(m_hFontNormal);\n\t\t\tRECT rcLeft = rcClient;\n\t\t\tdc.DrawText(lpstrLeft, cchLeft, &rcLeft, DT_LEFT | uFormat | DT_CALCRECT);\n\n\t\t\tdc.SelectFont(m_hFontLink);\n\t\t\tRECT rcLink = { rcLeft.right, rcLeft.top, rcClient.right, rcClient.bottom };\n\t\t\tdc.DrawText(lpstrLink, cchLink, &rcLink, DT_LEFT | uFormat | DT_CALCRECT);\n\n\t\t\tdc.SelectFont(m_hFontNormal);\n\t\t\tRECT rcRight = { rcLink.right, rcLink.top, rcClient.right, rcClient.bottom };\n\t\t\tdc.DrawText(lpstrRight, cchRight, &rcRight, DT_LEFT | uFormat | DT_CALCRECT);\n\n\t\t\tdc.SelectFont(hFontOld);\n\n\t\t\tint cyMax = __max(rcLeft.bottom, __max(rcLink.bottom, rcRight.bottom));\n\t\t\t::SetRect(&rcAll, rcLeft.left, rcLeft.top, rcRight.right, cyMax);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tHFONT hOldFont = NULL;\n\t\t\tif(m_hFontLink != NULL)\n\t\t\t\thOldFont = dc.SelectFont(m_hFontLink);\n\t\t\tLPTSTR lpstrText = (m_lpstrLabel != NULL) ? m_lpstrLabel : m_lpstrHyperLink;\n\t\t\tDWORD dwStyle = this->GetStyle();\n\t\t\tUINT uFormat = DT_LEFT;\n\t\t\tif (dwStyle & SS_CENTER)\n\t\t\t\tuFormat = DT_CENTER;\n\t\t\telse if (dwStyle & SS_RIGHT)\n\t\t\t\tuFormat = DT_RIGHT;\n\t\t\tuFormat |= IsSingleLine() ? DT_SINGLELINE : DT_WORDBREAK;\n\t\t\tdc.DrawText(lpstrText, -1, &rcAll, uFormat | DT_CALCRECT);\n\t\t\tif(m_hFontLink != NULL)\n\t\t\t\tdc.SelectFont(hOldFont);\n\t\t\tif (dwStyle & SS_CENTER)\n\t\t\t{\n\t\t\t\tint dx = (rcClient.right - rcAll.right) / 2;\n\t\t\t\t::OffsetRect(&rcAll, dx, 0);\n\t\t\t}\n\t\t\telse if (dwStyle & SS_RIGHT)\n\t\t\t{\n\t\t\t\tint dx = rcClient.right - rcAll.right;\n\t\t\t\t::OffsetRect(&rcAll, dx, 0);\n\t\t\t}\n\t\t}\n\n\t\tcx = rcAll.right - rcAll.left;\n\t\tcy = rcAll.bottom - rcAll.top;\n\n\t\treturn true;\n\t}\n\n\t// for command buttons only\n\tbool GetToolTipText(LPTSTR lpstrBuffer, int nLength) const\n\t{\n\t\tATLASSERT(IsCommandButton());\n\t\treturn GetHyperLink(lpstrBuffer, nLength);\n\t}\n\n\tbool SetToolTipText(LPCTSTR lpstrToolTipText)\n\t{\n\t\tATLASSERT(IsCommandButton());\n\t\treturn SetHyperLink(lpstrToolTipText);\n\t}\n\n// Operations\n\tBOOL SubclassWindow(HWND hWnd)\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);\n\t\tATLASSERT(::IsWindow(hWnd));\n\t\tif(m_hFontNormal == NULL)\n\t\t\tm_hFontNormal = (HFONT)::SendMessage(hWnd, WM_GETFONT, 0, 0L);\n\n\t\tBOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits >::SubclassWindow(hWnd);\n\t\tif(bRet != FALSE)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->Init();\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\tbool Navigate()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tbool bRet = true;\n\t\tif(IsNotifyButton())\n\t\t{\n\t\t\tNMHDR nmhdr = { this->m_hWnd, (UINT_PTR)this->GetDlgCtrlID(), NM_CLICK };\n\t\t\tthis->GetParent().SendMessage(WM_NOTIFY, this->GetDlgCtrlID(), (LPARAM)&nmhdr);\n\t\t}\n\t\telse if(IsCommandButton())\n\t\t{\n\t\t\tthis->GetParent().SendMessage(WM_COMMAND, MAKEWPARAM(this->GetDlgCtrlID(), BN_CLICKED), (LPARAM)this->m_hWnd);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tATLASSERT(m_lpstrHyperLink != NULL);\n\t\t\tDWORD_PTR dwRet = (DWORD_PTR)::ShellExecute(0, _T(\"open\"), m_lpstrHyperLink, 0, 0, SW_SHOWNORMAL);\n\t\t\tbRet = (dwRet > 32);\n\t\t\tATLASSERT(bRet);\n\t\t\tif(bRet)\n\t\t\t{\n\t\t\t\tm_bVisited = true;\n\t\t\t\tthis->Invalidate();\n\t\t\t}\n\t\t}\n\t\treturn bRet;\n\t}\n\n\tvoid CreateLinkFontFromNormal()\n\t{\n\t\tif(m_bInternalLinkFont)\n\t\t{\n\t\t\t::DeleteObject(m_hFontLink);\n\t\t\tm_bInternalLinkFont = false;\n\t\t}\n\n\t\tCFontHandle font = (m_hFontNormal != NULL) ? m_hFontNormal : (HFONT)::GetStockObject(SYSTEM_FONT);\n\t\tLOGFONT lf = {};\n\t\tfont.GetLogFont(&lf);\n\n\t\tif(IsUsingTagsBold())\n\t\t\tlf.lfWeight = FW_BOLD;\n\t\telse if(!IsNotUnderlined())\n\t\t\tlf.lfUnderline = TRUE;\n\n\t\tm_hFontLink = ::CreateFontIndirect(&lf);\n\t\tm_bInternalLinkFont = true;\n\t\tATLASSERT(m_hFontLink != NULL);\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CHyperLinkImpl)\n\t\tMESSAGE_HANDLER(WM_CREATE, OnCreate)\n\t\tMESSAGE_HANDLER(WM_DESTROY, OnDestroy)\n\t\tMESSAGE_RANGE_HANDLER(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseMessage)\n\t\tMESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\n\t\tMESSAGE_HANDLER(WM_PAINT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_SETFOCUS, OnFocus)\n\t\tMESSAGE_HANDLER(WM_KILLFOCUS, OnFocus)\n\t\tMESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)\n\t\tMESSAGE_HANDLER(WM_MOUSELEAVE, OnMouseLeave)\n\t\tMESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)\n\t\tMESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)\n\t\tMESSAGE_HANDLER(WM_CHAR, OnChar)\n\t\tMESSAGE_HANDLER(WM_GETDLGCODE, OnGetDlgCode)\n\t\tMESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)\n\t\tMESSAGE_HANDLER(WM_ENABLE, OnEnable)\n\t\tMESSAGE_HANDLER(WM_GETFONT, OnGetFont)\n\t\tMESSAGE_HANDLER(WM_SETFONT, OnSetFont)\n\t\tMESSAGE_HANDLER(WM_UPDATEUISTATE, OnUpdateUiState)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\tEND_MSG_MAP()\n\n\tLRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Init();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(m_tip.IsWindow())\n\t\t{\n\t\t\tm_tip.DestroyWindow();\n\t\t\tm_tip.m_hWnd = NULL;\n\t\t}\n\n\t\tif(m_bInternalLinkFont)\n\t\t{\n\t\t\t::DeleteObject(m_hFontLink);\n\t\t\tm_hFontLink = NULL;\n\t\t\tm_bInternalLinkFont = false;\n\t\t}\n\n\t\tif(m_bInternalNormalFont)\n\t\t{\n\t\t\t::DeleteObject(m_hFontNormal);\n\t\t\tm_hFontNormal = NULL;\n\t\t\tm_bInternalNormalFont = false;\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnMouseMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tMSG msg = { this->m_hWnd, uMsg, wParam, lParam };\n\t\tif(m_tip.IsWindow() && IsUsingToolTip())\n\t\t\tm_tip.RelayEvent(&msg);\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn 1;   // no background painting needed (we do it all during WM_PAINT)\n\t}\n\n\tLRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(!m_bPaintLabel)\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(wParam != NULL)\n\t\t{\n\t\t\tpT->DoEraseBackground((HDC)wParam);\n\t\t\tpT->DoPaint((HDC)wParam);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCPaintDC dc(this->m_hWnd);\n\t\t\tpT->DoEraseBackground(dc.m_hDC);\n\t\t\tpT->DoPaint(dc.m_hDC);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(m_bPaintLabel)\n\t\t\tthis->Invalidate();\n\t\telse\n\t\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tPOINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\t\tif(((m_lpstrHyperLink != NULL) || IsCommandButton()) && ::PtInRect(&m_rcLink, pt))\n\t\t{\n\t\t\t::SetCursor(m_hCursor);\n\t\t\tif(IsUnderlineHover())\n\t\t\t{\n\t\t\t\tif(!m_bHover)\n\t\t\t\t{\n\t\t\t\t\tm_bHover = true;\n\t\t\t\t\tthis->InvalidateRect(&m_rcLink);\n\t\t\t\t\tthis->UpdateWindow();\n\t\t\t\t\tStartTrackMouseLeave();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(IsUnderlineHover())\n\t\t\t{\n\t\t\t\tif(m_bHover)\n\t\t\t\t{\n\t\t\t\t\tm_bHover = false;\n\t\t\t\t\tthis->InvalidateRect(&m_rcLink);\n\t\t\t\t\tthis->UpdateWindow();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbHandled = FALSE;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnMouseLeave(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tif(IsUnderlineHover() && m_bHover)\n\t\t{\n\t\t\tm_bHover = false;\n\t\t\tthis->InvalidateRect(&m_rcLink);\n\t\t\tthis->UpdateWindow();\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tPOINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\t\tif(::PtInRect(&m_rcLink, pt))\n\t\t{\n\t\t\tthis->SetFocus();\n\t\t\tthis->SetCapture();\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tif(GetCapture() == this->m_hWnd)\n\t\t{\n\t\t\tReleaseCapture();\n\t\t\tPOINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\t\t\tif(::PtInRect(&m_rcLink, pt))\n\t\t\t{\n\t\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t\tpT->Navigate();\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tif((wParam == VK_RETURN) || (wParam == VK_SPACE))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->Navigate();\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnGetDlgCode(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn DLGC_WANTCHARS;\n\t}\n\n\tLRESULT OnSetCursor(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tPOINT pt = {};\n\t\tGetCursorPos(&pt);\n\t\tthis->ScreenToClient(&pt);\n\t\tif(((m_lpstrHyperLink != NULL)  || IsCommandButton()) && ::PtInRect(&m_rcLink, pt))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\tbHandled = FALSE;\n\t\treturn FALSE;\n\t}\n\n\tLRESULT OnEnable(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tthis->Invalidate();\n\t\tthis->UpdateWindow();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnGetFont(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn (LRESULT)m_hFontNormal;\n\t}\n\n\tLRESULT OnSetFont(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tif(m_bInternalNormalFont)\n\t\t{\n\t\t\t::DeleteObject(m_hFontNormal);\n\t\t\tm_bInternalNormalFont = false;\n\t\t}\n\n\t\tbool bCreateLinkFont = m_bInternalLinkFont;\n\n\t\tm_hFontNormal = (HFONT)wParam;\n\n\t\tif(bCreateLinkFont || IsAutoCreateLinkFont())\n\t\t\tCreateLinkFontFromNormal();\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->CalcLabelRect();\n\n\t\tif((BOOL)lParam)\n\t\t{\n\t\t\tthis->Invalidate();\n\t\t\tthis->UpdateWindow();\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnUpdateUiState(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\t// If the control is subclassed or superclassed, this message can cause\n\t\t// repainting without WM_PAINT. We don't use this state, so just do nothing.\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->CalcLabelRect();\n\t\tpT->Invalidate();\n\t\treturn 0;\n\t}\n\n// Implementation\n\tvoid Init()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\n\t\t// Check if we should paint a label\n\t\tconst int cchBuff = 8;\n\t\tTCHAR szBuffer[cchBuff] = {};\n\t\tif(::GetClassName(this->m_hWnd, szBuffer, cchBuff))\n\t\t{\n\t\t\tif(lstrcmpi(szBuffer, _T(\"static\")) == 0)\n\t\t\t{\n\t\t\t\tthis->ModifyStyle(0, SS_NOTIFY);   // we need this\n\t\t\t\tDWORD dwStyle = this->GetStyle() & 0x000000FF;\n\t\t\t\tif((dwStyle == SS_ICON) || (dwStyle == SS_BLACKRECT) || (dwStyle == SS_GRAYRECT) || \n\t\t\t\t\t\t(dwStyle == SS_WHITERECT) || (dwStyle == SS_BLACKFRAME) || (dwStyle == SS_GRAYFRAME) || \n\t\t\t\t\t\t(dwStyle == SS_WHITEFRAME) || (dwStyle == SS_OWNERDRAW) || \n\t\t\t\t\t\t(dwStyle == SS_BITMAP) || (dwStyle == SS_ENHMETAFILE))\n\t\t\t\t\tm_bPaintLabel = false;\n\t\t\t}\n\t\t}\n\n\t\t// create or load a cursor\n\t\tm_hCursor = ::LoadCursor(NULL, IDC_HAND);\n\t\tATLASSERT(m_hCursor != NULL);\n\n\t\t// set fonts\n\t\tif(m_bPaintLabel)\n\t\t{\n\t\t\tif(m_hFontNormal == NULL)\n\t\t\t{\n\t\t\t\tm_hFontNormal = AtlCreateControlFont();\n\t\t\t\tm_bInternalNormalFont = true;\n\t\t\t}\n\n\t\t\tif(m_hFontLink == NULL)\n\t\t\t\tCreateLinkFontFromNormal();\n\t\t}\n\n\t\t// create a tool tip\n\t\tm_tip.Create(this->m_hWnd);\n\t\tATLASSERT(m_tip.IsWindow());\n\n\t\t// set label (defaults to window text)\n\t\tif(m_lpstrLabel == NULL)\n\t\t{\n\t\t\tint nLen = this->GetWindowTextLength();\n\t\t\tif(nLen > 0)\n\t\t\t{\n\t\t\t\tATLTRY(m_lpstrLabel = new TCHAR[nLen + 1]);\n\t\t\t\tif(m_lpstrLabel != NULL)\n\t\t\t\t\tATLVERIFY(this->GetWindowText(m_lpstrLabel, nLen + 1) > 0);\n\t\t\t}\n\t\t}\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->CalcLabelRect();\n\n\t\t// set hyperlink (defaults to label), or just activate tool tip if already set\n\t\tif((m_lpstrHyperLink == NULL) && !IsCommandButton())\n\t\t{\n\t\t\tif(m_lpstrLabel != NULL)\n\t\t\t\tSetHyperLink(m_lpstrLabel);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_tip.Activate(TRUE);\n\t\t\tm_tip.AddTool(this->m_hWnd, m_lpstrHyperLink, &m_rcLink, 1);\n\t\t}\n\n\t\t// set link colors\n\t\tif(m_bPaintLabel)\n\t\t{\n\t\t\tATL::CRegKey rk;\n\t\t\tLONG lRet = rk.Open(HKEY_CURRENT_USER, _T(\"Software\\\\Microsoft\\\\Internet Explorer\\\\Settings\"));\n\t\t\tif(lRet == ERROR_SUCCESS)\n\t\t\t{\n\t\t\t\tconst int cchValue = 12;\n\t\t\t\tTCHAR szValue[cchValue] = {};\n\t\t\t\tULONG ulCount = cchValue;\n\t\t\t\tlRet = rk.QueryStringValue(_T(\"Anchor Color\"), szValue, &ulCount);\n\t\t\t\tif(lRet == ERROR_SUCCESS)\n\t\t\t\t{\n\t\t\t\t\tCOLORREF clr = pT->_ParseColorString(szValue);\n\t\t\t\t\tATLASSERT(clr != CLR_INVALID);\n\t\t\t\t\tif(clr != CLR_INVALID)\n\t\t\t\t\t\tm_clrLink = clr;\n\t\t\t\t}\n\n\t\t\t\tulCount = cchValue;\n\t\t\t\tlRet = rk.QueryStringValue(_T(\"Anchor Color Visited\"), szValue, &ulCount);\n\t\t\t\tif(lRet == ERROR_SUCCESS)\n\t\t\t\t{\n\t\t\t\t\tCOLORREF clr = pT->_ParseColorString(szValue);\n\t\t\t\t\tATLASSERT(clr != CLR_INVALID);\n\t\t\t\t\tif(clr != CLR_INVALID)\n\t\t\t\t\t\tm_clrVisited = clr;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic COLORREF _ParseColorString(LPTSTR lpstr)\n\t{\n\t\tint c[3] = { -1, -1, -1 };\n\t\tLPTSTR p = NULL;\n\t\tfor(int i = 0; i < 2; i++)\n\t\t{\n\t\t\tfor(p = lpstr; *p != _T('\\0'); p = ::CharNext(p))\n\t\t\t{\n\t\t\t\tif(*p == _T(','))\n\t\t\t\t{\n\t\t\t\t\t*p = _T('\\0');\n\t\t\t\t\tc[i] = _ttoi(lpstr);\n\t\t\t\t\tlpstr = &p[1];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(c[i] == -1)\n\t\t\t\treturn CLR_INVALID;\n\t\t}\n\t\tif(*lpstr == _T('\\0'))\n\t\t\treturn CLR_INVALID;\n\t\tc[2] = _ttoi(lpstr);\n\n\t\treturn RGB(c[0], c[1], c[2]);\n\t}\n\n\tbool CalcLabelRect()\n\t{\n\t\tif(!::IsWindow(this->m_hWnd))\n\t\t\treturn false;\n\t\tif((m_lpstrLabel == NULL) && (m_lpstrHyperLink == NULL))\n\t\t\treturn false;\n\n\t\tCClientDC dc(this->m_hWnd);\n\t\tRECT rcClient = {};\n\t\tthis->GetClientRect(&rcClient);\n\t\tm_rcLink = rcClient;\n\t\tif(!m_bPaintLabel)\n\t\t\treturn true;\n\n\t\tif(IsUsingTags())\n\t\t{\n\t\t\t// find tags and label parts\n\t\t\tLPTSTR lpstrLeft = NULL;\n\t\t\tint cchLeft = 0;\n\t\t\tLPTSTR lpstrLink = NULL;\n\t\t\tint cchLink = 0;\n\t\t\tLPTSTR lpstrRight = NULL;\n\t\t\tint cchRight = 0;\n\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->CalcLabelParts(lpstrLeft, cchLeft, lpstrLink, cchLink, lpstrRight, cchRight);\n\t\t\tATLASSERT(lpstrLink != NULL);\n\t\t\tATLASSERT(cchLink > 0);\n\n\t\t\t// get label part rects\n\t\t\tHFONT hFontOld = dc.SelectFont(m_hFontNormal);\n\n\t\t\tUINT uFormat = IsSingleLine() ? DT_SINGLELINE : DT_WORDBREAK;\n\n\t\t\tRECT rcLeft = rcClient;\n\t\t\tif(lpstrLeft != NULL)\n\t\t\t\tdc.DrawText(lpstrLeft, cchLeft, &rcLeft, DT_LEFT | uFormat | DT_CALCRECT);\n\n\t\t\tdc.SelectFont(m_hFontLink);\n\t\t\tRECT rcLink = rcClient;\n\t\t\tif(lpstrLeft != NULL)\n\t\t\t\trcLink.left = rcLeft.right;\n\t\t\tdc.DrawText(lpstrLink, cchLink, &rcLink, DT_LEFT | uFormat | DT_CALCRECT);\n\n\t\t\tdc.SelectFont(hFontOld);\n\n\t\t\tm_rcLink = rcLink;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tHFONT hOldFont = NULL;\n\t\t\tif(m_hFontLink != NULL)\n\t\t\t\thOldFont = dc.SelectFont(m_hFontLink);\n\t\t\tLPTSTR lpstrText = (m_lpstrLabel != NULL) ? m_lpstrLabel : m_lpstrHyperLink;\n\t\t\tDWORD dwStyle = this->GetStyle();\n\t\t\tUINT uFormat = DT_LEFT;\n\t\t\tif (dwStyle & SS_CENTER)\n\t\t\t\tuFormat = DT_CENTER;\n\t\t\telse if (dwStyle & SS_RIGHT)\n\t\t\t\tuFormat = DT_RIGHT;\n\t\t\tuFormat |= IsSingleLine() ? DT_SINGLELINE : DT_WORDBREAK;\n\t\t\tdc.DrawText(lpstrText, -1, &m_rcLink, uFormat | DT_CALCRECT);\n\t\t\tif(m_hFontLink != NULL)\n\t\t\t\tdc.SelectFont(hOldFont);\n\t\t\tif (dwStyle & SS_CENTER)\n\t\t\t{\n\t\t\t\tint dx = (rcClient.right - m_rcLink.right) / 2;\n\t\t\t\t::OffsetRect(&m_rcLink, dx, 0);\n\t\t\t}\n\t\t\telse if (dwStyle & SS_RIGHT)\n\t\t\t{\n\t\t\t\tint dx = rcClient.right - m_rcLink.right;\n\t\t\t\t::OffsetRect(&m_rcLink, dx, 0);\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tvoid CalcLabelParts(LPTSTR& lpstrLeft, int& cchLeft, LPTSTR& lpstrLink, int& cchLink, LPTSTR& lpstrRight, int& cchRight) const\n\t{\n\t\tlpstrLeft = NULL;\n\t\tcchLeft = 0;\n\t\tlpstrLink = NULL;\n\t\tcchLink = 0;\n\t\tlpstrRight = NULL;\n\t\tcchRight = 0;\n\n\t\tLPTSTR lpstrText = (m_lpstrLabel != NULL) ? m_lpstrLabel : m_lpstrHyperLink;\n\t\tint cchText = lstrlen(lpstrText);\n\t\tbool bOutsideLink = true;\n\t\tfor(int i = 0; i < cchText; i++)\n\t\t{\n\t\t\tif(lpstrText[i] != _T('<'))\n\t\t\t\tcontinue;\n\n\t\t\tif(bOutsideLink)\n\t\t\t{\n\t\t\t\tif(::CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, &lpstrText[i], 3, _T(\"<A>\"), 3) == CSTR_EQUAL)\n\t\t\t\t{\n\t\t\t\t\tif(i > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlpstrLeft = lpstrText;\n\t\t\t\t\t\tcchLeft = i;\n\t\t\t\t\t}\n\t\t\t\t\tlpstrLink = &lpstrText[i + 3];\n\t\t\t\t\tbOutsideLink = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(::CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, &lpstrText[i], 4, _T(\"</A>\"), 4) == CSTR_EQUAL)\n\t\t\t\t{\n\t\t\t\t\tcchLink = i - 3 - cchLeft;\n\t\t\t\t\tif(lpstrText[i + 4] != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlpstrRight = &lpstrText[i + 4];\n\t\t\t\t\t\tcchRight = cchText - (i + 4);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tvoid DoEraseBackground(CDCHandle dc)\n\t{\n\t\tHBRUSH hBrush = (HBRUSH)this->GetParent().SendMessage(WM_CTLCOLORSTATIC, (WPARAM)dc.m_hDC, (LPARAM)this->m_hWnd);\n\t\tif(hBrush != NULL)\n\t\t{\n\t\t\tRECT rect = {};\n\t\t\tthis->GetClientRect(&rect);\n\t\t\tdc.FillRect(&rect, hBrush);\n\t\t}\n\t}\n\n\tvoid DoPaint(CDCHandle dc)\n\t{\n\t\tif(IsUsingTags())\n\t\t{\n\t\t\t// find tags and label parts\n\t\t\tLPTSTR lpstrLeft = NULL;\n\t\t\tint cchLeft = 0;\n\t\t\tLPTSTR lpstrLink = NULL;\n\t\t\tint cchLink = 0;\n\t\t\tLPTSTR lpstrRight = NULL;\n\t\t\tint cchRight = 0;\n\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->CalcLabelParts(lpstrLeft, cchLeft, lpstrLink, cchLink, lpstrRight, cchRight);\n\n\t\t\t// get label part rects\n\t\t\tRECT rcClient = {};\n\t\t\tthis->GetClientRect(&rcClient);\n\n\t\t\tdc.SetBkMode(TRANSPARENT);\n\t\t\tHFONT hFontOld = dc.SelectFont(m_hFontNormal);\n\n\t\t\tUINT uFormat = IsSingleLine() ? DT_SINGLELINE : DT_WORDBREAK;\n\n\t\t\tif(lpstrLeft != NULL)\n\t\t\t\tdc.DrawText(lpstrLeft, cchLeft, &rcClient, DT_LEFT | uFormat);\n\n\t\t\tCOLORREF clrOld = dc.SetTextColor(this->IsWindowEnabled() ? (m_bVisited ? m_clrVisited : m_clrLink) : (::GetSysColor(COLOR_GRAYTEXT)));\n\t\t\tif((m_hFontLink != NULL) && (!IsUnderlineHover() || (IsUnderlineHover() && m_bHover)))\n\t\t\t\tdc.SelectFont(m_hFontLink);\n\t\t\telse\n\t\t\t\tdc.SelectFont(m_hFontNormal);\n\n\t\t\tdc.DrawText(lpstrLink, cchLink, &m_rcLink, DT_LEFT | uFormat);\n\n\t\t\tdc.SetTextColor(clrOld);\n\t\t\tdc.SelectFont(m_hFontNormal);\n\t\t\tif(lpstrRight != NULL)\n\t\t\t{\n\t\t\t\tRECT rcRight = { m_rcLink.right, m_rcLink.top, rcClient.right, rcClient.bottom };\n\t\t\t\tdc.DrawText(lpstrRight, cchRight, &rcRight, DT_LEFT | uFormat);\n\t\t\t}\n\n\t\t\tif(GetFocus() == this->m_hWnd)\n\t\t\t\tdc.DrawFocusRect(&m_rcLink);\n\n\t\t\tdc.SelectFont(hFontOld);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdc.SetBkMode(TRANSPARENT);\n\t\t\tCOLORREF clrOld = dc.SetTextColor(this->IsWindowEnabled() ? (m_bVisited ? m_clrVisited : m_clrLink) : (::GetSysColor(COLOR_GRAYTEXT)));\n\n\t\t\tHFONT hFontOld = NULL;\n\t\t\tif((m_hFontLink != NULL) && (!IsUnderlineHover() || (IsUnderlineHover() && m_bHover)))\n\t\t\t\thFontOld = dc.SelectFont(m_hFontLink);\n\t\t\telse\n\t\t\t\thFontOld = dc.SelectFont(m_hFontNormal);\n\n\t\t\tLPTSTR lpstrText = (m_lpstrLabel != NULL) ? m_lpstrLabel : m_lpstrHyperLink;\n\n\t\t\tDWORD dwStyle = this->GetStyle();\n\t\t\tUINT uFormat = DT_LEFT;\n\t\t\tif (dwStyle & SS_CENTER)\n\t\t\t\tuFormat = DT_CENTER;\n\t\t\telse if (dwStyle & SS_RIGHT)\n\t\t\t\tuFormat = DT_RIGHT;\n\t\t\tuFormat |= IsSingleLine() ? DT_SINGLELINE : DT_WORDBREAK;\n\n\t\t\tdc.DrawText(lpstrText, -1, &m_rcLink, uFormat);\n\n\t\t\tif(GetFocus() == this->m_hWnd)\n\t\t\t\tdc.DrawFocusRect(&m_rcLink);\n\n\t\t\tdc.SetTextColor(clrOld);\n\t\t\tdc.SelectFont(hFontOld);\n\t\t}\n\t}\n\n\tBOOL StartTrackMouseLeave()\n\t{\n\t\tTRACKMOUSEEVENT tme = {};\n\t\ttme.cbSize = sizeof(tme);\n\t\ttme.dwFlags = TME_LEAVE;\n\t\ttme.hwndTrack = this->m_hWnd;\n\t\treturn ::TrackMouseEvent(&tme);\n\t}\n\n// Implementation helpers\n\tbool IsUnderlined() const\n\t{\n\t\treturn ((m_dwExtendedStyle & (HLINK_NOTUNDERLINED | HLINK_UNDERLINEHOVER)) == 0);\n\t}\n\n\tbool IsNotUnderlined() const\n\t{\n\t\treturn ((m_dwExtendedStyle & HLINK_NOTUNDERLINED) != 0);\n\t}\n\n\tbool IsUnderlineHover() const\n\t{\n\t\treturn ((m_dwExtendedStyle & HLINK_UNDERLINEHOVER) != 0);\n\t}\n\n\tbool IsCommandButton() const\n\t{\n\t\treturn ((m_dwExtendedStyle & HLINK_COMMANDBUTTON) != 0);\n\t}\n\n\tbool IsNotifyButton() const\n\t{\n\t\treturn ((m_dwExtendedStyle & HLINK_NOTIFYBUTTON) == HLINK_NOTIFYBUTTON);\n\t}\n\n\tbool IsUsingTags() const\n\t{\n\t\treturn ((m_dwExtendedStyle & HLINK_USETAGS) != 0);\n\t}\n\n\tbool IsUsingTagsBold() const\n\t{\n\t\treturn ((m_dwExtendedStyle & HLINK_USETAGSBOLD) == HLINK_USETAGSBOLD);\n\t}\n\n\tbool IsUsingToolTip() const\n\t{\n\t\treturn ((m_dwExtendedStyle & HLINK_NOTOOLTIP) == 0);\n\t}\n\n\tbool IsAutoCreateLinkFont() const\n\t{\n\t\treturn ((m_dwExtendedStyle & HLINK_AUTOCREATELINKFONT) == HLINK_AUTOCREATELINKFONT);\n\t}\n\n\tbool IsSingleLine() const\n\t{\n\t\treturn ((m_dwExtendedStyle & HLINK_SINGLELINE) == HLINK_SINGLELINE);\n\t}\n};\n\nclass CHyperLink : public CHyperLinkImpl<CHyperLink>\n{\npublic:\n\tDECLARE_WND_CLASS(_T(\"WTL_HyperLink\"))\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CWaitCursor - displays a wait cursor\n\nclass CWaitCursor\n{\npublic:\n// Data\n\tHCURSOR m_hWaitCursor;\n\tHCURSOR m_hOldCursor;\n\tbool m_bInUse;\n\n// Constructor/destructor\n\tCWaitCursor(bool bSet = true, LPCTSTR lpstrCursor = IDC_WAIT, bool bSys = true) : m_hOldCursor(NULL), m_bInUse(false)\n\t{\n\t\tHINSTANCE hInstance = bSys ? NULL : ModuleHelper::GetResourceInstance();\n\t\tm_hWaitCursor = ::LoadCursor(hInstance, lpstrCursor);\n\t\tATLASSERT(m_hWaitCursor != NULL);\n\n\t\tif(bSet)\n\t\t\tSet();\n\t}\n\n\t~CWaitCursor()\n\t{\n\t\tRestore();\n\t}\n\n// Methods\n\tbool Set()\n\t{\n\t\tif(m_bInUse)\n\t\t\treturn false;\n\t\tm_hOldCursor = ::SetCursor(m_hWaitCursor);\n\t\tm_bInUse = true;\n\t\treturn true;\n\t}\n\n\tbool Restore()\n\t{\n\t\tif(!m_bInUse)\n\t\t\treturn false;\n\t\t::SetCursor(m_hOldCursor);\n\t\tm_bInUse = false;\n\t\treturn true;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CCustomWaitCursor - for custom and animated cursors\n\nclass CCustomWaitCursor : public CWaitCursor\n{\npublic:\n// Constructor/destructor\n\tCCustomWaitCursor(ATL::_U_STRINGorID cursor, bool bSet = true, HINSTANCE hInstance = NULL) : \n\t\t\tCWaitCursor(false, IDC_WAIT, true)\n\t{\n\t\tif(hInstance == NULL)\n\t\t\thInstance = ModuleHelper::GetResourceInstance();\n\t\tm_hWaitCursor = (HCURSOR)::LoadImage(hInstance, cursor.m_lpstr, IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE);\n\n\t\tif(bSet)\n\t\t\tSet();\n\t}\n\n\t~CCustomWaitCursor()\n\t{\n\t\tRestore();\n\t\t::DestroyCursor(m_hWaitCursor);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CMultiPaneStatusBarCtrl - Status Bar with multiple panes\n\ntemplate <class T, class TBase = CStatusBarCtrl>\nclass ATL_NO_VTABLE CMultiPaneStatusBarCtrlImpl : public ATL::CWindowImpl< T, TBase >\n{\npublic:\n\tDECLARE_WND_SUPERCLASS2(NULL, T, TBase::GetWndClassName())\n\n// Data\n\tenum { m_cxPaneMargin = 3 };\n\n\tint m_nPanes;\n\tint* m_pPane;\n\n// Constructor/destructor\n\tCMultiPaneStatusBarCtrlImpl() : m_nPanes(0), m_pPane(NULL)\n\t{ }\n\n\t~CMultiPaneStatusBarCtrlImpl()\n\t{\n\t\tdelete [] m_pPane;\n\t}\n\n// Methods\n\tHWND Create(HWND hWndParent, LPCTSTR lpstrText, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP, UINT nID = ATL_IDW_STATUS_BAR)\n\t{\n\t\treturn ATL::CWindowImpl< T, TBase >::Create(hWndParent, this->rcDefault, lpstrText, dwStyle, 0, nID);\n\t}\n\n\tHWND Create(HWND hWndParent, UINT nTextID = ATL_IDS_IDLEMESSAGE, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP, UINT nID = ATL_IDW_STATUS_BAR)\n\t{\n\t\tconst int cchMax = 128;   // max text length is 127 for status bars (+1 for null)\n\t\tTCHAR szText[cchMax] = {};\n\t\t::LoadString(ModuleHelper::GetResourceInstance(), nTextID, szText, cchMax);\n\t\treturn Create(hWndParent, szText, dwStyle, nID);\n\t}\n\n\tBOOL SetPanes(int* pPanes, int nPanes, bool bSetText = true)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(nPanes > 0);\n\n\t\tm_nPanes = nPanes;\n\t\tdelete [] m_pPane;\n\t\tm_pPane = NULL;\n\n\t\tATLTRY(m_pPane = new int[nPanes]);\n\t\tATLASSERT(m_pPane != NULL);\n\t\tif(m_pPane == NULL)\n\t\t\treturn FALSE;\n\n\t\tATL::CTempBuffer<int, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tint* pPanesPos = buff.Allocate(nPanes);\n\t\tATLASSERT(pPanesPos != NULL);\n\t\tif(pPanesPos == NULL)\n\t\t\treturn FALSE;\n\n\t\tATL::Checked::memcpy_s(m_pPane, nPanes * sizeof(int), pPanes, nPanes * sizeof(int));\n\n\t\t// get status bar DC and set font\n\t\tCClientDC dc(this->m_hWnd);\n\t\tHFONT hOldFont = dc.SelectFont(this->GetFont());\n\n\t\t// get status bar borders\n\t\tint arrBorders[3] = {};\n\t\tthis->GetBorders(arrBorders);\n\n\t\tconst int cchBuff = 128;\n\t\tTCHAR szBuff[cchBuff] = {};\n\t\tint cxLeft = arrBorders[0];\n\n\t\t// calculate right edge of each part\n\t\tfor(int i = 0; i < nPanes; i++)\n\t\t{\n\t\t\tif(pPanes[i] == ID_DEFAULT_PANE)\n\t\t\t{\n\t\t\t\t// make very large, will be resized later\n\t\t\t\tpPanesPos[i] = INT_MAX / 2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t::LoadString(ModuleHelper::GetResourceInstance(), pPanes[i], szBuff, cchBuff);\n\t\t\t\tSIZE size = {};\n\t\t\t\tdc.GetTextExtent(szBuff, lstrlen(szBuff), &size);\n\t\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t\t(void)pT;   // avoid level 4 warning\n\t\t\t\tpPanesPos[i] = cxLeft + size.cx + arrBorders[2] + 2 * pT->m_cxPaneMargin;\n\t\t\t}\n\t\t\tcxLeft = pPanesPos[i];\n\t\t}\n\n\t\tBOOL bRet = this->SetParts(nPanes, pPanesPos);\n\n\t\tif(bRet && bSetText)\n\t\t{\n\t\t\tfor(int i = 0; i < nPanes; i++)\n\t\t\t{\n\t\t\t\tif(pPanes[i] != ID_DEFAULT_PANE)\n\t\t\t\t{\n\t\t\t\t\t::LoadString(ModuleHelper::GetResourceInstance(), pPanes[i], szBuff, cchBuff);\n\t\t\t\t\tSetPaneText(m_pPane[i], szBuff);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdc.SelectFont(hOldFont);\n\t\treturn bRet;\n\t}\n\n\tbool GetPaneTextLength(int nPaneID, int* pcchLength = NULL, int* pnType = NULL) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tint nIndex  = GetPaneIndexFromID(nPaneID);\n\t\tif(nIndex == -1)\n\t\t\treturn false;\n\n\t\tint nLength = this->GetTextLength(nIndex, pnType);\n\t\tif(pcchLength != NULL)\n\t\t\t*pcchLength = nLength;\n\n\t\treturn true;\n\t}\n\n\tBOOL GetPaneText(int nPaneID, LPTSTR lpstrText, int* pcchLength = NULL, int* pnType = NULL) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tint nIndex  = GetPaneIndexFromID(nPaneID);\n\t\tif(nIndex == -1)\n\t\t\treturn FALSE;\n\n\t\tint nLength = this->GetText(nIndex, lpstrText, pnType);\n\t\tif(pcchLength != NULL)\n\t\t\t*pcchLength = nLength;\n\n\t\treturn TRUE;\n\t}\n\n#ifdef __ATLSTR_H__\n\tBOOL GetPaneText(int nPaneID, ATL::CString& strText, int* pcchLength = NULL, int* pnType = NULL) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tint nIndex  = GetPaneIndexFromID(nPaneID);\n\t\tif(nIndex == -1)\n\t\t\treturn FALSE;\n\n\t\tint nLength = this->GetText(nIndex, strText, pnType);\n\t\tif(pcchLength != NULL)\n\t\t\t*pcchLength = nLength;\n\n\t\treturn TRUE;\n\t}\n#endif // __ATLSTR_H__\n\n\tBOOL SetPaneText(int nPaneID, LPCTSTR lpstrText, int nType = 0)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tint nIndex  = GetPaneIndexFromID(nPaneID);\n\t\tif(nIndex == -1)\n\t\t\treturn FALSE;\n\n\t\treturn this->SetText(nIndex, lpstrText, nType);\n\t}\n\n\tBOOL GetPaneRect(int nPaneID, LPRECT lpRect) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tint nIndex  = GetPaneIndexFromID(nPaneID);\n\t\tif(nIndex == -1)\n\t\t\treturn FALSE;\n\n\t\treturn this->GetRect(nIndex, lpRect);\n\t}\n\n\tBOOL SetPaneWidth(int nPaneID, int cxWidth)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(nPaneID != ID_DEFAULT_PANE);   // Can't resize this one\n\t\tint nIndex  = GetPaneIndexFromID(nPaneID);\n\t\tif(nIndex == -1)\n\t\t\treturn FALSE;\n\n\t\t// get pane positions\n\t\tATL::CTempBuffer<int, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tint* pPanesPos = buff.Allocate(m_nPanes);\n\t\tif(pPanesPos == NULL)\n\t\t\treturn FALSE;\n\t\tthis->GetParts(m_nPanes, pPanesPos);\n\t\t// calculate offset\n\t\tint cxPaneWidth = pPanesPos[nIndex] - ((nIndex == 0) ? 0 : pPanesPos[nIndex - 1]);\n\t\tint cxOff = cxWidth - cxPaneWidth;\n\t\t// find variable width pane\n\t\tint nDef = m_nPanes;\n\t\tfor(int i = 0; i < m_nPanes; i++)\n\t\t{\n\t\t\tif(m_pPane[i] == ID_DEFAULT_PANE)\n\t\t\t{\n\t\t\t\tnDef = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// resize\n\t\tif(nIndex < nDef)   // before default pane\n\t\t{\n\t\t\tfor(int i = nIndex; i < nDef; i++)\n\t\t\t\tpPanesPos[i] += cxOff;\n\t\t\t\t\n\t\t}\n\t\telse\t\t\t// after default one\n\t\t{\n\t\t\tfor(int i = nDef; i < nIndex; i++)\n\t\t\t\tpPanesPos[i] -= cxOff;\n\t\t}\n\t\t// set pane postions\n\t\treturn this->SetParts(m_nPanes, pPanesPos);\n\t}\n\n\tBOOL GetPaneTipText(int nPaneID, LPTSTR lpstrText, int nSize) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tint nIndex  = GetPaneIndexFromID(nPaneID);\n\t\tif(nIndex == -1)\n\t\t\treturn FALSE;\n\n\t\tthis->GetTipText(nIndex, lpstrText, nSize);\n\t\treturn TRUE;\n\t}\n\n\tBOOL SetPaneTipText(int nPaneID, LPCTSTR lpstrText)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tint nIndex  = GetPaneIndexFromID(nPaneID);\n\t\tif(nIndex == -1)\n\t\t\treturn FALSE;\n\n\t\tthis->SetTipText(nIndex, lpstrText);\n\t\treturn TRUE;\n\t}\n\n\tBOOL GetPaneIcon(int nPaneID, HICON& hIcon) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tint nIndex  = GetPaneIndexFromID(nPaneID);\n\t\tif(nIndex == -1)\n\t\t\treturn FALSE;\n\n\t\thIcon = this->GetIcon(nIndex);\n\t\treturn TRUE;\n\t}\n\n\tBOOL SetPaneIcon(int nPaneID, HICON hIcon)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tint nIndex  = GetPaneIndexFromID(nPaneID);\n\t\tif(nIndex == -1)\n\t\t\treturn FALSE;\n\n\t\treturn this->SetIcon(nIndex, hIcon);\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CMultiPaneStatusBarCtrlImpl< T >)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\tEND_MSG_MAP()\n\n\tLRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tLRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);\n\t\tif((wParam != SIZE_MINIMIZED) && (m_nPanes > 0))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->UpdatePanesLayout();\n\t\t}\n\t\treturn lRet;\n\t}\n\n// Implementation\n\tBOOL UpdatePanesLayout()\n\t{\n\t\t// get pane positions\n\t\tATL::CTempBuffer<int, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tint* pPanesPos = buff.Allocate(m_nPanes);\n\t\tATLASSERT(pPanesPos != NULL);\n\t\tif(pPanesPos == NULL)\n\t\t\treturn FALSE;\n\t\tint nRet = this->GetParts(m_nPanes, pPanesPos);\n\t\tATLASSERT(nRet == m_nPanes);\n\t\tif(nRet != m_nPanes)\n\t\t\treturn FALSE;\n\t\t// calculate offset\n\t\tRECT rcClient = {};\n\t\tthis->GetClientRect(&rcClient);\n\t\tint cxOff = rcClient.right - pPanesPos[m_nPanes - 1];\n\t\t// Move panes left if size grip box is present\n\t\tif((this->GetStyle() & SBARS_SIZEGRIP) != 0)\n\t\t\tcxOff -= ::GetSystemMetrics(SM_CXVSCROLL) + ::GetSystemMetrics(SM_CXEDGE);\n\t\t// find variable width pane\n\t\tint i;\n\t\tfor(i = 0; i < m_nPanes; i++)\n\t\t{\n\t\t\tif(m_pPane[i] == ID_DEFAULT_PANE)\n\t\t\t\tbreak;\n\t\t}\n\t\t// resize all panes from the variable one to the right\n\t\tif((i < m_nPanes) && (pPanesPos[i] + cxOff) > ((i == 0) ? 0 : pPanesPos[i - 1]))\n\t\t{\n\t\t\tfor(; i < m_nPanes; i++)\n\t\t\t\tpPanesPos[i] += cxOff;\n\t\t}\n\t\t// set pane postions\n\t\treturn this->SetParts(m_nPanes, pPanesPos);\n\t}\n\n\tint GetPaneIndexFromID(int nPaneID) const\n\t{\n\t\tfor(int i = 0; i < m_nPanes; i++)\n\t\t{\n\t\t\tif(m_pPane[i] == nPaneID)\n\t\t\t\treturn i;\n\t\t}\n\n\t\treturn -1;   // not found\n\t}\n};\n\nclass CMultiPaneStatusBarCtrl : public CMultiPaneStatusBarCtrlImpl<CMultiPaneStatusBarCtrl>\n{\npublic:\n\tDECLARE_WND_SUPERCLASS(_T(\"WTL_MultiPaneStatusBar\"), GetWndClassName())\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CPaneContainer - provides header with title and close button for panes\n\n// pane container extended styles\n#define PANECNT_NOCLOSEBUTTON   0x00000001\n#define PANECNT_VERTICAL        0x00000002\n#define PANECNT_FLATBORDER      0x00000004\n#define PANECNT_NOBORDER        0x00000008\n#define PANECNT_DIVIDER         0x00000010\n#define PANECNT_GRADIENT        0x00000020\n\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CPaneContainerImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >, public CCustomDraw< T >\n{\npublic:\n\tDECLARE_WND_CLASS_EX2(NULL, T, 0, -1)\n\n// Constants\n\tenum\n\t{\n\t\tm_cxyBorder = 2,\n\t\tm_cxyTextOffset = 4,\n\t\tm_cxyBtnOffset = 1,\n\n\t\tm_cchTitle = 80,\n\n\t\tm_cxImageTB = 13,\n\t\tm_cyImageTB = 11,\n\t\tm_cxyBtnAddTB = 7,\n\n\t\tm_cxToolBar = m_cxImageTB + m_cxyBtnAddTB + m_cxyBorder + m_cxyBtnOffset,\n\n\t\tm_xBtnImageLeft = 6,\n\t\tm_yBtnImageTop = 5,\n\t\tm_xBtnImageRight = 12,\n\t\tm_yBtnImageBottom = 11,\n\n\t\tm_nCloseBtnID = ID_PANE_CLOSE\n\t};\n\n// Data members\n\tCToolBarCtrl m_tb;\n\tATL::CWindow m_wndClient;\n\tint m_cxyHeader;\n\tTCHAR m_szTitle[m_cchTitle];\n\tDWORD m_dwExtendedStyle;   // Pane container specific extended styles\n\tHFONT m_hFont;\n\tbool m_bInternalFont;\n\n\n// Constructor\n\tCPaneContainerImpl() : m_cxyHeader(0), m_dwExtendedStyle(0), m_hFont(NULL), m_bInternalFont(false)\n\t{\n\t\tm_szTitle[0] = 0;\n\t}\n\n// Attributes\n\tDWORD GetPaneContainerExtendedStyle() const\n\t{\n\t\treturn m_dwExtendedStyle;\n\t}\n\n\tDWORD SetPaneContainerExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\n\t{\n\t\tDWORD dwPrevStyle = m_dwExtendedStyle;\n\t\tif(dwMask == 0)\n\t\t\tm_dwExtendedStyle = dwExtendedStyle;\n\t\telse\n\t\t\tm_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\n\t\tif(this->m_hWnd != NULL)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tbool bUpdate = false;\n\n\t\t\tif(((dwPrevStyle & PANECNT_NOCLOSEBUTTON) != 0) && ((m_dwExtendedStyle & PANECNT_NOCLOSEBUTTON) == 0))   // add close button\n\t\t\t{\n\t\t\t\tpT->CreateCloseButton();\n\t\t\t\tbUpdate = true;\n\t\t\t}\n\t\t\telse if(((dwPrevStyle & PANECNT_NOCLOSEBUTTON) == 0) && ((m_dwExtendedStyle & PANECNT_NOCLOSEBUTTON) != 0))   // remove close button\n\t\t\t{\n\t\t\t\tpT->DestroyCloseButton();\n\t\t\t\tbUpdate = true;\n\t\t\t}\n\n\t\t\tif((dwPrevStyle & PANECNT_VERTICAL) != (m_dwExtendedStyle & PANECNT_VERTICAL))   // change orientation\n\t\t\t{\n\t\t\t\tpT->CalcSize();\n\t\t\t\tbUpdate = true;\n\t\t\t}\n\n\t\t\tif((dwPrevStyle & (PANECNT_FLATBORDER | PANECNT_NOBORDER)) != \n\t\t\t   (m_dwExtendedStyle & (PANECNT_FLATBORDER | PANECNT_NOBORDER)))   // change border\n\t\t\t{\n\t\t\t\tbUpdate = true;\n\t\t\t}\n\n\t\t\tif((dwPrevStyle & PANECNT_GRADIENT) != (m_dwExtendedStyle & PANECNT_GRADIENT))   // change background\n\t\t\t{\n\t\t\t\tbUpdate = true;\n\t\t\t}\n\n\t\t\tif(bUpdate)\n\t\t\t\tpT->UpdateLayout();\n\t\t}\n\t\treturn dwPrevStyle;\n\t}\n\n\tHWND GetClient() const\n\t{\n\t\treturn m_wndClient;\n\t}\n\n\tHWND SetClient(HWND hWndClient)\n\t{\n\t\tHWND hWndOldClient = m_wndClient;\n\t\tm_wndClient = hWndClient;\n\t\tif(this->m_hWnd != NULL)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->UpdateLayout();\n\t\t}\n\t\treturn hWndOldClient;\n\t}\n\n\tBOOL GetTitle(LPTSTR lpstrTitle, int cchLength) const\n\t{\n\t\tATLASSERT(lpstrTitle != NULL);\n\n\t\terrno_t nRet = ATL::Checked::tcsncpy_s(lpstrTitle, cchLength, m_szTitle, _TRUNCATE);\n\n\t\treturn ((nRet == 0) || (nRet == STRUNCATE));\n\t}\n\n\tBOOL SetTitle(LPCTSTR lpstrTitle)\n\t{\n\t\tATLASSERT(lpstrTitle != NULL);\n\n\t\terrno_t nRet = ATL::Checked::tcsncpy_s(m_szTitle, m_cchTitle, lpstrTitle, _TRUNCATE);\n\t\tbool bRet = ((nRet == 0) || (nRet == STRUNCATE));\n\t\tif(bRet && (this->m_hWnd != NULL))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->UpdateLayout();\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\tint GetTitleLength() const\n\t{\n\t\treturn lstrlen(m_szTitle);\n\t}\n\n// Methods\n\tHWND Create(HWND hWndParent, LPCTSTR lpstrTitle = NULL, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,\n\t\t\tDWORD dwExStyle = 0, UINT nID = 0, LPVOID lpCreateParam = NULL)\n\t{\n\t\tif(lpstrTitle != NULL)\n\t\t\tATL::Checked::tcsncpy_s(m_szTitle, m_cchTitle, lpstrTitle, _TRUNCATE);\n\t\treturn ATL::CWindowImpl< T, TBase, TWinTraits >::Create(hWndParent, this->rcDefault, NULL, dwStyle, dwExStyle, nID, lpCreateParam);\n\t}\n\n\tHWND Create(HWND hWndParent, UINT uTitleID, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,\n\t\t\tDWORD dwExStyle = 0, UINT nID = 0, LPVOID lpCreateParam = NULL)\n\t{\n\t\tif(uTitleID != 0U)\n\t\t\t::LoadString(ModuleHelper::GetResourceInstance(), uTitleID, m_szTitle, m_cchTitle);\n\t\treturn ATL::CWindowImpl< T, TBase, TWinTraits >::Create(hWndParent, this->rcDefault, NULL, dwStyle, dwExStyle, nID, lpCreateParam);\n\t}\n\n\tBOOL SubclassWindow(HWND hWnd)\n\t{\n\t\tBOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits >::SubclassWindow(hWnd);\n\t\tif(bRet != FALSE)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->Init();\n\n\t\t\tRECT rect = {};\n\t\t\tthis->GetClientRect(&rect);\n\t\t\tpT->UpdateLayout(rect.right, rect.bottom);\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\tBOOL EnableCloseButton(BOOL bEnable)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tT* pT = static_cast<T*>(this);\n\t\t(void)pT;   // avoid level 4 warning\n\t\treturn (m_tb.m_hWnd != NULL) ? m_tb.EnableButton(pT->m_nCloseBtnID, bEnable) : FALSE;\n\t}\n\n\tvoid UpdateLayout()\n\t{\n\t\tRECT rcClient = {};\n\t\tthis->GetClientRect(&rcClient);\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->UpdateLayout(rcClient.right, rcClient.bottom);\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CPaneContainerImpl)\n\t\tMESSAGE_HANDLER(WM_CREATE, OnCreate)\n\t\tMESSAGE_HANDLER(WM_DESTROY, OnDestroy)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\t\tMESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)\n\t\tMESSAGE_HANDLER(WM_GETFONT, OnGetFont)\n\t\tMESSAGE_HANDLER(WM_SETFONT, OnSetFont)\n\t\tMESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\n\t\tMESSAGE_HANDLER(WM_PAINT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_NOTIFY, OnNotify)\n\t\tMESSAGE_HANDLER(WM_COMMAND, OnCommand)\n\t\tFORWARD_NOTIFICATIONS()\n\tEND_MSG_MAP()\n\n\tLRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Init();\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tif(m_bInternalFont)\n\t\t{\n\t\t\t::DeleteObject(m_hFont);\n\t\t\tm_hFont = NULL;\n\t\t\tm_bInternalFont = false;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->UpdateLayout(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSetFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tif(m_wndClient.m_hWnd != NULL)\n\t\t\tm_wndClient.SetFocus();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnGetFont(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn (LRESULT)m_hFont;\n\t}\n\n\tLRESULT OnSetFont(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tif(m_bInternalFont)\n\t\t{\n\t\t\t::DeleteObject(m_hFont);\n\t\t\tm_bInternalFont = false;\n\t\t}\n\n\t\tm_hFont = (HFONT)wParam;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->CalcSize();\n\n\t\tif((BOOL)lParam != FALSE)\n\t\t\tpT->UpdateLayout();\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->DrawPaneTitleBackground((HDC)wParam);\n\n\t\treturn 1;\n\t}\n\n\tLRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(wParam != NULL)\n\t\t{\n\t\t\tpT->DrawPaneTitle((HDC)wParam);\n\n\t\t\tif(m_wndClient.m_hWnd == NULL)   // no client window\n\t\t\t\tpT->DrawPane((HDC)wParam);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCPaintDC dc(this->m_hWnd);\n\t\t\tpT->DrawPaneTitle(dc.m_hDC);\n\n\t\t\tif(m_wndClient.m_hWnd == NULL)   // no client window\n\t\t\t\tpT->DrawPane(dc.m_hDC);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnNotify(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif(m_tb.m_hWnd == NULL)\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\n\t\tT* pT = static_cast<T*>(this);\n\t\t(void)pT;   // avoid level 4 warning\n\t\tLPNMHDR lpnmh = (LPNMHDR)lParam;\n\t\tLRESULT lRet = 0;\n\n\t\t// pass toolbar custom draw notifications to the base class\n\t\tif((lpnmh->code == NM_CUSTOMDRAW) && (lpnmh->hwndFrom == m_tb.m_hWnd))\n\t\t\tlRet = CCustomDraw< T >::OnCustomDraw(0, lpnmh, bHandled);\n\t\t// tooltip notifications come with the tooltip window handle and button ID,\n\t\t// pass them to the parent if we don't handle them\n\t\telse if((lpnmh->code == TTN_GETDISPINFO) && (lpnmh->idFrom == pT->m_nCloseBtnID))\n\t\t\tbHandled = pT->GetToolTipText(lpnmh);\n\t\t// only let notifications not from the toolbar go to the parent\n\t\telse if((lpnmh->hwndFrom != m_tb.m_hWnd) && (lpnmh->idFrom != pT->m_nCloseBtnID))\n\t\t\tbHandled = FALSE;\n\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnCommand(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\t// if command comes from the close button, substitute HWND of the pane container instead\n\t\tif((m_tb.m_hWnd != NULL) && ((HWND)lParam == m_tb.m_hWnd))\n\t\t\treturn this->GetParent().SendMessage(WM_COMMAND, wParam, (LPARAM)this->m_hWnd);\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n// Custom draw overrides\n\tDWORD OnPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\n\t{\n\t\treturn CDRF_NOTIFYITEMDRAW;   // we need per-item notifications\n\t}\n\n\tDWORD OnItemPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\n\t{\n\t\treturn CDRF_NOTIFYPOSTPAINT;\n\t}\n\n\tDWORD OnItemPostPaint(int /*idCtrl*/, LPNMCUSTOMDRAW lpNMCustomDraw)\n\t{\n\t\tCDCHandle dc = lpNMCustomDraw->hdc;\n\t\tRECT& rc = lpNMCustomDraw->rc;\n\n\t\tRECT rcImage = { m_xBtnImageLeft, m_yBtnImageTop, m_xBtnImageRight + 1, m_yBtnImageBottom + 1 };\n\t\t::OffsetRect(&rcImage, rc.left, rc.top);\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tif((lpNMCustomDraw->uItemState & CDIS_DISABLED) != 0)\n\t\t{\n\t\t\tRECT rcShadow = rcImage;\n\t\t\t::OffsetRect(&rcShadow, 1, 1);\n\t\t\tCPen pen1;\n\t\t\tpen1.CreatePen(PS_SOLID, 0, ::GetSysColor(COLOR_3DHILIGHT));\n\t\t\tpT->DrawButtonImage(dc, rcShadow, pen1);\n\t\t\tCPen pen2;\n\t\t\tpen2.CreatePen(PS_SOLID, 0, ::GetSysColor(COLOR_3DSHADOW));\n\t\t\tpT->DrawButtonImage(dc, rcImage, pen2);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif((lpNMCustomDraw->uItemState & CDIS_SELECTED) != 0)\n\t\t\t\t::OffsetRect(&rcImage, 1, 1);\n\t\t\tCPen pen;\n\t\t\tpen.CreatePen(PS_SOLID, 0, ::GetSysColor(COLOR_BTNTEXT));\n\t\t\tpT->DrawButtonImage(dc, rcImage, pen);\n\t\t}\n\n\t\treturn CDRF_DODEFAULT;   // continue with the default item painting\n\t}\n\n// Implementation - overrideable methods\n\tvoid Init()\n\t{\n\t\tif(m_hFont == NULL)\n\t\t{\n\t\t\t// The same as AtlCreateControlFont() for horizontal pane\n\t\t\tLOGFONT lf = {};\n\t\t\tATLVERIFY(::SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, 0) != FALSE);\n\t\t\tif(IsVertical())\n\t\t\t\tlf.lfEscapement = 900;   // 90 degrees\n\t\t\tm_hFont = ::CreateFontIndirect(&lf);\n\t\t\tm_bInternalFont = true;\n\t\t}\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->CalcSize();\n\n\t\tif((m_dwExtendedStyle & PANECNT_NOCLOSEBUTTON) == 0)\n\t\t\tpT->CreateCloseButton();\n\t}\n\n\tvoid UpdateLayout(int cxWidth, int cyHeight)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tRECT rect = {};\n\n\t\tif(IsVertical())\n\t\t{\n\t\t\t::SetRect(&rect, 0, 0, m_cxyHeader, cyHeight);\n\t\t\tif(m_tb.m_hWnd != NULL)\n\t\t\t\tm_tb.SetWindowPos(NULL, m_cxyBorder, m_cxyBorder + m_cxyBtnOffset, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);\n\n\t\t\tif(m_wndClient.m_hWnd != NULL)\n\t\t\t\tm_wndClient.SetWindowPos(NULL, m_cxyHeader, 0, cxWidth - m_cxyHeader, cyHeight, SWP_NOZORDER);\n\t\t\telse\n\t\t\t\trect.right = cxWidth;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t::SetRect(&rect, 0, 0, cxWidth, m_cxyHeader);\n\t\t\tif(m_tb.m_hWnd != NULL)\n\t\t\t\tm_tb.SetWindowPos(NULL, rect.right - m_cxToolBar, m_cxyBorder + m_cxyBtnOffset, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);\n\n\t\t\tif(m_wndClient.m_hWnd != NULL)\n\t\t\t\tm_wndClient.SetWindowPos(NULL, 0, m_cxyHeader, cxWidth, cyHeight - m_cxyHeader, SWP_NOZORDER);\n\t\t\telse\n\t\t\t\trect.bottom = cyHeight;\n\t\t}\n\n\t\tthis->InvalidateRect(&rect);\n\t}\n\n\tvoid CreateCloseButton()\n\t{\n\t\tATLASSERT(m_tb.m_hWnd == NULL);\n\t\t// create toolbar for the \"x\" button\n\t\tm_tb.Create(this->m_hWnd, this->rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CCS_NODIVIDER | CCS_NORESIZE | CCS_NOPARENTALIGN | CCS_NOMOVEY | TBSTYLE_TOOLTIPS | TBSTYLE_FLAT, 0);\n\t\tATLASSERT(m_tb.IsWindow());\n\n\t\tif(m_tb.m_hWnd != NULL)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t(void)pT;   // avoid level 4 warning\n\n\t\t\tm_tb.SetButtonStructSize();\n\n\t\t\tTBBUTTON tbbtn = {};\n\t\t\ttbbtn.idCommand = pT->m_nCloseBtnID;\n\t\t\ttbbtn.fsState = TBSTATE_ENABLED;\n\t\t\ttbbtn.fsStyle = BTNS_BUTTON;\n\t\t\tm_tb.AddButtons(1, &tbbtn);\n\n\t\t\tm_tb.SetBitmapSize(m_cxImageTB, m_cyImageTB);\n\t\t\tm_tb.SetButtonSize(m_cxImageTB + m_cxyBtnAddTB, m_cyImageTB + m_cxyBtnAddTB);\n\n\t\t\tif(IsVertical())\n\t\t\t\tm_tb.SetWindowPos(NULL, m_cxyBorder + m_cxyBtnOffset, m_cxyBorder + m_cxyBtnOffset, m_cxImageTB + m_cxyBtnAddTB, m_cyImageTB + m_cxyBtnAddTB + 1, SWP_NOZORDER | SWP_NOACTIVATE);\n\t\t\telse\n\t\t\t\tm_tb.SetWindowPos(NULL, 0, 0, m_cxImageTB + m_cxyBtnAddTB, m_cyImageTB + m_cxyBtnAddTB + 1, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);\n\t\t}\n\t}\n\n\tvoid DestroyCloseButton()\n\t{\n\t\tif(m_tb.m_hWnd != NULL)\n\t\t\tm_tb.DestroyWindow();\n\t}\n\n\tvoid CalcSize()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tCFontHandle font = pT->GetTitleFont();\n\t\tif(font.IsNull())\n\t\t\tfont = (HFONT)::GetStockObject(SYSTEM_FONT);\n\t\tLOGFONT lf = {};\n\t\tfont.GetLogFont(lf);\n\t\tif(IsVertical())\n\t\t{\n\t\t\tm_cxyHeader = m_cxImageTB + m_cxyBtnAddTB + m_cxyBorder + 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint cyFont = abs(lf.lfHeight) + m_cxyBorder + 2 * m_cxyTextOffset;\n\t\t\tint cyBtn = m_cyImageTB + m_cxyBtnAddTB + m_cxyBorder + 2 * m_cxyBtnOffset + 1;\n\t\t\tm_cxyHeader = __max(cyFont, cyBtn);\n\t\t}\n\t}\n\n\tHFONT GetTitleFont() const\n\t{\n\t\treturn m_hFont;\n\t}\n\n\tBOOL GetToolTipText(LPNMHDR /*lpnmh*/)\n\t{\n\t\treturn FALSE;\n\t}\n\n\tvoid DrawPaneTitle(CDCHandle dc)\n\t{\n\t\tRECT rect = {};\n\t\tthis->GetClientRect(&rect);\n\n\t\tUINT uBorder = BF_LEFT | BF_TOP | BF_ADJUST;\n\t\tif(IsVertical())\n\t\t{\n\t\t\trect.right = rect.left + m_cxyHeader;\n\t\t\tuBorder |= BF_BOTTOM;\n\t\t}\n\t\telse\n\t\t{\n\t\t\trect.bottom = rect.top + m_cxyHeader;\n\t\t\tuBorder |= BF_RIGHT;\n\t\t}\n\n\t\tif((m_dwExtendedStyle & PANECNT_NOBORDER) == 0)\n\t\t{\n\t\t\tif((m_dwExtendedStyle & PANECNT_FLATBORDER) != 0)\n\t\t\t\tuBorder |= BF_FLAT;\n\t\t\tdc.DrawEdge(&rect, EDGE_ETCHED, uBorder);\n\t\t}\n\n\t\tif((m_dwExtendedStyle & PANECNT_DIVIDER) != 0)\n\t\t{\n\t\t\tuBorder = BF_FLAT | BF_ADJUST | (IsVertical() ? BF_RIGHT : BF_BOTTOM);\n\t\t\tdc.DrawEdge(&rect, BDR_SUNKENOUTER, uBorder);\n\t\t}\n\n\t\t// draw title text\n\t\tdc.SetTextColor(::GetSysColor(COLOR_WINDOWTEXT));\n\t\tdc.SetBkMode(TRANSPARENT);\n\t\tT* pT = static_cast<T*>(this);\n\t\tHFONT hFontOld = dc.SelectFont(pT->GetTitleFont());\n\n\t\tif(IsVertical())\n\t\t{\n\t\t\trect.top += m_cxyTextOffset;\n\t\t\trect.bottom -= m_cxyTextOffset;\n\t\t\tif(m_tb.m_hWnd != NULL)\n\t\t\t\trect.top += m_cxToolBar;;\n\n\t\t\tRECT rcCalc = { rect.left, rect.bottom, rect.right, rect.top };\n\t\t\tint cxFont = dc.DrawText(m_szTitle, -1, &rcCalc, DT_TOP | DT_SINGLELINE | DT_END_ELLIPSIS | DT_CALCRECT);\n\t\t\tRECT rcText = {};\n\t\t\trcText.left = (rect.right - rect.left - cxFont) / 2;\n\t\t\trcText.right = rcText.left + (rect.bottom - rect.top);\n\t\t\trcText.top = rect.bottom;\n\t\t\trcText.bottom = rect.top;\n\t\t\tdc.DrawText(m_szTitle, -1, &rcText, DT_TOP | DT_SINGLELINE | DT_END_ELLIPSIS);\n\t\t}\n\t\telse\n\t\t{\n\t\t\trect.left += m_cxyTextOffset;\n\t\t\trect.right -= m_cxyTextOffset;\n\t\t\tif(m_tb.m_hWnd != NULL)\n\t\t\t\trect.right -= m_cxToolBar;;\n\n\t\t\tdc.DrawText(m_szTitle, -1, &rect, DT_LEFT | DT_SINGLELINE | DT_VCENTER | DT_END_ELLIPSIS);\n\t\t}\n\n\t\tdc.SelectFont(hFontOld);\n\t}\n\n\tvoid DrawPaneTitleBackground(CDCHandle dc)\n\t{\n\t\tRECT rect = {};\n\t\tthis->GetClientRect(&rect);\n\t\tif(IsVertical())\n\t\t\trect.right = m_cxyHeader;\n\t\telse\n\t\t\trect.bottom = m_cxyHeader;\n\n\t\tif((m_dwExtendedStyle & PANECNT_GRADIENT) != 0)\n\t\t\tdc.GradientFillRect(rect, ::GetSysColor(COLOR_WINDOW), ::GetSysColor(COLOR_3DFACE), IsVertical());\n\t\telse\n\t\t\tdc.FillRect(&rect, COLOR_3DFACE);\n\t}\n\n\t// called only if pane is empty\n\tvoid DrawPane(CDCHandle dc)\n\t{\n\t\tRECT rect = {};\n\t\tthis->GetClientRect(&rect);\n\t\tif(IsVertical())\n\t\t\trect.left += m_cxyHeader;\n\t\telse\n\t\t\trect.top += m_cxyHeader;\n\t\tif((this->GetExStyle() & WS_EX_CLIENTEDGE) == 0)\n\t\t\tdc.DrawEdge(&rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);\n\t\tdc.FillRect(&rect, COLOR_APPWORKSPACE);\n\t}\n\n\t// drawing helper - draws \"x\" button image\n\tvoid DrawButtonImage(CDCHandle dc, RECT& rcImage, HPEN hPen)\n\t{\n\t\tHPEN hPenOld = dc.SelectPen(hPen);\n\n\t\tdc.MoveTo(rcImage.left, rcImage.top);\n\t\tdc.LineTo(rcImage.right, rcImage.bottom);\n\t\tdc.MoveTo(rcImage.left + 1, rcImage.top);\n\t\tdc.LineTo(rcImage.right + 1, rcImage.bottom);\n\n\t\tdc.MoveTo(rcImage.left, rcImage.bottom - 1);\n\t\tdc.LineTo(rcImage.right, rcImage.top - 1);\n\t\tdc.MoveTo(rcImage.left + 1, rcImage.bottom - 1);\n\t\tdc.LineTo(rcImage.right + 1, rcImage.top - 1);\n\n\t\tdc.SelectPen(hPenOld);\n\t}\n\n\tbool IsVertical() const\n\t{\n\t\treturn ((m_dwExtendedStyle & PANECNT_VERTICAL) != 0);\n\t}\n};\n\nclass CPaneContainer : public CPaneContainerImpl<CPaneContainer>\n{\npublic:\n\tDECLARE_WND_CLASS_EX(_T(\"WTL_PaneContainer\"), 0, -1)\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CSortListViewCtrl - implements sorting for a listview control\n\n// sort listview extended styles\n#define SORTLV_USESHELLBITMAPS\t0x00000001\n\n// Notification sent to parent when sort column is changed by user clicking header.  \n#define SLVN_SORTCHANGED\tLVN_LAST\n\n// A LPNMSORTLISTVIEW is sent with the SLVN_SORTCHANGED notification\ntypedef struct tagNMSORTLISTVIEW\n{\n    NMHDR hdr;\n    int iNewSortColumn;\n    int iOldSortColumn;\n} NMSORTLISTVIEW, *LPNMSORTLISTVIEW;\n\n// Column sort types. Can be set on a per-column basis with the SetColumnSortType method.\nenum\n{\n\tLVCOLSORT_NONE,\n\tLVCOLSORT_TEXT,   // default\n\tLVCOLSORT_TEXTNOCASE,\n\tLVCOLSORT_LONG,\n\tLVCOLSORT_DOUBLE,\n\tLVCOLSORT_DECIMAL,\n\tLVCOLSORT_DATETIME,\n\tLVCOLSORT_DATE,\n\tLVCOLSORT_TIME,\n\tLVCOLSORT_CUSTOM,\n\tLVCOLSORT_LAST = LVCOLSORT_CUSTOM\n};\n\n\ntemplate <class T>\nclass CSortListViewImpl\n{\npublic:\n\tenum\n\t{\n\t\tm_cchCmpTextMax = 32, // overrideable\n\t\tm_cxSortImage = 16,\n\t\tm_cySortImage = 15,\n\t\tm_cxSortArrow = 11,\n\t\tm_cySortArrow = 6,\n\t\tm_iSortUp = 0,        // index of sort bitmaps\n\t\tm_iSortDown = 1,\n\t\tm_nShellSortUpID = 133\n\t};\n\n\t// passed to LVCompare functions as lParam1 and lParam2 \n\tstruct LVCompareParam\n\t{\n\t\tint iItem;\n\t\tDWORD_PTR dwItemData;\n\t\tunion\n\t\t{\n\t\t\tlong lValue;\n\t\t\tdouble dblValue;\n\t\t\tDECIMAL decValue;\n\t\t\tLPCTSTR pszValue;\n\t\t};\n\t};\n\t\n\t// passed to LVCompare functions as the lParamSort parameter\n\tstruct LVSortInfo\n\t{\n\t\tT* pT;\n\t\tint iSortCol;\n\t\tbool bDescending;\n\t};\n\n\tbool m_bSortDescending;\n\tbool m_bCommCtrl6;\n\tint m_iSortColumn;\n\tCBitmap m_bmSort[2];\n\tint m_fmtOldSortCol;\n\tHBITMAP m_hbmOldSortCol;\n\tDWORD m_dwSortLVExtendedStyle;\n\tATL::CSimpleArray<WORD> m_arrColSortType;\n\tbool m_bUseWaitCursor;\n\t\n\tCSortListViewImpl() :\n\t\t\tm_bSortDescending(false),\n\t\t\tm_bCommCtrl6(false),\n\t\t\tm_iSortColumn(-1), \n\t\t\tm_fmtOldSortCol(0),\n\t\t\tm_hbmOldSortCol(NULL),\n\t\t\tm_dwSortLVExtendedStyle(SORTLV_USESHELLBITMAPS),\n\t\t\tm_bUseWaitCursor(true)\n\t{\n\t\tDWORD dwMajor = 0;\n\t\tDWORD dwMinor = 0;\n\t\tHRESULT hRet = ATL::AtlGetCommCtrlVersion(&dwMajor, &dwMinor);\n\t\tm_bCommCtrl6 = SUCCEEDED(hRet) && (dwMajor >= 6);\n\t}\n\t\n// Attributes\n\tvoid SetSortColumn(int iCol)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tCHeaderCtrl header = pT->GetHeader();\n\t\tATLASSERT(header.m_hWnd != NULL);\n\t\tATLASSERT((iCol >= -1) && (iCol < m_arrColSortType.GetSize()));\n\n\t\tint iOldSortCol = m_iSortColumn;\n\t\tm_iSortColumn = iCol;\n\t\tif(m_bCommCtrl6)\n\t\t{\n\t\t\tconst int nMask = HDF_SORTUP | HDF_SORTDOWN;\n\t\t\tHDITEM hditem = { HDI_FORMAT };\n\t\t\tif((iOldSortCol != iCol) && (iOldSortCol >= 0) && header.GetItem(iOldSortCol, &hditem))\n\t\t\t{\n\t\t\t\thditem.fmt &= ~nMask;\n\t\t\t\theader.SetItem(iOldSortCol, &hditem);\n\t\t\t}\n\t\t\tif((iCol >= 0) && header.GetItem(iCol, &hditem))\n\t\t\t{\n\t\t\t\thditem.fmt &= ~nMask;\n\t\t\t\thditem.fmt |= m_bSortDescending ? HDF_SORTDOWN : HDF_SORTUP;\n\t\t\t\theader.SetItem(iCol, &hditem);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif(m_bmSort[m_iSortUp].IsNull())\n\t\t\tpT->CreateSortBitmaps();\n\n\t\t// restore previous sort column's bitmap, if any, and format\n\t\tHDITEM hditem = { HDI_BITMAP | HDI_FORMAT };\n\t\tif((iOldSortCol != iCol) && (iOldSortCol >= 0))\n\t\t{\n\t\t\thditem.hbm = m_hbmOldSortCol;\n\t\t\thditem.fmt = m_fmtOldSortCol;\n\t\t\theader.SetItem(iOldSortCol, &hditem);\n\t\t}\n\n\t\t// save new sort column's bitmap and format, and add our sort bitmap\n\t\tif((iCol >= 0) && header.GetItem(iCol, &hditem))\n\t\t{\n\t\t\tif(iOldSortCol != iCol)\n\t\t\t{\n\t\t\t\tm_fmtOldSortCol = hditem.fmt;\n\t\t\t\tm_hbmOldSortCol = hditem.hbm;\n\t\t\t}\n\t\t\thditem.fmt &= ~HDF_IMAGE;\n\t\t\thditem.fmt |= HDF_BITMAP | HDF_BITMAP_ON_RIGHT;\n\t\t\tint i = m_bSortDescending ? m_iSortDown : m_iSortUp;\n\t\t\thditem.hbm = m_bmSort[i];\n\t\t\theader.SetItem(iCol, &hditem);\n\t\t}\n\t}\n\n\tint GetSortColumn() const\n\t{\n\t\treturn m_iSortColumn;\n\t}\n\n\tvoid SetColumnSortType(int iCol, WORD wType)\n\t{\n\t\tATLASSERT((iCol >= 0) && (iCol < m_arrColSortType.GetSize()));\n\t\tATLASSERT((wType >= LVCOLSORT_NONE) && (wType <= LVCOLSORT_LAST));\n\t\tm_arrColSortType[iCol] = wType;\n\t}\n\n\tWORD GetColumnSortType(int iCol) const\n\t{\n\t\tATLASSERT((iCol >= 0) && (iCol < m_arrColSortType.GetSize()));\n\t\treturn m_arrColSortType[iCol];\n\t}\n\n\tint GetColumnCount() const\n\t{\n\t\tconst T* pT = static_cast<const T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tCHeaderCtrl header = pT->GetHeader();\n\t\treturn header.m_hWnd != NULL ? header.GetItemCount() : 0;\n\t}\n\n\tbool IsSortDescending() const\n\t{\n\t\treturn m_bSortDescending;\n\t}\n\n\tDWORD GetSortListViewExtendedStyle() const\n\t{\n\t\treturn m_dwSortLVExtendedStyle;\n\t}\n\n\tDWORD SetSortListViewExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\n\t{\n\t\tDWORD dwPrevStyle = m_dwSortLVExtendedStyle;\n\t\tif(dwMask == 0)\n\t\t\tm_dwSortLVExtendedStyle = dwExtendedStyle;\n\t\telse\n\t\t\tm_dwSortLVExtendedStyle = (m_dwSortLVExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\n\t\treturn dwPrevStyle;\n\t}\n\n// Operations\n\tbool DoSortItems(int iCol, bool bDescending = false)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tATLASSERT((iCol >= 0) && (iCol < m_arrColSortType.GetSize()));\n\n\t\tWORD wType = m_arrColSortType[iCol];\n\t\tif(wType == LVCOLSORT_NONE)\n\t\t\treturn false;\n\n\t\tint nCount = pT->GetItemCount();\n\t\tif(nCount < 2)\n\t\t{\n\t\t\tm_bSortDescending = bDescending;\n\t\t\tSetSortColumn(iCol);\n\t\t\treturn true;\n\t\t}\n\n\t\tCWaitCursor waitCursor(false);\n\t\tif(m_bUseWaitCursor)\n\t\t\twaitCursor.Set();\n\n\t\tLVCompareParam* pParam = NULL;\n\t\tATLTRY(pParam = new LVCompareParam[nCount]);\n\t\tPFNLVCOMPARE pFunc = NULL;\n\t\tTCHAR pszTemp[pT->m_cchCmpTextMax] = {};\n\t\tbool bStrValue = false;\n\n\t\tswitch(wType)\n\t\t{\n\t\tcase LVCOLSORT_TEXT:\n\t\t\tpFunc = (PFNLVCOMPARE)pT->LVCompareText;\n\t\tcase LVCOLSORT_TEXTNOCASE:\n\t\t\tif(pFunc == NULL)\n\t\t\t\tpFunc = (PFNLVCOMPARE)pT->LVCompareTextNoCase;\n\t\tcase LVCOLSORT_CUSTOM:\n\t\t\t{\n\t\t\t\tif(pFunc == NULL)\n\t\t\t\t\tpFunc = (PFNLVCOMPARE)pT->LVCompareCustom;\n\n\t\t\t\tfor(int i = 0; i < nCount; i++)\n\t\t\t\t{\n\t\t\t\t\tpParam[i].iItem = i;\n\t\t\t\t\tpParam[i].dwItemData = pT->GetItemData(i);\n\t\t\t\t\tpParam[i].pszValue = new TCHAR[pT->m_cchCmpTextMax];\n\t\t\t\t\tpT->GetItemText(i, iCol, (LPTSTR)pParam[i].pszValue, pT->m_cchCmpTextMax);\n\t\t\t\t\tpT->SetItemData(i, (DWORD_PTR)&pParam[i]);\n\t\t\t\t}\n\t\t\t\tbStrValue = true;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase LVCOLSORT_LONG:\n\t\t\t{\n\t\t\t\tpFunc = (PFNLVCOMPARE)pT->LVCompareLong;\n\t\t\t\tfor(int i = 0; i < nCount; i++)\n\t\t\t\t{\n\t\t\t\t\tpParam[i].iItem = i;\n\t\t\t\t\tpParam[i].dwItemData = pT->GetItemData(i);\n\t\t\t\t\tpT->GetItemText(i, iCol, pszTemp, pT->m_cchCmpTextMax);\n\t\t\t\t\tpParam[i].lValue = pT->StrToLong(pszTemp);\n\t\t\t\t\tpT->SetItemData(i, (DWORD_PTR)&pParam[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase LVCOLSORT_DOUBLE:\n\t\t\t{\n\t\t\t\tpFunc = (PFNLVCOMPARE)pT->LVCompareDouble;\n\t\t\t\tfor(int i = 0; i < nCount; i++)\n\t\t\t\t{\n\t\t\t\t\tpParam[i].iItem = i;\n\t\t\t\t\tpParam[i].dwItemData = pT->GetItemData(i);\n\t\t\t\t\tpT->GetItemText(i, iCol, pszTemp, pT->m_cchCmpTextMax);\n\t\t\t\t\tpParam[i].dblValue = pT->StrToDouble(pszTemp);\n\t\t\t\t\tpT->SetItemData(i, (DWORD_PTR)&pParam[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase LVCOLSORT_DECIMAL:\n\t\t\t{\n\t\t\t\tpFunc = (PFNLVCOMPARE)pT->LVCompareDecimal;\n\t\t\t\tfor(int i = 0; i < nCount; i++)\n\t\t\t\t{\n\t\t\t\t\tpParam[i].iItem = i;\n\t\t\t\t\tpParam[i].dwItemData = pT->GetItemData(i);\n\t\t\t\t\tpT->GetItemText(i, iCol, pszTemp, pT->m_cchCmpTextMax);\n\t\t\t\t\tpT->StrToDecimal(pszTemp, &pParam[i].decValue);\n\t\t\t\t\tpT->SetItemData(i, (DWORD_PTR)&pParam[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase LVCOLSORT_DATETIME:\n\t\tcase LVCOLSORT_DATE:\n\t\tcase LVCOLSORT_TIME:\n\t\t\t{\n\t\t\t\tpFunc = (PFNLVCOMPARE)pT->LVCompareDouble;\n\t\t\t\tDWORD dwFlags = LOCALE_NOUSEROVERRIDE;\n\t\t\t\tif(wType == LVCOLSORT_DATE)\n\t\t\t\t\tdwFlags |= VAR_DATEVALUEONLY;\n\t\t\t\telse if(wType == LVCOLSORT_TIME)\n\t\t\t\t\tdwFlags |= VAR_TIMEVALUEONLY;\n\t\t\t\tfor(int i = 0; i < nCount; i++)\n\t\t\t\t{\n\t\t\t\t\tpParam[i].iItem = i;\n\t\t\t\t\tpParam[i].dwItemData = pT->GetItemData(i);\n\t\t\t\t\tpT->GetItemText(i, iCol, pszTemp, pT->m_cchCmpTextMax);\n\t\t\t\t\tpParam[i].dblValue = pT->DateStrToDouble(pszTemp, dwFlags);\n\t\t\t\t\tpT->SetItemData(i, (DWORD_PTR)&pParam[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"Unknown value for sort type in CSortListViewImpl::DoSortItems()\\n\"));\n\t\t\tbreak;\n\t\t} // switch(wType)\n\n\t\tATLASSERT(pFunc != NULL);\n\t\tLVSortInfo lvsi = { pT, iCol, bDescending };\n\t\tbool bRet = ((BOOL)pT->DefWindowProc(LVM_SORTITEMS, (WPARAM)&lvsi, (LPARAM)pFunc) != FALSE);\n\t\tfor(int i = 0; i < nCount; i++)\n\t\t{\n\t\t\tDWORD_PTR dwItemData = pT->GetItemData(i);\n\t\t\tLVCompareParam* p = (LVCompareParam*)dwItemData;\n\t\t\tATLASSERT(p != NULL);\n\t\t\tif(bStrValue)\n\t\t\t\tdelete [] (TCHAR*)p->pszValue;\n\t\t\tpT->SetItemData(i, p->dwItemData);\n\t\t}\n\t\tdelete [] pParam;\n\n\t\tif(bRet)\n\t\t{\n\t\t\tm_bSortDescending = bDescending;\n\t\t\tSetSortColumn(iCol);\n\t\t}\n\n\t\tif(m_bUseWaitCursor)\n\t\t\twaitCursor.Restore();\n\n\t\treturn bRet;\n\t}\n\n\tvoid CreateSortBitmaps()\n\t{\n\t\tif((m_dwSortLVExtendedStyle & SORTLV_USESHELLBITMAPS) != 0)\n\t\t{\n\t\t\tbool bFree = false;\n\t\t\tLPCTSTR pszModule = _T(\"shell32.dll\"); \n\t\t\tHINSTANCE hShell = ::GetModuleHandle(pszModule);\n\n\t\t\tif (hShell == NULL)\t\t\n\t\t\t{\n\t\t\t\thShell = ::LoadLibrary(pszModule);\n\t\t\t\tbFree = true;\n\t\t\t}\n \n\t\t\tif (hShell != NULL)\n\t\t\t{\n\t\t\t\tbool bSuccess = true;\n\t\t\t\tfor(int i = m_iSortUp; i <= m_iSortDown; i++)\n\t\t\t\t{\n\t\t\t\t\tif(!m_bmSort[i].IsNull())\n\t\t\t\t\t\tm_bmSort[i].DeleteObject();\n\t\t\t\t\tm_bmSort[i] = (HBITMAP)::LoadImage(hShell, MAKEINTRESOURCE(m_nShellSortUpID + i), \n\t\t\t\t\t\tIMAGE_BITMAP, 0, 0, LR_LOADMAP3DCOLORS);\n\t\t\t\t\tif(m_bmSort[i].IsNull())\n\t\t\t\t\t{\n\t\t\t\t\t\tbSuccess = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(bFree)\n\t\t\t\t\t::FreeLibrary(hShell);\n\t\t\t\tif(bSuccess)\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tfor(int i = m_iSortUp; i <= m_iSortDown; i++)\n\t\t{\n\t\t\tif(!m_bmSort[i].IsNull())\n\t\t\t\tm_bmSort[i].DeleteObject();\n\n\t\t\tCDC dcMem;\n\t\t\tCClientDC dc(::GetDesktopWindow());\n\t\t\tdcMem.CreateCompatibleDC(dc.m_hDC);\n\t\t\tm_bmSort[i].CreateCompatibleBitmap(dc.m_hDC, m_cxSortImage, m_cySortImage);\n\t\t\tHBITMAP hbmOld = dcMem.SelectBitmap(m_bmSort[i]);\n\t\t\tRECT rc = { 0, 0, m_cxSortImage, m_cySortImage };\n\t\t\tpT->DrawSortBitmap(dcMem.m_hDC, i, &rc);\n\t\t\tdcMem.SelectBitmap(hbmOld);\n\t\t\tdcMem.DeleteDC();\n\t\t}\n\t}\n\n\tvoid NotifyParentSortChanged(int iNewSortCol, int iOldSortCol)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tint nID = pT->GetDlgCtrlID();\n\t\tNMSORTLISTVIEW nm = { { pT->m_hWnd, (UINT_PTR)nID, SLVN_SORTCHANGED }, iNewSortCol, iOldSortCol };\n\t\t::SendMessage(pT->GetParent(), WM_NOTIFY, (WPARAM)nID, (LPARAM)&nm);\n\t}\n\n// Overrideables\n\tint CompareItemsCustom(LVCompareParam* /*pItem1*/, LVCompareParam* /*pItem2*/, int /*iSortCol*/)\n\t{\n\t\t// pItem1 and pItem2 contain valid iItem, dwItemData, and pszValue members.\n\t\t// If item1 > item2 return 1, if item1 < item2 return -1, else return 0.\n\t\treturn 0;\n\t}\n\n\tvoid DrawSortBitmap(CDCHandle dc, int iBitmap, LPRECT prc)\n\t{\n\t\tdc.FillRect(prc, ::GetSysColorBrush(COLOR_BTNFACE));\t\n\t\tHBRUSH hbrOld = dc.SelectBrush(::GetSysColorBrush(COLOR_BTNSHADOW));\n\t\tCPen pen;\n\t\tpen.CreatePen(PS_SOLID, 0, ::GetSysColor(COLOR_BTNSHADOW));\n\t\tHPEN hpenOld = dc.SelectPen(pen);\n\t\tPOINT ptOrg = { (m_cxSortImage - m_cxSortArrow) / 2, (m_cySortImage - m_cySortArrow) / 2 };\n\t\tif(iBitmap == m_iSortUp)\n\t\t{\n\t\t\tPOINT pts[3] = \n\t\t\t{\n\t\t\t\t{ ptOrg.x + m_cxSortArrow / 2, ptOrg.y },\n\t\t\t\t{ ptOrg.x, ptOrg.y + m_cySortArrow - 1 }, \n\t\t\t\t{ ptOrg.x + m_cxSortArrow - 1, ptOrg.y + m_cySortArrow - 1 }\n\t\t\t};\n\t\t\tdc.Polygon(pts, 3);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tPOINT pts[3] = \n\t\t\t{\n\t\t\t\t{ ptOrg.x, ptOrg.y },\n\t\t\t\t{ ptOrg.x + m_cxSortArrow / 2, ptOrg.y + m_cySortArrow - 1 },\n\t\t\t\t{ ptOrg.x + m_cxSortArrow - 1, ptOrg.y }\n\t\t\t};\n\t\t\tdc.Polygon(pts, 3);\n\t\t}\n\t\tdc.SelectBrush(hbrOld);\n\t\tdc.SelectPen(hpenOld);\n\t}\n\n\tdouble DateStrToDouble(LPCTSTR lpstr, DWORD dwFlags)\n\t{\n\t\tATLASSERT(lpstr != NULL);\n\t\tif((lpstr == NULL) || (lpstr[0] == _T('\\0')))\n\t\t\treturn 0;\n\n\t\tUSES_CONVERSION;\n\t\tHRESULT hRet = E_FAIL;\n\t\tDATE dRet = 0;\n\t\tif (FAILED(hRet = ::VarDateFromStr((LPOLESTR)T2COLE(lpstr), LANG_USER_DEFAULT, dwFlags, &dRet)))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"VarDateFromStr failed with result of 0x%8.8X\\n\"), hRet);\n\t\t\tdRet = 0;\n\t\t}\n\t\treturn dRet;\n\t}\n\n\tlong StrToLong(LPCTSTR lpstr)\n\t{\n\t\tATLASSERT(lpstr != NULL);\n\t\tif((lpstr == NULL) || (lpstr[0] == _T('\\0')))\n\t\t\treturn 0;\n\t\t\n\t\tUSES_CONVERSION;\n\t\tHRESULT hRet = E_FAIL;\n\t\tlong lRet = 0;\n\t\tif (FAILED(hRet = ::VarI4FromStr((LPOLESTR)T2COLE(lpstr), LANG_USER_DEFAULT, LOCALE_NOUSEROVERRIDE, &lRet)))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"VarI4FromStr failed with result of 0x%8.8X\\n\"), hRet);\n\t\t\tlRet = 0;\n\t\t}\n\t\treturn lRet;\n\t}\n\n\tdouble StrToDouble(LPCTSTR lpstr)\n\t{\n\t\tATLASSERT(lpstr != NULL);\n\t\tif((lpstr == NULL) || (lpstr[0] == _T('\\0')))\n\t\t\treturn 0;\n\n\t\tUSES_CONVERSION;\n\t\tHRESULT hRet = E_FAIL;\n\t\tdouble dblRet = 0;\n\t\tif (FAILED(hRet = ::VarR8FromStr((LPOLESTR)T2COLE(lpstr), LANG_USER_DEFAULT, LOCALE_NOUSEROVERRIDE, &dblRet)))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"VarR8FromStr failed with result of 0x%8.8X\\n\"), hRet);\n\t\t\tdblRet = 0;\n\t\t}\n\t\treturn dblRet;\n\t}\n\n\tbool StrToDecimal(LPCTSTR lpstr, DECIMAL* pDecimal)\n\t{\n\t\tATLASSERT(lpstr != NULL);\n\t\tATLASSERT(pDecimal != NULL);\n\t\tif((lpstr == NULL) || (pDecimal == NULL))\n\t\t\treturn false;\n\n\t\tUSES_CONVERSION;\n\t\tHRESULT hRet = E_FAIL;\n\t\tif (FAILED(hRet = ::VarDecFromStr((LPOLESTR)T2COLE(lpstr), LANG_USER_DEFAULT, LOCALE_NOUSEROVERRIDE, pDecimal)))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"VarDecFromStr failed with result of 0x%8.8X\\n\"), hRet);\n\t\t\tpDecimal->Lo64 = 0;\n\t\t\tpDecimal->Hi32 = 0;\n\t\t\tpDecimal->signscale = 0;\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n// Overrideable PFNLVCOMPARE functions\n\tstatic int CALLBACK LVCompareText(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)\n\t{\n\t\tATLASSERT((lParam1 != NULL) && (lParam2 != NULL) && (lParamSort != NULL));\n\n\t\tLVCompareParam* pParam1 = (LVCompareParam*)lParam1;\n\t\tLVCompareParam* pParam2 = (LVCompareParam*)lParam2;\n\t\tLVSortInfo* pInfo = (LVSortInfo*)lParamSort;\n\t\t\n\t\tint nRet = lstrcmp(pParam1->pszValue, pParam2->pszValue);\n\t\treturn pInfo->bDescending ? -nRet : nRet;\n\t}\n\n\tstatic int CALLBACK LVCompareTextNoCase(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)\n\t{\n\t\tATLASSERT((lParam1 != NULL) && (lParam2 != NULL) && (lParamSort != NULL));\n\n\t\tLVCompareParam* pParam1 = (LVCompareParam*)lParam1;\n\t\tLVCompareParam* pParam2 = (LVCompareParam*)lParam2;\n\t\tLVSortInfo* pInfo = (LVSortInfo*)lParamSort;\n\t\t\n\t\tint nRet = lstrcmpi(pParam1->pszValue, pParam2->pszValue);\n\t\treturn pInfo->bDescending ? -nRet : nRet;\n\t}\n\n\tstatic int CALLBACK LVCompareLong(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)\n\t{\n\t\tATLASSERT((lParam1 != NULL) && (lParam2 != NULL) && (lParamSort != NULL));\n\n\t\tLVCompareParam* pParam1 = (LVCompareParam*)lParam1;\n\t\tLVCompareParam* pParam2 = (LVCompareParam*)lParam2;\n\t\tLVSortInfo* pInfo = (LVSortInfo*)lParamSort;\n\t\t\n\t\tint nRet = 0;\n\t\tif(pParam1->lValue > pParam2->lValue)\n\t\t\tnRet = 1;\n\t\telse if(pParam1->lValue < pParam2->lValue)\n\t\t\tnRet = -1;\n\t\treturn pInfo->bDescending ? -nRet : nRet;\n\t}\n\n\tstatic int CALLBACK LVCompareDouble(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)\n\t{\n\t\tATLASSERT((lParam1 != NULL) && (lParam2 != NULL) && (lParamSort != NULL));\n\n\t\tLVCompareParam* pParam1 = (LVCompareParam*)lParam1;\n\t\tLVCompareParam* pParam2 = (LVCompareParam*)lParam2;\n\t\tLVSortInfo* pInfo = (LVSortInfo*)lParamSort;\n\t\t\n\t\tint nRet = 0;\n\t\tif(pParam1->dblValue > pParam2->dblValue)\n\t\t\tnRet = 1;\n\t\telse if(pParam1->dblValue < pParam2->dblValue)\n\t\t\tnRet = -1;\n\t\treturn pInfo->bDescending ? -nRet : nRet;\n\t}\n\n\tstatic int CALLBACK LVCompareCustom(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)\n\t{\n\t\tATLASSERT((lParam1 != NULL) && (lParam2 != NULL) && (lParamSort != NULL));\n\n\t\tLVCompareParam* pParam1 = (LVCompareParam*)lParam1;\n\t\tLVCompareParam* pParam2 = (LVCompareParam*)lParam2;\n\t\tLVSortInfo* pInfo = (LVSortInfo*)lParamSort;\n\t\t\n\t\tint nRet = pInfo->pT->CompareItemsCustom(pParam1, pParam2, pInfo->iSortCol);\n\t\treturn pInfo->bDescending ? -nRet : nRet;\n\t}\n\n\tstatic int CALLBACK LVCompareDecimal(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)\n\t{\n\t\tATLASSERT((lParam1 != NULL) && (lParam2 != NULL) && (lParamSort != NULL));\n\n\t\tLVCompareParam* pParam1 = (LVCompareParam*)lParam1;\n\t\tLVCompareParam* pParam2 = (LVCompareParam*)lParam2;\n\t\tLVSortInfo* pInfo = (LVSortInfo*)lParamSort;\n\t\t\n\t\tint nRet = (int)::VarDecCmp(&pParam1->decValue, &pParam2->decValue);\n\t\tnRet--;\n\t\treturn pInfo->bDescending ? -nRet : nRet;\n\t}\n\n\tBEGIN_MSG_MAP(CSortListViewImpl)\n\t\tMESSAGE_HANDLER(LVM_INSERTCOLUMN, OnInsertColumn)\n\t\tMESSAGE_HANDLER(LVM_DELETECOLUMN, OnDeleteColumn)\n\t\tNOTIFY_CODE_HANDLER(HDN_ITEMCLICKA, OnHeaderItemClick)\n\t\tNOTIFY_CODE_HANDLER(HDN_ITEMCLICKW, OnHeaderItemClick)\n\t\tMESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)\n\tEND_MSG_MAP()\n\n\tLRESULT OnInsertColumn(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\t\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tLRESULT lRet = pT->DefWindowProc(uMsg, wParam, lParam);\n\t\tif(lRet == -1)\n\t\t\treturn -1;\n\n\t\tWORD wType = 0;\n\t\tm_arrColSortType.Add(wType);\n\t\tint nCount = m_arrColSortType.GetSize();\n\t\tATLASSERT(nCount == GetColumnCount());\n\n\t\tfor(int i = nCount - 1; i > lRet; i--)\n\t\t\tm_arrColSortType[i] = m_arrColSortType[i - 1];\n\t\tm_arrColSortType[(int)lRet] = LVCOLSORT_TEXT;\n\n\t\tif(lRet <= m_iSortColumn)\n\t\t\tm_iSortColumn++;\n\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnDeleteColumn(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\t\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tLRESULT lRet = pT->DefWindowProc(uMsg, wParam, lParam);\n\t\tif(lRet == 0)\n\t\t\treturn 0;\n\n\t\tint iCol = (int)wParam; \n\t\tif(m_iSortColumn == iCol)\n\t\t\tm_iSortColumn = -1;\n\t\telse if(m_iSortColumn > iCol)\n\t\t\tm_iSortColumn--;\n\t\tm_arrColSortType.RemoveAt(iCol);\n\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnHeaderItemClick(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\n\t{\n\t\tLPNMHEADER p = (LPNMHEADER)pnmh;\n\t\tif(p->iButton == 0)\n\t\t{\n\t\t\tint iOld = m_iSortColumn;\n\t\t\tbool bDescending = (m_iSortColumn == p->iItem) ? !m_bSortDescending : false;\n\t\t\tif(DoSortItems(p->iItem, bDescending))\n\t\t\t\tNotifyParentSortChanged(p->iItem, iOld);\t\t\t\t\n\t\t}\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSettingChange(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(wParam == SPI_SETNONCLIENTMETRICS)\n\t\t\tGetSystemSettings();\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tvoid GetSystemSettings()\n\t{\n\t\tif(!m_bCommCtrl6 && !m_bmSort[m_iSortUp].IsNull())\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->CreateSortBitmaps();\n\t\t\tif(m_iSortColumn != -1)\n\t\t\t\tSetSortColumn(m_iSortColumn);\n\t\t}\n\t}\n\n};\n\n\ntypedef ATL::CWinTraits<WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | LVS_REPORT | LVS_SHOWSELALWAYS , WS_EX_CLIENTEDGE>   CSortListViewCtrlTraits;\n\ntemplate <class T, class TBase = CListViewCtrl, class TWinTraits = CSortListViewCtrlTraits>\nclass ATL_NO_VTABLE CSortListViewCtrlImpl: public ATL::CWindowImpl<T, TBase, TWinTraits>, public CSortListViewImpl<T>\n{\npublic:\n\tDECLARE_WND_SUPERCLASS2(NULL, T, TBase::GetWndClassName())\n\n\tbool SortItems(int iCol, bool bDescending = false)\n\t{\n\t\treturn this->DoSortItems(iCol, bDescending);\n\t}\n\t\t\n\tBEGIN_MSG_MAP(CSortListViewCtrlImpl)\n\t\tMESSAGE_HANDLER(LVM_INSERTCOLUMN, CSortListViewImpl<T>::OnInsertColumn)\n\t\tMESSAGE_HANDLER(LVM_DELETECOLUMN, CSortListViewImpl<T>::OnDeleteColumn)\n\t\tNOTIFY_CODE_HANDLER(HDN_ITEMCLICKA, CSortListViewImpl<T>::OnHeaderItemClick)\n\t\tNOTIFY_CODE_HANDLER(HDN_ITEMCLICKW, CSortListViewImpl<T>::OnHeaderItemClick)\n\t\tMESSAGE_HANDLER(WM_SETTINGCHANGE, CSortListViewImpl<T>::OnSettingChange)\n\tEND_MSG_MAP()\n};\n\nclass CSortListViewCtrl : public CSortListViewCtrlImpl<CSortListViewCtrl>\n{\npublic:\n\tDECLARE_WND_SUPERCLASS(_T(\"WTL_SortListViewCtrl\"), GetWndClassName())\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CTabView - implements tab view window\n\n// TabView Notifications\n#define TBVN_PAGEACTIVATED        (0U-741)\n#define TBVN_CONTEXTMENU          (0U-742)\n#define TBVN_TABCLOSEBTN          (0U-743)   // return 0 to close page, 1 to keep open\n// internal\n#define TBVN_CLOSEBTNMOUSELEAVE   (0U-744)\n\n// Notification data for TBVN_CONTEXTMENU\nstruct TBVCONTEXTMENUINFO\n{\n\tNMHDR hdr;\n\tPOINT pt;\n};\n\ntypedef TBVCONTEXTMENUINFO* LPTBVCONTEXTMENUINFO;\n\n\n// Helper class for tab item hover close button\nclass CTabViewCloseBtn : public ATL::CWindowImpl<CTabViewCloseBtn>\n{\npublic:\n\tDECLARE_WND_CLASS_EX(_T(\"WTL_TabView_CloseBtn\"), 0, -1)\n\n\tenum { _xyBtnImageLeftTop = 3, _xyBtnImageRightBottom = 9 };\n\n\tbool m_bHover;\n\tbool m_bPressed;\n\tCToolTipCtrl m_tip;\n\n\tCTabViewCloseBtn() : m_bHover(false), m_bPressed(false)\n\t{ }\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CTabViewCloseBtn)\n\t\tMESSAGE_RANGE_HANDLER(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseMessage)\n\t\tMESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)\n\t\tMESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)\n\t\tMESSAGE_HANDLER(WM_MOUSELEAVE, OnMouseLeave)\n\t\tMESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)\n\t\tMESSAGE_HANDLER(WM_CAPTURECHANGED, OnCaptureChanged)\n\t\tMESSAGE_HANDLER(WM_PAINT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\n\t\tFORWARD_NOTIFICATIONS()\n\tEND_MSG_MAP()\n\n\tLRESULT OnMouseMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tMSG msg = { m_hWnd, uMsg, wParam, lParam };\n\t\tif(m_tip.IsWindow() != FALSE)\n\t\t\tm_tip.RelayEvent(&msg);\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tSetCapture();\n\t\tm_bHover = false;\n\t\tm_bPressed = true;\n\t\tInvalidate(FALSE);\n\t\tUpdateWindow();\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tif(::GetCapture() == m_hWnd)\n\t\t{\n\t\t\tPOINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\t\t\tClientToScreen(&pt);\n\t\t\tRECT rect = {};\n\t\t\tGetWindowRect(&rect);\n\t\t\tbool bPressed = (::PtInRect(&rect, pt) != FALSE);\n\t\t\tif(m_bPressed != bPressed)\n\t\t\t{\n\t\t\t\tm_bPressed = bPressed;\n\t\t\t\tInvalidate(FALSE);\n\t\t\t\tUpdateWindow();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(!m_bHover)\n\t\t\t{\n\t\t\t\tm_bHover = true;\n\t\t\t\tInvalidate(FALSE);\n\t\t\t\tUpdateWindow();\n\t\t\t}\n\n\t\t\tTRACKMOUSEEVENT tme = { sizeof(TRACKMOUSEEVENT), TME_LEAVE, m_hWnd };\n\t\t\t::TrackMouseEvent(&tme);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnMouseLeave(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tif(m_bHover)\n\t\t{\n\t\t\tm_bHover = false;\n\t\t\tInvalidate(FALSE);\n\t\t\tUpdateWindow();\n\t\t}\n\n\t\tNMHDR nmhdr = { m_hWnd, (UINT_PTR)GetDlgCtrlID(), TBVN_CLOSEBTNMOUSELEAVE };\n\t\tGetParent().SendMessage(WM_NOTIFY, GetDlgCtrlID(), (LPARAM)&nmhdr);\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tif(::GetCapture() == m_hWnd)\n\t\t{\n\t\t\tbool bAction = m_bPressed;\n\t\t\tReleaseCapture();\n\n\t\t\tif(bAction)\n\t\t\t\tGetParent().SendMessage(WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(), BN_CLICKED), (LPARAM)m_hWnd);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnCaptureChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tif(m_bPressed)\n\t\t{\n\t\t\tm_bPressed = false;\n\t\t\tInvalidate(FALSE);\n\t\t\tUpdateWindow();\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tif(wParam != NULL)\n\t\t{\n\t\t\tDoPaint((HDC)wParam);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCPaintDC dc(this->m_hWnd);\n\t\t\tDoPaint(dc.m_hDC);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\t// painting helper\n\tvoid DoPaint(CDCHandle dc)\n\t{\n\t\tRECT rect = {};\n\t\tGetClientRect(&rect);\n\n\t\tRECT rcImage = { _xyBtnImageLeftTop, _xyBtnImageLeftTop, _xyBtnImageRightBottom + 1, _xyBtnImageRightBottom + 1 };\n\t\t::OffsetRect(&rcImage, rect.left, rect.top);\n\t\tif(m_bPressed)\n\t\t\t::OffsetRect(&rcImage, 1, 0);\n\n\t\t// draw button frame and background\n\t\tCPen penFrame;\n\t\tpenFrame.CreatePen(PS_SOLID, 0, ::GetSysColor((m_bHover || m_bPressed) ? COLOR_BTNTEXT : COLOR_BTNSHADOW));\n\t\tHPEN hPenOld = dc.SelectPen(penFrame);\n\n\t\tCBrush brush;\n\t\tbrush.CreateSysColorBrush(m_bPressed ? COLOR_BTNSHADOW : COLOR_WINDOW);\n\t\tHBRUSH hBrushOld = dc.SelectBrush(brush);\n\n\t\tdc.Rectangle(&rect);\n\n\t\t// draw button \"X\"\n\t\tCPen penX;\n\t\tpenX.CreatePen(PS_SOLID, 0, ::GetSysColor(COLOR_BTNTEXT));\n\t\tdc.SelectPen(penX);\n\n\t\tdc.MoveTo(rcImage.left, rcImage.top);\n\t\tdc.LineTo(rcImage.right, rcImage.bottom);\n\t\tdc.MoveTo(rcImage.left + 1, rcImage.top);\n\t\tdc.LineTo(rcImage.right + 1, rcImage.bottom);\n\n\t\tdc.MoveTo(rcImage.left, rcImage.bottom - 1);\n\t\tdc.LineTo(rcImage.right, rcImage.top - 1);\n\t\tdc.MoveTo(rcImage.left + 1, rcImage.bottom - 1);\n\t\tdc.LineTo(rcImage.right + 1, rcImage.top - 1);\n\n\t\tdc.SelectPen(hPenOld);\n\t\tdc.SelectBrush(hBrushOld);\n\t}\n};\n\n\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CTabViewImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >\n{\npublic:\n\tDECLARE_WND_CLASS_EX2(NULL, T, 0, COLOR_APPWORKSPACE)\n\n// Declarations and enums\n\tstruct TABVIEWPAGE\n\t{\n\t\tHWND hWnd;\n\t\tLPTSTR lpstrTitle;\n\t\tLPVOID pData;\n\t};\n\n\tstruct TCITEMEXTRA\n\t{\n\t\tTCITEMHEADER tciheader;\n\t\tTABVIEWPAGE tvpage;\n\n\t\toperator LPTCITEM() { return (LPTCITEM)this; }\n\t};\n\n\tenum\n\t{\n\t\tm_nTabID = 1313,\n\t\tm_cxMoveMark = 6,\n\t\tm_cyMoveMark = 3,\n\t\tm_nMenuItemsMax = (ID_WINDOW_TABLAST - ID_WINDOW_TABFIRST + 1)\n\t};\n\n\tenum { _nAutoScrollTimerID = 4321 };\n\n\tenum AutoScroll\n\t{\n\t\t_AUTOSCROLL_NONE = 0,\n\t\t_AUTOSCROLL_LEFT = -1,\n\t\t_AUTOSCROLL_RIGHT = 1\n\t};\n\n\tenum CloseBtn\n\t{\n\t\t_cxCloseBtn = 14,\n\t\t_cyCloseBtn = 13,\n\t\t_cxCloseBtnMargin = 4, \n\t\t_cxCloseBtnMarginSel = 1, \n\n\t\t_nCloseBtnID = ID_PANE_CLOSE\n\t};\n\n// Data members\n\tATL::CContainedWindowT<CTabCtrl> m_tab;\n\tint m_cyTabHeight;\n\n\tint m_nActivePage;\n\n\tint m_nInsertItem;\n\tPOINT m_ptStartDrag;\n\n\tCMenuHandle m_menu;\n\n\tint m_cchTabTextLength;\n\n\tint m_nMenuItemsCount;\n\n\tATL::CWindow m_wndTitleBar;\n\tLPTSTR m_lpstrTitleBarBase;\n\tint m_cchTitleBarLength;\n\n\tCImageList m_ilDrag;\n\n\tAutoScroll m_AutoScroll;\n\tCUpDownCtrl m_ud;\n\n\tCTabViewCloseBtn m_btnClose;\n\tint m_nCloseItem;\n\n\tbool m_bDestroyPageOnRemove:1;\n\tbool m_bDestroyImageList:1;\n\tbool m_bActivePageMenuItem:1;\n\tbool m_bActiveAsDefaultMenuItem:1;\n\tbool m_bEmptyMenuItem:1;\n\tbool m_bWindowsMenuItem:1;\n\tbool m_bNoTabDrag:1;\n\tbool m_bNoTabDragAutoScroll:1;\n\tbool m_bTabCloseButton:1;\n\t// internal\n\tbool m_bTabCapture:1;\n\tbool m_bTabDrag:1;\n\tbool m_bInternalFont:1;\n\n// Constructor/destructor\n\tCTabViewImpl() :\n\t\t\tm_tab(this, 1),\n\t\t\tm_cyTabHeight(0),\n\t\t\tm_nActivePage(-1),\n\t\t\tm_nInsertItem(-1), \n\t\t\tm_cchTabTextLength(30), \n\t\t\tm_nMenuItemsCount(10), \n\t\t\tm_lpstrTitleBarBase(NULL), \n\t\t\tm_cchTitleBarLength(100), \n\t                m_AutoScroll(_AUTOSCROLL_NONE), \n\t                m_nCloseItem(-1), \n\t\t\tm_bDestroyPageOnRemove(true), \n\t\t\tm_bDestroyImageList(true), \n\t\t\tm_bActivePageMenuItem(true), \n\t\t\tm_bActiveAsDefaultMenuItem(false), \n\t\t\tm_bEmptyMenuItem(false), \n\t\t\tm_bWindowsMenuItem(false), \n\t\t\tm_bNoTabDrag(false), \n\t                m_bNoTabDragAutoScroll(false), \n\t                m_bTabCloseButton(true), \n\t\t\tm_bTabCapture(false), \n\t\t\tm_bTabDrag(false), \n\t\t\tm_bInternalFont(false)\n\t{\n\t\tm_ptStartDrag.x = 0;\n\t\tm_ptStartDrag.y = 0;\n\t}\n\n\t~CTabViewImpl()\n\t{\n\t\tdelete [] m_lpstrTitleBarBase;\n\t}\n\n// Message filter function - to be called from PreTranslateMessage of the main window\n\tBOOL PreTranslateMessage(MSG* pMsg)\n\t{\n\t\tif(this->IsWindow() == FALSE)\n\t\t\treturn FALSE;\n\n\t\tBOOL bRet = FALSE;\n\n\t\t// Check for TabView built-in accelerators (Ctrl+Tab/Ctrl+Shift+Tab - next/previous page)\n\t\tint nCount = GetPageCount();\n\t\tif(nCount > 0)\n\t\t{\n\t\t\tbool bControl = (::GetKeyState(VK_CONTROL) < 0);\n\t\t\tif((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_TAB) && bControl)\n\t\t\t{\n\t\t\t\tif(nCount > 1)\n\t\t\t\t{\n\t\t\t\t\tint nPage = m_nActivePage;\n\t\t\t\t\tbool bShift = (::GetKeyState(VK_SHIFT) < 0);\n\t\t\t\t\tif(bShift)\n\t\t\t\t\t\tnPage = (nPage > 0) ? (nPage - 1) : (nCount - 1);\n\t\t\t\t\telse\n\t\t\t\t\t\tnPage = ((nPage >= 0) && (nPage < (nCount - 1))) ? (nPage + 1) : 0;\n\n\t\t\t\t\tSetActivePage(nPage);\n\t\t\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t\t\tpT->OnPageActivated(m_nActivePage);\n\t\t\t\t}\n\n\t\t\t\tbRet = TRUE;\n\t\t\t}\n\t\t}\n\n\t\t// If we are doing drag-drop, check for Escape key that cancels it\n\t\tif(bRet == FALSE)\n\t\t{\n\t\t\tif(m_bTabCapture && (pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_ESCAPE))\n\t\t\t{\n\t\t\t\t::ReleaseCapture();\n\t\t\t\tbRet = TRUE;\n\t\t\t}\n\t\t}\n\n\t\t// Pass the message to the active page\n\t\tif(bRet == FALSE)\n\t\t{\n\t\t\tif(m_nActivePage != -1)\n\t\t\t\tbRet = (BOOL)::SendMessage(GetPageHWND(m_nActivePage), WM_FORWARDMSG, 0, (LPARAM)pMsg);\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n// Attributes\n\tint GetPageCount() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn m_tab.GetItemCount();\n\t}\n\n\tint GetActivePage() const\n\t{\n\t\treturn m_nActivePage;\n\t}\n\n\tvoid SetActivePage(int nPage)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(IsValidPageIndex(nPage));\n\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tthis->SetRedraw(FALSE);\n\n\t\tif(m_nActivePage != -1)\n\t\t\t::ShowWindow(GetPageHWND(m_nActivePage), SW_HIDE);\n\t\tm_nActivePage = nPage;\n\t\tm_tab.SetCurSel(m_nActivePage);\n\t\t::ShowWindow(GetPageHWND(m_nActivePage), SW_SHOW);\n\n\t\tpT->UpdateLayout();\n\n\t\tthis->SetRedraw(TRUE);\n\t\tthis->RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);\n\n\t\tHWND hWndFocus = ::GetFocus();\n\t\tATL::CWindow wndTop = this->GetTopLevelWindow();\n\t\tif((hWndFocus == wndTop.m_hWnd) || ((wndTop.IsChild(hWndFocus) != FALSE) && (hWndFocus != m_tab.m_hWnd)))\n\t\t\t::SetFocus(GetPageHWND(m_nActivePage));\n\n\t\tpT->UpdateTitleBar();\n\t\tpT->UpdateMenu();\n\t}\n\n\tHIMAGELIST GetImageList() const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn m_tab.GetImageList();\n\t}\n\n\tHIMAGELIST SetImageList(HIMAGELIST hImageList)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn m_tab.SetImageList(hImageList);\n\t}\n\n\tvoid SetWindowMenu(HMENU hMenu)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\n\t\tm_menu = hMenu;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->UpdateMenu();\n\t}\n\n\tvoid SetTitleBarWindow(HWND hWnd)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\n\t\tdelete [] m_lpstrTitleBarBase;\n\t\tm_lpstrTitleBarBase = NULL;\n\n\t\tm_wndTitleBar = hWnd;\n\t\tif(hWnd == NULL)\n\t\t\treturn;\n\n\t\tint cchLen = m_wndTitleBar.GetWindowTextLength() + 1;\n\t\tATLTRY(m_lpstrTitleBarBase = new TCHAR[cchLen]);\n\t\tif(m_lpstrTitleBarBase != NULL)\n\t\t{\n\t\t\tm_wndTitleBar.GetWindowText(m_lpstrTitleBarBase, cchLen);\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->UpdateTitleBar();\n\t\t}\n\t}\n\n// Page attributes\n\tHWND GetPageHWND(int nPage) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(IsValidPageIndex(nPage));\n\n\t\tTCITEMEXTRA tcix = {};\n\t\ttcix.tciheader.mask = TCIF_PARAM;\n\t\tm_tab.GetItem(nPage, tcix);\n\n\t\treturn tcix.tvpage.hWnd;\n\t}\n\n\tLPCTSTR GetPageTitle(int nPage) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(IsValidPageIndex(nPage));\n\n\t\tTCITEMEXTRA tcix = {};\n\t\ttcix.tciheader.mask = TCIF_PARAM;\n\t\tif(m_tab.GetItem(nPage, tcix) == FALSE)\n\t\t\treturn NULL;\n\n\t\treturn tcix.tvpage.lpstrTitle;\n\t}\n\n\tbool SetPageTitle(int nPage, LPCTSTR lpstrTitle)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(IsValidPageIndex(nPage));\n\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tint cchBuff = lstrlen(lpstrTitle) + 1;\n\t\tLPTSTR lpstrBuff = NULL;\n\t\tATLTRY(lpstrBuff = new TCHAR[cchBuff]);\n\t\tif(lpstrBuff == NULL)\n\t\t\treturn false;\n\n\t\tATL::Checked::tcscpy_s(lpstrBuff, cchBuff, lpstrTitle);\n\t\tTCITEMEXTRA tcix = {};\n\t\ttcix.tciheader.mask = TCIF_PARAM;\n\t\tif(m_tab.GetItem(nPage, tcix) == FALSE)\n\t\t\treturn false;\n\n\t\tATL::CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tLPTSTR lpstrTabText = buff.Allocate(m_cchTabTextLength + 1);\n\t\tif(lpstrTabText == NULL)\n\t\t\treturn false;\n\n\t\tdelete [] tcix.tvpage.lpstrTitle;\n\n\t\tpT->ShortenTitle(lpstrTitle, lpstrTabText, m_cchTabTextLength + 1);\n\n\t\ttcix.tciheader.mask = TCIF_TEXT | TCIF_PARAM;\n\t\ttcix.tciheader.pszText = lpstrTabText;\n\t\ttcix.tvpage.lpstrTitle = lpstrBuff;\n\t\tif(m_tab.SetItem(nPage, tcix) == FALSE)\n\t\t\treturn false;\n\n\t\tpT->UpdateTitleBar();\n\t\tpT->UpdateMenu();\n\n\t\treturn true;\n\t}\n\n\tLPVOID GetPageData(int nPage) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(IsValidPageIndex(nPage));\n\n\t\tTCITEMEXTRA tcix = {};\n\t\ttcix.tciheader.mask = TCIF_PARAM;\n\t\tm_tab.GetItem(nPage, tcix);\n\n\t\treturn tcix.tvpage.pData;\n\t}\n\n\tLPVOID SetPageData(int nPage, LPVOID pData)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(IsValidPageIndex(nPage));\n\n\t\tTCITEMEXTRA tcix = {};\n\t\ttcix.tciheader.mask = TCIF_PARAM;\n\t\tm_tab.GetItem(nPage, tcix);\n\t\tLPVOID pDataOld = tcix.tvpage.pData;\n\n\t\ttcix.tvpage.pData = pData;\n\t\tm_tab.SetItem(nPage, tcix);\n\n\t\treturn pDataOld;\n\t}\n\n\tint GetPageImage(int nPage) const\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(IsValidPageIndex(nPage));\n\n\t\tTCITEMEXTRA tcix = {};\n\t\ttcix.tciheader.mask = TCIF_IMAGE;\n\t\tm_tab.GetItem(nPage, tcix);\n\n\t\treturn tcix.tciheader.iImage;\n\t}\n\n\tint SetPageImage(int nPage, int nImage)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(IsValidPageIndex(nPage));\n\n\t\tTCITEMEXTRA tcix = {};\n\t\ttcix.tciheader.mask = TCIF_IMAGE;\n\t\tm_tab.GetItem(nPage, tcix);\n\t\tint nImageOld = tcix.tciheader.iImage;\n\n\t\ttcix.tciheader.iImage = nImage;\n\t\tm_tab.SetItem(nPage, tcix);\n\n\t\treturn nImageOld;\n\t}\n\n// Operations\n\tbool AddPage(HWND hWndView, LPCTSTR lpstrTitle, int nImage = -1, LPVOID pData = NULL)\n\t{\n\t\treturn InsertPage(GetPageCount(), hWndView, lpstrTitle, nImage, pData);\n\t}\n\n\tbool InsertPage(int nPage, HWND hWndView, LPCTSTR lpstrTitle, int nImage = -1, LPVOID pData = NULL)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT((nPage == GetPageCount()) || IsValidPageIndex(nPage));\n\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tint cchBuff = lstrlen(lpstrTitle) + 1;\n\t\tLPTSTR lpstrBuff = NULL;\n\t\tATLTRY(lpstrBuff = new TCHAR[cchBuff]);\n\t\tif(lpstrBuff == NULL)\n\t\t\treturn false;\n\n\t\tATL::Checked::tcscpy_s(lpstrBuff, cchBuff, lpstrTitle);\n\n\t\tATL::CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tLPTSTR lpstrTabText = buff.Allocate(m_cchTabTextLength + 1);\n\t\tif(lpstrTabText == NULL)\n\t\t\treturn false;\n\n\t\tpT->ShortenTitle(lpstrTitle, lpstrTabText, m_cchTabTextLength + 1);\n\n\t\tthis->SetRedraw(FALSE);\n\n\t\tTCITEMEXTRA tcix = {};\n\t\ttcix.tciheader.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;\n\t\ttcix.tciheader.pszText = lpstrTabText;\n\t\ttcix.tciheader.iImage = nImage;\n\t\ttcix.tvpage.hWnd = hWndView;\n\t\ttcix.tvpage.lpstrTitle = lpstrBuff;\n\t\ttcix.tvpage.pData = pData;\n\t\tint nItem = m_tab.InsertItem(nPage, tcix);\n\t\tif(nItem == -1)\n\t\t{\n\t\t\tdelete [] lpstrBuff;\n\t\t\tthis->SetRedraw(TRUE);\n\t\t\treturn false;\n\t\t}\n\n\t\t// adjust active page index, if inserted before it\n\t\tif(nPage <= m_nActivePage)\n\t\t\tm_nActivePage++;\n\n\t\tSetActivePage(nItem);\n\t\tpT->OnPageActivated(m_nActivePage);\n\n\t\tif(GetPageCount() == 1)\n\t\t\tpT->ShowTabControl(true);\n\n\t\tpT->UpdateLayout();\n\n\t\tthis->SetRedraw(TRUE);\n\t\tthis->RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);\n\n\t\treturn true;\n\t}\n\n\tvoid RemovePage(int nPage)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tATLASSERT(IsValidPageIndex(nPage));\n\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tthis->SetRedraw(FALSE);\n\n\t\tif(GetPageCount() == 1)\n\t\t\tpT->ShowTabControl(false);\n\n\t\tif(m_bDestroyPageOnRemove)\n\t\t\t::DestroyWindow(GetPageHWND(nPage));\n\t\telse\n\t\t\t::ShowWindow(GetPageHWND(nPage), SW_HIDE);\n\t\tLPTSTR lpstrTitle = (LPTSTR)GetPageTitle(nPage);\n\t\tdelete [] lpstrTitle;\n\n\t\tATLVERIFY(m_tab.DeleteItem(nPage) != FALSE);\n\n\t\tif(m_nActivePage == nPage)\n\t\t{\n\t\t\tm_nActivePage = -1;\n\n\t\t\tif(nPage > 0)\n\t\t\t{\n\t\t\t\tSetActivePage(nPage - 1);\n\t\t\t}\n\t\t\telse if(GetPageCount() > 0)\n\t\t\t{\n\t\t\t\tSetActivePage(nPage);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis->SetRedraw(TRUE);\n\t\t\t\tthis->Invalidate();\n\t\t\t\tthis->UpdateWindow();\n\t\t\t\tpT->UpdateTitleBar();\n\t\t\t\tpT->UpdateMenu();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnPage = (nPage < m_nActivePage) ? (m_nActivePage - 1) : m_nActivePage;\n\t\t\tm_nActivePage = -1;\n\t\t\tSetActivePage(nPage);\n\t\t}\n\n\t\tpT->OnPageActivated(m_nActivePage);\n\t}\n\n\tvoid RemoveAllPages()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\n\t\tif(GetPageCount() == 0)\n\t\t\treturn;\n\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tthis->SetRedraw(FALSE);\n\n\t\tpT->ShowTabControl(false);\n\n\t\tfor(int i = 0; i < GetPageCount(); i++)\n\t\t{\n\t\t\tif(m_bDestroyPageOnRemove)\n\t\t\t\t::DestroyWindow(GetPageHWND(i));\n\t\t\telse\n\t\t\t\t::ShowWindow(GetPageHWND(i), SW_HIDE);\n\t\t\tLPTSTR lpstrTitle = (LPTSTR)GetPageTitle(i);\n\t\t\tdelete [] lpstrTitle;\n\t\t}\n\t\tm_tab.DeleteAllItems();\n\n\t\tm_nActivePage = -1;\n\t\tpT->OnPageActivated(m_nActivePage);\n\n\t\tthis->SetRedraw(TRUE);\n\t\tthis->Invalidate();\n\t\tthis->UpdateWindow();\n\n\t\tpT->UpdateTitleBar();\n\t\tpT->UpdateMenu();\n\t}\n\n\tint PageIndexFromHwnd(HWND hWnd) const\n\t{\n\t\tint nIndex = -1;\n\n\t\tfor(int i = 0; i < GetPageCount(); i++)\n\t\t{\n\t\t\tif(GetPageHWND(i) == hWnd)\n\t\t\t{\n\t\t\t\tnIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn nIndex;\n\t}\n\n\tvoid BuildWindowMenu(HMENU hMenu, int nMenuItemsCount = 10, bool bEmptyMenuItem = true, bool bWindowsMenuItem = true, bool bActivePageMenuItem = true, bool bActiveAsDefaultMenuItem = false)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\n\t\tCMenuHandle menu = hMenu;\n\t\tT* pT = static_cast<T*>(this);\n\t\t(void)pT;   // avoid level 4 warning\n\t\tint nFirstPos = 0;\n\n\t\t// Find first menu item in our range\n\t\tfor(nFirstPos = 0; nFirstPos < menu.GetMenuItemCount(); nFirstPos++)\n\t\t{\n\t\t\tUINT nID = menu.GetMenuItemID(nFirstPos);\n\t\t\tif(((nID >= ID_WINDOW_TABFIRST) && (nID <= ID_WINDOW_TABLAST)) || (nID == ID_WINDOW_SHOWTABLIST))\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Remove all menu items for tab pages\n\t\tBOOL bRet = TRUE;\n\t\twhile(bRet != FALSE)\n\t\t\tbRet = menu.DeleteMenu(nFirstPos, MF_BYPOSITION);\n\n\t\t// Add separator if it's not already there\n\t\tint nPageCount = GetPageCount();\n\t\tif((bWindowsMenuItem || (nPageCount > 0)) && (nFirstPos > 0))\n\t\t{\n\t\t\tCMenuItemInfo mii;\n\t\t\tmii.fMask = MIIM_TYPE;\n\t\t\tmenu.GetMenuItemInfo(nFirstPos - 1, TRUE, &mii);\n\t\t\tif((mii.fType & MFT_SEPARATOR) == 0)\n\t\t\t{\n\t\t\t\tmenu.AppendMenu(MF_SEPARATOR);\n\t\t\t\tnFirstPos++;\n\t\t\t}\n\t\t}\n\n\t\t// Add menu items for all pages\n\t\tif(nPageCount > 0)\n\t\t{\n\t\t\t// Append menu items for all pages\n\t\t\tconst int cchPrefix = 3;   // 2 digits + space\n\t\t\tnMenuItemsCount = __min(__min(nPageCount, nMenuItemsCount), (int)m_nMenuItemsMax);\n\t\t\tATLASSERT(nMenuItemsCount < 100);   // 2 digits only\n\t\t\tif(nMenuItemsCount >= 100)\n\t\t\t\tnMenuItemsCount = 99;\n\n\t\t\tfor(int i = 0; i < nMenuItemsCount; i++)\n\t\t\t{\n\t\t\t\tLPCTSTR lpstrTitle = GetPageTitle(i);\n\t\t\t\tint nLen = lstrlen(lpstrTitle);\n\t\t\t\tATL::CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\t\t\tLPTSTR lpstrText = buff.Allocate(cchPrefix + nLen + 1);\n\t\t\t\tATLASSERT(lpstrText != NULL);\n\t\t\t\tif(lpstrText != NULL)\n\t\t\t\t{\n\t\t\t\t\tLPCTSTR lpstrFormat = (i < 9) ? _T(\"&%i %s\") : _T(\"%i %s\");\n\t\t\t\t\t_stprintf_s(lpstrText, cchPrefix + nLen + 1, lpstrFormat, i + 1, lpstrTitle);\n\t\t\t\t\tmenu.AppendMenu(MF_STRING, ID_WINDOW_TABFIRST + i, lpstrText);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Mark active page\n\t\t\tif(bActivePageMenuItem && (m_nActivePage != -1))\n\t\t\t{\n\t\t\t\tif(bActiveAsDefaultMenuItem)\n\t\t\t\t{\n\t\t\t\t\tmenu.SetMenuDefaultItem((UINT)-1,  TRUE);\n\t\t\t\t\tmenu.SetMenuDefaultItem(nFirstPos + m_nActivePage,  TRUE);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmenu.CheckMenuRadioItem(nFirstPos, nFirstPos + nMenuItemsCount, nFirstPos + m_nActivePage, MF_BYPOSITION);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(bEmptyMenuItem)\n\t\t\t{\n\t\t\t\tmenu.AppendMenu(MF_BYPOSITION | MF_STRING, ID_WINDOW_TABFIRST, pT->GetEmptyListText());\n\t\t\t\tmenu.EnableMenuItem(ID_WINDOW_TABFIRST, MF_GRAYED);\n\t\t\t}\n\n\t\t\t// Remove separator if nothing else is there\n\t\t\tif(!bEmptyMenuItem && !bWindowsMenuItem && (nFirstPos > 0))\n\t\t\t{\n\t\t\t\tCMenuItemInfo mii;\n\t\t\t\tmii.fMask = MIIM_TYPE;\n\t\t\t\tmenu.GetMenuItemInfo(nFirstPos - 1, TRUE, &mii);\n\t\t\t\tif((mii.fType & MFT_SEPARATOR) != 0)\n\t\t\t\t\tmenu.DeleteMenu(nFirstPos - 1, MF_BYPOSITION);\n\t\t\t}\n\t\t}\n\n\t\t// Add \"Windows...\" menu item\n\t\tif(bWindowsMenuItem)\n\t\t\tmenu.AppendMenu(MF_BYPOSITION | MF_STRING, ID_WINDOW_SHOWTABLIST, pT->GetWindowsMenuItemText());\n\t}\n\n\tBOOL SubclassWindow(HWND hWnd)\n\t{\n\t\tBOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits >::SubclassWindow(hWnd);\n\t\tif(bRet != FALSE)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->CreateTabControl();\n\t\t\tpT->UpdateLayout();\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CTabViewImpl)\n\t\tMESSAGE_HANDLER(WM_CREATE, OnCreate)\n\t\tMESSAGE_HANDLER(WM_DESTROY, OnDestroy)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\t\tMESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)\n\t\tMESSAGE_HANDLER(WM_GETFONT, OnGetFont)\n\t\tMESSAGE_HANDLER(WM_SETFONT, OnSetFont)\n\t\tMESSAGE_HANDLER(WM_TIMER, OnTimer)\n\t\tMESSAGE_HANDLER(WM_CONTEXTMENU, OnTabContextMenu)\n\t\tNOTIFY_HANDLER(m_nTabID, TCN_SELCHANGE, OnTabChanged)\n\t\tNOTIFY_ID_HANDLER(m_nTabID, OnTabNotification)\n\t\tNOTIFY_CODE_HANDLER(TTN_GETDISPINFO, OnTabGetDispInfo)\n\t\tFORWARD_NOTIFICATIONS()\n\tALT_MSG_MAP(1)   // tab control\n\t\tMESSAGE_HANDLER(WM_LBUTTONDOWN, OnTabLButtonDown)\n\t\tMESSAGE_HANDLER(WM_LBUTTONUP, OnTabLButtonUp)\n\t\tMESSAGE_HANDLER(WM_CAPTURECHANGED, OnTabCaptureChanged)\n\t\tMESSAGE_HANDLER(WM_MOUSEMOVE, OnTabMouseMove)\n\t\tMESSAGE_HANDLER(WM_MOUSELEAVE, OnTabMouseLeave)\n\t\tNOTIFY_HANDLER(T::_nCloseBtnID, TBVN_CLOSEBTNMOUSELEAVE, OnTabCloseBtnMouseLeave)\n\t\tCOMMAND_HANDLER(T::_nCloseBtnID, BN_CLICKED, OnTabCloseBtnClicked)\n\tEND_MSG_MAP()\n\n\tLRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->CreateTabControl();\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tRemoveAllPages();\n\n\t\tif(m_bDestroyImageList)\n\t\t{\n\t\t\tCImageList il = m_tab.SetImageList(NULL);\n\t\t\tif(il.m_hImageList != NULL)\n\t\t\t\til.Destroy();\n\t\t}\n\n\t\tif(m_bInternalFont)\n\t\t{\n\t\t\tHFONT hFont = m_tab.GetFont();\n\t\t\tm_tab.SetFont(NULL, FALSE);\n\t\t\t::DeleteObject(hFont);\n\t\t\tm_bInternalFont = false;\n\t\t}\n\n\t\tm_ud.m_hWnd = NULL;\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->UpdateLayout();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSetFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tif(m_nActivePage != -1)\n\t\t\t::SetFocus(GetPageHWND(m_nActivePage));\n\t\treturn 0;\n\t}\n\n\tLRESULT OnGetFont(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn m_tab.SendMessage(WM_GETFONT);\n\t}\n\n\tLRESULT OnSetFont(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tif(m_bInternalFont)\n\t\t{\n\t\t\tHFONT hFont = m_tab.GetFont();\n\t\t\tm_tab.SetFont(NULL, FALSE);\n\t\t\t::DeleteObject(hFont);\n\t\t\tm_bInternalFont = false;\n\t\t}\n\n\t\tm_tab.SendMessage(WM_SETFONT, wParam, lParam);\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tm_cyTabHeight = pT->CalcTabHeight();\n\n\t\tif((BOOL)lParam != FALSE)\n\t\t\tpT->UpdateLayout();\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnTimer(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(wParam == _nAutoScrollTimerID)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->DoAutoScroll();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnTabContextMenu(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tPOINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\t\tint nPage = m_nActivePage;\n\t\tbool bAction = false;\n\t\tif((HWND)wParam == m_tab.m_hWnd)\n\t\t{\n\t\t\tif((pt.x == -1) && (pt.y == -1))   // keyboard\n\t\t\t{\n\t\t\t\tRECT rect = {};\n\t\t\t\tm_tab.GetItemRect(m_nActivePage, &rect);\n\t\t\t\tpt.x = rect.left;\n\t\t\t\tpt.y = rect.bottom;\n\t\t\t\tm_tab.ClientToScreen(&pt);\n\t\t\t\tbAction = true;\n\t\t\t}\n\t\t\telse if(::WindowFromPoint(pt) == m_tab.m_hWnd)\n\t\t\t{\n\t\t\t\tTCHITTESTINFO hti = {};\n\t\t\t\thti.pt = pt;\n\t\t\t\tthis->ScreenToClient(&hti.pt);\n\t\t\t\tnPage = m_tab.HitTest(&hti);\n\n\t\t\t\tbAction = true;\n\t\t\t}\n\t\t}\n\n\t\tif(bAction)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->OnContextMenu(nPage, pt);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnTabChanged(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)\n\t{\n\t\tif(m_bTabCloseButton && (m_btnClose.m_hWnd != NULL))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tRECT rcClose = {};\n\t\t\tpT->CalcCloseButtonRect(m_nCloseItem, rcClose);\n\t\t\tm_btnClose.SetWindowPos(NULL, &rcClose, SWP_NOZORDER | SWP_NOACTIVATE);\n\t\t}\n\n\t\tSetActivePage(m_tab.GetCurSel());\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->OnPageActivated(m_nActivePage);\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnTabNotification(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)\n\t{\n\t\t// nothing to do - this just blocks all tab control\n\t\t// notifications from being propagated further\n\t\treturn 0;\n\t}\n\n\tLRESULT OnTabGetDispInfo(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\n\t{\n\t\tLPNMTTDISPINFO pTTDI = (LPNMTTDISPINFO)pnmh;\n\t\tif(pTTDI->hdr.hwndFrom == m_tab.GetTooltips())\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->UpdateTooltipText(pTTDI);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n// Tab control message handlers\n\tLRESULT OnTabLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif(!m_bNoTabDrag && (m_tab.GetItemCount() > 1))\n\t\t{\n\t\t\tm_bTabCapture = true;\n\t\t\tm_tab.SetCapture();\n\n\t\t\tm_ptStartDrag.x = GET_X_LPARAM(lParam);\n\t\t\tm_ptStartDrag.y = GET_Y_LPARAM(lParam);\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnTabLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif(m_bTabCapture)\n\t\t{\n\t\t\tif(m_bTabDrag)\n\t\t\t{\n\t\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t\tPOINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\t\t\t\tint nItem = pT->DragHitTest(pt);\n\t\t\t\tif(nItem != -1)\n\t\t\t\t\tMovePage(m_nActivePage, nItem);\n\t\t\t}\n\n\t\t\t::ReleaseCapture();\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnTabCaptureChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(m_bTabCapture)\n\t\t{\n\t\t\tm_bTabCapture = false;\n\n\t\t\tif(m_bTabDrag)\n\t\t\t{\n\t\t\t\tm_bTabDrag = false;\n\n\t\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t\tif(!m_bNoTabDragAutoScroll)\n\t\t\t\t\tpT->StartStopAutoScroll(-1);\n\n\t\t\t\tpT->DrawMoveMark(-1);\n\n\t\t\t\tm_ilDrag.DragLeave(GetDesktopWindow());\n\t\t\t\tm_ilDrag.EndDrag();\n\n\t\t\t\tm_ilDrag.Destroy();\n\t\t\t\tm_ilDrag.m_hImageList = NULL;\n\t\t\t}\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnTabMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tbHandled = FALSE;\n\n\t\tif(m_bTabCapture)\n\t\t{\n\t\t\tPOINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\n\t\t\tif(!m_bTabDrag)\n\t\t\t{\n\t\t\t\tif((abs(m_ptStartDrag.x - GET_X_LPARAM(lParam)) >= ::GetSystemMetrics(SM_CXDRAG)) ||\n\t\t\t\t   (abs(m_ptStartDrag.y - GET_Y_LPARAM(lParam)) >= ::GetSystemMetrics(SM_CYDRAG)))\n\t\t\t\t{\n\t\t\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t\t\tpT->GenerateDragImage(m_nActivePage);\n\n\t\t\t\t\tint cxCursor = ::GetSystemMetrics(SM_CXCURSOR);\n\t\t\t\t\tint cyCursor = ::GetSystemMetrics(SM_CYCURSOR);\n\t\t\t\t\tm_ilDrag.BeginDrag(0, -(cxCursor / 2), -(cyCursor / 2));\n\t\t\t\t\tPOINT ptEnter = m_ptStartDrag;\n\t\t\t\t\tm_tab.ClientToScreen(&ptEnter);\n\t\t\t\t\tm_ilDrag.DragEnter(GetDesktopWindow(), ptEnter);\n\n\t\t\t\t\tm_bTabDrag = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(m_bTabDrag)\n\t\t\t{\n\t\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t\tint nItem = pT->DragHitTest(pt);\n\n\t\t\t\tpT->SetMoveCursor(nItem != -1);\n\n\t\t\t\tif(m_nInsertItem != nItem)\n\t\t\t\t\tpT->DrawMoveMark(nItem);\n\n\t\t\t\tif(!m_bNoTabDragAutoScroll)\n\t\t\t\t\tpT->StartStopAutoScroll(pt.x);\n\n\t\t\t\tm_ilDrag.DragShowNolock((nItem != -1) ? TRUE : FALSE);\n\t\t\t\tm_tab.ClientToScreen(&pt);\n\t\t\t\tm_ilDrag.DragMove(pt);\n\n\t\t\t\tbHandled = TRUE;\n\t\t\t}\n\t\t}\n\t\telse if(m_bTabCloseButton)\n\t\t{\n\t\t\tTCHITTESTINFO thti = {};\n\t\t\tthti.pt.x = GET_X_LPARAM(lParam);\n\t\t\tthti.pt.y = GET_Y_LPARAM(lParam);\n\n\t\t\tint nItem = m_tab.HitTest(&thti);\n\t\t\tif(nItem >= 0)\n\t\t\t{\n\t\t\t\tATLTRACE(_T(\"+++++ item = %i\\n\"), nItem);\n\n\t\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t\tif(m_btnClose.m_hWnd == NULL)\n\t\t\t\t{\n\t\t\t\t\tpT->CreateCloseButton(nItem);\n\t\t\t\t\tm_nCloseItem = nItem;\n\t\t\t\t}\n\t\t\t\telse if(m_nCloseItem != nItem)\n\t\t\t\t{\n\t\t\t\t\tRECT rcClose = {};\n\t\t\t\t\tpT->CalcCloseButtonRect(nItem, rcClose);\n\t\t\t\t\tm_btnClose.SetWindowPos(NULL, &rcClose, SWP_NOZORDER | SWP_NOACTIVATE);\n\t\t\t\t\tm_nCloseItem = nItem;\n\t\t\t\t}\n\n\t\t\t\tTRACKMOUSEEVENT tme = { sizeof(TRACKMOUSEEVENT), TME_LEAVE, m_tab.m_hWnd };\n\t\t\t\t::TrackMouseEvent(&tme);\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnTabMouseLeave(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tbHandled = FALSE;\n\n\t\tif(m_btnClose.m_hWnd != NULL)\n\t\t{\n\t\t\tPOINT pt = {};\n\t\t\t::GetCursorPos(&pt);\n\t\t\tRECT rect = {};\n\t\t\tm_btnClose.GetWindowRect(&rect);\n\t\t\tif(::PtInRect(&rect, pt) == FALSE)\n\t\t\t{\n\t\t\t\tm_nCloseItem = -1;\n\t\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t\tpT->DestroyCloseButton();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbHandled = TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnTabCloseBtnMouseLeave(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)\n\t{\n\t\tTCHITTESTINFO thti = {};\n\t\t::GetCursorPos(&thti.pt);\n\t\tm_tab.ScreenToClient(&thti.pt);\n\t\tint nItem = m_tab.HitTest(&thti);\n\t\tif(nItem == -1)\n\t\t\tm_tab.SendMessage(WM_MOUSELEAVE);\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnTabCloseBtnClicked(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->OnTabCloseBtn(m_nCloseItem);\n\n\t\treturn 0;\n\t}\n\n// Implementation helpers\n\tbool IsValidPageIndex(int nPage) const\n\t{\n\t\treturn ((nPage >= 0) && (nPage < GetPageCount()));\n\t}\n\n\tbool MovePage(int nMovePage, int nInsertBeforePage)\n\t{\n\t\tATLASSERT(IsValidPageIndex(nMovePage));\n\t\tATLASSERT(IsValidPageIndex(nInsertBeforePage));\n\n\t\tif(!IsValidPageIndex(nMovePage) || !IsValidPageIndex(nInsertBeforePage))\n\t\t\treturn false;\n\n\t\tif(nMovePage == nInsertBeforePage)\n\t\t\treturn true;   // nothing to do\n\n\t\tATL::CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tLPTSTR lpstrTabText = buff.Allocate(m_cchTabTextLength + 1);\n\t\tif(lpstrTabText == NULL)\n\t\t\treturn false;\n\t\tTCITEMEXTRA tcix = {};\n\t\ttcix.tciheader.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;\n\t\ttcix.tciheader.pszText = lpstrTabText;\n\t\ttcix.tciheader.cchTextMax = m_cchTabTextLength + 1;\n\t\tBOOL bRet = m_tab.GetItem(nMovePage, tcix);\n\t\tATLASSERT(bRet != FALSE);\n\t\tif(bRet == FALSE)\n\t\t\treturn false;\n\n\t\tint nInsertItem = (nInsertBeforePage > nMovePage) ? nInsertBeforePage + 1 : nInsertBeforePage;\n\t\tint nNewItem = m_tab.InsertItem(nInsertItem, tcix);\n\t\tATLASSERT(nNewItem == nInsertItem);\n\t\tif(nNewItem != nInsertItem)\n\t\t{\n\t\t\tATLVERIFY(m_tab.DeleteItem(nNewItem));\n\t\t\treturn false;\n\t\t}\n\n\t\tif(nMovePage > nInsertBeforePage)\n\t\t\tATLVERIFY(m_tab.DeleteItem(nMovePage + 1) != FALSE);\n\t\telse if(nMovePage < nInsertBeforePage)\n\t\t\tATLVERIFY(m_tab.DeleteItem(nMovePage) != FALSE);\n\n\t\tSetActivePage(nInsertBeforePage);\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->OnPageActivated(m_nActivePage);\n\n\t\treturn true;\n\t}\n\n// Implementation overrideables\n\tbool CreateTabControl()\n\t{\n\t\tm_tab.Create(this->m_hWnd, this->rcDefault, NULL, WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TCS_TOOLTIPS, 0, m_nTabID);\n\t\tATLASSERT(m_tab.m_hWnd != NULL);\n\t\tif(m_tab.m_hWnd == NULL)\n\t\t\treturn false;\n\n\t\tm_tab.SetFont(AtlCreateControlFont());\n\t\tm_bInternalFont = true;\n\n\t\tm_tab.SetItemExtra(sizeof(TABVIEWPAGE));\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tm_cyTabHeight = pT->CalcTabHeight();\n\n\t\treturn true;\n\t}\n\n\tint CalcTabHeight()\n\t{\n\t\tint nCount = m_tab.GetItemCount();\n\t\tTCHAR szText[] = _T(\"NS\");\n\t\tTCITEMEXTRA tcix = {};\n\t\ttcix.tciheader.mask = TCIF_TEXT;\n\t\ttcix.tciheader.pszText = szText;\n\t\tint nIndex = m_tab.InsertItem(nCount, tcix);\n\n\t\tRECT rect = { 0, 0, 1000, 1000 };\n\t\tm_tab.AdjustRect(FALSE, &rect);\n\n\t\tRECT rcWnd = { 0, 0, 1000, rect.top };\n\t\t::AdjustWindowRectEx(&rcWnd, m_tab.GetStyle(), FALSE, m_tab.GetExStyle());\n\n\t\tint nHeight = rcWnd.bottom - rcWnd.top;\n\n\t\tm_tab.DeleteItem(nIndex);\n\n\t\treturn nHeight;\n\t}\n\n\tvoid ShowTabControl(bool bShow)\n\t{\n\t\tm_tab.ShowWindow(bShow ? SW_SHOWNOACTIVATE : SW_HIDE);\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->UpdateLayout();\n\t}\n\n\tvoid UpdateLayout()\n\t{\n\t\tRECT rect = {};\n\t\tthis->GetClientRect(&rect);\n\n\t\tint cyOffset = 0;\n\t\tif(m_tab.IsWindow() && ((m_tab.GetStyle() & WS_VISIBLE) != 0))\n\t\t{\n\t\t\tm_tab.SetWindowPos(NULL, 0, 0, rect.right - rect.left, m_cyTabHeight, SWP_NOZORDER);\n\t\t\tcyOffset = m_cyTabHeight;\n\t\t}\n\n\t\tif(m_nActivePage != -1)\n\t\t\t::SetWindowPos(GetPageHWND(m_nActivePage), NULL, 0, cyOffset, rect.right - rect.left, rect.bottom - rect.top - cyOffset, SWP_NOZORDER);\n\t}\n\n\tvoid UpdateMenu()\n\t{\n\t\tif(m_menu.m_hMenu != NULL)\n\t\t\tBuildWindowMenu(m_menu, m_nMenuItemsCount, m_bEmptyMenuItem, m_bWindowsMenuItem, m_bActivePageMenuItem, m_bActiveAsDefaultMenuItem);\n\t}\n\n\tvoid UpdateTitleBar()\n\t{\n\t\tif(!m_wndTitleBar.IsWindow() || (m_lpstrTitleBarBase == NULL))\n\t\t\treturn;   // nothing to do\n\n\t\tif(m_nActivePage != -1)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tLPCTSTR lpstrTitle = pT->GetPageTitle(m_nActivePage);\n\t\t\tLPCTSTR lpstrDivider = pT->GetTitleDividerText();\n\t\t\tint cchBuffer = m_cchTitleBarLength + lstrlen(lpstrDivider) + lstrlen(m_lpstrTitleBarBase) + 1;\n\t\t\tATL::CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\t\tLPTSTR lpstrPageTitle = buff.Allocate(cchBuffer);\n\t\t\tATLASSERT(lpstrPageTitle != NULL);\n\t\t\tif(lpstrPageTitle != NULL)\n\t\t\t{\n\t\t\t\tpT->ShortenTitle(lpstrTitle, lpstrPageTitle, m_cchTitleBarLength + 1);\n\t\t\t\tATL::Checked::tcscat_s(lpstrPageTitle, cchBuffer, lpstrDivider);\n\t\t\t\tATL::Checked::tcscat_s(lpstrPageTitle, cchBuffer, m_lpstrTitleBarBase);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlpstrPageTitle = m_lpstrTitleBarBase;\n\t\t\t}\n\n\t\t\tm_wndTitleBar.SetWindowText(lpstrPageTitle);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_wndTitleBar.SetWindowText(m_lpstrTitleBarBase);\n\t\t}\n\t}\n\n\tvoid DrawMoveMark(int nItem)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tif(m_nInsertItem != -1)\n\t\t{\n\t\t\tRECT rect = {};\n\t\t\tpT->GetMoveMarkRect(rect);\n\t\t\tm_tab.InvalidateRect(&rect);\n\t\t}\n\n\t\tm_nInsertItem = nItem;\n\n\t\tif(m_nInsertItem != -1)\n\t\t{\n\t\t\tCClientDC dc(m_tab.m_hWnd);\n\n\t\t\tRECT rect = {};\n\t\t\tpT->GetMoveMarkRect(rect);\n\n\t\t\tCPen pen;\n\t\t\tpen.CreatePen(PS_SOLID, 1, ::GetSysColor(COLOR_WINDOWTEXT));\n\t\t\tCBrush brush;\n\t\t\tbrush.CreateSolidBrush(::GetSysColor(COLOR_WINDOWTEXT));\n\n\t\t\tHPEN hPenOld = dc.SelectPen(pen);\n\t\t\tHBRUSH hBrushOld = dc.SelectBrush(brush);\n\n\t\t\tint x = rect.left;\n\t\t\tint y = rect.top;\n\t\t\tPOINT ptsTop[3] = { { x, y }, { x + m_cxMoveMark, y }, { x + (m_cxMoveMark / 2), y + m_cyMoveMark } };\n\t\t\tdc.Polygon(ptsTop, 3);\n\n\t\t\ty = rect.bottom - 1;\n\t\t\tPOINT ptsBottom[3] = { { x, y }, { x + m_cxMoveMark, y }, { x + (m_cxMoveMark / 2), y - m_cyMoveMark } };\n\t\t\tdc.Polygon(ptsBottom, 3);\n\n\t\t\tdc.SelectPen(hPenOld);\n\t\t\tdc.SelectBrush(hBrushOld);\n\t\t}\n\t}\n\n\tvoid GetMoveMarkRect(RECT& rect) const\n\t{\n\t\tm_tab.GetClientRect(&rect);\n\n\t\tRECT rcItem = {};\n\t\tm_tab.GetItemRect(m_nInsertItem, &rcItem);\n\n\t\tif(m_nInsertItem <= m_nActivePage)\n\t\t{\n\t\t\trect.left = rcItem.left - m_cxMoveMark / 2 - 1;\n\t\t\trect.right = rcItem.left + m_cxMoveMark / 2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\trect.left = rcItem.right - m_cxMoveMark / 2 - 1;\n\t\t\trect.right = rcItem.right + m_cxMoveMark / 2;\n\t\t}\n\t}\n\n\tvoid SetMoveCursor(bool bCanMove)\n\t{\n\t\t::SetCursor(::LoadCursor(NULL, bCanMove ? IDC_ARROW : IDC_NO));\n\t}\n\n\tvoid GenerateDragImage(int nItem)\n\t{\n\t\tATLASSERT(IsValidPageIndex(nItem));\n\n\t\tRECT rcItem = {};\n\t\tm_tab.GetItemRect(nItem, &rcItem);\n\t\t::InflateRect(&rcItem, 2, 2);   // make bigger to cover selected item\n\n\t\tATLASSERT(m_ilDrag.m_hImageList == NULL);\n\t\tm_ilDrag.Create(rcItem.right - rcItem.left, rcItem.bottom - rcItem.top, ILC_COLORDDB | ILC_MASK, 1, 1);\n\n\t\tCClientDC dc(this->m_hWnd);\n\t\tCDC dcMem;\n\t\tdcMem.CreateCompatibleDC(dc);\n\t\tATLASSERT(dcMem.m_hDC != NULL);\n\t\tdcMem.SetViewportOrg(-rcItem.left, -rcItem.top);\n\n\t\tCBitmap bmp;\n\t\tbmp.CreateCompatibleBitmap(dc, rcItem.right - rcItem.left, rcItem.bottom - rcItem.top);\n\t\tATLASSERT(bmp.m_hBitmap != NULL);\n\n\t\tHBITMAP hBmpOld = dcMem.SelectBitmap(bmp);\n\t\tm_tab.SendMessage(WM_PRINTCLIENT, (WPARAM)dcMem.m_hDC);\n\t\tdcMem.SelectBitmap(hBmpOld);\n\n\t\tATLVERIFY(m_ilDrag.Add(bmp.m_hBitmap, RGB(255, 0, 255)) != -1);\n\t}\n\n\tvoid ShortenTitle(LPCTSTR lpstrTitle, LPTSTR lpstrShortTitle, int cchShortTitle)\n\t{\n\t\tif(lstrlen(lpstrTitle) >= cchShortTitle)\n\t\t{\n\t\t\tLPCTSTR lpstrEllipsis = _T(\"...\");\n\t\t\tint cchEllipsis = lstrlen(lpstrEllipsis);\n\t\t\tATL::Checked::tcsncpy_s(lpstrShortTitle, cchShortTitle, lpstrTitle, cchShortTitle - cchEllipsis - 1);\n\t\t\tATL::Checked::tcscat_s(lpstrShortTitle, cchShortTitle, lpstrEllipsis);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tATL::Checked::tcscpy_s(lpstrShortTitle, cchShortTitle, lpstrTitle);\n\t\t}\n\t}\n\n\tvoid UpdateTooltipText(LPNMTTDISPINFO pTTDI)\n\t{\n\t\tATLASSERT(pTTDI != NULL);\n\t\tpTTDI->lpszText = (LPTSTR)GetPageTitle((int)pTTDI->hdr.idFrom);\n\t}\n\n\tint DragHitTest(POINT pt) const\n\t{\n\t\tRECT rect = {};\n\t\tthis->GetClientRect(&rect);\n\t\tif(::PtInRect(&rect, pt) == FALSE)\n\t\t\treturn -1;\n\n\t\tm_tab.GetClientRect(&rect);\n\t\tTCHITTESTINFO hti = {};\n\t\thti.pt.x = pt.x;\n\t\thti.pt.y = rect.bottom / 2;   // use middle to ignore\n\t\tint nItem = m_tab.HitTest(&hti);\n\t\tif(nItem == -1)\n\t\t{\n\t\t\tint nLast = m_tab.GetItemCount() - 1;\n\t\t\tRECT rcItem = {};\n\t\t\tm_tab.GetItemRect(nLast, &rcItem);\n\t\t\tif(pt.x >= rcItem.right)\n\t\t\t\tnItem = nLast;\n\t\t}\n\n\t\treturn nItem;\n\t}\n\n\tvoid StartStopAutoScroll(int x)\n\t{\n\t\tAutoScroll scroll = _AUTOSCROLL_NONE;\n\t\tif(x != -1)\n\t\t{\n\t\t\tRECT rect = {};\n\t\t\tm_tab.GetClientRect(&rect);\n\t\t\tint dx = ::GetSystemMetrics(SM_CXVSCROLL);\n\t\t\tif((x >= 0) && (x < dx))\n\t\t\t{\n\t\t\t\tRECT rcItem = {};\n\t\t\t\tm_tab.GetItemRect(0, &rcItem);\n\t\t\t\tif(rcItem.left < rect.left)\n\t\t\t\t\tscroll = _AUTOSCROLL_LEFT;\n\t\t\t}\n\t\t\telse if((x >= (rect.right - dx)) && (x < rect.right))\n\t\t\t{\n\t\t\t\tRECT rcItem = {};\n\t\t\t\tm_tab.GetItemRect(m_tab.GetItemCount() - 1, &rcItem);\n\t\t\t\tif(rcItem.right > rect.right)\n\t\t\t\t\tscroll = _AUTOSCROLL_RIGHT;\n\t\t\t}\n\t\t}\n\n\t\tif(scroll != _AUTOSCROLL_NONE)\n\t\t{\n\t\t\tif(m_ud.m_hWnd == NULL)\n\t\t\t\tm_ud = m_tab.GetWindow(GW_CHILD);\n\n\t\t\tif(m_AutoScroll != scroll)\n\t\t\t{\n\t\t\t\tm_AutoScroll = scroll;\n\t\t\t\tthis->SetTimer(_nAutoScrollTimerID, 300);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis->KillTimer(_nAutoScrollTimerID);\n\t\t\tm_AutoScroll = _AUTOSCROLL_NONE;\n\t\t}\n\t}\n\n\tvoid DoAutoScroll()\n\t{\n\t\tATLASSERT(m_AutoScroll != _AUTOSCROLL_NONE);\n\n\t\tint nMin = -1, nMax = -1;\n\t\tm_ud.GetRange(nMin, nMax);\n\t\tint nPos = m_ud.GetPos();\n\n\t\tint nNewPos = -1;\n\t\tif((m_AutoScroll == _AUTOSCROLL_LEFT) && (nPos > nMin))\n\t\t\tnNewPos = nPos - 1;\n\t\telse if((m_AutoScroll == _AUTOSCROLL_RIGHT) && (nPos < nMax))\n\t\t\tnNewPos = nPos + 1;\n\t\tif(nNewPos != -1)\n\t\t{\n\t\t\tm_tab.SendMessage(WM_HSCROLL, MAKEWPARAM(SB_THUMBPOSITION, nNewPos));\n\t\t\tm_tab.SendMessage(WM_HSCROLL, MAKEWPARAM(SB_ENDSCROLL, 0));\n\n\t\t\tPOINT pt = {};\n\t\t\t::GetCursorPos(&pt);\n\t\t\tm_tab.ScreenToClient(&pt);\n\t\t\tm_tab.SendMessage(WM_MOUSEMOVE, NULL, MAKELPARAM(pt.x, pt.y));\n\t\t}\n\t}\n\n// Text for menu items and title bar - override to provide different strings\n\tstatic LPCTSTR GetEmptyListText()\n\t{\n\t\treturn _T(\"(Empty)\");\n\t}\n\n\tstatic LPCTSTR GetWindowsMenuItemText()\n\t{\n\t\treturn _T(\"&Windows...\");\n\t}\n\n\tstatic LPCTSTR GetTitleDividerText()\n\t{\n\t\treturn _T(\" - \");\n\t}\n\n// Notifications - override to provide different behavior\n\tvoid OnPageActivated(int nPage)\n\t{\n\t\tNMHDR nmhdr = {};\n\t\tnmhdr.hwndFrom = this->m_hWnd;\n\t\tnmhdr.idFrom = nPage;\n\t\tnmhdr.code = TBVN_PAGEACTIVATED;\n\t\tthis->GetParent().SendMessage(WM_NOTIFY, this->GetDlgCtrlID(), (LPARAM)&nmhdr);\n\t}\n\n\tvoid OnContextMenu(int nPage, POINT pt)\n\t{\n\t\tTBVCONTEXTMENUINFO cmi = {};\n\t\tcmi.hdr.hwndFrom = this->m_hWnd;\n\t\tcmi.hdr.idFrom = nPage;\n\t\tcmi.hdr.code = TBVN_CONTEXTMENU;\n\t\tcmi.pt = pt;\n\t\tthis->GetParent().SendMessage(WM_NOTIFY, this->GetDlgCtrlID(), (LPARAM)&cmi);\n\t}\n\n\tvoid OnTabCloseBtn(int nPage)\n\t{\n\t\tNMHDR nmhdr = {};\n\t\tnmhdr.hwndFrom = this->m_hWnd;\n\t\tnmhdr.idFrom = nPage;\n\t\tnmhdr.code = TBVN_TABCLOSEBTN;\n\t\tLRESULT lRet = this->GetParent().SendMessage(WM_NOTIFY, this->GetDlgCtrlID(), (LPARAM)&nmhdr);\n\t\tif(lRet == 0)   // default - close page\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->RemovePage(m_nCloseItem);\n\t\t\tm_nCloseItem = -1;\n\t\t\tpT->DestroyCloseButton();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_tab.SendMessage(WM_MOUSELEAVE);\n\t\t}\n\t}\n\n// Close button overrideables\n\tvoid CreateCloseButton(int nItem)\n\t{\n\t\tATLASSERT(m_btnClose.m_hWnd == NULL);\n\n\t\tm_btnClose.m_bPressed = false;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tRECT rcClose = {};\n\t\tpT->CalcCloseButtonRect(nItem, rcClose);\n\t\tm_btnClose.Create(m_tab.m_hWnd, rcClose, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, T::_nCloseBtnID);\n\t\tATLASSERT(m_btnClose.IsWindow());\n\n\t\tif(m_btnClose.m_hWnd != NULL)\n\t\t{\n\t\t\t// create a tool tip\n\t\t\tATLASSERT(m_btnClose.m_tip.m_hWnd == NULL);\n\t\t\tm_btnClose.m_tip.Create(m_btnClose.m_hWnd);\n\t\t\tATLASSERT(m_btnClose.m_tip.IsWindow());\n\n\t\t\tif(m_btnClose.m_tip.IsWindow())\n\t\t\t{\n\t\t\t\tm_btnClose.m_tip.Activate(TRUE);\n\n\t\t\t\tRECT rect = {};\n\t\t\t\tm_btnClose.GetClientRect(&rect);\n\t\t\t\tm_btnClose.m_tip.AddTool(m_btnClose.m_hWnd, LPSTR_TEXTCALLBACK, &rect, T::_nCloseBtnID);\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid DestroyCloseButton()\n\t{\n\t\tATLASSERT(m_btnClose.m_hWnd != NULL);\n\n\t\tif(m_btnClose.m_hWnd != NULL)\n\t\t{\n\t\t\tif(m_btnClose.m_tip.IsWindow())\n\t\t\t{\n\t\t\t\tm_btnClose.m_tip.DestroyWindow();\n\t\t\t\tm_btnClose.m_tip.m_hWnd = NULL;\n\t\t\t}\n\n\t\t\tm_btnClose.DestroyWindow();\n\t\t}\n\t}\n\n\tvoid CalcCloseButtonRect(int nItem, RECT& rcClose)\n\t{\n\t\tRECT rcItem = {};\n\t\tm_tab.GetItemRect(nItem, &rcItem);\n\n\t\tint cy = (rcItem.bottom - rcItem.top - _cyCloseBtn) / 2;\n\t\tint cx = (nItem == m_tab.GetCurSel()) ? _cxCloseBtnMarginSel : _cxCloseBtnMargin;\n\t\t::SetRect(&rcClose, rcItem.right - cx - _cxCloseBtn, rcItem.top + cy, \n\t\t\t            rcItem.right - cx, rcItem.top + cy + _cyCloseBtn);\n\t}\n};\n\nclass CTabView : public CTabViewImpl<CTabView>\n{\npublic:\n\tDECLARE_WND_CLASS_EX(_T(\"WTL_TabView\"), 0, COLOR_APPWORKSPACE)\n};\n\n} // namespace WTL\n\n#endif // __ATLCTRLX_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlddx.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLDDX_H__\n#define __ATLDDX_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atlddx.h requires atlapp.h to be included first\n#endif\n\n#include <float.h>\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CWinDataExchange<T>\n\n\nnamespace WTL\n{\n\n// Constants\n#define DDX_LOAD\tFALSE\n#define DDX_SAVE\tTRUE\n\n// DDX map macros\n#define BEGIN_DDX_MAP(thisClass) \\\n\tBOOL DoDataExchange(BOOL bSaveAndValidate = FALSE, UINT nCtlID = (UINT)-1) \\\n\t{ \\\n\t\t(bSaveAndValidate); \\\n\t\t(nCtlID);\n\n#define DDX_TEXT(nID, var) \\\n\t\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\t{ \\\n\t\t\tif(!DDX_Text(nID, var, sizeof(var), bSaveAndValidate)) \\\n\t\t\t\treturn FALSE; \\\n\t\t}\n\n#define DDX_TEXT_LEN(nID, var, len) \\\n\t\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\t{ \\\n\t\t\tif(!DDX_Text(nID, var, sizeof(var), bSaveAndValidate, TRUE, len)) \\\n\t\t\t\treturn FALSE; \\\n\t\t}\n\n#define DDX_INT(nID, var) \\\n\t\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\t{ \\\n\t\t\tif(!DDX_Int(nID, var, TRUE, bSaveAndValidate)) \\\n\t\t\t\treturn FALSE; \\\n\t\t}\n\n#define DDX_INT_RANGE(nID, var, min, max) \\\n\t\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\t{ \\\n\t\t\tif(!DDX_Int(nID, var, TRUE, bSaveAndValidate, TRUE, min, max)) \\\n\t\t\t\treturn FALSE; \\\n\t\t}\n\n#define DDX_UINT(nID, var) \\\n\t\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\t{ \\\n\t\t\tif(!DDX_Int(nID, var, FALSE, bSaveAndValidate)) \\\n\t\t\t\treturn FALSE; \\\n\t\t}\n\n#define DDX_UINT_RANGE(nID, var, min, max) \\\n\t\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\t{ \\\n\t\t\tif(!DDX_Int(nID, var, FALSE, bSaveAndValidate, TRUE, min, max)) \\\n\t\t\t\treturn FALSE; \\\n\t\t}\n\n#define DDX_FLOAT(nID, var) \\\n\t\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\t{ \\\n\t\t\tif(!DDX_Float(nID, var, bSaveAndValidate)) \\\n\t\t\t\treturn FALSE; \\\n\t\t}\n\n#define DDX_FLOAT_RANGE(nID, var, min, max) \\\n\t\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\t{ \\\n\t\t\tif(!DDX_Float(nID, var, bSaveAndValidate, TRUE, min, max)) \\\n\t\t\t\treturn FALSE; \\\n\t\t}\n#define DDX_FLOAT_P(nID, var, precision) \\\n\t\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\t{ \\\n\t\t\tif(!DDX_Float(nID, var, bSaveAndValidate, FALSE, 0, 0, precision)) \\\n\t\t\t\treturn FALSE; \\\n\t\t}\n\n#define DDX_FLOAT_P_RANGE(nID, var, min, max, precision) \\\n\t\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\t{ \\\n\t\t\tif(!DDX_Float(nID, var, bSaveAndValidate, TRUE, min, max, precision)) \\\n\t\t\t\treturn FALSE; \\\n\t\t}\n\n#define DDX_CONTROL(nID, obj) \\\n\t\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\t\tDDX_Control(nID, obj, bSaveAndValidate);\n\n#define DDX_CONTROL_HANDLE(nID, obj) \\\n\t\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\t\tDDX_Control_Handle(nID, obj, bSaveAndValidate);\n\n#define DDX_CHECK(nID, var) \\\n\t\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\t\tDDX_Check(nID, var, bSaveAndValidate);\n\n#define DDX_RADIO(nID, var) \\\n\t\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\t\tDDX_Radio(nID, var, bSaveAndValidate);\n\n#define END_DDX_MAP() \\\n\t\treturn TRUE; \\\n\t}\n\n// DDX support for Tab, Combo, ListBox and ListView selection index\n// Note: Specialized versions require atlctrls.h to be included first\n\n#define DDX_INDEX(CtrlClass, nID, var) \\\n\tif((nCtlID == (UINT)-1) || (nCtlID == nID)) \\\n\t\tDDX_Index<CtrlClass>(nID, var, bSaveAndValidate);\n\n#ifdef __ATLCTRLS_H__\n  #define DDX_TAB_INDEX(nID, var)      DDX_INDEX(WTL::CTabCtrl, nID, var)\n  #define DDX_COMBO_INDEX(nID, var)    DDX_INDEX(WTL::CComboBox, nID, var)\n  #define DDX_LISTBOX_INDEX(nID, var)  DDX_INDEX(WTL::CListBox, nID, var)\n  #define DDX_LISTVIEW_INDEX(nID, var) DDX_INDEX(WTL::CListViewCtrl, nID, var)\n#endif // __ATLCTRLS_H__\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CWinDataExchange - provides support for DDX\n\ntemplate <class T>\nclass CWinDataExchange\n{\npublic:\n// Data exchange method - override in your derived class\n\tBOOL DoDataExchange(BOOL /*bSaveAndValidate*/ = FALSE, UINT /*nCtlID*/ = (UINT)-1)\n\t{\n\t\t// this one should never be called, override it in\n\t\t// your derived class by implementing DDX map\n\t\tATLASSERT(FALSE);\n\t\treturn FALSE;\n\t}\n\n// Helpers for validation error reporting\n\tenum _XDataType\n\t{\n\t\tddxDataNull = 0,\n\t\tddxDataText = 1,\n\t\tddxDataInt = 2,\n\t\tddxDataFloat = 3,\n\t\tddxDataDouble = 4\n\t};\n\n\tstruct _XTextData\n\t{\n\t\tint nLength;\n\t\tint nMaxLength;\n\t};\n\n\tstruct _XIntData\n\t{\n\t\tlong nVal;\n\t\tlong nMin;\n\t\tlong nMax;\n\t};\n\n\tstruct _XFloatData\n\t{\n\t\tdouble nVal;\n\t\tdouble nMin;\n\t\tdouble nMax;\n\t};\n\n\tstruct _XData\n\t{\n\t\t_XDataType nDataType;\n\t\tunion\n\t\t{\n\t\t\t_XTextData textData;\n\t\t\t_XIntData intData;\n\t\t\t_XFloatData floatData;\n\t\t};\n\t};\n\n// Text exchange\n\tBOOL DDX_Text(UINT nID, LPTSTR lpstrText, int cbSize, BOOL bSave, BOOL bValidate = FALSE, int nLength = 0)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tBOOL bSuccess = TRUE;\n\n\t\tif(bSave)\n\t\t{\n\t\t\tHWND hWndCtrl = pT->GetDlgItem(nID);\n\t\t\tint nRetLen = ::GetWindowText(hWndCtrl, lpstrText, cbSize / sizeof(TCHAR));\n\t\t\tif(nRetLen < ::GetWindowTextLength(hWndCtrl))\n\t\t\t\tbSuccess = FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tATLASSERT(!bValidate || (lstrlen(lpstrText) <= nLength));\n\t\t\tbSuccess = pT->SetDlgItemText(nID, lpstrText);\n\t\t}\n\n\t\tif(!bSuccess)\n\t\t{\n\t\t\tpT->OnDataExchangeError(nID, bSave);\n\t\t}\n\t\telse if(bSave && bValidate)   // validation\n\t\t{\n\t\t\tATLASSERT(nLength > 0);\n\t\t\tif(lstrlen(lpstrText) > nLength)\n\t\t\t{\n\t\t\t\t_XData data = { ddxDataText };\n\t\t\t\tdata.textData.nLength = lstrlen(lpstrText);\n\t\t\t\tdata.textData.nMaxLength = nLength;\n\t\t\t\tpT->OnDataValidateError(nID, bSave, data);\n\t\t\t\tbSuccess = FALSE;\n\t\t\t}\n\t\t}\n\t\treturn bSuccess;\n\t}\n\n\tBOOL DDX_Text(UINT nID, BSTR& bstrText, int /*cbSize*/, BOOL bSave, BOOL bValidate = FALSE, int nLength = 0)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tBOOL bSuccess = TRUE;\n\n\t\tif(bSave)\n\t\t{\n\t\t\tbSuccess = pT->GetDlgItemText(nID, bstrText);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tUSES_CONVERSION;\n\t\t\tLPTSTR lpstrText = OLE2T(bstrText);\n\t\t\tATLASSERT(!bValidate || (lstrlen(lpstrText) <= nLength));\n\t\t\tbSuccess = pT->SetDlgItemText(nID, lpstrText);\n\t\t}\n\n\t\tif(!bSuccess)\n\t\t{\n\t\t\tpT->OnDataExchangeError(nID, bSave);\n\t\t}\n\t\telse if(bSave && bValidate)   // validation\n\t\t{\n\t\t\tATLASSERT(nLength > 0);\n\t\t\tif((int)::SysStringLen(bstrText) > nLength)\n\t\t\t{\n\t\t\t\t_XData data = { ddxDataText };\n\t\t\t\tdata.textData.nLength = (int)::SysStringLen(bstrText);\n\t\t\t\tdata.textData.nMaxLength = nLength;\n\t\t\t\tpT->OnDataValidateError(nID, bSave, data);\n\t\t\t\tbSuccess = FALSE;\n\t\t\t}\n\t\t}\n\t\treturn bSuccess;\n\t}\n\n\tBOOL DDX_Text(UINT nID, ATL::CComBSTR& bstrText, int /*cbSize*/, BOOL bSave, BOOL bValidate = FALSE, int nLength = 0)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tBOOL bSuccess = TRUE;\n\n\t\tif(bSave)\n\t\t{\n\t\t\tbSuccess = pT->GetDlgItemText(nID, (BSTR&)bstrText);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tUSES_CONVERSION;\n\t\t\tLPTSTR lpstrText = OLE2T(bstrText);\n\t\t\tATLASSERT(!bValidate || (lstrlen(lpstrText) <= nLength));\n\t\t\tbSuccess = pT->SetDlgItemText(nID, lpstrText);\n\t\t}\n\n\t\tif(!bSuccess)\n\t\t{\n\t\t\tpT->OnDataExchangeError(nID, bSave);\n\t\t}\n\t\telse if(bSave && bValidate)   // validation\n\t\t{\n\t\t\tATLASSERT(nLength > 0);\n\t\t\tif((int)bstrText.Length() > nLength)\n\t\t\t{\n\t\t\t\t_XData data = { ddxDataText };\n\t\t\t\tdata.textData.nLength = (int)bstrText.Length();\n\t\t\t\tdata.textData.nMaxLength = nLength;\n\t\t\t\tpT->OnDataValidateError(nID, bSave, data);\n\t\t\t\tbSuccess = FALSE;\n\t\t\t}\n\t\t}\n\t\treturn bSuccess;\n\t}\n\n#ifdef __ATLSTR_H__\n\tBOOL DDX_Text(UINT nID, ATL::CString& strText, int /*cbSize*/, BOOL bSave, BOOL bValidate = FALSE, int nLength = 0)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tBOOL bSuccess = TRUE;\n\n\t\tif(bSave)\n\t\t{\n\t\t\tHWND hWndCtrl = pT->GetDlgItem(nID);\n\t\t\tint nLen = ::GetWindowTextLength(hWndCtrl);\n\t\t\tint nRetLen = -1;\n\t\t\tLPTSTR lpstr = strText.GetBufferSetLength(nLen);\n\t\t\tif(lpstr != NULL)\n\t\t\t{\n\t\t\t\tnRetLen = ::GetWindowText(hWndCtrl, lpstr, nLen + 1);\n\t\t\t\tstrText.ReleaseBuffer();\n\t\t\t}\n\t\t\tif(nRetLen < nLen)\n\t\t\t\tbSuccess = FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tbSuccess = pT->SetDlgItemText(nID, strText);\n\t\t}\n\n\t\tif(!bSuccess)\n\t\t{\n\t\t\tpT->OnDataExchangeError(nID, bSave);\n\t\t}\n\t\telse if(bSave && bValidate)   // validation\n\t\t{\n\t\t\tATLASSERT(nLength > 0);\n\t\t\tif(strText.GetLength() > nLength)\n\t\t\t{\n\t\t\t\t_XData data = { ddxDataText };\n\t\t\t\tdata.textData.nLength = strText.GetLength();\n\t\t\t\tdata.textData.nMaxLength = nLength;\n\t\t\t\tpT->OnDataValidateError(nID, bSave, data);\n\t\t\t\tbSuccess = FALSE;\n\t\t\t}\n\t\t}\n\t\treturn bSuccess;\n\t}\n#endif // __ATLSTR_H__\n\n// Numeric exchange\n\ttemplate <class Type>\n\tBOOL DDX_Int(UINT nID, Type& nVal, BOOL bSigned, BOOL bSave, BOOL bValidate = FALSE, Type nMin = 0, Type nMax = 0)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tBOOL bSuccess = TRUE;\n\n\t\tif(bSave)\n\t\t{\n\t\t\tnVal = (Type)pT->GetDlgItemInt(nID, &bSuccess, bSigned);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tATLASSERT(!bValidate || ((nVal >= nMin) && (nVal <= nMax)));\n\t\t\tbSuccess = pT->SetDlgItemInt(nID, nVal, bSigned);\n\t\t}\n\n\t\tif(!bSuccess)\n\t\t{\n\t\t\tpT->OnDataExchangeError(nID, bSave);\n\t\t}\n\t\telse if(bSave && bValidate)   // validation\n\t\t{\n\t\t\tATLASSERT(nMin != nMax);\n\t\t\tif((nVal < nMin) || (nVal > nMax))\n\t\t\t{\n\t\t\t\t_XData data = { ddxDataInt };\n\t\t\t\tdata.intData.nVal = (long)nVal;\n\t\t\t\tdata.intData.nMin = (long)nMin;\n\t\t\t\tdata.intData.nMax = (long)nMax;\n\t\t\t\tpT->OnDataValidateError(nID, bSave, data);\n\t\t\t\tbSuccess = FALSE;\n\t\t\t}\n\t\t}\n\t\treturn bSuccess;\n\t}\n\n// Float exchange\n\tstatic BOOL _AtlSimpleFloatParse(LPCTSTR lpszText, double& d)\n\t{\n\t\tATLASSERT(lpszText != NULL);\n\t\twhile ((*lpszText == _T(' ')) || (*lpszText == _T('\\t')))\n\t\t\tlpszText++;\n\n\t\tTCHAR chFirst = lpszText[0];\n\t\td = _tcstod(lpszText, (LPTSTR*)&lpszText);\n\t\tif ((d == 0.0) && (chFirst != _T('0')))\n\t\t\treturn FALSE;   // could not convert\n\t\twhile ((*lpszText == _T(' ')) || (*lpszText == _T('\\t')))\n\t\t\tlpszText++;\n\n\t\tif (*lpszText != _T('\\0'))\n\t\t\treturn FALSE;   // not terminated properly\n\n\t\treturn TRUE;\n\t}\n\n\tBOOL DDX_Float(UINT nID, float& nVal, BOOL bSave, BOOL bValidate = FALSE, float nMin = 0.F, float nMax = 0.F, int nPrecision = FLT_DIG)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tBOOL bSuccess = TRUE;\n\t\tconst int cchBuff = 32;\n\t\tTCHAR szBuff[cchBuff] = {};\n\n\t\tif(bSave)\n\t\t{\n\t\t\tpT->GetDlgItemText(nID, szBuff, cchBuff);\n\t\t\tdouble d = 0;\n\t\t\tif(_AtlSimpleFloatParse(szBuff, d))\n\t\t\t\tnVal = (float)d;\n\t\t\telse\n\t\t\t\tbSuccess = FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tATLASSERT(!bValidate || ((nVal >= nMin) && (nVal <= nMax)));\n\t\t\t_stprintf_s(szBuff, cchBuff, _T(\"%.*g\"), nPrecision, nVal);\n\t\t\tbSuccess = pT->SetDlgItemText(nID, szBuff);\n\t\t}\n\n\t\tif(!bSuccess)\n\t\t{\n\t\t\tpT->OnDataExchangeError(nID, bSave);\n\t\t}\n\t\telse if(bSave && bValidate)   // validation\n\t\t{\n\t\t\tATLASSERT(nMin != nMax);\n\t\t\tif((nVal < nMin) || (nVal > nMax))\n\t\t\t{\n\t\t\t\t_XData data = { ddxDataFloat };\n\t\t\t\tdata.floatData.nVal = (double)nVal;\n\t\t\t\tdata.floatData.nMin = (double)nMin;\n\t\t\t\tdata.floatData.nMax = (double)nMax;\n\t\t\t\tpT->OnDataValidateError(nID, bSave, data);\n\t\t\t\tbSuccess = FALSE;\n\t\t\t}\n\t\t}\n\t\treturn bSuccess;\n\t}\n\n\tBOOL DDX_Float(UINT nID, double& nVal, BOOL bSave, BOOL bValidate = FALSE, double nMin = 0., double nMax = 0., int nPrecision = DBL_DIG)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tBOOL bSuccess = TRUE;\n\t\tconst int cchBuff = 32;\n\t\tTCHAR szBuff[cchBuff] = {};\n\n\t\tif(bSave)\n\t\t{\n\t\t\tpT->GetDlgItemText(nID, szBuff, cchBuff);\n\t\t\tdouble d = 0;\n\t\t\tif(_AtlSimpleFloatParse(szBuff, d))\n\t\t\t\tnVal = d;\n\t\t\telse\n\t\t\t\tbSuccess = FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tATLASSERT(!bValidate || ((nVal >= nMin) && (nVal <= nMax)));\n\t\t\t_stprintf_s(szBuff, cchBuff, _T(\"%.*g\"), nPrecision, nVal);\n\t\t\tbSuccess = pT->SetDlgItemText(nID, szBuff);\n\t\t}\n\n\t\tif(!bSuccess)\n\t\t{\n\t\t\tpT->OnDataExchangeError(nID, bSave);\n\t\t}\n\t\telse if(bSave && bValidate)   // validation\n\t\t{\n\t\t\tATLASSERT(nMin != nMax);\n\t\t\tif((nVal < nMin) || (nVal > nMax))\n\t\t\t{\n\t\t\t\t_XData data = { ddxDataFloat };\n\t\t\t\tdata.floatData.nVal = nVal;\n\t\t\t\tdata.floatData.nMin = nMin;\n\t\t\t\tdata.floatData.nMax = nMax;\n\t\t\t\tpT->OnDataValidateError(nID, bSave, data);\n\t\t\t\tbSuccess = FALSE;\n\t\t\t}\n\t\t}\n\t\treturn bSuccess;\n\t}\n\n// Full control subclassing (for CWindowImpl derived controls)\n\ttemplate <class TControl>\n\tvoid DDX_Control(UINT nID, TControl& ctrl, BOOL bSave)\n\t{\n\t\tif(!bSave && (ctrl.m_hWnd == NULL))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tctrl.SubclassWindow(pT->GetDlgItem(nID));\n\t\t}\n\t}\n\n// Simple control attaching (for HWND wrapper controls)\n\ttemplate <class TControl>\n\tvoid DDX_Control_Handle(UINT nID, TControl& ctrl, BOOL bSave)\n\t{\n\t\tif(!bSave && (ctrl.m_hWnd == NULL))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tctrl = pT->GetDlgItem(nID);\n\t\t}\n\t}\n\n// Control state\n\tvoid DDX_Check(UINT nID, int& nValue, BOOL bSave)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tHWND hWndCtrl = pT->GetDlgItem(nID);\n\t\tif(bSave)\n\t\t{\n\t\t\tnValue = (int)::SendMessage(hWndCtrl, BM_GETCHECK, 0, 0L);\n\t\t\tATLASSERT((nValue >= 0) && (nValue <= 2));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif((nValue < 0) || (nValue > 2))\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ATL: Warning - dialog data checkbox value (%d) out of range.\\n\"), nValue);\n\t\t\t\tnValue = 0;  // default to off\n\t\t\t}\n\t\t\t::SendMessage(hWndCtrl, BM_SETCHECK, nValue, 0L);\n\t\t}\n\t}\n\n\t// variant that supports bool (checked/not-checked, no intermediate state)\n\tvoid DDX_Check(UINT nID, bool& bCheck, BOOL bSave)\n\t{\n\t\tint nValue = bCheck ? 1 : 0;\n\t\tDDX_Check(nID, nValue, bSave);\n\n\t\tif(bSave)\n\t\t{\n\t\t\tif(nValue == 2)\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ATL: Warning - checkbox state (%d) out of supported range.\\n\"), nValue);\n\t\t\tbCheck = (nValue == 1);\n\t\t}\n\t}\n\n\tvoid DDX_Radio(UINT nID, int& nValue, BOOL bSave)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tHWND hWndCtrl = pT->GetDlgItem(nID);\n\t\tATLASSERT(hWndCtrl != NULL);\n\n\t\t// must be first in a group of auto radio buttons\n\t\tATLASSERT(::GetWindowLong(hWndCtrl, GWL_STYLE) & WS_GROUP);\n\t\tATLASSERT(::SendMessage(hWndCtrl, WM_GETDLGCODE, 0, 0L) & DLGC_RADIOBUTTON);\n\n\t\tif(bSave)\n\t\t\tnValue = -1;     // value if none found\n\n\t\t// walk all children in group\n\t\tint nButton = 0;\n\t\tdo\n\t\t{\n\t\t\tif(::SendMessage(hWndCtrl, WM_GETDLGCODE, 0, 0L) & DLGC_RADIOBUTTON)\n\t\t\t{\n\t\t\t\t// control in group is a radio button\n\t\t\t\tif(bSave)\n\t\t\t\t{\n\t\t\t\t\tif(::SendMessage(hWndCtrl, BM_GETCHECK, 0, 0L) != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tATLASSERT(nValue == -1);    // only set once\n\t\t\t\t\t\tnValue = nButton;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// select button\n\t\t\t\t\t::SendMessage(hWndCtrl, BM_SETCHECK, (nButton == nValue), 0L);\n\t\t\t\t}\n\t\t\t\tnButton++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ATL: Warning - skipping non-radio button in group.\\n\"));\n\t\t\t}\n\t\t\thWndCtrl = ::GetWindow(hWndCtrl, GW_HWNDNEXT);\n\t\t}\n\t\twhile ((hWndCtrl != NULL) && !(GetWindowLong(hWndCtrl, GWL_STYLE) & WS_GROUP));\n\t}\n\n// DDX support for Tab, Combo, ListBox and ListView selection index\n\ttemplate <class TCtrl>\n\tINT _getSel(TCtrl& tCtrl)\n\t{\n\t\treturn tCtrl.GetCurSel();\n\t}\n\n\ttemplate <class TCtrl>\n\tvoid _setSel(TCtrl& tCtrl, INT iSel)\n\t{\n\t\tif(iSel < 0)\n\t\t\ttCtrl.SetCurSel(-1);\n\t\telse\n\t\t\ttCtrl.SetCurSel(iSel);\n\t}\n\n#ifdef __ATLCTRLS_H__\n\t// ListViewCtrl specialization\n\ttemplate <>\n\tINT _getSel(WTL::CListViewCtrl& tCtrl)\n\t{\n\t\treturn tCtrl.GetSelectedIndex();\n\t}\n\n\ttemplate <>\n\tvoid _setSel(WTL::CListViewCtrl& tCtrl, INT iSel)\n\t{\n\t\tif(iSel < 0)\n\t\t\ttCtrl.SelectItem(-1);\n\t\telse\n\t\t\ttCtrl.SelectItem(iSel);\n\t}\n#endif // __ATLCTRLS_H__\n\n\ttemplate <class TCtrl>\n\tvoid DDX_Index(UINT nID, INT& nVal, BOOL bSave)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tTCtrl ctrl(pT->GetDlgItem(nID));\n\n\t\tif(bSave)\n\t\t\tnVal = _getSel(ctrl);\n\t\telse\n\t\t\t_setSel(ctrl, nVal);\n\t}\n\n// Overrideables\n\tvoid OnDataExchangeError(UINT nCtrlID, BOOL /*bSave*/)\n\t{\n\t\t// Override to display an error message\n\t\t::MessageBeep((UINT)-1);\n\t\tT* pT = static_cast<T*>(this);\n\t\t::SetFocus(pT->GetDlgItem(nCtrlID));\n\t}\n\n\tvoid OnDataValidateError(UINT nCtrlID, BOOL /*bSave*/, _XData& /*data*/)\n\t{\n\t\t// Override to display an error message\n\t\t::MessageBeep((UINT)-1);\n\t\tT* pT = static_cast<T*>(this);\n\t\t::SetFocus(pT->GetDlgItem(nCtrlID));\n\t}\n};\n\n} // namespace WTL\n\n#endif // __ATLDDX_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atldlgs.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLDLGS_H__\n#define __ATLDLGS_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atldlgs.h requires atlapp.h to be included first\n#endif\n\n#ifndef __ATLWIN_H__\n\t#error atldlgs.h requires atlwin.h to be included first\n#endif\n\n#include <shlobj.h>\n\n#if (_WIN32_WINNT >= 0x0600)\n  #include <shobjidl.h>\n#endif // (_WIN32_WINNT >= 0x0600)\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CFileDialogImpl<T>\n// CFileDialog\n// CSimpleFileDialog\n// CMultiFileDialogImpl<T>\n// CMultiFileDialog\n// CShellFileDialogImpl<T>\n// CShellFileOpenDialogImpl<T>\n// CShellFileOpenDialog\n// CShellFileSaveDialogImpl<T>\n// CShellFileSaveDialog\n// CFolderDialogImpl<T>\n// CFolderDialog\n// CFontDialogImpl<T>\n// CFontDialog\n// CRichEditFontDialogImpl<T>\n// CRichEditFontDialog\n// CColorDialogImpl<T>\n// CColorDialog\n// CPrintDialogImpl<T>\n// CPrintDialog\n// CPrintDialogExImpl<T>\n// CPrintDialogEx\n// CPageSetupDialogImpl<T>\n// CPageSetupDialog\n// CFindReplaceDialogImpl<T>\n// CFindReplaceDialog\n//\n// CDialogBaseUnits\n// CMemDlgTemplate\n// CIndirectDialogImpl<T, TDlgTemplate, TBase>\n//\n// CPropertySheetWindow\n// CPropertySheetImpl<T, TBase>\n// CPropertySheet\n// CPropertyPageWindow\n// CPropertyPageImpl<T, TBase>\n// CPropertyPage<t_wDlgTemplateID>\n// CAxPropertyPageImpl<T, TBase>\n// CAxPropertyPage<t_wDlgTemplateID>\n//\n// CWizard97SheetWindow\n// CWizard97SheetImpl<T, TBase>\n// CWizard97Sheet\n// CWizard97PageWindow\n// CWizard97PageImpl<T, TBase>\n// CWizard97ExteriorPageImpl<T, TBase>\n// CWizard97InteriorPageImpl<T, TBase>\n//\n// CAeroWizardFrameWindow\n// CAeroWizardFrameImpl<T, TBase>\n// CAeroWizardFrame\n// CAeroWizardPageWindow\n// CAeroWizardPageImpl<T, TBase>\n// CAeroWizardPage<t_wDlgTemplateID>\n// CAeroWizardAxPageImpl<T, TBase>\n// CAeroWizardAxPage<t_wDlgTemplateID>\n//\n// CTaskDialogConfig\n// CTaskDialogImpl<T>\n// CTaskDialog\n//\n// Global functions:\n//   AtlTaskDialog()\n\n\nnamespace WTL\n{\n\n///////////////////////////////////////////////////////////////////////////////\n// CFileDialogImpl - used for File Open or File Save As\n\ntemplate <class T>\nclass ATL_NO_VTABLE CFileDialogImpl : public ATL::CDialogImplBase\n{\npublic:\n\tOPENFILENAME m_ofn;\n\tBOOL m_bOpenFileDialog;            // TRUE for file open, FALSE for file save\n\tTCHAR m_szFileTitle[_MAX_FNAME];   // contains file title after return\n\tTCHAR m_szFileName[_MAX_PATH];     // contains full path name after return\n\n\tCFileDialogImpl(BOOL bOpenFileDialog, // TRUE for FileOpen, FALSE for FileSaveAs\n\t\t\tLPCTSTR lpszDefExt = NULL,\n\t\t\tLPCTSTR lpszFileName = NULL,\n\t\t\tDWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,\n\t\t\tLPCTSTR lpszFilter = NULL,\n\t\t\tHWND hWndParent = NULL) : m_bOpenFileDialog(bOpenFileDialog)\n\t{\n\t\tmemset(&m_ofn, 0, sizeof(m_ofn)); // initialize structure to 0/NULL\n\t\tm_ofn.lStructSize = sizeof(m_ofn);\n\t\tm_ofn.lpstrFile = m_szFileName;\n\t\tm_ofn.nMaxFile = _MAX_PATH;\n\t\tm_ofn.lpstrDefExt = lpszDefExt;\n\t\tm_ofn.lpstrFileTitle = (LPTSTR)m_szFileTitle;\n\t\tm_ofn.nMaxFileTitle = _MAX_FNAME;\n\t\tm_ofn.Flags = dwFlags | OFN_EXPLORER | OFN_ENABLEHOOK | OFN_ENABLESIZING;\n\t\tm_ofn.lpstrFilter = lpszFilter;\n\t\tm_ofn.hInstance = ModuleHelper::GetResourceInstance();\n\t\tm_ofn.lpfnHook = (LPOFNHOOKPROC)T::StartDialogProc;\n\t\tm_ofn.hwndOwner = hWndParent;\n\n\t\tm_szFileName[0] = _T('\\0');\n\t\tm_szFileTitle[0] = _T('\\0');\n\n\t\t// setup initial file name\n\t\tif(lpszFileName != NULL)\n\t\t\tATL::Checked::tcsncpy_s(m_szFileName, _countof(m_szFileName), lpszFileName, _TRUNCATE);\n\t}\n\n\tINT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\n\t{\n\t\tATLASSERT((m_ofn.Flags & OFN_ENABLEHOOK) != 0);\n\t\tATLASSERT(m_ofn.lpfnHook != NULL);   // can still be a user hook\n\n\t\tATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\n\n\t\tif(m_ofn.hwndOwner == NULL)   // set only if not specified before\n\t\t\tm_ofn.hwndOwner = hWndParent;\n\n\t\tATLASSERT(m_hWnd == NULL);\n\n\t\t// Allocate the thunk structure here, where we can fail gracefully.\n\t\tBOOL bRetTh = m_thunk.Init(NULL, NULL);\n\t\tif(bRetTh == FALSE)\n\t\t{\n\t\t\t::SetLastError(ERROR_OUTOFMEMORY);\n\t\t\treturn -1;\n\t\t}\n\n\t\tModuleHelper::AddCreateWndData(&m_thunk.cd, (ATL::CDialogImplBase*)this);\n\n\t\tBOOL bRet = (m_bOpenFileDialog != FALSE) ? ::GetOpenFileName(&m_ofn) : ::GetSaveFileName(&m_ofn);\n\n\t\tm_hWnd = NULL;\n\n\t\treturn (bRet != FALSE) ? IDOK : IDCANCEL;\n\t}\n\n// Attributes\n\tATL::CWindow GetFileDialogWindow() const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn ATL::CWindow(GetParent());\n\t}\n\n\tint GetFilePath(LPTSTR lpstrFilePath, int nLength) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\n\n\t\treturn (int)GetFileDialogWindow().SendMessage(CDM_GETFILEPATH, nLength, (LPARAM)lpstrFilePath);\n\t}\n\n\tint GetFolderIDList(LPVOID lpBuff, int nLength) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\n\n\t\treturn (int)GetFileDialogWindow().SendMessage(CDM_GETFOLDERIDLIST, nLength, (LPARAM)lpBuff);\n\t}\n\n\tint GetFolderPath(LPTSTR lpstrFolderPath, int nLength) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\n\n\t\treturn (int)GetFileDialogWindow().SendMessage(CDM_GETFOLDERPATH, nLength, (LPARAM)lpstrFolderPath);\n\t}\n\n\tint GetSpec(LPTSTR lpstrSpec, int nLength) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\n\n\t\treturn (int)GetFileDialogWindow().SendMessage(CDM_GETSPEC, nLength, (LPARAM)lpstrSpec);\n\t}\n\n\tvoid SetControlText(int nCtrlID, LPCTSTR lpstrText)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\n\n\t\tGetFileDialogWindow().SendMessage(CDM_SETCONTROLTEXT, nCtrlID, (LPARAM)lpstrText);\n\t}\n\n\tvoid SetDefExt(LPCTSTR lpstrExt)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\n\n\t\tGetFileDialogWindow().SendMessage(CDM_SETDEFEXT, 0, (LPARAM)lpstrExt);\n\t}\n\n\tBOOL GetReadOnlyPref() const\t// return TRUE if readonly checked\n\t{\n\t\treturn ((m_ofn.Flags & OFN_READONLY) != 0) ? TRUE : FALSE;\n\t}\n\n// Operations\n\tvoid HideControl(int nCtrlID)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\n\n\t\tGetFileDialogWindow().SendMessage(CDM_HIDECONTROL, nCtrlID);\n\t}\n\n// Special override for common dialogs\n\tBOOL EndDialog(INT_PTR /*nRetCode*/ = 0)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tGetFileDialogWindow().SendMessage(WM_COMMAND, MAKEWPARAM(IDCANCEL, 0));\n\t\treturn TRUE;\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CFileDialogImpl)\n\t\tNOTIFY_CODE_HANDLER(CDN_FILEOK, _OnFileOK)\n\t\tNOTIFY_CODE_HANDLER(CDN_FOLDERCHANGE, _OnFolderChange)\n\t\tNOTIFY_CODE_HANDLER(CDN_HELP, _OnHelp)\n\t\tNOTIFY_CODE_HANDLER(CDN_INITDONE, _OnInitDone)\n\t\tNOTIFY_CODE_HANDLER(CDN_SELCHANGE, _OnSelChange)\n\t\tNOTIFY_CODE_HANDLER(CDN_SHAREVIOLATION, _OnShareViolation)\n\t\tNOTIFY_CODE_HANDLER(CDN_TYPECHANGE, _OnTypeChange)\n\t\tNOTIFY_CODE_HANDLER(CDN_INCLUDEITEM, _OnIncludeItem)\n\tEND_MSG_MAP()\n\n\tLRESULT _OnFileOK(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tT* pT = static_cast<T*>(this);\n\t\treturn !pT->OnFileOK((LPOFNOTIFY)pnmh);\n\t}\n\n\tLRESULT _OnFolderChange(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->OnFolderChange((LPOFNOTIFY)pnmh);\n\t\treturn 0;\n\t}\n\n\tLRESULT _OnHelp(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->OnHelp((LPOFNOTIFY)pnmh);\n\t\treturn 0;\n\t}\n\n\tLRESULT _OnInitDone(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->OnInitDone((LPOFNOTIFY)pnmh);\n\t\treturn 0;\n\t}\n\n\tLRESULT _OnSelChange(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->OnSelChange((LPOFNOTIFY)pnmh);\n\t\treturn 0;\n\t}\n\n\tLRESULT _OnShareViolation(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tT* pT = static_cast<T*>(this);\n\t\treturn pT->OnShareViolation((LPOFNOTIFY)pnmh);\n\t}\n\n\tLRESULT _OnTypeChange(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->OnTypeChange((LPOFNOTIFY)pnmh);\n\t\treturn 0;\n\t}\n\n\tLRESULT _OnIncludeItem(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tT* pT = static_cast<T*>(this);\n\t\treturn pT->OnIncludeItem((LPOFNOTIFYEX)pnmh);\n\t}\n\n// Overrideables\n\tBOOL OnFileOK(LPOFNOTIFY /*lpon*/)\n\t{\n\t\treturn TRUE;\n\t}\n\n\tvoid OnFolderChange(LPOFNOTIFY /*lpon*/)\n\t{\n\t}\n\n\tvoid OnHelp(LPOFNOTIFY /*lpon*/)\n\t{\n\t}\n\n\tvoid OnInitDone(LPOFNOTIFY /*lpon*/)\n\t{\n\t}\n\n\tvoid OnSelChange(LPOFNOTIFY /*lpon*/)\n\t{\n\t}\n\n\tint OnShareViolation(LPOFNOTIFY /*lpon*/)\n\t{\n\t\treturn 0;\n\t}\n\n\tvoid OnTypeChange(LPOFNOTIFY /*lpon*/)\n\t{\n\t}\n\n\tBOOL OnIncludeItem(LPOFNOTIFYEX /*lponex*/)\n\t{\n\t\treturn TRUE;   // include item\n\t}\n};\n\nclass CFileDialog : public CFileDialogImpl<CFileDialog>\n{\npublic:\n\tCFileDialog(BOOL bOpenFileDialog, // TRUE for FileOpen, FALSE for FileSaveAs\n\t\tLPCTSTR lpszDefExt = NULL,\n\t\tLPCTSTR lpszFileName = NULL,\n\t\tDWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,\n\t\tLPCTSTR lpszFilter = NULL,\n\t\tHWND hWndParent = NULL)\n\t\t: CFileDialogImpl<CFileDialog>(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter, hWndParent)\n\t{ }\n\n\t// override base class map and references to handlers\n\tDECLARE_EMPTY_MSG_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CSimpleFileDialog - simple class for non-customized Open/SaveAs dialogs\n\nclass CSimpleFileDialog\n{\npublic:\n\tOPENFILENAME m_ofn;\n\tBOOL m_bOpenFileDialog;            // TRUE for file open, FALSE for file save\n\tTCHAR m_szFileTitle[_MAX_FNAME];   // contains file title after return\n\tTCHAR m_szFileName[_MAX_PATH];     // contains full path name after return\n\n\tCSimpleFileDialog(BOOL bOpenFileDialog, // TRUE for FileOpen, FALSE for FileSaveAs\n\t\t\tLPCTSTR lpszDefExt = NULL,\n\t\t\tLPCTSTR lpszFileName = NULL,\n\t\t\tDWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,\n\t\t\tLPCTSTR lpszFilter = NULL,\n\t\t\tHWND hWndParent = NULL) : m_bOpenFileDialog(bOpenFileDialog)\n\t{\n\t\tmemset(&m_ofn, 0, sizeof(m_ofn)); // initialize structure to 0/NULL\n\t\tm_ofn.lStructSize = sizeof(m_ofn);\n\t\tm_ofn.lpstrFile = m_szFileName;\n\t\tm_ofn.nMaxFile = _MAX_PATH;\n\t\tm_ofn.lpstrDefExt = lpszDefExt;\n\t\tm_ofn.lpstrFileTitle = (LPTSTR)m_szFileTitle;\n\t\tm_ofn.nMaxFileTitle = _MAX_FNAME;\n\t\tm_ofn.Flags = dwFlags | OFN_EXPLORER | OFN_ENABLESIZING;\n\t\tm_ofn.lpstrFilter = lpszFilter;\n\t\tm_ofn.hInstance = ModuleHelper::GetResourceInstance();\n\t\tm_ofn.hwndOwner = hWndParent;\n\n\t\tm_szFileName[0] = _T('\\0');\n\t\tm_szFileTitle[0] = _T('\\0');\n\n\t\t// setup initial file name\n\t\tif(lpszFileName != NULL)\n\t\t\tATL::Checked::tcsncpy_s(m_szFileName, _countof(m_szFileName), lpszFileName, _TRUNCATE);\n\t}\n\n\tINT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\n\t{\n\t\tATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\n\n\t\tif(m_ofn.hwndOwner == NULL)   // set only if not specified before\n\t\t\tm_ofn.hwndOwner = hWndParent;\n\n\t\tBOOL bRet = (m_bOpenFileDialog != FALSE) ? ::GetOpenFileName(&m_ofn) : ::GetSaveFileName(&m_ofn);\n\n\t\treturn (bRet != FALSE) ? IDOK : IDCANCEL;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Multi File Dialog - Multi-select File Open dialog\n\n// The class dynamically resizes the buffer as the file selection changes\n// (as described in Knowledge Base article 131462). It also expands selected\n// shortcut files to take into account the full path of the target file.\n// Note that this doesn't work on Win9x for the old style dialogs, as well as\n// on NT for non-Unicode builds. \n\n#ifndef _WTL_FIXED_OFN_BUFFER_LENGTH\n  #define _WTL_FIXED_OFN_BUFFER_LENGTH 0x10000\n#endif\n\ntemplate <class T>\nclass ATL_NO_VTABLE CMultiFileDialogImpl : public CFileDialogImpl< T >\n{\npublic:\n\tmutable LPCTSTR m_pNextFile; \n#ifndef _UNICODE\n\tbool m_bIsNT;\n#endif\n\n\tCMultiFileDialogImpl(\n\t\tLPCTSTR lpszDefExt = NULL,\n\t\tLPCTSTR lpszFileName = NULL,\n\t\tDWORD dwFlags = OFN_HIDEREADONLY,\n\t\tLPCTSTR lpszFilter = NULL,\n\t\tHWND hWndParent = NULL)\n\t\t: CFileDialogImpl<T>(TRUE, lpszDefExt, lpszFileName, dwFlags, lpszFilter, hWndParent), \n\t\t  m_pNextFile(NULL)\n\t{\n\t\tthis->m_ofn.Flags |= OFN_ALLOWMULTISELECT;   // Force multiple selection mode\n\n#ifndef _UNICODE\n#ifdef _versionhelpers_H_INCLUDED_\n\t\tOSVERSIONINFOEX ovi = { sizeof(OSVERSIONINFOEX) };\n\t\tovi.dwPlatformId = VER_PLATFORM_WIN32_NT;\n\t\tDWORDLONG const dwlConditionMask = ::VerSetConditionMask(0, VER_PLATFORMID, VER_EQUAL);\n\t\tm_bIsNT = (::VerifyVersionInfo(&ovi, VER_PLATFORMID, dwlConditionMask) != FALSE);\n#else // !_versionhelpers_H_INCLUDED_\n\t\tOSVERSIONINFO ovi = { sizeof(OSVERSIONINFO) };\n\t\t::GetVersionEx(&ovi);\n\t\tm_bIsNT = (ovi.dwPlatformId == VER_PLATFORM_WIN32_NT);\n#endif // _versionhelpers_H_INCLUDED_\n\t\tif (m_bIsNT)\n\t\t{\n\t\t\t// On NT platforms, GetOpenFileNameA thunks to GetOpenFileNameW and there \n\t\t\t// is absolutely nothing we can do except to start off with a large buffer.\n\t\t\tATLVERIFY(ResizeFilenameBuffer(_WTL_FIXED_OFN_BUFFER_LENGTH));\n\t\t}\n#endif\n\t}\n\n\t~CMultiFileDialogImpl()\n\t{\n\t\tif (this->m_ofn.lpstrFile != this->m_szFileName)   // Free the buffer if we allocated it\n\t\t\tdelete[] this->m_ofn.lpstrFile;\n\t}\n\n// Operations\n\t// Get the directory that the files were chosen from.\n\t// The function returns the number of characters copied, not including the terminating zero. \n\t// If the buffer is NULL, the function returns the required size, in characters, including the terminating zero.\n\t// If the function fails, the return value is zero.\n\tint GetDirectory(LPTSTR pBuffer, int nBufLen) const\n\t{\n\t\tif (this->m_ofn.lpstrFile == NULL)\n\t\t\treturn 0;\n\n\t\tLPCTSTR pStr = this->m_ofn.lpstrFile;\n\t\tint nLength = lstrlen(pStr);\n\t\tif (pStr[nLength + 1] == 0)\n\t\t{\n\t\t\t// The OFN buffer contains a single item so extract its path.\n\t\t\tLPCTSTR pSep = _tcsrchr(pStr, _T('\\\\'));\n\t\t\tif (pSep != NULL)\n\t\t\t\tnLength = (int)(DWORD_PTR)(pSep - pStr);\n\t\t}\n\n\t\tint nRet = 0;\n\t\tif (pBuffer == NULL)   // If the buffer is NULL, return the required length\n\t\t{\n\t\t\tnRet = nLength + 1;\n\t\t}\n\t\telse if (nBufLen > nLength)\n\t\t{\n\t\t\tATL::Checked::tcsncpy_s(pBuffer, nBufLen, pStr, nLength);\n\t\t\tnRet = nLength;\n\t\t}\n\n\t\treturn nRet;\n\t}\n\n#ifdef __ATLSTR_H__\n\tbool GetDirectory(ATL::CString& strDir) const\n\t{\n\t\tbool bRet = false;\n\n\t\tint nLength = GetDirectory(NULL, 0);\n\t\tif (nLength > 0)\n\t\t{\n\t\t\tbRet = (GetDirectory(strDir.GetBuffer(nLength), nLength) > 0);\n\t\t\tstrDir.ReleaseBuffer(nLength - 1);\n\t\t}\n\n\t\treturn bRet;\n\t}\n#endif // __ATLSTR_H__\n\n\t// Get the first filename as a pointer into the buffer.\n\tLPCTSTR GetFirstFileName() const\n\t{\n\t\tif (this->m_ofn.lpstrFile == NULL)\n\t\t\treturn NULL;\n\n\t\tm_pNextFile = NULL;   // Reset internal buffer pointer\n\n\t\tLPCTSTR pStr = this->m_ofn.lpstrFile;\n\t\tint nLength = lstrlen(pStr);\n\t\tif (pStr[nLength + 1] != 0)\n\t\t{\n\t\t\t// Multiple items were selected. The first string is the directory,\n\t\t\t// so skip forwards to the second string.\n\t\t\tpStr += nLength + 1;\n\n\t\t\t// Set up m_pNext so it points to the second item (or null).\n\t\t\tm_pNextFile = pStr;\n\t\t\tGetNextFileName();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// A single item was selected. Skip forward past the path.\n\t\t\tLPCTSTR pSep = _tcsrchr(pStr, _T('\\\\'));\n\t\t\tif (pSep != NULL)\n\t\t\t\tpStr = pSep + 1;\n\t\t}\n\n\t\treturn pStr;\n\t}\n\n\t// Get the next filename as a pointer into the buffer.\n\tLPCTSTR GetNextFileName() const\n\t{\n\t\tif (m_pNextFile == NULL)\n\t\t\treturn NULL;\n\n\t\tLPCTSTR pStr = m_pNextFile;\n\t\t// Set \"m_pNextFile\" to point to the next file name, or null if we \n\t\t// have reached the last file in the list.\n\t\tint nLength = lstrlen(pStr);\n\t\tm_pNextFile = (pStr[nLength + 1] != 0) ? &pStr[nLength + 1] : NULL;\n\n\t\treturn pStr;\n\t}\n\n\t// Get the first filename as a full path.\n\t// The function returns the number of characters copied, not including the terminating zero. \n\t// If the buffer is NULL, the function returns the required size, in characters, including the terminating zero.\n\t// If the function fails, the return value is zero.\n\tint GetFirstPathName(LPTSTR pBuffer, int nBufLen) const\n\t{\n\t\tLPCTSTR pStr = GetFirstFileName();\n\t\tint nLengthDir = GetDirectory(NULL, 0);\n\t\tif((pStr == NULL) || (nLengthDir == 0))\n\t\t\treturn 0;\n\n\t\t// Figure out the required length.\n\t\tint nLengthTotal = nLengthDir + lstrlen(pStr);\n\n\t\tint nRet = 0;\n\t\tif(pBuffer == NULL) // If the buffer is NULL, return the required length\n\t\t{\n\t\t\tnRet = nLengthTotal + 1;\n\t\t}\n\t\telse if (nBufLen > nLengthTotal) // If the buffer is big enough, go ahead and construct the path\n\t\t{\t\t\n\t\t\tGetDirectory(pBuffer, nBufLen);\n\t\t\tATL::Checked::tcscat_s(pBuffer, nBufLen, _T(\"\\\\\"));\n\t\t\tATL::Checked::tcscat_s(pBuffer, nBufLen, pStr);\n\t\t\tnRet = nLengthTotal;\n\t\t}\n\n\t\treturn nRet;\n\t}\n\n#ifdef __ATLSTR_H__\n\tbool GetFirstPathName(ATL::CString& strPath) const\n\t{\n\t\tbool bRet = false;\n\n\t\tint nLength = GetFirstPathName(NULL, 0);\n\t\tif (nLength > 0)\n\t\t{\n\t\t\tbRet = (GetFirstPathName(strPath.GetBuffer(nLength), nLength) > 0);\n\t\t\tstrPath.ReleaseBuffer(nLength - 1);\n\t\t}\n\n\t\treturn bRet;\n\t}\n#endif // __ATLSTR_H__\n\n\t// Get the next filename as a full path.\n\t// The function returns the number of characters copied, not including the terminating zero. \n\t// If the buffer is NULL, the function returns the required size, in characters, including the terminating zero.\n\t// If the function fails, the return value is zero.\n\t// The internal position marker is moved forward only if the function succeeds and the buffer was large enough.\n\tint GetNextPathName(LPTSTR pBuffer, int nBufLen) const\n\t{\n\t\tif (m_pNextFile == NULL)\n\t\t\treturn 0;\n\n\t\tint nRet = 0;\n\t\tLPCTSTR pStr = m_pNextFile;\n\t\t// Does the filename contain a backslash?\n\t\tif (_tcsrchr(pStr, _T('\\\\')) != NULL)\n\t\t{\n\t\t\t// Yes, so we'll assume it's a full path.\n\t\t\tint nLength = lstrlen(pStr);\n\n\t\t\tif (pBuffer == NULL) // If the buffer is NULL, return the required length\n\t\t\t{\n\t\t\t\tnRet = nLength + 1;\n\t\t\t}\n\t\t\telse if (nBufLen > nLength) // The buffer is big enough, so go ahead and copy the filename\n\t\t\t{\n\t\t\t\tATL::Checked::tcscpy_s(pBuffer, nBufLen, GetNextFileName());\n\t\t\t\tnRet = nBufLen;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// The filename is relative, so construct the full path.\n\t\t\tint nLengthDir = GetDirectory(NULL, 0);\n\t\t\tif (nLengthDir > 0)\n\t\t\t{\n\t\t\t\t// Calculate the required space.\n\t\t\t\tint nLengthTotal = nLengthDir + lstrlen(pStr);\n\n\t\t\t\tif(pBuffer == NULL) // If the buffer is NULL, return the required length\n\t\t\t\t{\n\t\t\t\t\tnRet = nLengthTotal + 1;\n\t\t\t\t}\n\t\t\t\telse if (nBufLen > nLengthTotal) // If the buffer is big enough, go ahead and construct the path\n\t\t\t\t{\n\t\t\t\t\tGetDirectory(pBuffer, nBufLen);\n\t\t\t\t\tATL::Checked::tcscat_s(pBuffer, nBufLen, _T(\"\\\\\"));\n\t\t\t\t\tATL::Checked::tcscat_s(pBuffer, nBufLen, GetNextFileName());\n\t\t\t\t\tnRet = nLengthTotal;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nRet;\n\t}\n\n#ifdef __ATLSTR_H__\n\tbool GetNextPathName(ATL::CString& strPath) const\n\t{\n\t\tbool bRet = false;\n\n\t\tint nLength = GetNextPathName(NULL, 0);\n\t\tif (nLength > 0)\n\t\t{\n\t\t\tbRet = (GetNextPathName(strPath.GetBuffer(nLength), nLength) > 0);\n\t\t\tstrPath.ReleaseBuffer(nLength - 1);\n\t\t}\n\n\t\treturn bRet;\n\t}\n#endif // __ATLSTR_H__\n\n// Implementation\n\tbool ResizeFilenameBuffer(DWORD dwLength)\n\t{\n\t\tif (dwLength > this->m_ofn.nMaxFile)\n\t\t{\n\t\t\t// Free the old buffer.\n\t\t\tif (this->m_ofn.lpstrFile != this->m_szFileName)\n\t\t\t{\n\t\t\t\tdelete[] this->m_ofn.lpstrFile;\n\t\t\t\tthis->m_ofn.lpstrFile = NULL;\n\t\t\t\tthis->m_ofn.nMaxFile = 0;\n\t\t\t}\n\n\t\t\t// Allocate the new buffer.\n\t\t\tLPTSTR lpstrBuff = NULL;\n\t\t\tATLTRY(lpstrBuff = new TCHAR[dwLength]);\n\t\t\tif (lpstrBuff != NULL)\n\t\t\t{\n\t\t\t\tthis->m_ofn.lpstrFile = lpstrBuff;\n\t\t\t\tthis->m_ofn.lpstrFile[0] = 0;\n\t\t\t\tthis->m_ofn.nMaxFile = dwLength;\n\t\t\t}\n\t\t}\n\n\t\treturn (this->m_ofn.lpstrFile != NULL);\n\t}\n\n\tvoid OnSelChange(LPOFNOTIFY /*lpon*/)\n\t{\n#ifndef _UNICODE\n\t\t// There is no point resizing the buffer in ANSI builds running on NT.\n\t\tif (m_bIsNT)\n\t\t\treturn;\n#endif\n\n\t\t// Get the buffer length required to hold the spec.\n\t\tint nLength = this->GetSpec(NULL, 0);\n\t\tif (nLength <= 1)\n\t\t\treturn; // no files are selected, presumably\n\t\t\n\t\t// Add room for the directory, and an extra terminating zero.\n\t\tnLength += this->GetFolderPath(NULL, 0) + 1;\n\n\t\tif (!ResizeFilenameBuffer(nLength))\n\t\t{\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn;\n\t\t}\n\n\t\t// If we are not following links then our work is done.\n\t\tif ((this->m_ofn.Flags & OFN_NODEREFERENCELINKS) != 0)\n\t\t\treturn;\n\n\t\t// Get the file spec, which is the text in the edit control.\n\t\tif (this->GetSpec(this->m_ofn.lpstrFile, this->m_ofn.nMaxFile) <= 0)\n\t\t\treturn;\n\t\t\n\t\t// Get the ID-list of the current folder.\n\t\tint nBytes = this->GetFolderIDList(NULL, 0);\n#ifdef STRICT_TYPED_ITEMIDS\n\t\tATL::CTempBuffer<ITEMIDLIST_RELATIVE> idlist;\n#else\n\t\tATL::CTempBuffer<ITEMIDLIST> idlist;\n#endif\n\t\tidlist.AllocateBytes(nBytes);\n\t\tif ((nBytes <= 0) || (this->GetFolderIDList(idlist, nBytes) <= 0))\n\t\t\treturn;\n\n\t\t// First bind to the desktop folder, then to the current folder.\n\t\tATL::CComPtr<IShellFolder> pDesktop, pFolder;\n\t\tif (FAILED(::SHGetDesktopFolder(&pDesktop)))\n\t\t\treturn;\n\t\tif (FAILED(pDesktop->BindToObject(idlist, NULL, IID_IShellFolder, (void**)&pFolder)))\n\t\t\treturn;\n\n\t\t// Work through the file spec, looking for quoted filenames. If we find a shortcut file, then \n\t\t// we need to add enough extra buffer space to hold its target path.\n\t\tDWORD nExtraChars = 0;\n\t\tbool bInsideQuotes = false;\n\t\tLPCTSTR pAnchor = this->m_ofn.lpstrFile;\n\t\tLPCTSTR pChar = this->m_ofn.lpstrFile;\n\t\tfor ( ; *pChar; ++pChar)\n\t\t{\n\t\t\t// Look for quotation marks.\n\t\t\tif (*pChar == _T('\\\"'))\n\t\t\t{\n\t\t\t\t// We are either entering or leaving a passage of quoted text.\n\t\t\t\tbInsideQuotes = !bInsideQuotes;\n\n\t\t\t\t// Is it an opening or closing quote?\n\t\t\t\tif (bInsideQuotes)\n\t\t\t\t{\n\t\t\t\t\t// We found an opening quote, so set \"pAnchor\" to the following character.\n\t\t\t\t\tpAnchor = pChar + 1;\n\t\t\t\t}\n\t\t\t\telse // closing quote\n\t\t\t\t{\n\t\t\t\t\t// Each quoted entity should be shorter than MAX_PATH.\n\t\t\t\t\tif (pChar - pAnchor >= MAX_PATH)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t// Get the ID-list and attributes of the file.\n\t\t\t\t\tUSES_CONVERSION;\n\t\t\t\t\tint nFileNameLength = (int)(DWORD_PTR)(pChar - pAnchor);\n\t\t\t\t\tTCHAR szFileName[MAX_PATH] = {};\n\t\t\t\t\tATL::Checked::tcsncpy_s(szFileName, MAX_PATH, pAnchor, nFileNameLength);\n#ifdef STRICT_TYPED_ITEMIDS\n\t\t\t\t\tPIDLIST_RELATIVE pidl = NULL;\n#else\n\t\t\t\t\tLPITEMIDLIST pidl = NULL;\n#endif\n\t\t\t\t\tDWORD dwAttrib = SFGAO_LINK;\n\t\t\t\t\tif (SUCCEEDED(pFolder->ParseDisplayName(NULL, NULL, T2W(szFileName), NULL, &pidl, &dwAttrib)))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Is it a shortcut file?\n\t\t\t\t\t\tif (dwAttrib & SFGAO_LINK)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Bind to its IShellLink interface.\n\t\t\t\t\t\t\tATL::CComPtr<IShellLink> pLink;\n\t\t\t\t\t\t\tif (SUCCEEDED(pFolder->BindToObject(pidl, NULL, IID_IShellLink, (void**)&pLink)))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Get the shortcut's target path.\n\t\t\t\t\t\t\t\tTCHAR szPath[MAX_PATH] = {};\n\t\t\t\t\t\t\t\tif (SUCCEEDED(pLink->GetPath(szPath, MAX_PATH, NULL, 0)))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// If the target path is longer than the shortcut name, then add on the number \n\t\t\t\t\t\t\t\t\t// of extra characters that are required.\n\t\t\t\t\t\t\t\t\tint nNewLength = lstrlen(szPath);\n\t\t\t\t\t\t\t\t\tif (nNewLength > nFileNameLength)\n\t\t\t\t\t\t\t\t\t\tnExtraChars += nNewLength - nFileNameLength;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Free the ID-list returned by ParseDisplayName.\n\t\t\t\t\t\t::CoTaskMemFree(pidl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If we need more space for shortcut targets, then reallocate.\n\t\tif (nExtraChars > 0)\n\t\t\tATLVERIFY(ResizeFilenameBuffer(this->m_ofn.nMaxFile + nExtraChars));\n\t}\n};\n\nclass CMultiFileDialog : public CMultiFileDialogImpl<CMultiFileDialog>\n{\npublic:\n\tCMultiFileDialog(\n\t\tLPCTSTR lpszDefExt = NULL,\n\t\tLPCTSTR lpszFileName = NULL,\n\t\tDWORD dwFlags = OFN_HIDEREADONLY,\n\t\tLPCTSTR lpszFilter = NULL,\n\t\tHWND hWndParent = NULL)\n\t\t: CMultiFileDialogImpl<CMultiFileDialog>(lpszDefExt, lpszFileName, dwFlags, lpszFilter, hWndParent)\n\t{ }\n\n\tBEGIN_MSG_MAP(CMultiFileDialog)\n\t\tCHAIN_MSG_MAP(CMultiFileDialogImpl<CMultiFileDialog>)\n\tEND_MSG_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Shell File Dialog - new Shell File Open and Save dialogs in Vista\n\n// Note: Use GetPtr() to access dialog interface methods.\n// Example:\n//\tCShellFileOpenDialog dlg;\n//\tdlg.GetPtr()->SetTitle(L\"MyFileOpenDialog\");\n\n#if (_WIN32_WINNT >= 0x0600)\n\n///////////////////////////////////////////////////////////////////////////////\n// CShellFileDialogImpl - base class for CShellFileOpenDialogImpl and CShellFileSaveDialogImpl\n\ntemplate <class T>\nclass ATL_NO_VTABLE CShellFileDialogImpl : public IFileDialogEvents\n{\npublic:\n// Operations\n\tINT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\n\t{\n\t\tINT_PTR nRet = -1;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(pT->m_spFileDlg == NULL)\n\t\t{\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn nRet;\n\t\t}\n\n\t\tDWORD dwCookie = 0;\n\t\tpT->_Advise(dwCookie);\n\n\t\tHRESULT hRet = pT->m_spFileDlg->Show(hWndParent);\n\t\tif(SUCCEEDED(hRet))\n\t\t\tnRet = IDOK;\n\t\telse if(hRet == HRESULT_FROM_WIN32(ERROR_CANCELLED))\n\t\t\tnRet = IDCANCEL;\n\t\telse\n\t\t\tATLASSERT(FALSE);   // error\n\n\t\tpT->_Unadvise(dwCookie);\n\n\t\treturn nRet;\n\t}\n\n\tbool IsNull() const\n\t{\n\t\tconst T* pT = static_cast<const T*>(this);\n\t\treturn (pT->m_spFileDlg == NULL);\n\t}\n\n// Operations - get file path after dialog returns\n\tHRESULT GetFilePath(LPWSTR lpstrFilePath, int cchLength)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_spFileDlg != NULL);\n\n\t\tATL::CComPtr<IShellItem> spItem;\n\t\tHRESULT hRet = pT->m_spFileDlg->GetResult(&spItem);\n\n\t\tif(SUCCEEDED(hRet))\n\t\t\thRet = GetFileNameFromShellItem(spItem, SIGDN_FILESYSPATH, lpstrFilePath, cchLength);\n\n\t\treturn hRet;\n\t}\n\n\tHRESULT GetFileTitle(LPWSTR lpstrFileTitle, int cchLength)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_spFileDlg != NULL);\n\n\t\tATL::CComPtr<IShellItem> spItem;\n\t\tHRESULT hRet = pT->m_spFileDlg->GetResult(&spItem);\n\n\t\tif(SUCCEEDED(hRet))\n\t\t\thRet = GetFileNameFromShellItem(spItem, SIGDN_NORMALDISPLAY, lpstrFileTitle, cchLength);\n\n\t\treturn hRet;\n\t}\n\n#ifdef __ATLSTR_H__\n\tHRESULT GetFilePath(ATL::CString& strFilePath)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_spFileDlg != NULL);\n\n\t\tATL::CComPtr<IShellItem> spItem;\n\t\tHRESULT hRet = pT->m_spFileDlg->GetResult(&spItem);\n\n\t\tif(SUCCEEDED(hRet))\n\t\t\thRet = GetFileNameFromShellItem(spItem, SIGDN_FILESYSPATH, strFilePath);\n\n\t\treturn hRet;\n\t}\n\n\tHRESULT GetFileTitle(ATL::CString& strFileTitle)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_spFileDlg != NULL);\n\n\t\tATL::CComPtr<IShellItem> spItem;\n\t\tHRESULT hRet = pT->m_spFileDlg->GetResult(&spItem);\n\n\t\tif(SUCCEEDED(hRet))\n\t\t\thRet = GetFileNameFromShellItem(spItem, SIGDN_NORMALDISPLAY, strFileTitle);\n\n\t\treturn hRet;\n\t}\n#endif // __ATLSTR_H__\n\n// Helpers for IShellItem\n\tstatic HRESULT GetFileNameFromShellItem(IShellItem* pShellItem, SIGDN type, LPWSTR lpstr, int cchLength)\n\t{\n\t\tATLASSERT(pShellItem != NULL);\n\n\t\tLPWSTR lpstrName = NULL;\n\t\tHRESULT hRet = pShellItem->GetDisplayName(type, &lpstrName);\n\n\t\tif(SUCCEEDED(hRet))\n\t\t{\n\t\t\tif(lstrlenW(lpstrName) < cchLength)\n\t\t\t{\n\t\t\t\tATL::Checked::wcscpy_s(lpstr, cchLength, lpstrName);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\thRet = DISP_E_BUFFERTOOSMALL;\n\t\t\t}\n\n\t\t\t::CoTaskMemFree(lpstrName);\n\t\t}\n\n\t\treturn hRet;\n\t}\n\n#ifdef __ATLSTR_H__\n\tstatic HRESULT GetFileNameFromShellItem(IShellItem* pShellItem, SIGDN type, ATL::CString& str)\n\t{\n\t\tATLASSERT(pShellItem != NULL);\n\n\t\tLPWSTR lpstrName = NULL;\n\t\tHRESULT hRet = pShellItem->GetDisplayName(type, &lpstrName);\n\n\t\tif(SUCCEEDED(hRet))\n\t\t{\n\t\t\tstr = lpstrName;\n\t\t\t::CoTaskMemFree(lpstrName);\n\t\t}\n\n\t\treturn hRet;\n\t}\n#endif // __ATLSTR_H__\n\n// Implementation\n\tvoid _Advise(DWORD& dwCookie)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_spFileDlg != NULL);\n\t\tHRESULT hRet = pT->m_spFileDlg->Advise((IFileDialogEvents*)this, &dwCookie);\n\t\tATLVERIFY(SUCCEEDED(hRet));\n\t}\n\n\tvoid _Unadvise(DWORD dwCookie)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_spFileDlg != NULL);\n\t\tHRESULT hRet = pT->m_spFileDlg->Unadvise(dwCookie);\n\t\tATLVERIFY(SUCCEEDED(hRet));\n\t}\n\n\tvoid _Init(LPCWSTR lpszFileName, DWORD dwOptions, LPCWSTR lpszDefExt, const COMDLG_FILTERSPEC* arrFilterSpec, UINT uFilterSpecCount)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_spFileDlg != NULL);\n\n\t\tHRESULT hRet = E_FAIL;\n\n\t\tif(lpszFileName != NULL)\n\t\t{\n\t\t\thRet = pT->m_spFileDlg->SetFileName(lpszFileName);\n\t\t\tATLASSERT(SUCCEEDED(hRet));\n\t\t}\n\n\t\thRet = pT->m_spFileDlg->SetOptions(dwOptions);\n\t\tATLASSERT(SUCCEEDED(hRet));\n\n\t\tif(lpszDefExt != NULL)\n\t\t{\n\t\t\thRet = pT->m_spFileDlg->SetDefaultExtension(lpszDefExt);\n\t\t\tATLASSERT(SUCCEEDED(hRet));\n\t\t}\n\n\t\tif((arrFilterSpec != NULL) && (uFilterSpecCount != 0U))\n\t\t{\n\t\t\thRet = pT->m_spFileDlg->SetFileTypes(uFilterSpecCount, arrFilterSpec);\n\t\t\tATLASSERT(SUCCEEDED(hRet));\n\t\t}\n\t}\n\n// Implementation - IUnknown interface\n\tSTDMETHOD(QueryInterface)(REFIID riid, void** ppvObject)\n\t{\n\t\tif(ppvObject == NULL)\n\t\t\treturn E_POINTER;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(IsEqualGUID(riid, IID_IUnknown) || IsEqualGUID(riid, IID_IFileDialogEvents))\n\t\t{\n\t\t\t*ppvObject = (IFileDialogEvents*)pT;\n\t\t\t// AddRef() not needed\n\t\t\treturn S_OK;\n\t\t}\n\n\t\treturn E_NOINTERFACE;\n\t}\n\n\tvirtual ULONG STDMETHODCALLTYPE AddRef()\n\t{\n\t\treturn 1;\n\t}\n\n\tvirtual ULONG STDMETHODCALLTYPE Release()\n\t{\n\t\treturn 1;\n\t}\n\n// Implementation - IFileDialogEvents interface\n\tvirtual HRESULT STDMETHODCALLTYPE OnFileOk(IFileDialog* pfd)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_spFileDlg.IsEqualObject(pfd));\n\t\t(void)pfd;   // avoid level 4 warning\n\t\treturn pT->OnFileOk();\n\t}\n\n\tvirtual HRESULT STDMETHODCALLTYPE OnFolderChanging(IFileDialog* pfd, IShellItem* psiFolder)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_spFileDlg.IsEqualObject(pfd));\n\t\t(void)pfd;   // avoid level 4 warning\n\t\treturn pT->OnFolderChanging(psiFolder);\n\t}\n\n\tvirtual HRESULT STDMETHODCALLTYPE OnFolderChange(IFileDialog* pfd)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_spFileDlg.IsEqualObject(pfd));\n\t\t(void)pfd;   // avoid level 4 warning\n\t\treturn pT->OnFolderChange();\n\t}\n\n\tvirtual HRESULT STDMETHODCALLTYPE OnSelectionChange(IFileDialog* pfd)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_spFileDlg.IsEqualObject(pfd));\n\t\t(void)pfd;   // avoid level 4 warning\n\t\treturn pT->OnSelectionChange();\n\t}\n\n\tvirtual HRESULT STDMETHODCALLTYPE OnShareViolation(IFileDialog* pfd, IShellItem* psi, FDE_SHAREVIOLATION_RESPONSE* pResponse)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_spFileDlg.IsEqualObject(pfd));\n\t\t(void)pfd;   // avoid level 4 warning\n\t\treturn pT->OnShareViolation(psi, pResponse);\n\t}\n\n\tvirtual HRESULT STDMETHODCALLTYPE OnTypeChange(IFileDialog* pfd)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_spFileDlg.IsEqualObject(pfd));\n\t\t(void)pfd;   // avoid level 4 warning\n\t\treturn pT->OnTypeChange();\n\t}\n\n\tvirtual HRESULT STDMETHODCALLTYPE OnOverwrite(IFileDialog* pfd, IShellItem* psi, FDE_OVERWRITE_RESPONSE* pResponse)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_spFileDlg.IsEqualObject(pfd));\n\t\t(void)pfd;   // avoid level 4 warning\n\t\treturn pT->OnOverwrite(psi, pResponse);\n\t}\n\n// Overrideables - Event handlers\n\tHRESULT OnFileOk()\n\t{\n\t\treturn E_NOTIMPL;\n\t}\n\n\tHRESULT OnFolderChanging(IShellItem* /*psiFolder*/)\n\t{\n\t\treturn E_NOTIMPL;\n\t}\n\n\tHRESULT OnFolderChange()\n\t{\n\t\treturn E_NOTIMPL;\n\t}\n\n\tHRESULT OnSelectionChange()\n\t{\n\t\treturn E_NOTIMPL;\n\t}\n\n\tHRESULT OnShareViolation(IShellItem* /*psi*/, FDE_SHAREVIOLATION_RESPONSE* /*pResponse*/)\n\t{\n\t\treturn E_NOTIMPL;\n\t}\n\n\tHRESULT OnTypeChange()\n\t{\n\t\treturn E_NOTIMPL;\n\t}\n\n\tHRESULT OnOverwrite(IShellItem* /*psi*/, FDE_OVERWRITE_RESPONSE* /*pResponse*/)\n\t{\n\t\treturn E_NOTIMPL;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CShellFileOpenDialogImpl - implements new Shell File Open dialog\n\ntemplate <class T>\nclass ATL_NO_VTABLE CShellFileOpenDialogImpl : public CShellFileDialogImpl< T >\n{\npublic:\n\tATL::CComPtr<IFileOpenDialog> m_spFileDlg;\n\n\tCShellFileOpenDialogImpl(LPCWSTR lpszFileName = NULL, \n\t                         DWORD dwOptions = FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST, \n\t                         LPCWSTR lpszDefExt = NULL, \n\t                         const COMDLG_FILTERSPEC* arrFilterSpec = NULL, \n\t                         UINT uFilterSpecCount = 0U)\n\t{\n\t\tHRESULT hRet = m_spFileDlg.CoCreateInstance(CLSID_FileOpenDialog);\n\n\t\tif(SUCCEEDED(hRet))\n\t\t\tthis->_Init(lpszFileName, dwOptions, lpszDefExt, arrFilterSpec, uFilterSpecCount);\n\t}\n\n\tvirtual ~CShellFileOpenDialogImpl()\n\t{ }\n\n\tIFileOpenDialog* GetPtr()\n\t{\n\t\treturn m_spFileDlg;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CShellFileOpenDialog - new Shell File Open dialog without events\n\nclass CShellFileOpenDialog : public CShellFileOpenDialogImpl<CShellFileOpenDialog>\n{\npublic:\n\tCShellFileOpenDialog(LPCWSTR lpszFileName = NULL, \n\t                     DWORD dwOptions = FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST, \n\t                     LPCWSTR lpszDefExt = NULL, \n\t                     const COMDLG_FILTERSPEC* arrFilterSpec = NULL, \n\t                     UINT uFilterSpecCount = 0U) : CShellFileOpenDialogImpl<CShellFileOpenDialog>(lpszFileName, dwOptions, lpszDefExt, arrFilterSpec, uFilterSpecCount)\n\t{ }\n\n\tvirtual ~CShellFileOpenDialog()\n\t{ }\n\n// Implementation (remove _Advise/_Unadvise code using template magic)\n\tvoid _Advise(DWORD& /*dwCookie*/)\n\t{ }\n\n\tvoid _Unadvise(DWORD /*dwCookie*/)\n\t{ }\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CShellFileSaveDialogImpl - implements new Shell File Save dialog\n\ntemplate <class T>\nclass ATL_NO_VTABLE CShellFileSaveDialogImpl : public CShellFileDialogImpl< T >\n{\npublic:\n\tATL::CComPtr<IFileSaveDialog> m_spFileDlg;\n\n\tCShellFileSaveDialogImpl(LPCWSTR lpszFileName = NULL, \n\t                         DWORD dwOptions = FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | FOS_OVERWRITEPROMPT, \n\t                         LPCWSTR lpszDefExt = NULL, \n\t                         const COMDLG_FILTERSPEC* arrFilterSpec = NULL, \n\t                         UINT uFilterSpecCount = 0U)\n\t{\n\t\tHRESULT hRet = m_spFileDlg.CoCreateInstance(CLSID_FileSaveDialog);\n\n\t\tif(SUCCEEDED(hRet))\n\t\t\tthis->_Init(lpszFileName, dwOptions, lpszDefExt, arrFilterSpec, uFilterSpecCount);\n\t}\n\n\tvirtual ~CShellFileSaveDialogImpl()\n\t{ }\n\n\tIFileSaveDialog* GetPtr()\n\t{\n\t\treturn m_spFileDlg;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CShellFileSaveDialog - new Shell File Save dialog without events\n\nclass CShellFileSaveDialog : public CShellFileSaveDialogImpl<CShellFileSaveDialog>\n{\npublic:\n\tCShellFileSaveDialog(LPCWSTR lpszFileName = NULL, \n\t                     DWORD dwOptions = FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | FOS_OVERWRITEPROMPT, \n\t                     LPCWSTR lpszDefExt = NULL, \n\t                     const COMDLG_FILTERSPEC* arrFilterSpec = NULL, \n\t                     UINT uFilterSpecCount = 0U) : CShellFileSaveDialogImpl<CShellFileSaveDialog>(lpszFileName, dwOptions, lpszDefExt, arrFilterSpec, uFilterSpecCount)\n\t{ }\n\n\tvirtual ~CShellFileSaveDialog()\n\t{ }\n\n// Implementation (remove _Advise/_Unadvise code using template magic)\n\tvoid _Advise(DWORD& /*dwCookie*/)\n\t{ }\n\n\tvoid _Unadvise(DWORD /*dwCookie*/)\n\t{ }\n};\n\n#endif // (_WIN32_WINNT >= 0x0600)\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CFolderDialogImpl - used for browsing for a folder\n\ntemplate <class T>\nclass ATL_NO_VTABLE CFolderDialogImpl\n{\npublic:\n\tBROWSEINFO m_bi;\n\tLPCTSTR m_lpstrInitialFolder;\n\tLPCITEMIDLIST m_pidlInitialSelection;\n\tbool m_bExpandInitialSelection;\n\tTCHAR m_szFolderDisplayName[MAX_PATH];\n\tTCHAR m_szFolderPath[MAX_PATH];\n#ifdef STRICT_TYPED_ITEMIDS\n\tPIDLIST_ABSOLUTE m_pidlSelected;\n#else\n\tLPITEMIDLIST m_pidlSelected;\n#endif\n\tHWND m_hWnd;   // used only in the callback function\n\n// Constructor\n\tCFolderDialogImpl(HWND hWndParent = NULL, LPCTSTR lpstrTitle = NULL, UINT uFlags = BIF_RETURNONLYFSDIRS) : \n\t\t\tm_lpstrInitialFolder(NULL), m_pidlInitialSelection(NULL), m_bExpandInitialSelection(false), m_pidlSelected(NULL), m_hWnd(NULL)\n\t{\n\t\tmemset(&m_bi, 0, sizeof(m_bi)); // initialize structure to 0/NULL\n\n\t\tm_bi.hwndOwner = hWndParent;\n\t\tm_bi.pidlRoot = NULL;\n\t\tm_bi.pszDisplayName = m_szFolderDisplayName;\n\t\tm_bi.lpszTitle = lpstrTitle;\n\t\tm_bi.ulFlags = uFlags;\n\t\tm_bi.lpfn = BrowseCallbackProc;\n\t\tm_bi.lParam = (LPARAM)static_cast<T*>(this);\n\n\t\tm_szFolderPath[0] = 0;\n\t\tm_szFolderDisplayName[0] = 0;\n\t}\n\n\t~CFolderDialogImpl()\n\t{\n\t\t::CoTaskMemFree(m_pidlSelected);\n\t}\n\n// Operations\n\tINT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\n\t{\n\t\tif(m_bi.hwndOwner == NULL)   // set only if not specified before\n\t\t\tm_bi.hwndOwner = hWndParent;\n\n\t\t// Clear out any previous results\n\t\tm_szFolderPath[0] = 0;\n\t\tm_szFolderDisplayName[0] = 0;\n\t\t::CoTaskMemFree(m_pidlSelected);\n\n\t\tINT_PTR nRet = IDCANCEL;\n\t\tm_pidlSelected = ::SHBrowseForFolder(&m_bi);\n\n\t\tif(m_pidlSelected != NULL)\n\t\t{\n\t\t\tnRet = IDOK;\n\n\t\t\t// If BIF_RETURNONLYFSDIRS is set, we try to get the filesystem path.\n\t\t\t// Otherwise, the caller must handle the ID-list directly.\n\t\t\tif((m_bi.ulFlags & BIF_RETURNONLYFSDIRS) != 0)\n\t\t\t{\n\t\t\t\tif(::SHGetPathFromIDList(m_pidlSelected, m_szFolderPath) == FALSE)\n\t\t\t\t\tnRet = IDCANCEL;\n\t\t\t}\n\t\t}\n\n\t\treturn nRet;\n\t}\n\n\t// Methods to call before DoModal\n\tvoid SetInitialFolder(LPCTSTR lpstrInitialFolder, bool bExpand = true)\n\t{\n\t\t// lpstrInitialFolder may be a file if BIF_BROWSEINCLUDEFILES is specified\n\t\tm_lpstrInitialFolder = lpstrInitialFolder;\n\t\tm_bExpandInitialSelection = bExpand;\n\t}\n\n\tvoid SetInitialSelection(LPCITEMIDLIST pidl, bool bExpand = true)\n\t{\n\t\tm_pidlInitialSelection = pidl;\n\t\tm_bExpandInitialSelection = bExpand;\n\t}\n\n#ifdef STRICT_TYPED_ITEMIDS\n\tvoid SetRootFolder(PCIDLIST_ABSOLUTE pidl)\n#else\n\tvoid SetRootFolder(LPCITEMIDLIST pidl)\n#endif\n\t{\n\t\tm_bi.pidlRoot = pidl;\n\t}\n\n\t// Methods to call after DoModal\n\tLPITEMIDLIST GetSelectedItem(bool bDetach = false)\n\t{\n\t\tLPITEMIDLIST pidl = m_pidlSelected;\n\t\tif(bDetach)\n\t\t\tm_pidlSelected = NULL;\n\n\t\treturn pidl;\n\t}\n\n\tLPCTSTR GetFolderPath() const\n\t{\n\t\treturn m_szFolderPath;\n\t}\n\n\tLPCTSTR GetFolderDisplayName() const\n\t{\n\t\treturn m_szFolderDisplayName;\n\t}\n\n\tint GetFolderImageIndex() const\n\t{\n\t\treturn m_bi.iImage;\n\t}\n\n// Callback function and overrideables\n\tstatic int CALLBACK BrowseCallbackProc(HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM lpData)\n\t{\n\t\tint nRet = 0;\n\t\tT* pT = (T*)lpData;\n\t\tbool bClear = false;\n\t\tif(pT->m_hWnd == NULL)\n\t\t{\n\t\t\tpT->m_hWnd = hWnd;\n\t\t\tbClear = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tATLASSERT(pT->m_hWnd == hWnd);\n\t\t}\n\n\t\tswitch(uMsg)\n\t\t{\n\t\tcase BFFM_INITIALIZED:\n\t\t\t// Set initial selection\n\t\t\t// Note that m_pidlInitialSelection, if set, takes precedence over m_lpstrInitialFolder\n\t\t\tif(pT->m_pidlInitialSelection != NULL)\n\t\t\t\tpT->SetSelection(pT->m_pidlInitialSelection);\n\t\t\telse if(pT->m_lpstrInitialFolder != NULL)\n\t\t\t\tpT->SetSelection(pT->m_lpstrInitialFolder);\n\n\t\t\t// Expand initial selection if appropriate\n\t\t\tif(pT->m_bExpandInitialSelection && ((pT->m_bi.ulFlags & BIF_NEWDIALOGSTYLE) != 0))\n\t\t\t{\n\t\t\t\tif(pT->m_pidlInitialSelection != NULL)\n\t\t\t\t\tpT->SetExpanded(pT->m_pidlInitialSelection);\n\t\t\t\telse if(pT->m_lpstrInitialFolder != NULL)\n\t\t\t\t\tpT->SetExpanded(pT->m_lpstrInitialFolder);\n\t\t\t}\n\t\t\tpT->OnInitialized();\n\t\t\tbreak;\n\t\tcase BFFM_SELCHANGED:\n\t\t\tpT->OnSelChanged((LPITEMIDLIST)lParam);\n\t\t\tbreak;\n\t\tcase BFFM_VALIDATEFAILED:\n\t\t\tnRet = pT->OnValidateFailed((LPCTSTR)lParam);\n\t\t\tbreak;\n\t\tcase BFFM_IUNKNOWN:\n\t\t\tpT->OnIUnknown((IUnknown*)lParam);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"Unknown message received in CFolderDialogImpl::BrowseCallbackProc\\n\"));\n\t\t\tbreak;\n\t\t}\n\n\t\tif(bClear)\n\t\t\tpT->m_hWnd = NULL;\n\t\treturn nRet;\n\t}\n\n\tvoid OnInitialized()\n\t{\n\t}\n\n\tvoid OnSelChanged(LPITEMIDLIST /*pItemIDList*/)\n\t{\n\t}\n\n\tint OnValidateFailed(LPCTSTR /*lpstrFolderPath*/)\n\t{\n\t\treturn 1;   // 1=continue, 0=EndDialog\n\t}\n\n\tvoid OnIUnknown(IUnknown* /*pUnknown*/)\n\t{\n\t}\n\n\t// Commands - valid to call only from handlers\n\tvoid EnableOK(BOOL bEnable)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, BFFM_ENABLEOK, 0, bEnable);\n\t}\n\n\tvoid SetSelection(LPCITEMIDLIST pItemIDList)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, BFFM_SETSELECTION, FALSE, (LPARAM)pItemIDList);\n\t}\n\n\tvoid SetSelection(LPCTSTR lpstrFolderPath)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, BFFM_SETSELECTION, TRUE, (LPARAM)lpstrFolderPath);\n\t}\n\n\tvoid SetStatusText(LPCTSTR lpstrText)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, BFFM_SETSTATUSTEXT, 0, (LPARAM)lpstrText);\n\t}\n\n\tvoid SetOKText(LPCTSTR lpstrOKText)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\tUSES_CONVERSION;\n\t\tLPCWSTR lpstr = T2CW(lpstrOKText);\n\t\t::SendMessage(m_hWnd, BFFM_SETOKTEXT, 0, (LPARAM)lpstr);\n\t}\n\n\tvoid SetExpanded(LPCITEMIDLIST pItemIDList)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, BFFM_SETEXPANDED, FALSE, (LPARAM)pItemIDList);\n\t}\n\n\tvoid SetExpanded(LPCTSTR lpstrFolderPath)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\tUSES_CONVERSION;\n\t\tLPCWSTR lpstr = T2CW(lpstrFolderPath);\n\t\t::SendMessage(m_hWnd, BFFM_SETEXPANDED, TRUE, (LPARAM)lpstr);\n\t}\n};\n\nclass CFolderDialog : public CFolderDialogImpl<CFolderDialog>\n{\npublic:\n\tCFolderDialog(HWND hWndParent = NULL, LPCTSTR lpstrTitle = NULL, UINT uFlags = BIF_RETURNONLYFSDIRS)\n\t\t: CFolderDialogImpl<CFolderDialog>(hWndParent, lpstrTitle, uFlags)\n\t{ }\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CCommonDialogImplBase - base class for common dialog classes\n\nclass ATL_NO_VTABLE CCommonDialogImplBase : public ATL::CWindowImplBase\n{\npublic:\n\tstatic UINT_PTR APIENTRY HookProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\n\t{\n\t\tif(uMsg != WM_INITDIALOG)\n\t\t\treturn 0;\n\t\tCCommonDialogImplBase* pT = (CCommonDialogImplBase*)ModuleHelper::ExtractCreateWndData();\n\t\tATLASSERT(pT != NULL);\n\t\tATLASSERT(pT->m_hWnd == NULL);\n\t\tATLASSERT(::IsWindow(hWnd));\n\t\t// subclass dialog's window\n\t\tif(!pT->SubclassWindow(hWnd))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"Subclassing a common dialog failed\\n\"));\n\t\t\treturn 0;\n\t\t}\n\t\t// check message map for WM_INITDIALOG handler\n\t\tLRESULT lRes = 0;\n\t\tif(pT->ProcessWindowMessage(pT->m_hWnd, uMsg, wParam, lParam, lRes, 0) == FALSE)\n\t\t\treturn 0;\n\t\treturn lRes;\n\t}\n\n// Special override for common dialogs\n\tBOOL EndDialog(INT_PTR /*nRetCode*/ = 0)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tSendMessage(WM_COMMAND, MAKEWPARAM(IDABORT, 0));\n\t\treturn TRUE;\n\t}\n\n// Implementation - try to override these, to prevent errors\n\tHWND Create(HWND, ATL::_U_RECT, LPCTSTR, DWORD, DWORD, ATL::_U_MENUorID, ATOM, LPVOID)\n\t{\n\t\tATLASSERT(FALSE);   // should not be called\n\t\treturn NULL;\n\t}\n\n\tstatic LRESULT CALLBACK StartWindowProc(HWND /*hWnd*/, UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/)\n\t{\n\t\tATLASSERT(FALSE);   // should not be called\n\t\treturn 0;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CFontDialogImpl - font selection dialog\n\ntemplate <class T>\nclass ATL_NO_VTABLE CFontDialogImpl : public CCommonDialogImplBase\n{\npublic:\n\tenum { _cchStyleName = 64 };\n\n\tCHOOSEFONT m_cf;\n\tTCHAR m_szStyleName[_cchStyleName];  // contains style name after return\n\tLOGFONT m_lf;                        // default LOGFONT to store the info\n\n// Constructors\n\tCFontDialogImpl(LPLOGFONT lplfInitial = NULL,\n\t\t\tDWORD dwFlags = CF_EFFECTS | CF_SCREENFONTS,\n\t\t\tHDC hDCPrinter = NULL,\n\t\t\tHWND hWndParent = NULL)\n\t{\n\t\tmemset(&m_cf, 0, sizeof(m_cf));\n\t\tmemset(&m_lf, 0, sizeof(m_lf));\n\t\tmemset(&m_szStyleName, 0, sizeof(m_szStyleName));\n\n\t\tm_cf.lStructSize = sizeof(m_cf);\n\t\tm_cf.hwndOwner = hWndParent;\n\t\tm_cf.rgbColors = RGB(0, 0, 0);\n\t\tm_cf.lpszStyle = (LPTSTR)&m_szStyleName;\n\t\tm_cf.Flags = dwFlags | CF_ENABLEHOOK;\n\t\tm_cf.lpfnHook = (LPCFHOOKPROC)T::HookProc;\n\n\t\tif(lplfInitial != NULL)\n\t\t{\n\t\t\tm_cf.lpLogFont = lplfInitial;\n\t\t\tm_cf.Flags |= CF_INITTOLOGFONTSTRUCT;\n\t\t\tm_lf = *lplfInitial;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_cf.lpLogFont = &m_lf;\n\t\t}\n\n\t\tif(hDCPrinter != NULL)\n\t\t{\n\t\t\tm_cf.hDC = hDCPrinter;\n\t\t\tm_cf.Flags |= CF_PRINTERFONTS;\n\t\t}\n\t}\n\n// Operations\n\tINT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\n\t{\n\t\tATLASSERT((m_cf.Flags & CF_ENABLEHOOK) != 0);\n\t\tATLASSERT(m_cf.lpfnHook != NULL);   // can still be a user hook\n\n\t\tif(m_cf.hwndOwner == NULL)          // set only if not specified before\n\t\t\tm_cf.hwndOwner = hWndParent;\n\n\t\tATLASSERT(m_hWnd == NULL);\n\n\t\t// Allocate the thunk structure here, where we can fail gracefully.\n\t\tBOOL bRetTh = m_thunk.Init(NULL, NULL);\n\t\tif(bRetTh == FALSE)\n\t\t{\n\t\t\t::SetLastError(ERROR_OUTOFMEMORY);\n\t\t\treturn -1;\n\t\t}\n\n\t\tModuleHelper::AddCreateWndData(&m_thunk.cd, (CCommonDialogImplBase*)this);\n\n\t\tBOOL bRet = ::ChooseFont(&m_cf);\n\n\t\tm_hWnd = NULL;\n\n\t\tif(bRet)   // copy logical font from user's initialization buffer (if needed)\n\t\t\tATL::Checked::memcpy_s(&m_lf, sizeof(m_lf), m_cf.lpLogFont, sizeof(m_lf));\n\n\t\treturn bRet ? IDOK : IDCANCEL;\n\t}\n\n\t// works only when the dialog is dislayed or after\n\tvoid GetCurrentFont(LPLOGFONT lplf) const\n\t{\n\t\tATLASSERT(lplf != NULL);\n\n\t\tif(m_hWnd != NULL)\n\t\t\t::SendMessage(m_hWnd, WM_CHOOSEFONT_GETLOGFONT, 0, (LPARAM)lplf);\n\t\telse\n\t\t\t*lplf = m_lf;\n\t}\n\n\t// works only when the dialog is dislayed or before\n\tvoid SetLogFont(LPLOGFONT lplf)\n\t{\n\t\tATLASSERT(lplf != NULL);\n\n\t\tif(m_hWnd != NULL)\n\t\t{\n\t\t\t::SendMessage(m_hWnd, WM_CHOOSEFONT_SETLOGFONT, 0, (LPARAM)lplf);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_lf = *lplf;\n\t\t\tm_cf.Flags |= CF_INITTOLOGFONTSTRUCT;\n\t\t}\n\t}\n\n\tvoid SetFlags(DWORD dwFlags)\n\t{\n\t\tif(m_hWnd != NULL)\n\t\t{\n\t\t\tCHOOSEFONT cf = { sizeof(CHOOSEFONT) };\n\t\t\tcf.Flags = dwFlags;\n\t\t\t::SendMessage(m_hWnd, WM_CHOOSEFONT_SETFLAGS, 0, (LPARAM)&cf);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_cf.Flags = dwFlags;\n\t\t}\n\t}\n\n\t// Helpers for parsing information after successful return\n\tLPCTSTR GetFaceName() const   // return the face name of the font\n\t{\n\t\treturn (LPCTSTR)m_cf.lpLogFont->lfFaceName;\n\t}\n\n\tLPCTSTR GetStyleName() const  // return the style name of the font\n\t{\n\t\treturn m_cf.lpszStyle;\n\t}\n\n\tint GetSize() const           // return the pt size of the font\n\t{\n\t\treturn m_cf.iPointSize;\n\t}\n\n\tCOLORREF GetColor() const     // return the color of the font\n\t{\n\t\treturn m_cf.rgbColors;\n\t}\n\n\tint GetWeight() const         // return the chosen font weight\n\t{\n\t\treturn (int)m_cf.lpLogFont->lfWeight;\n\t}\n\n\tBOOL IsStrikeOut() const      // return TRUE if strikeout\n\t{\n\t\treturn (m_cf.lpLogFont->lfStrikeOut) ? TRUE : FALSE;\n\t}\n\n\tBOOL IsUnderline() const      // return TRUE if underline\n\t{\n\t\treturn (m_cf.lpLogFont->lfUnderline) ? TRUE : FALSE;\n\t}\n\n\tBOOL IsBold() const           // return TRUE if bold font\n\t{\n\t\treturn (m_cf.lpLogFont->lfWeight == FW_BOLD) ? TRUE : FALSE;\n\t}\n\n\tBOOL IsItalic() const         // return TRUE if italic font\n\t{\n\t\treturn m_cf.lpLogFont->lfItalic ? TRUE : FALSE;\n\t}\n};\n\nclass CFontDialog : public CFontDialogImpl<CFontDialog>\n{\npublic:\n\tCFontDialog(LPLOGFONT lplfInitial = NULL,\n\t\tDWORD dwFlags = CF_EFFECTS | CF_SCREENFONTS,\n\t\tHDC hDCPrinter = NULL,\n\t\tHWND hWndParent = NULL)\n\t\t: CFontDialogImpl<CFontDialog>(lplfInitial, dwFlags, hDCPrinter, hWndParent)\n\t{ }\n\n\tDECLARE_EMPTY_MSG_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CRichEditFontDialogImpl - font selection for the Rich Edit ctrl\n\n#ifdef _RICHEDIT_\n\ntemplate <class T>\nclass ATL_NO_VTABLE CRichEditFontDialogImpl : public CFontDialogImpl< T >\n{\npublic:\n\tCRichEditFontDialogImpl(const CHARFORMAT& charformat,\n\t\t\tDWORD dwFlags = CF_SCREENFONTS,\n\t\t\tHDC hDCPrinter = NULL,\n\t\t\tHWND hWndParent = NULL)\n\t\t\t: CFontDialogImpl< T >(NULL, dwFlags, hDCPrinter, hWndParent)\n\t{\n\t\tthis->m_cf.Flags |= CF_INITTOLOGFONTSTRUCT;\n\t\tthis->m_cf.Flags |= FillInLogFont(charformat);\n\t\tthis->m_cf.lpLogFont = &this->m_lf;\n\n\t\tif((charformat.dwMask & CFM_COLOR) != 0)\n\t\t\tthis->m_cf.rgbColors = charformat.crTextColor;\n\t}\n\n\tvoid GetCharFormat(CHARFORMAT& cf) const\n\t{\n\t\tUSES_CONVERSION;\n\t\tcf.dwEffects = 0;\n\t\tcf.dwMask = 0;\n\t\tif((this->m_cf.Flags & CF_NOSTYLESEL) == 0)\n\t\t{\n\t\t\tcf.dwMask |= CFM_BOLD | CFM_ITALIC;\n\t\t\tcf.dwEffects |= this->IsBold() ? CFE_BOLD : 0;\n\t\t\tcf.dwEffects |= this->IsItalic() ? CFE_ITALIC : 0;\n\t\t}\n\t\tif((this->m_cf.Flags & CF_NOSIZESEL) == 0)\n\t\t{\n\t\t\tcf.dwMask |= CFM_SIZE;\n\t\t\t// GetSize() returns in tenths of points so mulitply by 2 to get twips\n\t\t\tcf.yHeight = this->GetSize() * 2;\n\t\t}\n\n\t\tif((this->m_cf.Flags & CF_NOFACESEL) == 0)\n\t\t{\n\t\t\tcf.dwMask |= CFM_FACE;\n\t\t\tcf.bPitchAndFamily = this->m_cf.lpLogFont->lfPitchAndFamily;\n\t\t\tATL::Checked::tcscpy_s(cf.szFaceName, _countof(cf.szFaceName), this->GetFaceName());\n\t\t}\n\n\t\tif((this->m_cf.Flags & CF_EFFECTS) != 0)\n\t\t{\n\t\t\tcf.dwMask |= CFM_UNDERLINE | CFM_STRIKEOUT | CFM_COLOR;\n\t\t\tcf.dwEffects |= this->IsUnderline() ? CFE_UNDERLINE : 0;\n\t\t\tcf.dwEffects |= this->IsStrikeOut() ? CFE_STRIKEOUT : 0;\n\t\t\tcf.crTextColor = this->GetColor();\n\t\t}\n\t\tif((this->m_cf.Flags & CF_NOSCRIPTSEL) == 0)\n\t\t{\n\t\t\tcf.bCharSet = this->m_cf.lpLogFont->lfCharSet;\n\t\t\tcf.dwMask |= CFM_CHARSET;\n\t\t}\n\t\tcf.yOffset = 0;\n\t}\n\n\tDWORD FillInLogFont(const CHARFORMAT& cf)\n\t{\n\t\tUSES_CONVERSION;\n\t\tDWORD dwFlags = 0;\n\t\tif((cf.dwMask & CFM_SIZE) != 0)\n\t\t{\n\t\t\tHDC hDC = ::CreateDC(_T(\"DISPLAY\"), NULL, NULL, NULL);\n\t\t\tLONG yPerInch = ::GetDeviceCaps(hDC, LOGPIXELSY);\n\t\t\tthis->m_lf.lfHeight = -(int)((cf.yHeight * yPerInch) / 1440);\n\t\t}\n\t\telse\n\t\t\tthis->m_lf.lfHeight = 0;\n\n\t\tthis->m_lf.lfWidth = 0;\n\t\tthis->m_lf.lfEscapement = 0;\n\t\tthis->m_lf.lfOrientation = 0;\n\n\t\tif((cf.dwMask & (CFM_ITALIC | CFM_BOLD)) == (CFM_ITALIC | CFM_BOLD))\n\t\t{\n\t\t\tthis->m_lf.lfWeight = ((cf.dwEffects & CFE_BOLD) != 0) ? FW_BOLD : FW_NORMAL;\n\t\t\tthis->m_lf.lfItalic = (BYTE)(((cf.dwEffects & CFE_ITALIC) != 0) ? TRUE : FALSE);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdwFlags |= CF_NOSTYLESEL;\n\t\t\tthis->m_lf.lfWeight = FW_DONTCARE;\n\t\t\tthis->m_lf.lfItalic = FALSE;\n\t\t}\n\n\t\tif((cf.dwMask & (CFM_UNDERLINE | CFM_STRIKEOUT | CFM_COLOR)) == (CFM_UNDERLINE|CFM_STRIKEOUT|CFM_COLOR))\n\t\t{\n\t\t\tdwFlags |= CF_EFFECTS;\n\t\t\tthis->m_lf.lfUnderline = (BYTE)(((cf.dwEffects & CFE_UNDERLINE) != 0) ? TRUE : FALSE);\n\t\t\tthis->m_lf.lfStrikeOut = (BYTE)(((cf.dwEffects & CFE_STRIKEOUT) != 0) ? TRUE : FALSE);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis->m_lf.lfUnderline = (BYTE)FALSE;\n\t\t\tthis->m_lf.lfStrikeOut = (BYTE)FALSE;\n\t\t}\n\n\t\tif((cf.dwMask & CFM_CHARSET) != 0)\n\t\t\tthis->m_lf.lfCharSet = cf.bCharSet;\n\t\telse\n\t\t\tdwFlags |= CF_NOSCRIPTSEL;\n\t\tthis->m_lf.lfOutPrecision = OUT_DEFAULT_PRECIS;\n\t\tthis->m_lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;\n\t\tthis->m_lf.lfQuality = DEFAULT_QUALITY;\n\t\tif((cf.dwMask & CFM_FACE) != 0)\n\t\t{\n\t\t\tthis->m_lf.lfPitchAndFamily = cf.bPitchAndFamily;\n\t\t\tATL::Checked::tcscpy_s(this->m_lf.lfFaceName, _countof(this->m_lf.lfFaceName), cf.szFaceName);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis->m_lf.lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE;\n\t\t\tthis->m_lf.lfFaceName[0] = (TCHAR)0;\n\t\t}\n\t\treturn dwFlags;\n\t}\n};\n\nclass CRichEditFontDialog : public CRichEditFontDialogImpl<CRichEditFontDialog>\n{\npublic:\n\tCRichEditFontDialog(const CHARFORMAT& charformat,\n\t\tDWORD dwFlags = CF_SCREENFONTS,\n\t\tHDC hDCPrinter = NULL,\n\t\tHWND hWndParent = NULL)\n\t\t: CRichEditFontDialogImpl<CRichEditFontDialog>(charformat, dwFlags, hDCPrinter, hWndParent)\n\t{ }\n\n\tDECLARE_EMPTY_MSG_MAP()\n};\n\n#endif // _RICHEDIT_\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CColorDialogImpl - color selection\n\ntemplate <class T>\nclass ATL_NO_VTABLE CColorDialogImpl : public CCommonDialogImplBase\n{\npublic:\n\tCHOOSECOLOR m_cc;\n\n// Constructor\n\tCColorDialogImpl(COLORREF clrInit = 0, DWORD dwFlags = 0, HWND hWndParent = NULL)\n\t{\n\t\tmemset(&m_cc, 0, sizeof(m_cc));\n\n\t\tm_cc.lStructSize = sizeof(m_cc);\n\t\tm_cc.lpCustColors = GetCustomColors();\n\t\tm_cc.hwndOwner = hWndParent;\n\t\tm_cc.Flags = dwFlags | CC_ENABLEHOOK;\n\t\tm_cc.lpfnHook = (LPCCHOOKPROC)T::HookProc;\n\n\t\tif(clrInit != 0)\n\t\t{\n\t\t\tm_cc.rgbResult = clrInit;\n\t\t\tm_cc.Flags |= CC_RGBINIT;\n\t\t}\n\t}\n\n// Operations\n\tINT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\n\t{\n\t\tATLASSERT((m_cc.Flags & CC_ENABLEHOOK) != 0);\n\t\tATLASSERT(m_cc.lpfnHook != NULL);   // can still be a user hook\n\n\t\tif(m_cc.hwndOwner == NULL)          // set only if not specified before\n\t\t\tm_cc.hwndOwner = hWndParent;\n\n\t\tATLASSERT(m_hWnd == NULL);\n\n\t\t// Allocate the thunk structure here, where we can fail gracefully.\n\t\tBOOL bRetTh = m_thunk.Init(NULL, NULL);\n\t\tif(bRetTh == FALSE)\n\t\t{\n\t\t\t::SetLastError(ERROR_OUTOFMEMORY);\n\t\t\treturn -1;\n\t\t}\n\n\t\tModuleHelper::AddCreateWndData(&m_thunk.cd, (CCommonDialogImplBase*)this);\n\n\t\tBOOL bRet = ::ChooseColor(&m_cc);\n\n\t\tm_hWnd = NULL;\n\n\t\treturn bRet ? IDOK : IDCANCEL;\n\t}\n\n\t// Set the current color while dialog is displayed\n\tvoid SetCurrentColor(COLORREF clr)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tSendMessage(_GetSetRGBMessage(), 0, (LPARAM)clr);\n\t}\n\n\t// Get the selected color after DoModal returns, or in OnColorOK\n\tCOLORREF GetColor() const\n\t{\n\t\treturn m_cc.rgbResult;\n\t}\n\n// Special override for the color dialog\n\tstatic UINT_PTR APIENTRY HookProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\n\t{\n\t\tif((uMsg != WM_INITDIALOG) && (uMsg != _GetColorOKMessage()))\n\t\t\treturn 0;\n\n\t\tLPCHOOSECOLOR lpCC = (LPCHOOSECOLOR)lParam;\n\t\tCCommonDialogImplBase* pT = NULL;\n\n\t\tif(uMsg == WM_INITDIALOG)\n\t\t{\n\t\t\tpT = (CCommonDialogImplBase*)ModuleHelper::ExtractCreateWndData();\n\t\t\tlpCC->lCustData = (LPARAM)pT;\n\t\t\tATLASSERT(pT != NULL);\n\t\t\tATLASSERT(pT->m_hWnd == NULL);\n\t\t\tATLASSERT(::IsWindow(hWnd));\n\t\t\t// subclass dialog's window\n\t\t\tif(!pT->SubclassWindow(hWnd))\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"Subclassing a Color common dialog failed\\n\"));\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\telse if(uMsg == _GetColorOKMessage())\n\t\t{\n\t\t\tpT = (CCommonDialogImplBase*)lpCC->lCustData;\n\t\t\tATLASSERT(pT != NULL);\n\t\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn 0;\n\t\t}\n\n\t\t// pass to the message map\n\t\tLRESULT lRes = 0;\n\t\tif(pT->ProcessWindowMessage(pT->m_hWnd, uMsg, wParam, lParam, lRes, 0) == FALSE)\n\t\t\treturn 0;\n\n\t\treturn lRes;\n\t}\n\n// Helpers\n\tstatic COLORREF* GetCustomColors()\n\t{\n\t\tstatic COLORREF rgbCustomColors[16] =\n\t\t{\n\t\t\tRGB(255, 255, 255), RGB(255, 255, 255), \n\t\t\tRGB(255, 255, 255), RGB(255, 255, 255), \n\t\t\tRGB(255, 255, 255), RGB(255, 255, 255), \n\t\t\tRGB(255, 255, 255), RGB(255, 255, 255), \n\t\t\tRGB(255, 255, 255), RGB(255, 255, 255), \n\t\t\tRGB(255, 255, 255), RGB(255, 255, 255), \n\t\t\tRGB(255, 255, 255), RGB(255, 255, 255), \n\t\t\tRGB(255, 255, 255), RGB(255, 255, 255), \n\t\t};\n\n\t\treturn rgbCustomColors;\n\t}\n\n\tstatic UINT _GetSetRGBMessage()\n\t{\n\t\tstatic UINT uSetRGBMessage = 0;\n\t\tif(uSetRGBMessage == 0)\n\t\t{\n\t\t\tCStaticDataInitCriticalSectionLock lock;\n\t\t\tif(FAILED(lock.Lock()))\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CColorDialogImpl::_GetSetRGBMessage.\\n\"));\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif(uSetRGBMessage == 0)\n\t\t\t\tuSetRGBMessage = ::RegisterWindowMessage(SETRGBSTRING);\n\n\t\t\tlock.Unlock();\n\t\t}\n\t\tATLASSERT(uSetRGBMessage != 0);\n\t\treturn uSetRGBMessage;\n\t}\n\n\tstatic UINT _GetColorOKMessage()\n\t{\n\t\tstatic UINT uColorOKMessage = 0;\n\t\tif(uColorOKMessage == 0)\n\t\t{\n\t\t\tCStaticDataInitCriticalSectionLock lock;\n\t\t\tif(FAILED(lock.Lock()))\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CColorDialogImpl::_GetColorOKMessage.\\n\"));\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif(uColorOKMessage == 0)\n\t\t\t\tuColorOKMessage = ::RegisterWindowMessage(COLOROKSTRING);\n\n\t\t\tlock.Unlock();\n\t\t}\n\t\tATLASSERT(uColorOKMessage != 0);\n\t\treturn uColorOKMessage;\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CColorDialogImpl)\n\t\tMESSAGE_HANDLER(_GetColorOKMessage(), _OnColorOK)\n\tEND_MSG_MAP()\n\n\tLRESULT _OnColorOK(UINT, WPARAM, LPARAM, BOOL&)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\treturn pT->OnColorOK();\n\t}\n\n// Overrideable\n\tBOOL OnColorOK()        // validate color\n\t{\n\t\treturn FALSE;\n\t}\n};\n\nclass CColorDialog : public CColorDialogImpl<CColorDialog>\n{\npublic:\n\tCColorDialog(COLORREF clrInit = 0, DWORD dwFlags = 0, HWND hWndParent = NULL)\n\t\t: CColorDialogImpl<CColorDialog>(clrInit, dwFlags, hWndParent)\n\t{ }\n\n\t// override base class map and references to handlers\n\tDECLARE_EMPTY_MSG_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CPrintDialogImpl - used for Print... and PrintSetup...\n\n// global helper\nstatic inline HDC _AtlCreateDC(HGLOBAL hDevNames, HGLOBAL hDevMode)\n{\n\tif(hDevNames == NULL)\n\t\treturn NULL;\n\n\tLPDEVNAMES lpDevNames = (LPDEVNAMES)::GlobalLock(hDevNames);\n\tLPDEVMODE  lpDevMode = (hDevMode != NULL) ? (LPDEVMODE)::GlobalLock(hDevMode) : NULL;\n\n\tif(lpDevNames == NULL)\n\t\treturn NULL;\n\n\tHDC hDC = ::CreateDC((LPCTSTR)lpDevNames + lpDevNames->wDriverOffset,\n\t\t\t\t\t  (LPCTSTR)lpDevNames + lpDevNames->wDeviceOffset,\n\t\t\t\t\t  (LPCTSTR)lpDevNames + lpDevNames->wOutputOffset,\n\t\t\t\t\t  lpDevMode);\n\n\t::GlobalUnlock(hDevNames);\n\tif(hDevMode != NULL)\n\t\t::GlobalUnlock(hDevMode);\n\treturn hDC;\n}\n\n#pragma warning(push)\n#pragma warning(disable: 4512)   // assignment operator could not be generated\n\ntemplate <class T>\nclass ATL_NO_VTABLE CPrintDialogImpl : public CCommonDialogImplBase\n{\npublic:\n\t// print dialog parameter block (note this is a reference)\n\tPRINTDLG& m_pd;\n\n// Constructors\n\tCPrintDialogImpl(BOOL bPrintSetupOnly = FALSE,\t// TRUE for Print Setup, FALSE for Print Dialog\n\t\t\tDWORD dwFlags = PD_ALLPAGES | PD_USEDEVMODECOPIES | PD_NOPAGENUMS | PD_NOSELECTION,\n\t\t\tHWND hWndParent = NULL)\n\t\t\t: m_pd(m_pdActual)\n\t{\n\t\tmemset(&m_pdActual, 0, sizeof(m_pdActual));\n\n\t\tm_pd.lStructSize = sizeof(m_pdActual);\n\t\tm_pd.hwndOwner = hWndParent;\n\t\tm_pd.Flags = (dwFlags | PD_ENABLEPRINTHOOK | PD_ENABLESETUPHOOK);\n\t\tm_pd.lpfnPrintHook = (LPPRINTHOOKPROC)T::HookProc;\n\t\tm_pd.lpfnSetupHook = (LPSETUPHOOKPROC)T::HookProc;\n\n\t\tif(bPrintSetupOnly)\n\t\t\tm_pd.Flags |= PD_PRINTSETUP;\n\t\telse\n\t\t\tm_pd.Flags |= PD_RETURNDC;\n\n\t\tm_pd.Flags &= ~PD_RETURNIC; // do not support information context\n\t}\n\n// Operations\n\tINT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\n\t{\n\t\tATLASSERT((m_pd.Flags & PD_ENABLEPRINTHOOK) != 0);\n\t\tATLASSERT((m_pd.Flags & PD_ENABLESETUPHOOK) != 0);\n\t\tATLASSERT(m_pd.lpfnPrintHook != NULL);   // can still be a user hook\n\t\tATLASSERT(m_pd.lpfnSetupHook != NULL);   // can still be a user hook\n\t\tATLASSERT((m_pd.Flags & PD_RETURNDEFAULT) == 0);   // use GetDefaults for this\n\n\t\tif(m_pd.hwndOwner == NULL)   // set only if not specified before\n\t\t\tm_pd.hwndOwner = hWndParent;\n\n\t\tATLASSERT(m_hWnd == NULL);\n\n\t\t// Allocate the thunk structure here, where we can fail gracefully.\n\t\tBOOL bRetTh = m_thunk.Init(NULL, NULL);\n\t\tif(bRetTh == FALSE)\n\t\t{\n\t\t\t::SetLastError(ERROR_OUTOFMEMORY);\n\t\t\treturn -1;\n\t\t}\n\n\t\tModuleHelper::AddCreateWndData(&m_thunk.cd, (CCommonDialogImplBase*)this);\n\n\t\tBOOL bRet = ::PrintDlg(&m_pd);\n\n\t\tm_hWnd = NULL;\n\n\t\treturn bRet ? IDOK : IDCANCEL;\n\t}\n\n\t// GetDefaults will not display a dialog but will get device defaults\n\tBOOL GetDefaults()\n\t{\n\t\tm_pd.Flags |= PD_RETURNDEFAULT;\n\t\tATLASSERT(m_pd.hDevMode == NULL);    // must be NULL\n\t\tATLASSERT(m_pd.hDevNames == NULL);   // must be NULL\n\n\t\treturn ::PrintDlg(&m_pd);\n\t}\n\n\t// Helpers for parsing information after successful return num. copies requested\n\tint GetCopies() const\n\t{\n\t\tif((m_pd.Flags & PD_USEDEVMODECOPIES) != 0)\n\t\t{\n\t\t\tLPDEVMODE lpDevMode = GetDevMode();\n\t\t\treturn (lpDevMode != NULL) ? lpDevMode->dmCopies : -1;\n\t\t}\n\n\t\treturn m_pd.nCopies;\n\t}\n\n\tBOOL PrintCollate() const       // TRUE if collate checked\n\t{\n\t\treturn ((m_pd.Flags & PD_COLLATE) != 0) ? TRUE : FALSE;\n\t}\n\n\tBOOL PrintSelection() const     // TRUE if printing selection\n\t{\n\t\treturn ((m_pd.Flags & PD_SELECTION) != 0) ? TRUE : FALSE;\n\t}\n\n\tBOOL PrintAll() const           // TRUE if printing all pages\n\t{\n\t\treturn (!PrintRange() && !PrintSelection()) ? TRUE : FALSE;\n\t}\n\n\tBOOL PrintRange() const         // TRUE if printing page range\n\t{\n\t\treturn ((m_pd.Flags & PD_PAGENUMS) != 0) ? TRUE : FALSE;\n\t}\n\n\tBOOL PrintToFile() const        // TRUE if printing to a file\n\t{\n\t\treturn ((m_pd.Flags & PD_PRINTTOFILE) != 0) ? TRUE : FALSE;\n\t}\n\n\tint GetFromPage() const         // starting page if valid\n\t{\n\t\treturn PrintRange() ? m_pd.nFromPage : -1;\n\t}\n\n\tint GetToPage() const           // ending page if valid\n\t{\n\t\treturn PrintRange() ? m_pd.nToPage : -1;\n\t}\n\n\tLPDEVMODE GetDevMode() const    // return DEVMODE\n\t{\n\t\tif(m_pd.hDevMode == NULL)\n\t\t\treturn NULL;\n\n\t\treturn (LPDEVMODE)::GlobalLock(m_pd.hDevMode);\n\t}\n\n\tLPCTSTR GetDriverName() const   // return driver name\n\t{\n\t\tif(m_pd.hDevNames == NULL)\n\t\t\treturn NULL;\n\n\t\tLPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_pd.hDevNames);\n\t\tif(lpDev == NULL)\n\t\t\treturn NULL;\n\n\t\treturn (LPCTSTR)lpDev + lpDev->wDriverOffset;\n\t}\n\n\tLPCTSTR GetDeviceName() const   // return device name\n\t{\n\t\tif(m_pd.hDevNames == NULL)\n\t\t\treturn NULL;\n\n\t\tLPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_pd.hDevNames);\n\t\tif(lpDev == NULL)\n\t\t\treturn NULL;\n\n\t\treturn (LPCTSTR)lpDev + lpDev->wDeviceOffset;\n\t}\n\n\tLPCTSTR GetPortName() const     // return output port name\n\t{\n\t\tif(m_pd.hDevNames == NULL)\n\t\t\treturn NULL;\n\n\t\tLPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_pd.hDevNames);\n\t\tif(lpDev == NULL)\n\t\t\treturn NULL;\n\n\t\treturn (LPCTSTR)lpDev + lpDev->wOutputOffset;\n\t}\n\n\tHDC GetPrinterDC() const        // return HDC (caller must delete)\n\t{\n\t\tATLASSERT((m_pd.Flags & PD_RETURNDC) != 0);\n\t\treturn m_pd.hDC;\n\t}\n\n\t// This helper creates a DC based on the DEVNAMES and DEVMODE structures.\n\t// This DC is returned, but also stored in m_pd.hDC as though it had been\n\t// returned by CommDlg.  It is assumed that any previously obtained DC\n\t// has been/will be deleted by the user.  This may be\n\t// used without ever invoking the print/print setup dialogs.\n\tHDC CreatePrinterDC()\n\t{\n\t\tm_pd.hDC = _AtlCreateDC(m_pd.hDevNames, m_pd.hDevMode);\n\t\treturn m_pd.hDC;\n\t}\n\n// Implementation\n\tPRINTDLG m_pdActual; // the Print/Print Setup need to share this\n\n\t// The following handle the case of print setup... from the print dialog\n\tCPrintDialogImpl(PRINTDLG& pdInit) : m_pd(pdInit)\n\t{\n\t\tmemset(&m_pdActual, 0, sizeof(m_pdActual));\n\t}\n\n\tBEGIN_MSG_MAP(CPrintDialogImpl)\n#ifdef psh1\n\t\tCOMMAND_ID_HANDLER(psh1, OnPrintSetup) // print setup button when print is displayed\n#else // !psh1\n\t\tCOMMAND_ID_HANDLER(0x0400, OnPrintSetup) // value from dlgs.h\n#endif // !psh1\n\tEND_MSG_MAP()\n\n\tLRESULT OnPrintSetup(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& /*bHandled*/)\n\t{\n\t\tT dlgSetup(m_pd);\n\t\tModuleHelper::AddCreateWndData(&dlgSetup.m_thunk.cd, (CCommonDialogImplBase*)&dlgSetup);\n\t\treturn DefWindowProc(WM_COMMAND, MAKEWPARAM(wID, wNotifyCode), (LPARAM)hWndCtl);\n\t}\n};\n\nclass CPrintDialog : public CPrintDialogImpl<CPrintDialog>\n{\npublic:\n\tCPrintDialog(BOOL bPrintSetupOnly = FALSE,\n\t\tDWORD dwFlags = PD_ALLPAGES | PD_USEDEVMODECOPIES | PD_NOPAGENUMS | PD_NOSELECTION,\n\t\tHWND hWndParent = NULL)\n\t\t: CPrintDialogImpl<CPrintDialog>(bPrintSetupOnly, dwFlags, hWndParent)\n\t{ }\n\n\tCPrintDialog(PRINTDLG& pdInit) : CPrintDialogImpl<CPrintDialog>(pdInit)\n\t{ }\n};\n\n#pragma warning(pop)\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CPrintDialogExImpl - new print dialog for Windows 2000\n\n} // namespace WTL\n\n#include <atlcom.h>\n\nextern \"C\" const __declspec(selectany) IID IID_IPrintDialogCallback = {0x5852a2c3, 0x6530, 0x11d1, {0xb6, 0xa3, 0x0, 0x0, 0xf8, 0x75, 0x7b, 0xf9}};\nextern \"C\" const __declspec(selectany) IID IID_IPrintDialogServices = {0x509aaeda, 0x5639, 0x11d1, {0xb6, 0xa1, 0x0, 0x0, 0xf8, 0x75, 0x7b, 0xf9}};\n\nnamespace WTL\n{\n\ntemplate <class T>\nclass ATL_NO_VTABLE CPrintDialogExImpl : \n\t\t\t\tpublic ATL::CWindow,\n\t\t\t\tpublic ATL::CMessageMap,\n\t\t\t\tpublic IPrintDialogCallback,\n\t\t\t\tpublic ATL::IObjectWithSiteImpl< T >\n{\npublic:\n\tPRINTDLGEX m_pdex;\n\n// Constructor\n\tCPrintDialogExImpl(DWORD dwFlags = PD_ALLPAGES | PD_USEDEVMODECOPIES | PD_NOPAGENUMS | PD_NOSELECTION | PD_NOCURRENTPAGE,\n\t\t\t\tHWND hWndParent = NULL)\n\t{\n\t\tmemset(&m_pdex, 0, sizeof(m_pdex));\n\n\t\tm_pdex.lStructSize = sizeof(PRINTDLGEX);\n\t\tm_pdex.hwndOwner = hWndParent;\n\t\tm_pdex.Flags = dwFlags;\n\t\tm_pdex.nStartPage = START_PAGE_GENERAL;\n\t\t// callback object will be set in DoModal\n\n\t\tm_pdex.Flags &= ~PD_RETURNIC; // do not support information context\n\t}\n\n// Operations\n\tHRESULT DoModal(HWND hWndParent = ::GetActiveWindow())\n\t{\n\t\tATLASSERT(m_hWnd == NULL);\n\t\tATLASSERT((m_pdex.Flags & PD_RETURNDEFAULT) == 0);   // use GetDefaults for this\n\n\t\tif(m_pdex.hwndOwner == NULL)   // set only if not specified before\n\t\t\tm_pdex.hwndOwner = hWndParent;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tm_pdex.lpCallback = (IUnknown*)(IPrintDialogCallback*)pT;\n\n\t\tHRESULT hResult = ::PrintDlgEx(&m_pdex);\n\n\t\tm_hWnd = NULL;\n\n\t\treturn hResult;\n\t}\n\n\tBOOL EndDialog(INT_PTR /*nRetCode*/ = 0)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tSendMessage(WM_COMMAND, MAKEWPARAM(IDABORT, 0));\n\t\treturn TRUE;\n\t}\n\n\t// GetDefaults will not display a dialog but will get device defaults\n\tHRESULT GetDefaults()\n\t{\n\t\tATLASSERT(m_pdex.hDevMode == NULL);    // must be NULL\n\t\tATLASSERT(m_pdex.hDevNames == NULL);   // must be NULL\n\n\t\tif(m_pdex.hwndOwner == NULL)   // set only if not specified before\n\t\t\tm_pdex.hwndOwner = ::GetActiveWindow();\n\n\t\tm_pdex.Flags |= PD_RETURNDEFAULT;\n\t\tHRESULT hRet = ::PrintDlgEx(&m_pdex);\n\t\tm_pdex.Flags &= ~PD_RETURNDEFAULT;\n\n\t\treturn hRet;\n\t}\n\n\t// Helpers for parsing information after successful return num. copies requested\n\tint GetCopies() const\n\t{\n\t\tif((m_pdex.Flags & PD_USEDEVMODECOPIES) != 0)\n\t\t{\n\t\t\tLPDEVMODE lpDevMode = GetDevMode();\n\t\t\treturn (lpDevMode != NULL) ? lpDevMode->dmCopies : -1;\n\t\t}\n\n\t\treturn m_pdex.nCopies;\n\t}\n\n\tBOOL PrintCollate() const       // TRUE if collate checked\n\t{\n\t\treturn ((m_pdex.Flags & PD_COLLATE) != 0) ? TRUE : FALSE;\n\t}\n\n\tBOOL PrintSelection() const     // TRUE if printing selection\n\t{\n\t\treturn ((m_pdex.Flags & PD_SELECTION) != 0) ? TRUE : FALSE;\n\t}\n\n\tBOOL PrintAll() const           // TRUE if printing all pages\n\t{\n\t\treturn (!PrintRange() && !PrintSelection()) ? TRUE : FALSE;\n\t}\n\n\tBOOL PrintRange() const         // TRUE if printing page range\n\t{\n\t\treturn ((m_pdex.Flags & PD_PAGENUMS) != 0) ? TRUE : FALSE;\n\t}\n\n\tBOOL PrintToFile() const        // TRUE if printing to a file\n\t{\n\t\treturn ((m_pdex.Flags & PD_PRINTTOFILE) != 0) ? TRUE : FALSE;\n\t}\n\n\tLPDEVMODE GetDevMode() const    // return DEVMODE\n\t{\n\t\tif(m_pdex.hDevMode == NULL)\n\t\t\treturn NULL;\n\n\t\treturn (LPDEVMODE)::GlobalLock(m_pdex.hDevMode);\n\t}\n\n\tLPCTSTR GetDriverName() const   // return driver name\n\t{\n\t\tif(m_pdex.hDevNames == NULL)\n\t\t\treturn NULL;\n\n\t\tLPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_pdex.hDevNames);\n\t\tif(lpDev == NULL)\n\t\t\treturn NULL;\n\n\t\treturn (LPCTSTR)lpDev + lpDev->wDriverOffset;\n\t}\n\n\tLPCTSTR GetDeviceName() const   // return device name\n\t{\n\t\tif(m_pdex.hDevNames == NULL)\n\t\t\treturn NULL;\n\n\t\tLPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_pdex.hDevNames);\n\t\tif(lpDev == NULL)\n\t\t\treturn NULL;\n\n\t\treturn (LPCTSTR)lpDev + lpDev->wDeviceOffset;\n\t}\n\n\tLPCTSTR GetPortName() const     // return output port name\n\t{\n\t\tif(m_pdex.hDevNames == NULL)\n\t\t\treturn NULL;\n\n\t\tLPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_pdex.hDevNames);\n\t\tif(lpDev == NULL)\n\t\t\treturn NULL;\n\n\t\treturn (LPCTSTR)lpDev + lpDev->wOutputOffset;\n\t}\n\n\tHDC GetPrinterDC() const        // return HDC (caller must delete)\n\t{\n\t\tATLASSERT((m_pdex.Flags & PD_RETURNDC) != 0);\n\t\treturn m_pdex.hDC;\n\t}\n\n\t// This helper creates a DC based on the DEVNAMES and DEVMODE structures.\n\t// This DC is returned, but also stored in m_pdex.hDC as though it had been\n\t// returned by CommDlg.  It is assumed that any previously obtained DC\n\t// has been/will be deleted by the user.  This may be\n\t// used without ever invoking the print/print setup dialogs.\n\tHDC CreatePrinterDC()\n\t{\n\t\tm_pdex.hDC = _AtlCreateDC(m_pdex.hDevNames, m_pdex.hDevMode);\n\t\treturn m_pdex.hDC;\n\t}\n\n// Implementation - interfaces\n\n// IUnknown\n\tSTDMETHOD(QueryInterface)(REFIID riid, void** ppvObject)\n\t{\n\t\tif(ppvObject == NULL)\n\t\t\treturn E_POINTER;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(IsEqualGUID(riid, IID_IUnknown) || IsEqualGUID(riid, IID_IPrintDialogCallback))\n\t\t{\n\t\t\t*ppvObject = (IPrintDialogCallback*)pT;\n\t\t\t// AddRef() not needed\n\t\t\treturn S_OK;\n\t\t}\n\t\telse if(IsEqualGUID(riid, IID_IObjectWithSite))\n\t\t{\n\t\t\t*ppvObject = (IObjectWithSite*)pT;\n\t\t\t// AddRef() not needed\n\t\t\treturn S_OK;\n\t\t}\n\n\t\treturn E_NOINTERFACE;\n\t}\n\n\tvirtual ULONG STDMETHODCALLTYPE AddRef()\n\t{\n\t\treturn 1;\n\t}\n\n\tvirtual ULONG STDMETHODCALLTYPE Release()\n\t{\n\t\treturn 1;\n\t}\n\n// IPrintDialogCallback\n\tSTDMETHOD(InitDone)()\n\t{\n\t\treturn S_FALSE;\n\t}\n\n\tSTDMETHOD(SelectionChange)()\n\t{\n\t\treturn S_FALSE;\n\t}\n\n\tSTDMETHOD(HandleMessage)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* plResult)\n\t{\n\t\t// set up m_hWnd the first time\n\t\tif(m_hWnd == NULL)\n\t\t\tAttach(hWnd);\n\n\t\t// call message map\n\t\tHRESULT hRet = ProcessWindowMessage(hWnd, uMsg, wParam, lParam, *plResult, 0) ? S_OK : S_FALSE;\n\t\tif((hRet == S_OK) && (uMsg == WM_NOTIFY))   // return in DWLP_MSGRESULT\n\t\t\t::SetWindowLongPtr(GetParent(), DWLP_MSGRESULT, (LONG_PTR)*plResult);\n\n\t\tif((uMsg == WM_INITDIALOG) && (hRet == S_OK) && ((BOOL)*plResult != FALSE))\n\t\t\thRet = S_FALSE;\n\n\t\treturn hRet;\n\t}\n};\n\nclass CPrintDialogEx : public CPrintDialogExImpl<CPrintDialogEx>\n{\npublic:\n\tCPrintDialogEx(\n\t\tDWORD dwFlags = PD_ALLPAGES | PD_USEDEVMODECOPIES | PD_NOPAGENUMS | PD_NOSELECTION | PD_NOCURRENTPAGE,\n\t\tHWND hWndParent = NULL)\n\t\t: CPrintDialogExImpl<CPrintDialogEx>(dwFlags, hWndParent)\n\t{ }\n\n\tDECLARE_EMPTY_MSG_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CPageSetupDialogImpl - Page Setup dialog\n\ntemplate <class T>\nclass ATL_NO_VTABLE CPageSetupDialogImpl : public CCommonDialogImplBase\n{\npublic:\n\tPAGESETUPDLG m_psd;\n\tATL::CWndProcThunk m_thunkPaint;\n\n// Constructors\n\tCPageSetupDialogImpl(DWORD dwFlags = PSD_MARGINS | PSD_INWININIINTLMEASURE, HWND hWndParent = NULL)\n\t{\n\t\tmemset(&m_psd, 0, sizeof(m_psd));\n\n\t\tm_psd.lStructSize = sizeof(m_psd);\n\t\tm_psd.hwndOwner = hWndParent;\n\t\tm_psd.Flags = (dwFlags | PSD_ENABLEPAGESETUPHOOK | PSD_ENABLEPAGEPAINTHOOK);\n\t\tm_psd.lpfnPageSetupHook = (LPPAGESETUPHOOK)T::HookProc;\n\t\tm_thunkPaint.Init((WNDPROC)T::PaintHookProc, this);\n\t\tm_psd.lpfnPagePaintHook = (LPPAGEPAINTHOOK)m_thunkPaint.GetWNDPROC();\n\t}\n\n\tDECLARE_EMPTY_MSG_MAP()\n\n// Attributes\n\tLPDEVMODE GetDevMode() const    // return DEVMODE\n\t{\n\t\tif(m_psd.hDevMode == NULL)\n\t\t\treturn NULL;\n\n\t\treturn (LPDEVMODE)::GlobalLock(m_psd.hDevMode);\n\t}\n\n\tLPCTSTR GetDriverName() const   // return driver name\n\t{\n\t\tif(m_psd.hDevNames == NULL)\n\t\t\treturn NULL;\n\n\t\tLPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_psd.hDevNames);\n\t\treturn (LPCTSTR)lpDev + lpDev->wDriverOffset;\n\t}\n\n\tLPCTSTR GetDeviceName() const   // return device name\n\t{\n\t\tif(m_psd.hDevNames == NULL)\n\t\t\treturn NULL;\n\n\t\tLPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_psd.hDevNames);\n\t\treturn (LPCTSTR)lpDev + lpDev->wDeviceOffset;\n\t}\n\n\tLPCTSTR GetPortName() const     // return output port name\n\t{\n\t\tif(m_psd.hDevNames == NULL)\n\t\t\treturn NULL;\n\n\t\tLPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_psd.hDevNames);\n\t\treturn (LPCTSTR)lpDev + lpDev->wOutputOffset;\n\t}\n\n\tHDC CreatePrinterDC()\n\t{\n\t\treturn _AtlCreateDC(m_psd.hDevNames, m_psd.hDevMode);\n\t}\n\n\tSIZE GetPaperSize() const\n\t{\n\t\tSIZE size = { m_psd.ptPaperSize.x, m_psd.ptPaperSize.y };\n\t\treturn size;\n\t}\n\n\tvoid GetMargins(LPRECT lpRectMargins, LPRECT lpRectMinMargins) const\n\t{\n\t\tif(lpRectMargins != NULL)\n\t\t\t*lpRectMargins = m_psd.rtMargin;\n\t\tif(lpRectMinMargins != NULL)\n\t\t\t*lpRectMinMargins = m_psd.rtMinMargin;\n\t}\n\n// Operations\n\tINT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\n\t{\n\t\tATLASSERT((m_psd.Flags & PSD_ENABLEPAGESETUPHOOK) != 0);\n\t\tATLASSERT((m_psd.Flags & PSD_ENABLEPAGEPAINTHOOK) != 0);\n\t\tATLASSERT(m_psd.lpfnPageSetupHook != NULL);   // can still be a user hook\n\t\tATLASSERT(m_psd.lpfnPagePaintHook != NULL);   // can still be a user hook\n\n\t\tif(m_psd.hwndOwner == NULL)   // set only if not specified before\n\t\t\tm_psd.hwndOwner = hWndParent;\n\n\t\tATLASSERT(m_hWnd == NULL);\n\n\t\t// Allocate the thunk structure here, where we can fail gracefully.\n\t\tBOOL bRetTh = m_thunk.Init(NULL, NULL);\n\t\tif(bRetTh == FALSE)\n\t\t{\n\t\t\t::SetLastError(ERROR_OUTOFMEMORY);\n\t\t\treturn -1;\n\t\t}\n\n\t\tModuleHelper::AddCreateWndData(&m_thunk.cd, (CCommonDialogImplBase*)this);\n\n\t\tBOOL bRet = ::PageSetupDlg(&m_psd);\n\n\t\tm_hWnd = NULL;\n\n\t\treturn bRet ? IDOK : IDCANCEL;\n\t}\n\n// Implementation\n\tstatic UINT_PTR CALLBACK PaintHookProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\n\t{\n\t\tT* pT = (T*)hWnd;\n\t\tUINT_PTR uRet = 0;\n\t\tswitch(uMsg)\n\t\t{\n\t\tcase WM_PSD_PAGESETUPDLG:\n\t\t\tuRet = pT->PreDrawPage(LOWORD(wParam), HIWORD(wParam), (LPPAGESETUPDLG)lParam);\n\t\t\tbreak;\n\t\tcase WM_PSD_FULLPAGERECT:\n\t\tcase WM_PSD_MINMARGINRECT:\n\t\tcase WM_PSD_MARGINRECT:\n\t\tcase WM_PSD_GREEKTEXTRECT:\n\t\tcase WM_PSD_ENVSTAMPRECT:\n\t\tcase WM_PSD_YAFULLPAGERECT:\n\t\t\tuRet = pT->OnDrawPage(uMsg, (HDC)wParam, (LPRECT)lParam);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"CPageSetupDialogImpl::PaintHookProc - unknown message received\\n\"));\n\t\t\tbreak;\n\t\t}\n\t\treturn uRet;\n\t}\n\n// Overridables\n\tUINT_PTR PreDrawPage(WORD /*wPaper*/, WORD /*wFlags*/, LPPAGESETUPDLG /*pPSD*/)\n\t{\n\t\t// return 1 to prevent any more drawing\n\t\treturn 0;\n\t}\n\n\tUINT_PTR OnDrawPage(UINT /*uMsg*/, HDC /*hDC*/, LPRECT /*lpRect*/)\n\t{\n\t\treturn 0; // do the default\n\t}\n};\n\nclass CPageSetupDialog : public CPageSetupDialogImpl<CPageSetupDialog>\n{\npublic:\n\tCPageSetupDialog(DWORD dwFlags = PSD_MARGINS | PSD_INWININIINTLMEASURE, HWND hWndParent = NULL)\n\t\t: CPageSetupDialogImpl<CPageSetupDialog>(dwFlags, hWndParent)\n\t{ }\n\n\t// override PaintHookProc and references to handlers\n\tstatic UINT_PTR CALLBACK PaintHookProc(HWND, UINT, WPARAM, LPARAM)\n\t{\n\t\treturn 0;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CFindReplaceDialogImpl - Find/FindReplace modeless dialogs\n\ntemplate <class T>\nclass ATL_NO_VTABLE CFindReplaceDialogImpl : public CCommonDialogImplBase\n{\npublic:\n\tenum { _cchFindReplaceBuffer = 128 };\n\n\tFINDREPLACE m_fr;\n\tTCHAR m_szFindWhat[_cchFindReplaceBuffer];\n\tTCHAR m_szReplaceWith[_cchFindReplaceBuffer];\n\n// Constructors\n\tCFindReplaceDialogImpl()\n\t{\n\t\tmemset(&m_fr, 0, sizeof(m_fr));\n\t\tm_szFindWhat[0] = _T('\\0');\n\t\tm_szReplaceWith[0] = _T('\\0');\n\n\t\tm_fr.lStructSize = sizeof(m_fr);\n\t\tm_fr.Flags = FR_ENABLEHOOK;\n\t\tm_fr.lpfnHook = (LPFRHOOKPROC)T::HookProc;\n\t\tm_fr.lpstrFindWhat = (LPTSTR)m_szFindWhat;\n\t\tm_fr.wFindWhatLen = _cchFindReplaceBuffer;\n\t\tm_fr.lpstrReplaceWith = (LPTSTR)m_szReplaceWith;\n\t\tm_fr.wReplaceWithLen = _cchFindReplaceBuffer;\n\t}\n\n\t// Note: You must allocate the object on the heap.\n\t//       If you do not, you must override OnFinalMessage()\n\tvirtual void OnFinalMessage(HWND /*hWnd*/)\n\t{\n\t\tdelete this;\n\t}\n\n\tHWND Create(BOOL bFindDialogOnly, // TRUE for Find, FALSE for FindReplace\n\t\t\tLPCTSTR lpszFindWhat,\n\t\t\tLPCTSTR lpszReplaceWith = NULL,\n\t\t\tDWORD dwFlags = FR_DOWN,\n\t\t\tHWND hWndParent = NULL)\n\t{\n\t\tATLASSERT((m_fr.Flags & FR_ENABLEHOOK) != 0);\n\t\tATLASSERT(m_fr.lpfnHook != NULL);\n\n\t\tm_fr.Flags |= dwFlags;\n\n\t\tif(hWndParent == NULL)\n\t\t\tm_fr.hwndOwner = ::GetActiveWindow();\n\t\telse\n\t\t\tm_fr.hwndOwner = hWndParent;\n\t\tATLASSERT(m_fr.hwndOwner != NULL); // must have an owner for modeless dialog\n\n\t\tif(lpszFindWhat != NULL)\n\t\t\tATL::Checked::tcsncpy_s(m_szFindWhat, _countof(m_szFindWhat), lpszFindWhat, _TRUNCATE);\n\n\t\tif(lpszReplaceWith != NULL)\n\t\t\tATL::Checked::tcsncpy_s(m_szReplaceWith, _countof(m_szReplaceWith), lpszReplaceWith, _TRUNCATE);\n\n\t\tATLASSERT(m_hWnd == NULL);\n\n\t\t// Allocate the thunk structure here, where we can fail gracefully.\n\t\tBOOL bRet = m_thunk.Init(NULL, NULL);\n\t\tif(bRet == FALSE)\n\t\t{\n\t\t\t::SetLastError(ERROR_OUTOFMEMORY);\n\t\t\treturn NULL;\n\t\t}\n\n\t\tModuleHelper::AddCreateWndData(&m_thunk.cd, (CCommonDialogImplBase*)this);\n\n\t\tHWND hWnd = NULL;\n\t\tif(bFindDialogOnly)\n\t\t\thWnd = ::FindText(&m_fr);\n\t\telse\n\t\t\thWnd = ::ReplaceText(&m_fr);\n\n\t\tATLASSERT(m_hWnd == hWnd);\n\t\treturn hWnd;\n\t}\n\n\tstatic UINT GetFindReplaceMsg()\n\t{\n\t\tstatic const UINT nMsgFindReplace = ::RegisterWindowMessage(FINDMSGSTRING);\n\t\treturn nMsgFindReplace;\n\t}\n\t// call while handling FINDMSGSTRING registered message\n\t// to retreive the object\n\tstatic T* PASCAL GetNotifier(LPARAM lParam)\n\t{\n\t\tATLASSERT(lParam != NULL);\n\t\tT* pDlg = (T*)(lParam - offsetof(T, m_fr));\n\t\treturn pDlg;\n\t}\n\n// Operations\n\t// Helpers for parsing information after successful return\n\tLPCTSTR GetFindString() const    // get find string\n\t{\n\t\treturn (LPCTSTR)m_fr.lpstrFindWhat;\n\t}\n\n\tLPCTSTR GetReplaceString() const // get replacement string\n\t{\n\t\treturn (LPCTSTR)m_fr.lpstrReplaceWith;\n\t}\n\n\tBOOL SearchDown() const          // TRUE if search down, FALSE is up\n\t{\n\t\treturn ((m_fr.Flags & FR_DOWN) != 0) ? TRUE : FALSE;\n\t}\n\n\tBOOL FindNext() const            // TRUE if command is find next\n\t{\n\t\treturn ((m_fr.Flags & FR_FINDNEXT) != 0) ? TRUE : FALSE;\n\t}\n\n\tBOOL MatchCase() const           // TRUE if matching case\n\t{\n\t\treturn ((m_fr.Flags & FR_MATCHCASE) != 0) ? TRUE : FALSE;\n\t}\n\n\tBOOL MatchWholeWord() const      // TRUE if matching whole words only\n\t{\n\t\treturn ((m_fr.Flags & FR_WHOLEWORD) != 0) ? TRUE : FALSE;\n\t}\n\n\tBOOL ReplaceCurrent() const      // TRUE if replacing current string\n\t{\n\t\treturn ((m_fr. Flags & FR_REPLACE) != 0) ? TRUE : FALSE;\n\t}\n\n\tBOOL ReplaceAll() const          // TRUE if replacing all occurrences\n\t{\n\t\treturn ((m_fr.Flags & FR_REPLACEALL) != 0) ? TRUE : FALSE;\n\t}\n\n\tBOOL IsTerminating() const       // TRUE if terminating dialog\n\t{\n\t\treturn ((m_fr.Flags & FR_DIALOGTERM) != 0) ? TRUE : FALSE ;\n\t}\n};\n\nclass CFindReplaceDialog : public CFindReplaceDialogImpl<CFindReplaceDialog>\n{\npublic:\n\tDECLARE_EMPTY_MSG_MAP()\n};\n\n\n/////////////////////////////////////////////////////////////////////////\n// CDialogBaseUnits - Dialog Units helper\n//\n\nclass CDialogBaseUnits\n{\npublic:\n\tSIZE m_sizeUnits;\n\n// Constructors\n\tCDialogBaseUnits()\n\t{\n\t\t// The base units of the out-dated System Font\n\t\tLONG nDlgBaseUnits = ::GetDialogBaseUnits();\n\t\tm_sizeUnits.cx = LOWORD(nDlgBaseUnits);\n\t\tm_sizeUnits.cy = HIWORD(nDlgBaseUnits);\n\t}\n\n\tCDialogBaseUnits(HWND hWnd)\n\t{\n\t\tif(!InitDialogBaseUnits(hWnd)) {\n\t\t\tLONG nDlgBaseUnits = ::GetDialogBaseUnits();\n\t\t\tm_sizeUnits.cx = LOWORD(nDlgBaseUnits);\n\t\t\tm_sizeUnits.cy = HIWORD(nDlgBaseUnits);\n\t\t}\n\t}\n\n\tCDialogBaseUnits(HFONT hFont, HWND hWnd = NULL)\n\t{\n\t\tif(!InitDialogBaseUnits(hFont, hWnd)) {\n\t\t\tLONG nDlgBaseUnits = ::GetDialogBaseUnits();\n\t\t\tm_sizeUnits.cx = LOWORD(nDlgBaseUnits);\n\t\t\tm_sizeUnits.cy = HIWORD(nDlgBaseUnits);\n\t\t}\n\t}\n\n\tCDialogBaseUnits(const LOGFONT& lf, HWND hWnd = NULL)\n\t{\n\t\tif(!InitDialogBaseUnits(lf, hWnd)) {\n\t\t\tLONG nDlgBaseUnits = ::GetDialogBaseUnits();\n\t\t\tm_sizeUnits.cx = LOWORD(nDlgBaseUnits);\n\t\t\tm_sizeUnits.cy = HIWORD(nDlgBaseUnits);\n\t\t}\n\t}\n\n// Operations\n\tBOOL InitDialogBaseUnits(HWND hWnd)\n\t{\n\t\tATLASSERT(::IsWindow(hWnd));\n\t\tRECT rc = { 0, 0, 4, 8 };\n\t\tif(!::MapDialogRect(hWnd, &rc)) return FALSE;\n\t\tm_sizeUnits.cx = rc.right;\n\t\tm_sizeUnits.cy = rc.bottom;\n\t\treturn TRUE;\n\t}\n\n\tBOOL InitDialogBaseUnits(const LOGFONT& lf, HWND hWnd = NULL)\n\t{\n\t\tCFont font;\n\t\tfont.CreateFontIndirect(&lf);\n\t\tif(font.IsNull()) return FALSE;\n\t\treturn InitDialogBaseUnits(font, hWnd);\n\t}\n\n\tBOOL InitDialogBaseUnits(HFONT hFont, HWND hWnd = NULL)\n\t{\n\t\tATLASSERT(hFont != NULL);\n\t\tCWindowDC dc = hWnd;\n\t\tTEXTMETRIC tmText = {};\n\t\tSIZE sizeText = {};\n\t\tHFONT hFontOld = dc.SelectFont(hFont);\n\t\tdc.GetTextMetrics(&tmText);\n\t\tm_sizeUnits.cy = tmText.tmHeight + tmText.tmExternalLeading;\n\t\tdc.GetTextExtent(_T(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\"), 52, &sizeText);\n\t\tm_sizeUnits.cx = (sizeText.cx + 26) / 52;\n\t\tdc.SelectFont(hFontOld);\n\t\treturn TRUE;\n\t}\n\n\tSIZE GetDialogBaseUnits() const\n\t{\n\t\treturn m_sizeUnits;\n\t}\n\n\tINT MapDialogPixelsX(INT x) const\n\t{\n\t\treturn ::MulDiv(x, 4, m_sizeUnits.cx);  // Pixels X to DLU\n\t}\n\n\tINT MapDialogPixelsY(INT y) const\n\t{\n\t\treturn ::MulDiv(y, 8, m_sizeUnits.cy);  // Pixels Y to DLU\n\t}\n\n\tPOINT MapDialogPixels(POINT pt) const\n\t{\n\t\tPOINT out = { MapDialogPixelsX(pt.x), MapDialogPixelsY(pt.y) };\n\t\treturn out;\n\t}\n\n\tSIZE MapDialogPixels(SIZE input) const\n\t{\n\t\tSIZE out = { MapDialogPixelsX(input.cx), MapDialogPixelsY(input.cy) };\n\t\treturn out;\n\t}\n\n\tRECT MapDialogPixels(const RECT& input) const\n\t{\n\t\tRECT out = { MapDialogPixelsX(input.left), MapDialogPixelsY(input.top), MapDialogPixelsX(input.right), MapDialogPixelsY(input.bottom) };\n\t\treturn out;\n\t}\n\n\tINT MapDialogUnitsX(INT x) const\n\t{\n\t\treturn ::MulDiv(x, m_sizeUnits.cx, 4);  // DLU to Pixels X\n\t}\n\n\tINT MapDialogUnitsY(INT y) const\n\t{\n\t\treturn ::MulDiv(y, m_sizeUnits.cy, 8);  // DLU to Pixels Y\n\t}\n\n\tPOINT MapDialogUnits(POINT pt) const\n\t{\n\t\tPOINT out = { MapDialogUnitsX(pt.x), MapDialogUnitsY(pt.y) };\n\t\treturn out;\n\t}\n\n\tSIZE MapDialogUnits(SIZE input) const\n\t{\n\t\tSIZE out = { MapDialogUnitsX(input.cx), MapDialogUnitsY(input.cy) };\n\t\treturn out;\n\t}\n\n\tRECT MapDialogUnits(const RECT& input) const\n\t{\n\t\tRECT out = { MapDialogUnitsX(input.left), MapDialogUnitsY(input.top), MapDialogUnitsX(input.right), MapDialogUnitsY(input.bottom) };\n\t\treturn out;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CMemDlgTemplate - in-memory dialog template - DLGTEMPLATE or DLGTEMPLATEEX\n\n// traits suitable for dialog controls\ntypedef ATL::CWinTraits<WS_CHILD | WS_VISIBLE, 0>\tCDlgControlWinTraits;\n\ntemplate <class TWinTraits>\nclass CMemDlgTemplateT\n{\npublic:\n\ttypedef ATL::_DialogSplitHelper::DLGTEMPLATEEX DLGTEMPLATEEX;\n\ttypedef ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX DLGITEMTEMPLATEEX;\n\n\tenum StdCtrlType\n\t{\n\t\tCTRL_BUTTON    = 0x0080,\n\t\tCTRL_EDIT      = 0x0081,\n\t\tCTRL_STATIC    = 0x0082,\n\t\tCTRL_LISTBOX   = 0x0083,\n\t\tCTRL_SCROLLBAR = 0x0084,\n\t\tCTRL_COMBOBOX  = 0x0085\n\t};\n\n\tHANDLE m_hData;\n\tLPBYTE m_pData;\n\tLPBYTE m_pPtr;\n\tSIZE_T m_cAllocated;\n\n\tCMemDlgTemplateT() : m_hData(NULL), m_pData(NULL), m_pPtr(NULL), m_cAllocated(0)\n\t{ }\n\n\t~CMemDlgTemplateT()\n\t{\n\t\tReset();\n\t}\n\n\tbool IsValid() const\n\t{\n\t\treturn (m_pData != NULL);\n\t}\n\n\tbool IsTemplateEx() const\n\t{\n\t\treturn (IsValid() && ((DLGTEMPLATEEX*)m_pData)->signature == 0xFFFF);\n\t}\n\n\tLPDLGTEMPLATE GetTemplatePtr()\n\t{\n\t\treturn reinterpret_cast<LPDLGTEMPLATE>(m_pData);\n\t}\n\n\tDLGTEMPLATEEX* GetTemplateExPtr()\n\t{\n\t\treturn reinterpret_cast<DLGTEMPLATEEX*>(m_pData);\n\t}\n\n\tvoid Reset()\n\t{\n\t\tif (IsValid())\n\t\t{\n\t\t\t::GlobalUnlock(m_pData);\n\t\t\tATLVERIFY(::GlobalFree(m_hData) == NULL);\n\t\t}\n\n\t\tm_hData = NULL;\n\t\tm_pData = NULL;\n\t\tm_pPtr = NULL;\n\t\tm_cAllocated = 0;\n\t}\n\n\tvoid Create(bool bDlgEx, LPCTSTR lpszCaption, const RECT& rc, DWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t            LPCTSTR lpstrFontName = NULL, WORD wFontSize = 0, WORD wWeight = 0, BYTE bItalic = 0, BYTE bCharset = 0, DWORD dwHelpID = 0,\n\t            ATL::_U_STRINGorID ClassName = 0U, ATL::_U_STRINGorID Menu = 0U)\n\t{\n\t\tCreate(bDlgEx, lpszCaption, (short) rc.left, (short) rc.top, (short) (rc.right - rc.left), (short) (rc.bottom - rc.top), dwStyle, dwExStyle,\n\t\t\tlpstrFontName, wFontSize, wWeight, bItalic, bCharset, dwHelpID, ClassName.m_lpstr, Menu.m_lpstr);\n\t}\n\n\tvoid Create(bool bDlgEx, LPCTSTR lpszCaption, short nX, short nY, short nWidth, short nHeight, DWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t            LPCTSTR lpstrFontName = NULL, WORD wFontSize = 0, WORD wWeight = 0, BYTE bItalic = 0, BYTE bCharset = 0, DWORD dwHelpID = 0,\n\t            ATL::_U_STRINGorID ClassName = 0U, ATL::_U_STRINGorID Menu = 0U)\n\t{\n\t\t// Should have DS_SETFONT style to set the dialog font name and size\n\t\tif (lpstrFontName != NULL)\n\t\t{\n\t\t\tdwStyle |= DS_SETFONT;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdwStyle &= ~DS_SETFONT;\n\t\t}\n\n\t\tif (bDlgEx)\n\t\t{\n\t\t\tDLGTEMPLATEEX dlg = {1, 0xFFFF, dwHelpID, dwExStyle, dwStyle, 0, nX, nY, nWidth, nHeight};\n\t\t\tAddData(&dlg, sizeof(dlg));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDLGTEMPLATE dlg = {dwStyle, dwExStyle, 0, nX, nY, nWidth, nHeight};\n\t\t\tAddData(&dlg, sizeof(dlg));\n\t\t}\n\n\t\tif (Menu.m_lpstr == NULL)\n\t\t{\n\t\t\tWORD menuData = 0;\n\t\t\tAddData(&menuData, sizeof(WORD));\n\t\t}\n\t\telse if (IS_INTRESOURCE(Menu.m_lpstr))\n\t\t{\n\t\t\tWORD menuData[] = { 0xFFFF, LOWORD(Menu.m_lpstr) };\n\t\t\tAddData(menuData, sizeof(menuData));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAddString(Menu.m_lpstr);\n\t\t}\n\n\t\tif (ClassName.m_lpstr == NULL)\n\t\t{\n\t\t\tWORD classData = 0;\n\t\t\tAddData(&classData, sizeof(WORD));\n\t\t}\n\t\telse if (IS_INTRESOURCE(ClassName.m_lpstr))\n\t\t{\n\t\t\tWORD classData[] = { 0xFFFF, LOWORD(ClassName.m_lpstr) };\n\t\t\tAddData(classData, sizeof(classData));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAddString(ClassName.m_lpstr);\n\t\t}\n\n\t\t// Set dialog caption\n\t\tAddString(lpszCaption);\n\n\t\tif (lpstrFontName != NULL)\n\t\t{\n\t\t\tAddData(&wFontSize, sizeof(wFontSize));\n\n\t\t\tif (bDlgEx)\n\t\t\t{\n\t\t\t\tAddData(&wWeight, sizeof(wWeight));\n\t\t\t\tAddData(&bItalic, sizeof(bItalic));\n\t\t\t\tAddData(&bCharset, sizeof(bCharset));\n\t\t\t}\n\n\t\t\tAddString(lpstrFontName);\n\t\t}\n\t}\n\n\tvoid AddControl(ATL::_U_STRINGorID ClassName, WORD wId, const RECT& rc, DWORD dwStyle, DWORD dwExStyle,\n\t                ATL::_U_STRINGorID Text, const WORD* pCreationData = NULL, WORD nCreationData = 0, DWORD dwHelpID = 0)\n\t{\n\t\tAddControl(ClassName.m_lpstr, wId, (short) rc.left, (short) rc.top, (short) (rc.right - rc.left), (short) (rc.bottom - rc.top), dwStyle, dwExStyle,\n\t\t\tText.m_lpstr, pCreationData, nCreationData, dwHelpID);\n\t}\n\n\tvoid AddControl(ATL::_U_STRINGorID ClassName, WORD wId, short nX, short nY, short nWidth, short nHeight, DWORD dwStyle, DWORD dwExStyle,\n\t                ATL::_U_STRINGorID Text, const WORD* pCreationData = NULL, WORD nCreationData = 0, DWORD dwHelpID = 0)\n\t{\n\t\tATLASSERT(IsValid());\n\n\t\t// DWORD align data\n\t\tconst DWORD_PTR dwDwordAlignBits = sizeof(DWORD) - 1;\n\t\tm_pPtr = (LPBYTE)(((DWORD_PTR)m_pPtr + dwDwordAlignBits) & (~dwDwordAlignBits));\n\n\t\tif (IsTemplateEx())\n\t\t{\n\t\t\tDLGTEMPLATEEX* dlg = (DLGTEMPLATEEX*)m_pData;\n\t\t\tdlg->cDlgItems++;\n\n\t\t\tDLGITEMTEMPLATEEX item = {dwHelpID, TWinTraits::GetWndExStyle(0) | dwExStyle, TWinTraits::GetWndStyle(0) | dwStyle, nX, nY, nWidth, nHeight, wId};\n\t\t\tAddData(&item, sizeof(item));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tLPDLGTEMPLATE dlg = (LPDLGTEMPLATE)m_pData;\n\t\t\tdlg->cdit++;\n\n\t\t\tDLGITEMTEMPLATE item = {TWinTraits::GetWndStyle(0) | dwStyle, TWinTraits::GetWndExStyle(0) | dwExStyle, nX, nY, nWidth, nHeight, wId};\n\t\t\tAddData(&item, sizeof(item));\n\t\t}\n\n\t\tATLASSERT(ClassName.m_lpstr != NULL);\n\t\tif (IS_INTRESOURCE(ClassName.m_lpstr))\n\t\t{\n\t\t\tWORD wData[] = { 0xFFFF, LOWORD(ClassName.m_lpstr) };\n\t\t\tAddData(wData, sizeof(wData));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAddString(ClassName.m_lpstr);\n\t\t}\n\n\t\tif (Text.m_lpstr == NULL)\n\t\t{\n\t\t\tWORD classData = 0;\n\t\t\tAddData(&classData, sizeof(WORD));\n\t\t}\n\t\telse if (IS_INTRESOURCE(Text.m_lpstr))\n\t\t{\n\t\t\tWORD wData[] = { 0xFFFF, LOWORD(Text.m_lpstr) };\n\t\t\tAddData(wData, sizeof(wData));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAddString(Text.m_lpstr);\n\t\t}\n\n\t\tAddData(&nCreationData, sizeof(nCreationData));\n\n\t\tif ((nCreationData != 0))\n\t\t{\n\t\t\tATLASSERT(pCreationData != NULL);\n\t\t\tAddData(pCreationData, nCreationData * sizeof(WORD));\n\t\t}\n\t}\n\n\tvoid AddStdControl(StdCtrlType CtrlType, WORD wId, short nX, short nY, short nWidth, short nHeight,\n\t                   DWORD dwStyle, DWORD dwExStyle, ATL::_U_STRINGorID Text, const WORD* pCreationData = NULL, WORD nCreationData = 0, DWORD dwHelpID = 0)\n\t{\n\t\tAddControl(CtrlType, wId, nX, nY, nWidth, nHeight, dwStyle, dwExStyle, Text, pCreationData, nCreationData, dwHelpID);\n\t}\n\n\tvoid AddData(LPCVOID pData, size_t nData)\n\t{\n\t\tATLASSERT(pData != NULL);\n\n\t\tconst SIZE_T ALLOCATION_INCREMENT = 1024;\n\n\t\tif (m_pData == NULL)\n\t\t{\n\t\t\tm_cAllocated = ((nData / ALLOCATION_INCREMENT) + 1) * ALLOCATION_INCREMENT;\n\t\t\tm_hData = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, m_cAllocated);\n\t\t\tATLASSERT(m_hData != NULL);\n\t\t\tm_pPtr = m_pData = static_cast<LPBYTE>(::GlobalLock(m_hData));\n\t\t\tATLASSERT(m_pData != NULL);\n\t\t}\n\t\telse if (((m_pPtr - m_pData) + nData) > m_cAllocated)\n\t\t{\n\t\t\tSIZE_T ptrPos = (m_pPtr - m_pData);\n\t\t\tm_cAllocated += ((nData / ALLOCATION_INCREMENT) + 1) * ALLOCATION_INCREMENT;\n\t\t\t::GlobalUnlock(m_pData);\n\t\t\tm_hData = ::GlobalReAlloc(m_hData, m_cAllocated, GMEM_MOVEABLE | GMEM_ZEROINIT);\n\t\t\tATLASSERT(m_hData != NULL);\n\t\t\tm_pData = static_cast<LPBYTE>(::GlobalLock(m_hData));\n\t\t\tATLASSERT(m_pData != NULL);\n\t\t\tm_pPtr = m_pData + ptrPos;\n\t\t}\n\n\t\tATL::Checked::memcpy_s(m_pPtr, m_cAllocated - (m_pPtr - m_pData), pData, nData);\n\n\t\tm_pPtr += nData;\n\t}\n\n\tvoid AddString(LPCTSTR lpszStr)\n\t{\n\t\tif (lpszStr == NULL)\n\t\t{\n\t\t\tWCHAR szEmpty = 0;\n\t\t\tAddData(&szEmpty, sizeof(szEmpty));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tUSES_CONVERSION;\n\t\t\tLPCWSTR lpstr = T2CW(lpszStr);\n\t\t\tint nSize = lstrlenW(lpstr) + 1;\n\t\t\tAddData(lpstr, nSize * sizeof(WCHAR));\n\t\t}\n\t}\n};\n\ntypedef CMemDlgTemplateT<CDlgControlWinTraits>\tCMemDlgTemplate;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Dialog and control macros for indirect dialogs\n\n// for DLGTEMPLATE\n#define BEGIN_DIALOG(x, y, width, height) \\\n\tvoid DoInitTemplate() \\\n\t{ \\\n\t\tbool bExTemplate = false; \\\n\t\tshort nX = x, nY = y, nWidth = width, nHeight = height; \\\n\t\tLPCTSTR szCaption = NULL; \\\n\t\tDWORD dwStyle = WS_POPUP | WS_BORDER | WS_SYSMENU; \\\n\t\tDWORD dwExStyle = 0; \\\n\t\tLPCTSTR szFontName = NULL; \\\n\t\tWORD wFontSize = 0; \\\n\t\tWORD wWeight = 0; \\\n\t\tBYTE bItalic = 0; \\\n\t\tBYTE bCharset = 0; \\\n\t\tDWORD dwHelpID = 0; \\\n\t\tATL::_U_STRINGorID Menu = 0U; \\\n\t\tATL::_U_STRINGorID ClassName = 0U;\n\n// for DLGTEMPLATEEX\n#define BEGIN_DIALOG_EX(x, y, width, height, helpID) \\\n\tvoid DoInitTemplate() \\\n\t{ \\\n\t\tbool bExTemplate = true; \\\n\t\tshort nX = x, nY = y, nWidth = width, nHeight = height; \\\n\t\tLPCTSTR szCaption = NULL; \\\n\t\tDWORD dwStyle = WS_POPUP | WS_BORDER | WS_SYSMENU; \\\n\t\tDWORD dwExStyle = 0; \\\n\t\tLPCTSTR szFontName = NULL; \\\n\t\tWORD wFontSize = 0; \\\n\t\tWORD wWeight = 0; \\\n\t\tBYTE bItalic = 0; \\\n\t\tBYTE bCharset = 0; \\\n\t\tDWORD dwHelpID = helpID; \\\n\t\tATL::_U_STRINGorID Menu = 0U; \\\n\t\tATL::_U_STRINGorID ClassName = 0U;\n\n#define END_DIALOG() \\\n\t\tm_Template.Create(bExTemplate, szCaption, nX, nY, nWidth, nHeight, dwStyle, dwExStyle, szFontName, wFontSize, wWeight, bItalic, bCharset, dwHelpID, ClassName, Menu); \\\n\t}\n\n#define DIALOG_CAPTION(caption) \\\n\t\tszCaption = caption;\n#define DIALOG_STYLE(style) \\\n\t\tdwStyle = style;\n#define DIALOG_EXSTYLE(exStyle) \\\n\t\tdwExStyle = exStyle;\n#define DIALOG_FONT(pointSize, typeFace) \\\n\t\twFontSize = pointSize; \\\n\t\tszFontName = typeFace;\n#define DIALOG_FONT_EX(pointsize, typeface, weight, italic, charset) \\\n\t\tATLASSERT(bExTemplate); \\\n\t\twFontSize = pointsize; \\\n\t\tszFontName = typeface; \\\n\t\twWeight = weight; \\\n\t\tbItalic = italic; \\\n\t\tbCharset = charset;\n#define DIALOG_MENU(menuName) \\\n\t\tMenu = menuName;\n#define DIALOG_CLASS(className) \\\n\t\tClassName = className;\n\n#define BEGIN_CONTROLS_MAP() \\\n\tvoid DoInitControls() \\\n\t{\n\n#define END_CONTROLS_MAP() \\\n\t}\n\n\n#define CONTROL_LTEXT(text, id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_STATIC, (WORD)id, x, y, width, height, style | SS_LEFT | WS_GROUP, exStyle, text, NULL, 0);\n#define CONTROL_CTEXT(text, id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_STATIC, (WORD)id, x, y, width, height, style | SS_CENTER | WS_GROUP, exStyle, text, NULL, 0);\n#define CONTROL_RTEXT(text, id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_STATIC, (WORD)id, x, y, width, height, style | SS_RIGHT | WS_GROUP, exStyle, text, NULL, 0);\n#define CONTROL_PUSHBUTTON(text, id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_PUSHBUTTON | WS_TABSTOP, exStyle, text, NULL, 0);\n#define CONTROL_DEFPUSHBUTTON(text, id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_DEFPUSHBUTTON | WS_TABSTOP, exStyle, text, NULL, 0);\n#define CONTROL_PUSHBOX(text, id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_PUSHBOX | WS_TABSTOP, exStyle, text, NULL, 0);\n#define CONTROL_STATE3(text, id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_3STATE | WS_TABSTOP, exStyle, text, NULL, 0);\n#define CONTROL_AUTO3STATE(text, id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_AUTO3STATE | WS_TABSTOP, exStyle, text, NULL, 0);\n#define CONTROL_CHECKBOX(text, id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_CHECKBOX | WS_TABSTOP, exStyle, text, NULL, 0);\n#define CONTROL_AUTOCHECKBOX(text, id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_AUTOCHECKBOX | WS_TABSTOP, exStyle, text, NULL, 0);\n#define CONTROL_RADIOBUTTON(text, id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_RADIOBUTTON | WS_TABSTOP, exStyle, text, NULL, 0);\n#define CONTROL_AUTORADIOBUTTON(text, id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_AUTORADIOBUTTON | WS_TABSTOP, exStyle, text, NULL, 0);\n#define CONTROL_COMBOBOX(id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_COMBOBOX, (WORD)id, x, y, width, height, style | CBS_DROPDOWN | WS_TABSTOP, exStyle, (LPCTSTR)NULL, NULL, 0);\n#define CONTROL_EDITTEXT(id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_EDIT, (WORD)id, x, y, width, height, style | ES_LEFT | WS_BORDER | WS_TABSTOP, exStyle, (LPCTSTR)NULL, NULL, 0);\n#define CONTROL_GROUPBOX(text, id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_GROUPBOX, exStyle, text, NULL, 0);\n#define CONTROL_LISTBOX(id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_LISTBOX, (WORD)id, x, y, width, height, style | LBS_NOTIFY | WS_BORDER, exStyle, (LPCTSTR)NULL, NULL, 0);\n#define CONTROL_SCROLLBAR(id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_SCROLLBAR, (WORD)id, x, y, width, height, style | SBS_HORZ, exStyle, (LPCTSTR)NULL, NULL, 0);\n#define CONTROL_ICON(text, id, x, y, width, height, style, exStyle) \\\n\tm_Template.AddStdControl(m_Template.CTRL_STATIC, (WORD)id, x, y, width, height, style | SS_ICON, exStyle, text, NULL, 0);\n#define CONTROL_CONTROL(text, id, className, style, x, y, width, height, exStyle) \\\n\tm_Template.AddControl(className, (WORD)id, x, y, width, height, style, exStyle, text, NULL, 0);\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CIndirectDialogImpl - dialogs with template in memory\n\ntemplate <class T, class TDlgTemplate = CMemDlgTemplate, class TBase = ATL::CWindow>\nclass ATL_NO_VTABLE CIndirectDialogImpl : public ATL::CDialogImpl< T, TBase >\n{\npublic:\n\tenum { IDD = 0 };   // no dialog template resource\n\n\tTDlgTemplate m_Template;\n\n\tvoid CreateTemplate()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->DoInitTemplate();\n\t\tpT->DoInitControls();\n\t}\n\n\tINT_PTR DoModal(HWND hWndParent = ::GetActiveWindow(), LPARAM dwInitParam = NULL)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_hWnd == NULL);\n\n\t\tif(!m_Template.IsValid())\n\t\t\tCreateTemplate();\n\n\t\t// Allocate the thunk structure here, where we can fail gracefully.\n\t\tBOOL bRet = this->m_thunk.Init(NULL, NULL);\n\t\tif(bRet == FALSE)\n\t\t{\n\t\t\t::SetLastError(ERROR_OUTOFMEMORY);\n\t\t\treturn -1;\n\t\t}\n\n\t\tModuleHelper::AddCreateWndData(&this->m_thunk.cd, (ATL::CDialogImplBaseT< TBase >*)pT);\n\n#ifdef _DEBUG\n\t\tthis->m_bModal = true;\n#endif // _DEBUG\n\n\t\treturn ::DialogBoxIndirectParam(ModuleHelper::GetResourceInstance(), m_Template.GetTemplatePtr(), hWndParent, (DLGPROC)T::StartDialogProc, dwInitParam);\n\t}\n\n\tHWND Create(HWND hWndParent, LPARAM dwInitParam = NULL)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(pT->m_hWnd == NULL);\n\n\t\tif(!m_Template.IsValid())\n\t\t\tCreateTemplate();\n\n\t\t// Allocate the thunk structure here, where we can fail gracefully.\n\t\tBOOL bRet = this->m_thunk.Init(NULL, NULL);\n\t\tif(bRet == FALSE) \n\t\t{\n\t\t\t::SetLastError(ERROR_OUTOFMEMORY);\n\t\t\treturn NULL;\n\t\t}\n\n\t\tModuleHelper::AddCreateWndData(&this->m_thunk.cd, (ATL::CDialogImplBaseT< TBase >*)pT);\n\n#ifdef _DEBUG\n\t\tthis->m_bModal = false;\n#endif // _DEBUG\n\n\t\tHWND hWnd = ::CreateDialogIndirectParam(ModuleHelper::GetResourceInstance(), (LPCDLGTEMPLATE)m_Template.GetTemplatePtr(), hWndParent, (DLGPROC)T::StartDialogProc, dwInitParam);\n\t\tATLASSERT(this->m_hWnd == hWnd);\n\n\t\treturn hWnd;\n\t}\n\n\t// for CComControl\n\tHWND Create(HWND hWndParent, RECT&, LPARAM dwInitParam = NULL)\n\t{\n\t\treturn Create(hWndParent, dwInitParam);\n\t}\n\n\tvoid DoInitTemplate() \n\t{\n\t\tATLASSERT(FALSE);   // MUST be defined in derived class\n\t}\n\n\tvoid DoInitControls() \n\t{\n\t\tATLASSERT(FALSE);   // MUST be defined in derived class\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CPropertySheetWindow - client side for a property sheet\n\nclass CPropertySheetWindow : public ATL::CWindow\n{\npublic:\n// Constructors\n\tCPropertySheetWindow(HWND hWnd = NULL) : ATL::CWindow(hWnd)\n\t{ }\n\n\tCPropertySheetWindow& operator =(HWND hWnd)\n\t{\n\t\tm_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n// Attributes\n\tint GetPageCount() const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tHWND hWndTabCtrl = GetTabControl();\n\t\tATLASSERT(hWndTabCtrl != NULL);\n\t\treturn (int)::SendMessage(hWndTabCtrl, TCM_GETITEMCOUNT, 0, 0L);\n\t}\n\n\tHWND GetActivePage() const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (HWND)::SendMessage(m_hWnd, PSM_GETCURRENTPAGEHWND, 0, 0L);\n\t}\n\n\tint GetActiveIndex() const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tHWND hWndTabCtrl = GetTabControl();\n\t\tATLASSERT(hWndTabCtrl != NULL);\n\t\treturn (int)::SendMessage(hWndTabCtrl, TCM_GETCURSEL, 0, 0L);\n\t}\n\n\tBOOL SetActivePage(int nPageIndex)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (BOOL)::SendMessage(m_hWnd, PSM_SETCURSEL, nPageIndex, 0L);\n\t}\n\n\tBOOL SetActivePage(HPROPSHEETPAGE hPage)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(hPage != NULL);\n\t\treturn (BOOL)::SendMessage(m_hWnd, PSM_SETCURSEL, 0, (LPARAM)hPage);\n\t}\n\n\tBOOL SetActivePageByID(int nPageID)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (BOOL)::SendMessage(m_hWnd, PSM_SETCURSELID, 0, nPageID);\n\t}\n\n\tvoid SetTitle(LPCTSTR lpszText, UINT nStyle = 0)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT((nStyle & ~PSH_PROPTITLE) == 0); // only PSH_PROPTITLE is valid\n\t\tATLASSERT(lpszText != NULL);\n\t\t::SendMessage(m_hWnd, PSM_SETTITLE, nStyle, (LPARAM)lpszText);\n\t}\n\n\tHWND GetTabControl() const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (HWND)::SendMessage(m_hWnd, PSM_GETTABCONTROL, 0, 0L);\n\t}\n\n\tvoid SetFinishText(LPCTSTR lpszText)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\t::SendMessage(m_hWnd, PSM_SETFINISHTEXT, 0, (LPARAM)lpszText);\n\t}\n\n\tvoid SetWizardButtons(DWORD dwFlags)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\t::PostMessage(m_hWnd, PSM_SETWIZBUTTONS, 0, dwFlags);\n\t}\n\n// Operations\n\tBOOL AddPage(HPROPSHEETPAGE hPage)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(hPage != NULL);\n\t\treturn (BOOL)::SendMessage(m_hWnd, PSM_ADDPAGE, 0, (LPARAM)hPage);\n\t}\n\n\tBOOL AddPage(LPCPROPSHEETPAGE pPage)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(pPage != NULL);\n\t\tHPROPSHEETPAGE hPage = ::CreatePropertySheetPage(pPage);\n\t\tif(hPage == NULL)\n\t\t\treturn FALSE;\n\t\treturn (BOOL)::SendMessage(m_hWnd, PSM_ADDPAGE, 0, (LPARAM)hPage);\n\t}\n\n\tBOOL InsertPage(int nNewPageIndex, HPROPSHEETPAGE hPage)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(hPage != NULL);\n\t\treturn (BOOL)::SendMessage(m_hWnd, PSM_INSERTPAGE, nNewPageIndex, (LPARAM)hPage);\n\t}\n\n\tBOOL InsertPage(int nNewPageIndex, LPCPROPSHEETPAGE pPage)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(pPage != NULL);\n\t\tHPROPSHEETPAGE hPage = ::CreatePropertySheetPage(pPage);\n\t\tif(hPage == NULL)\n\t\t\treturn FALSE;\n\t\treturn (BOOL)::SendMessage(m_hWnd, PSM_INSERTPAGE, nNewPageIndex, (LPARAM)hPage);\n\t}\n\n\tBOOL InsertPage(HPROPSHEETPAGE hPageInsertAfter, HPROPSHEETPAGE hPage)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(hPage != NULL);\n\t\treturn (BOOL)::SendMessage(m_hWnd, PSM_INSERTPAGE, (WPARAM)hPageInsertAfter, (LPARAM)hPage);\n\t}\n\n\tBOOL InsertPage(HPROPSHEETPAGE hPageInsertAfter, LPCPROPSHEETPAGE pPage)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(pPage != NULL);\n\t\tHPROPSHEETPAGE hPage = ::CreatePropertySheetPage(pPage);\n\t\tif(hPage == NULL)\n\t\t\treturn FALSE;\n\t\treturn (BOOL)::SendMessage(m_hWnd, PSM_INSERTPAGE, (WPARAM)hPageInsertAfter, (LPARAM)hPage);\n\t}\n\n\tvoid RemovePage(int nPageIndex)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\t::SendMessage(m_hWnd, PSM_REMOVEPAGE, nPageIndex, 0L);\n\t}\n\n\tvoid RemovePage(HPROPSHEETPAGE hPage)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(hPage != NULL);\n\t\t::SendMessage(m_hWnd, PSM_REMOVEPAGE, 0, (LPARAM)hPage);\n\t}\n\n\tBOOL PressButton(int nButton)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (BOOL)::SendMessage(m_hWnd, PSM_PRESSBUTTON, nButton, 0L);\n\t}\n\n\tBOOL Apply()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (BOOL)::SendMessage(m_hWnd, PSM_APPLY, 0, 0L);\n\t}\n\n\tvoid CancelToClose()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\t::SendMessage(m_hWnd, PSM_CANCELTOCLOSE, 0, 0L);\n\t}\n\n\tvoid SetModified(HWND hWndPage, BOOL bChanged = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(::IsWindow(hWndPage));\n\t\tUINT uMsg = bChanged ? PSM_CHANGED : PSM_UNCHANGED;\n\t\t::SendMessage(m_hWnd, uMsg, (WPARAM)hWndPage, 0L);\n\t}\n\n\tLRESULT QuerySiblings(WPARAM wParam, LPARAM lParam)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn ::SendMessage(m_hWnd, PSM_QUERYSIBLINGS, wParam, lParam);\n\t}\n\n\tvoid RebootSystem()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\t::SendMessage(m_hWnd, PSM_REBOOTSYSTEM, 0, 0L);\n\t}\n\n\tvoid RestartWindows()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\t::SendMessage(m_hWnd, PSM_RESTARTWINDOWS, 0, 0L);\n\t}\n\n\tBOOL IsDialogMessage(LPMSG lpMsg)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (BOOL)::SendMessage(m_hWnd, PSM_ISDIALOGMESSAGE, 0, (LPARAM)lpMsg);\n\t}\n\n\tint HwndToIndex(HWND hWnd) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (int)::SendMessage(m_hWnd, PSM_HWNDTOINDEX, (WPARAM)hWnd, 0L);\n\t}\n\n\tHWND IndexToHwnd(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (HWND)::SendMessage(m_hWnd, PSM_INDEXTOHWND, nIndex, 0L);\n\t}\n\n\tint PageToIndex(HPROPSHEETPAGE hPage) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (int)::SendMessage(m_hWnd, PSM_PAGETOINDEX, 0, (LPARAM)hPage);\n\t}\n\n\tHPROPSHEETPAGE IndexToPage(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (HPROPSHEETPAGE)::SendMessage(m_hWnd, PSM_INDEXTOPAGE, nIndex, 0L);\n\t}\n\n\tint IdToIndex(int nID) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (int)::SendMessage(m_hWnd, PSM_IDTOINDEX, 0, nID);\n\t}\n\n\tint IndexToId(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (int)::SendMessage(m_hWnd, PSM_INDEXTOID, nIndex, 0L);\n\t}\n\n\tint GetResult() const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (int)::SendMessage(m_hWnd, PSM_GETRESULT, 0, 0L);\n\t}\n\n\tBOOL RecalcPageSizes()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (BOOL)::SendMessage(m_hWnd, PSM_RECALCPAGESIZES, 0, 0L);\n\t}\n\n\tvoid SetHeaderTitle(int nIndex, LPCTSTR lpstrHeaderTitle)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\t::SendMessage(m_hWnd, PSM_SETHEADERTITLE, nIndex, (LPARAM)lpstrHeaderTitle);\n\t}\n\n\tvoid SetHeaderSubTitle(int nIndex, LPCTSTR lpstrHeaderSubTitle)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\t::SendMessage(m_hWnd, PSM_SETHEADERSUBTITLE, nIndex, (LPARAM)lpstrHeaderSubTitle);\n\t}\n\n// Implementation - override to prevent usage\n\tHWND Create(LPCTSTR, HWND, ATL::_U_RECT = NULL, LPCTSTR = NULL, DWORD = 0, DWORD = 0, ATL::_U_MENUorID = 0U, LPVOID = NULL)\n\t{\n\t\tATLASSERT(FALSE);\n\t\treturn NULL;\n\t}\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// CPropertySheetImpl - implements a property sheet\n\ntemplate <class T, class TBase = CPropertySheetWindow>\nclass ATL_NO_VTABLE CPropertySheetImpl : public ATL::CWindowImplBaseT< TBase >\n{\npublic:\n\tPROPSHEETHEADER m_psh;\n\tATL::CSimpleArray<HPROPSHEETPAGE> m_arrPages;\n\n// Construction/Destruction\n\tCPropertySheetImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL, UINT uStartPage = 0, HWND hWndParent = NULL)\n\t{\n\t\tmemset(&m_psh, 0, sizeof(PROPSHEETHEADER));\n\t\tm_psh.dwSize = sizeof(PROPSHEETHEADER);\n\t\tm_psh.dwFlags = PSH_USECALLBACK;\n\t\tm_psh.hInstance = ModuleHelper::GetResourceInstance();\n\t\tm_psh.phpage = NULL;   // will be set later\n\t\tm_psh.nPages = 0;      // will be set later\n\t\tm_psh.pszCaption = title.m_lpstr;\n\t\tm_psh.nStartPage = uStartPage;\n\t\tm_psh.hwndParent = hWndParent;   // if NULL, will be set in DoModal/Create\n\t\tm_psh.pfnCallback = T::PropSheetCallback;\n\t}\n\n\t~CPropertySheetImpl()\n\t{\n\t\tif(m_arrPages.GetSize() > 0)   // sheet never created, destroy all pages\n\t\t{\n\t\t\tfor(int i = 0; i < m_arrPages.GetSize(); i++)\n\t\t\t\t::DestroyPropertySheetPage((HPROPSHEETPAGE)m_arrPages[i]);\n\t\t}\n\t}\n\n// Callback function and overrideables\n\tstatic int CALLBACK PropSheetCallback(HWND hWnd, UINT uMsg, LPARAM lParam)\n\t{\n\t\t(void)lParam;   // avoid level 4 warning\n\t\tint nRet = 0;\n\n\t\tif(uMsg == PSCB_INITIALIZED)\n\t\t{\n\t\t\tATLASSERT(hWnd != NULL);\n\t\t\tT* pT = (T*)ModuleHelper::ExtractCreateWndData();\n\t\t\t// subclass the sheet window\n\t\t\tpT->SubclassWindow(hWnd);\n\t\t\t// remove page handles array\n\t\t\tpT->_CleanUpPages();\n\n\t\t\tpT->OnSheetInitialized();\n\t\t}\n\n\t\treturn nRet;\n\t}\n\n\tvoid OnSheetInitialized()\n\t{\n\t}\n\n// Create method\n\tHWND Create(HWND hWndParent = NULL)\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);\n\n\t\tm_psh.dwFlags |= PSH_MODELESS;\n\t\tif(m_psh.hwndParent == NULL)\n\t\t\tm_psh.hwndParent = hWndParent;\n\t\tm_psh.phpage = (HPROPSHEETPAGE*)m_arrPages.GetData();\n\t\tm_psh.nPages = m_arrPages.GetSize();\n\n\t\tT* pT = static_cast<T*>(this);\n\n\t\t// Allocate the thunk structure here, where we can fail gracefully.\n\t\tBOOL bRet = pT->m_thunk.Init(NULL, NULL);\n\t\tif(bRet == FALSE)\n\t\t{\n\t\t\t::SetLastError(ERROR_OUTOFMEMORY);\n\t\t\treturn NULL;\n\t\t}\n\n\t\tModuleHelper::AddCreateWndData(&pT->m_thunk.cd, pT);\n\n\t\tHWND hWnd = (HWND)::PropertySheet(&m_psh);\n\t\t_CleanUpPages();   // ensure clean-up, required if call failed\n\n\t\tATLASSERT(this->m_hWnd == hWnd);\n\n\t\treturn hWnd;\n\t}\n\n\tINT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);\n\n\t\tm_psh.dwFlags &= ~PSH_MODELESS;\n\t\tif(m_psh.hwndParent == NULL)\n\t\t\tm_psh.hwndParent = hWndParent;\n\t\tm_psh.phpage = (HPROPSHEETPAGE*)m_arrPages.GetData();\n\t\tm_psh.nPages = m_arrPages.GetSize();\n\n\t\tT* pT = static_cast<T*>(this);\n\n\t\t// Allocate the thunk structure here, where we can fail gracefully.\n\t\tBOOL bRet = pT->m_thunk.Init(NULL, NULL);\n\t\tif(bRet == FALSE)\n\t\t{\n\t\t\t::SetLastError(ERROR_OUTOFMEMORY);\n\t\t\treturn -1;\n\t\t}\n\n\t\tModuleHelper::AddCreateWndData(&pT->m_thunk.cd, pT);\n\n\t\tINT_PTR nRet = ::PropertySheet(&m_psh);\n\t\t_CleanUpPages();   // ensure clean-up, required if call failed\n\n\t\treturn nRet;\n\t}\n\n\t// implementation helper - clean up pages array\n\tvoid _CleanUpPages()\n\t{\n\t\tm_psh.nPages = 0;\n\t\tm_psh.phpage = NULL;\n\t\tm_arrPages.RemoveAll();\n\t}\n\n// Attributes (extended overrides of client class methods)\n// These now can be called before the sheet is created\n// Note: Calling these after the sheet is created gives unpredictable results\n\tint GetPageCount() const\n\t{\n\t\tif(this->m_hWnd == NULL)   // not created yet\n\t\t\treturn m_arrPages.GetSize();\n\t\treturn TBase::GetPageCount();\n\t}\n\n\tint GetActiveIndex() const\n\t{\n\t\tif(this->m_hWnd == NULL)   // not created yet\n\t\t\treturn m_psh.nStartPage;\n\t\treturn TBase::GetActiveIndex();\n\t}\n\n\tHPROPSHEETPAGE GetPage(int nPageIndex) const\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);   // can't do this after it's created\n\t\treturn (HPROPSHEETPAGE)m_arrPages[nPageIndex];\n\t}\n\n\tint GetPageIndex(HPROPSHEETPAGE hPage) const\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);   // can't do this after it's created\n\t\treturn m_arrPages.Find((HPROPSHEETPAGE&)hPage);\n\t}\n\n\tBOOL SetActivePage(int nPageIndex)\n\t{\n\t\tif(this->m_hWnd == NULL)   // not created yet\n\t\t{\n\t\t\tATLASSERT((nPageIndex >= 0) && (nPageIndex < m_arrPages.GetSize()));\n\t\t\tm_psh.nStartPage = nPageIndex;\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn TBase::SetActivePage(nPageIndex);\n\t}\n\n\tBOOL SetActivePage(HPROPSHEETPAGE hPage)\n\t{\n\t\tATLASSERT(hPage != NULL);\n\t\tif(this->m_hWnd == NULL)   // not created yet\n\t\t{\n\t\t\tint nPageIndex = GetPageIndex(hPage);\n\t\t\tif(nPageIndex == -1)\n\t\t\t\treturn FALSE;\n\n\t\t\treturn SetActivePage(nPageIndex);\n\t\t}\n\t\treturn TBase::SetActivePage(hPage);\n\n\t}\n\n\tvoid SetTitle(LPCTSTR lpszText, UINT nStyle = 0)\n\t{\n\t\tATLASSERT((nStyle & ~PSH_PROPTITLE) == 0);   // only PSH_PROPTITLE is valid\n\t\tATLASSERT(lpszText != NULL);\n\n\t\tif(this->m_hWnd == NULL)\n\t\t{\n\t\t\t// set internal state\n\t\t\tm_psh.pszCaption = lpszText;   // must exist until sheet is created\n\t\t\tm_psh.dwFlags &= ~PSH_PROPTITLE;\n\t\t\tm_psh.dwFlags |= nStyle;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// set external state\n\t\t\tTBase::SetTitle(lpszText, nStyle);\n\t\t}\n\t}\n\n\tvoid SetWizardMode()\n\t{\n\t\tm_psh.dwFlags |= PSH_WIZARD;\n\t}\n\n\tvoid EnableHelp()\n\t{\n\t\tm_psh.dwFlags |= PSH_HASHELP;\n\t}\n\n// Operations\n\tBOOL AddPage(HPROPSHEETPAGE hPage)\n\t{\n\t\tATLASSERT(hPage != NULL);\n\t\tBOOL bRet = FALSE;\n\t\tif(this->m_hWnd != NULL)\n\t\t\tbRet = TBase::AddPage(hPage);\n\t\telse\t// sheet not created yet, use internal data\n\t\t\tbRet = m_arrPages.Add((HPROPSHEETPAGE&)hPage);\n\t\treturn bRet;\n\t}\n\n\tBOOL AddPage(LPCPROPSHEETPAGE pPage)\n\t{\n\t\tATLASSERT(pPage != NULL);\n\t\tHPROPSHEETPAGE hPage = ::CreatePropertySheetPage(pPage);\n\t\tif(hPage == NULL)\n\t\t\treturn FALSE;\n\t\tBOOL bRet = AddPage(hPage);\n\t\tif(!bRet)\n\t\t\t::DestroyPropertySheetPage(hPage);\n\t\treturn bRet;\n\t}\n\n\tBOOL RemovePage(HPROPSHEETPAGE hPage)\n\t{\n\t\tATLASSERT(hPage != NULL);\n\t\tif(this->m_hWnd == NULL)   // not created yet\n\t\t{\n\t\t\tint nPage = GetPageIndex(hPage);\n\t\t\tif(nPage == -1)\n\t\t\t\treturn FALSE;\n\t\t\treturn RemovePage(nPage);\n\t\t}\n\t\tTBase::RemovePage(hPage);\n\t\treturn TRUE;\n\n\t}\n\n\tBOOL RemovePage(int nPageIndex)\n\t{\n\t\tBOOL bRet = TRUE;\n\t\tif(this->m_hWnd != NULL)\n\t\t\tTBase::RemovePage(nPageIndex);\n\t\telse\t// sheet not created yet, use internal data\n\t\t\tbRet = m_arrPages.RemoveAt(nPageIndex);\n\t\treturn bRet;\n\t}\n\n\tvoid SetHeader(LPCTSTR szbmHeader)\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);   // can't do this after it's created\n\n\t\tm_psh.dwFlags &= ~PSH_WIZARD;\n\t\tm_psh.dwFlags |= (PSH_HEADER | PSH_WIZARD97);\n\t\tm_psh.pszbmHeader = szbmHeader;\n\t}\n\n\tvoid SetHeader(HBITMAP hbmHeader)\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);   // can't do this after it's created\n\n\t\tm_psh.dwFlags &= ~PSH_WIZARD;\n\t\tm_psh.dwFlags |= (PSH_HEADER | PSH_USEHBMHEADER | PSH_WIZARD97);\n\t\tm_psh.hbmHeader = hbmHeader;\n\t}\n\n\tvoid SetWatermark(LPCTSTR szbmWatermark, HPALETTE hplWatermark = NULL)\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);   // can't do this after it's created\n\n\t\tm_psh.dwFlags &= ~PSH_WIZARD;\n\t\tm_psh.dwFlags |= PSH_WATERMARK | PSH_WIZARD97;\n\t\tm_psh.pszbmWatermark = szbmWatermark;\n\n\t\tif(hplWatermark != NULL)\n\t\t{\n\t\t\tm_psh.dwFlags |= PSH_USEHPLWATERMARK;\n\t\t\tm_psh.hplWatermark = hplWatermark;\n\t\t}\n\t}\n\n\tvoid SetWatermark(HBITMAP hbmWatermark, HPALETTE hplWatermark = NULL)\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);   // can't do this after it's created\n\n\t\tm_psh.dwFlags &= ~PSH_WIZARD;\n\t\tm_psh.dwFlags |= (PSH_WATERMARK | PSH_USEHBMWATERMARK | PSH_WIZARD97);\n\t\tm_psh.hbmWatermark = hbmWatermark;\n\n\t\tif(hplWatermark != NULL)\n\t\t{\n\t\t\tm_psh.dwFlags |= PSH_USEHPLWATERMARK;\n\t\t\tm_psh.hplWatermark = hplWatermark;\n\t\t}\n\t}\n\n\tvoid StretchWatermark(bool bStretchWatermark)\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);   // can't do this after it's created\n\t\tif(bStretchWatermark)\n\t\t\tm_psh.dwFlags |= PSH_STRETCHWATERMARK;\n\t\telse\n\t\t\tm_psh.dwFlags &= ~PSH_STRETCHWATERMARK;\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CPropertySheetImpl)\n\t\tMESSAGE_HANDLER(WM_COMMAND, OnCommand)\n\t\tMESSAGE_HANDLER(WM_SYSCOMMAND, OnSysCommand)\n\tEND_MSG_MAP()\n\n\tLRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tLRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);\n\t\tif((HIWORD(wParam) == BN_CLICKED) && ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) &&\n\t\t   ((m_psh.dwFlags & PSH_MODELESS) != 0) && (this->GetActivePage() == NULL))\n\t\t\tthis->DestroyWindow();\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnSysCommand(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(((m_psh.dwFlags & PSH_MODELESS) == PSH_MODELESS) && ((wParam & 0xFFF0) == SC_CLOSE))\n\t\t\tthis->SendMessage(WM_CLOSE);\n\t\telse\n\t\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n};\n\n// for non-customized sheets\nclass CPropertySheet : public CPropertySheetImpl<CPropertySheet>\n{\npublic:\n\tCPropertySheet(ATL::_U_STRINGorID title = (LPCTSTR)NULL, UINT uStartPage = 0, HWND hWndParent = NULL)\n\t\t: CPropertySheetImpl<CPropertySheet>(title, uStartPage, hWndParent)\n\t{ }\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CPropertyPageWindow - client side for a property page\n\nclass CPropertyPageWindow : public ATL::CWindow\n{\npublic:\n// Constructors\n\tCPropertyPageWindow(HWND hWnd = NULL) : ATL::CWindow(hWnd)\n\t{ }\n\n\tCPropertyPageWindow& operator =(HWND hWnd)\n\t{\n\t\tm_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n// Attributes\n\tCPropertySheetWindow GetPropertySheet() const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn CPropertySheetWindow(GetParent());\n\t}\n\n// Operations\n\tBOOL Apply()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(GetParent() != NULL);\n\t\treturn GetPropertySheet().Apply();\n\t}\n\n\tvoid CancelToClose()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(GetParent() != NULL);\n\t\tGetPropertySheet().CancelToClose();\n\t}\n\n\tvoid SetModified(BOOL bChanged = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(GetParent() != NULL);\n\t\tGetPropertySheet().SetModified(m_hWnd, bChanged);\n\t}\n\n\tLRESULT QuerySiblings(WPARAM wParam, LPARAM lParam)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(GetParent() != NULL);\n\t\treturn GetPropertySheet().QuerySiblings(wParam, lParam);\n\t}\n\n\tvoid RebootSystem()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(GetParent() != NULL);\n\t\tGetPropertySheet().RebootSystem();\n\t}\n\n\tvoid RestartWindows()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(GetParent() != NULL);\n\t\tGetPropertySheet().RestartWindows();\n\t}\n\n\tvoid SetWizardButtons(DWORD dwFlags)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(GetParent() != NULL);\n\t\tGetPropertySheet().SetWizardButtons(dwFlags);\n\t}\n\n// Implementation - overrides to prevent usage\n\tHWND Create(LPCTSTR, HWND, ATL::_U_RECT = NULL, LPCTSTR = NULL, DWORD = 0, DWORD = 0, ATL::_U_MENUorID = 0U, LPVOID = NULL)\n\t{\n\t\tATLASSERT(FALSE);\n\t\treturn NULL;\n\t}\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// CPropertyPageImpl - implements a property page\n\n#if defined(_WTL_FORCE_OLD_PAGE_NOTIFY_HANDLERS) && defined(_WTL_NEW_PAGE_NOTIFY_HANDLERS)\n\t#error _WTL_FORCE_OLD_PAGE_NOTIFY_HANDLERS and _WTL_NEW_PAGE_NOTIFY_HANDLERS cannot be both defined\n#endif\n\n#if !defined(_WTL_FORCE_OLD_PAGE_NOTIFY_HANDLERS) && !defined(_WTL_NEW_PAGE_NOTIFY_HANDLERS)\n  #define _WTL_NEW_PAGE_NOTIFY_HANDLERS\n#endif\n\n// NOTE: _WTL_NEW_PAGE_NOTIFY_HANDLERS is now defined by default.\n// It enables use of new notification handlers that \n// return direct values without any restrictions.\n// Define _WTL_FORCE_OLD_PAGE_NOTIFY_HANDLERS to use old handlers.\n\ntemplate <class T, class TBase = CPropertyPageWindow>\nclass ATL_NO_VTABLE CPropertyPageImpl : public ATL::CDialogImplBaseT< TBase >\n{\npublic:\n\tPROPSHEETPAGE m_psp;\n\n\toperator PROPSHEETPAGE*() { return &m_psp; }\n\n// Construction\n\tCPropertyPageImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL)\n\t{\n\t\t// initialize PROPSHEETPAGE struct\n\t\tmemset(&m_psp, 0, sizeof(PROPSHEETPAGE));\n\t\tm_psp.dwSize = sizeof(PROPSHEETPAGE);\n\t\tm_psp.dwFlags = PSP_USECALLBACK;\n\t\tm_psp.hInstance = ModuleHelper::GetResourceInstance();\n\t\tT* pT = static_cast<T*>(this);\n\t\tm_psp.pszTemplate = MAKEINTRESOURCE(pT->IDD);\n\t\tm_psp.pfnDlgProc = (DLGPROC)T::StartDialogProc;\n\t\tm_psp.pfnCallback = T::PropPageCallback;\n\t\tm_psp.lParam = (LPARAM)pT;\n\n\t\tif(title.m_lpstr != NULL)\n\t\t\tSetTitle(title);\n\t}\n\n// Callback function and overrideables\n\tstatic UINT CALLBACK PropPageCallback(HWND hWnd, UINT uMsg, LPPROPSHEETPAGE ppsp)\n\t{\n\t\t(void)hWnd;   // avoid level 4 warning\n\t\tATLASSERT(hWnd == NULL);\n\t\tT* pT = (T*)ppsp->lParam;\n\t\tUINT uRet = 0;\n\n\t\tswitch(uMsg)\n\t\t{\n\t\tcase PSPCB_CREATE:\n\t\t\t{\n\t\t\t\tATL::CDialogImplBaseT< TBase >* pPage = (ATL::CDialogImplBaseT< TBase >*)pT;\n\t\t\t\tModuleHelper::AddCreateWndData(&pPage->m_thunk.cd, pPage);\n\t\t\t\tuRet = pT->OnPageCreate() ? 1 : 0;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase PSPCB_ADDREF:\n\t\t\tpT->OnPageAddRef();\n\t\t\tbreak;\n\t\tcase PSPCB_RELEASE:\n\t\t\tpT->OnPageRelease();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t\treturn uRet;\n\t}\n\n\tbool OnPageCreate()\n\t{\n\t\treturn true;   // true - allow page to be created, false - prevent creation\n\t}\n\n\tvoid OnPageAddRef()\n\t{\n\t}\n\n\tvoid OnPageRelease()\n\t{\n\t}\n\n// Create method\n\tHPROPSHEETPAGE Create()\n\t{\n\t\treturn ::CreatePropertySheetPage(&m_psp);\n\t}\n\n// Attributes\n\tvoid SetTitle(ATL::_U_STRINGorID title)\n\t{\n\t\tm_psp.pszTitle = title.m_lpstr;\n\t\tm_psp.dwFlags |= PSP_USETITLE;\n\t}\n\n\tvoid SetHeaderTitle(LPCTSTR lpstrHeaderTitle)\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);   // can't do this after it's created\n\t\tm_psp.dwFlags |= PSP_USEHEADERTITLE;\n\t\tm_psp.pszHeaderTitle = lpstrHeaderTitle;\n\t}\n\n\tvoid SetHeaderSubTitle(LPCTSTR lpstrHeaderSubTitle)\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);   // can't do this after it's created\n\t\tm_psp.dwFlags |= PSP_USEHEADERSUBTITLE;\n\t\tm_psp.pszHeaderSubTitle = lpstrHeaderSubTitle;\n\t}\n\n// Operations\n\tvoid EnableHelp()\n\t{\n\t\tm_psp.dwFlags |= PSP_HASHELP;\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CPropertyPageImpl)\n\t\tMESSAGE_HANDLER(WM_NOTIFY, OnNotify)\n\tEND_MSG_MAP()\n\n\tLRESULT OnNotify(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\tNMHDR* pNMHDR = (NMHDR*)lParam;\n\n\t\t// don't handle messages not from the page/sheet itself\n\t\tif((pNMHDR->hwndFrom != this->m_hWnd) && (pNMHDR->hwndFrom != ::GetParent(this->m_hWnd)))\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tLRESULT lResult = 0;\n\t\tswitch(pNMHDR->code)\n\t\t{\n#ifdef _WTL_NEW_PAGE_NOTIFY_HANDLERS\n\t\tcase PSN_SETACTIVE:\n\t\t\tlResult = pT->OnSetActive();\n\t\t\tbreak;\n\t\tcase PSN_KILLACTIVE:\n\t\t\tlResult = pT->OnKillActive();\n\t\t\tbreak;\n\t\tcase PSN_APPLY:\n\t\t\tlResult = pT->OnApply();\n\t\t\tbreak;\n\t\tcase PSN_RESET:\n\t\t\tpT->OnReset();\n\t\t\tbreak;\n\t\tcase PSN_QUERYCANCEL:\n\t\t\tlResult = pT->OnQueryCancel();\n\t\t\tbreak;\n\t\tcase PSN_WIZNEXT:\n\t\t\tlResult = pT->OnWizardNext();\n\t\t\tbreak;\n\t\tcase PSN_WIZBACK:\n\t\t\tlResult = pT->OnWizardBack();\n\t\t\tbreak;\n\t\tcase PSN_WIZFINISH:\n\t\t\tlResult = pT->OnWizardFinish();\n\t\t\tbreak;\n\t\tcase PSN_HELP:\n\t\t\tpT->OnHelp();\n\t\t\tbreak;\n\t\tcase PSN_GETOBJECT:\n\t\t\tif(!pT->OnGetObject((LPNMOBJECTNOTIFY)lParam))\n\t\t\t\tbHandled = FALSE;\n\t\t\tbreak;\n\t\tcase PSN_TRANSLATEACCELERATOR:\n\t\t\t{\n\t\t\t\tLPPSHNOTIFY lpPSHNotify = (LPPSHNOTIFY)lParam;\n\t\t\t\tlResult = pT->OnTranslateAccelerator((LPMSG)lpPSHNotify->lParam);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase PSN_QUERYINITIALFOCUS:\n\t\t\t{\n\t\t\t\tLPPSHNOTIFY lpPSHNotify = (LPPSHNOTIFY)lParam;\n\t\t\t\tlResult = (LRESULT)pT->OnQueryInitialFocus((HWND)lpPSHNotify->lParam);\n\t\t\t}\n\t\t\tbreak;\n\n#else // !_WTL_NEW_PAGE_NOTIFY_HANDLERS\n\t\tcase PSN_SETACTIVE:\n\t\t\tlResult = pT->OnSetActive() ? 0 : -1;\n\t\t\tbreak;\n\t\tcase PSN_KILLACTIVE:\n\t\t\tlResult = !pT->OnKillActive();\n\t\t\tbreak;\n\t\tcase PSN_APPLY:\n\t\t\tlResult = pT->OnApply() ? PSNRET_NOERROR : PSNRET_INVALID_NOCHANGEPAGE;\n\t\t\tbreak;\n\t\tcase PSN_RESET:\n\t\t\tpT->OnReset();\n\t\t\tbreak;\n\t\tcase PSN_QUERYCANCEL:\n\t\t\tlResult = !pT->OnQueryCancel();\n\t\t\tbreak;\n\t\tcase PSN_WIZNEXT:\n\t\t\tlResult = pT->OnWizardNext();\n\t\t\tbreak;\n\t\tcase PSN_WIZBACK:\n\t\t\tlResult = pT->OnWizardBack();\n\t\t\tbreak;\n\t\tcase PSN_WIZFINISH:\n\t\t\tlResult = !pT->OnWizardFinish();\n\t\t\tbreak;\n\t\tcase PSN_HELP:\n\t\t\tpT->OnHelp();\n\t\t\tbreak;\n\t\tcase PSN_GETOBJECT:\n\t\t\tif(!pT->OnGetObject((LPNMOBJECTNOTIFY)lParam))\n\t\t\t\tbHandled = FALSE;\n\t\t\tbreak;\n\t\tcase PSN_TRANSLATEACCELERATOR:\n\t\t\t{\n\t\t\t\tLPPSHNOTIFY lpPSHNotify = (LPPSHNOTIFY)lParam;\n\t\t\t\tlResult = pT->OnTranslateAccelerator((LPMSG)lpPSHNotify->lParam) ? PSNRET_MESSAGEHANDLED : PSNRET_NOERROR;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase PSN_QUERYINITIALFOCUS:\n\t\t\t{\n\t\t\t\tLPPSHNOTIFY lpPSHNotify = (LPPSHNOTIFY)lParam;\n\t\t\t\tlResult = (LRESULT)pT->OnQueryInitialFocus((HWND)lpPSHNotify->lParam);\n\t\t\t}\n\t\t\tbreak;\n\n#endif // !_WTL_NEW_PAGE_NOTIFY_HANDLERS\n\t\tdefault:\n\t\t\tbHandled = FALSE;   // not handled\n\t\t}\n\n\t\treturn lResult;\n\t}\n\n// Overridables\n#ifdef _WTL_NEW_PAGE_NOTIFY_HANDLERS\n\tint OnSetActive()\n\t{\n\t\t// 0 = allow activate\n\t\t// -1 = go back that was active\n\t\t// page ID = jump to page\n\t\treturn 0;\n\t}\n\n\tBOOL OnKillActive()\n\t{\n\t\t// FALSE = allow deactivate\n\t\t// TRUE = prevent deactivation\n\t\treturn FALSE;\n\t}\n\n\tint OnApply()\n\t{\n\t\t// PSNRET_NOERROR = apply OK\n\t\t// PSNRET_INVALID = apply not OK, return to this page\n\t\t// PSNRET_INVALID_NOCHANGEPAGE = apply not OK, don't change focus\n\t\treturn PSNRET_NOERROR;\n\t}\n\n\tvoid OnReset()\n\t{\n\t}\n\n\tBOOL OnQueryCancel()\n\t{\n\t\t// FALSE = allow cancel\n\t\t// TRUE = prevent cancel\n\t\treturn FALSE;\n\t}\n\n\tint OnWizardBack()\n\t{\n\t\t// 0  = goto previous page\n\t\t// -1 = prevent page change\n\t\t// >0 = jump to page by dlg ID\n\t\treturn 0;\n\t}\n\n\tint OnWizardNext()\n\t{\n\t\t// 0  = goto next page\n\t\t// -1 = prevent page change\n\t\t// >0 = jump to page by dlg ID\n\t\treturn 0;\n\t}\n\n\tINT_PTR OnWizardFinish()\n\t{\n\t\t// FALSE = allow finish\n\t\t// TRUE = prevent finish\n\t\t// HWND = prevent finish and set focus to HWND (CommCtrl 5.80 only)\n\t\treturn FALSE;\n\t}\n\n\tvoid OnHelp()\n\t{\n\t}\n\n\tBOOL OnGetObject(LPNMOBJECTNOTIFY /*lpObjectNotify*/)\n\t{\n\t\treturn FALSE;   // not processed\n\t}\n\n\tint OnTranslateAccelerator(LPMSG /*lpMsg*/)\n\t{\n\t\t// PSNRET_NOERROR - message not handled\n\t\t// PSNRET_MESSAGEHANDLED - message handled\n\t\treturn PSNRET_NOERROR;\n\t}\n\n\tHWND OnQueryInitialFocus(HWND /*hWndFocus*/)\n\t{\n\t\t// NULL = set focus to default control\n\t\t// HWND = set focus to HWND\n\t\treturn NULL;\n\t}\n\n#else // !_WTL_NEW_PAGE_NOTIFY_HANDLERS\n\tBOOL OnSetActive()\n\t{\n\t\treturn TRUE;\n\t}\n\n\tBOOL OnKillActive()\n\t{\n\t\treturn TRUE;\n\t}\n\n\tBOOL OnApply()\n\t{\n\t\treturn TRUE;\n\t}\n\n\tvoid OnReset()\n\t{\n\t}\n\n\tBOOL OnQueryCancel()\n\t{\n\t\treturn TRUE;    // ok to cancel\n\t}\n\n\tint OnWizardBack()\n\t{\n\t\t// 0  = goto previous page\n\t\t// -1 = prevent page change\n\t\t// >0 = jump to page by dlg ID\n\t\treturn 0;\n\t}\n\n\tint OnWizardNext()\n\t{\n\t\t// 0  = goto next page\n\t\t// -1 = prevent page change\n\t\t// >0 = jump to page by dlg ID\n\t\treturn 0;\n\t}\n\n\tBOOL OnWizardFinish()\n\t{\n\t\treturn TRUE;\n\t}\n\n\tvoid OnHelp()\n\t{\n\t}\n\n\tBOOL OnGetObject(LPNMOBJECTNOTIFY /*lpObjectNotify*/)\n\t{\n\t\treturn FALSE;   // not processed\n\t}\n\n\tBOOL OnTranslateAccelerator(LPMSG /*lpMsg*/)\n\t{\n\t\treturn FALSE;   // not translated\n\t}\n\n\tHWND OnQueryInitialFocus(HWND /*hWndFocus*/)\n\t{\n\t\treturn NULL;   // default\n\t}\n\n#endif // !_WTL_NEW_PAGE_NOTIFY_HANDLERS\n};\n\n// for non-customized pages\ntemplate <WORD t_wDlgTemplateID>\nclass CPropertyPage : public CPropertyPageImpl<CPropertyPage<t_wDlgTemplateID> >\n{\npublic:\n\tenum { IDD = t_wDlgTemplateID };\n\n\tCPropertyPage(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : CPropertyPageImpl<CPropertyPage>(title)\n\t{ }\n\n\tDECLARE_EMPTY_MSG_MAP()\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// CAxPropertyPageImpl - property page that hosts ActiveX controls\n\n#ifndef _ATL_NO_HOSTING\n\n// Note: You must #include <atlhost.h> to use these classes\n\ntemplate <class T, class TBase = CPropertyPageWindow>\nclass ATL_NO_VTABLE CAxPropertyPageImpl : public CPropertyPageImpl< T, TBase >\n{\npublic:\n// Data members\n\tHGLOBAL m_hInitData;\n\tHGLOBAL m_hDlgRes;\n\tHGLOBAL m_hDlgResSplit;\n\n// Constructor/destructor\n\tCAxPropertyPageImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : \n\t\t\tCPropertyPageImpl< T, TBase >(title),\n\t\t\tm_hInitData(NULL), m_hDlgRes(NULL), m_hDlgResSplit(NULL)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\t(void)pT;   // avoid level 4 warning\n\n\t\t// initialize ActiveX hosting and modify dialog template\n\t\tATL::AtlAxWinInit();\n\n\t\tHINSTANCE hInstance = ModuleHelper::GetResourceInstance();\n\t\tLPCTSTR lpTemplateName = MAKEINTRESOURCE(pT->IDD);\n\t\tHRSRC hDlg = ::FindResource(hInstance, lpTemplateName, (LPTSTR)RT_DIALOG);\n\t\tif(hDlg != NULL)\n\t\t{\n\t\t\tHRSRC hDlgInit = ::FindResource(hInstance, lpTemplateName, (LPTSTR)_ATL_RT_DLGINIT);\n\n\t\t\tBYTE* pInitData = NULL;\n\t\t\tif(hDlgInit != NULL)\n\t\t\t{\n\t\t\t\tm_hInitData = ::LoadResource(hInstance, hDlgInit);\n\t\t\t\tpInitData = (BYTE*)::LockResource(m_hInitData);\n\t\t\t}\n\n\t\t\tm_hDlgRes = ::LoadResource(hInstance, hDlg);\n\t\t\tDLGTEMPLATE* pDlg = (DLGTEMPLATE*)::LockResource(m_hDlgRes);\n\t\t\tLPCDLGTEMPLATE lpDialogTemplate = ATL::_DialogSplitHelper::SplitDialogTemplate(pDlg, pInitData);\n\t\t\tif(lpDialogTemplate != pDlg)\n\t\t\t\tm_hDlgResSplit = GlobalHandle(lpDialogTemplate);\n\n\t\t\t// set up property page to use in-memory dialog template\n\t\t\tif(lpDialogTemplate != NULL)\n\t\t\t{\n\t\t\t\tthis->m_psp.dwFlags |= PSP_DLGINDIRECT;\n\t\t\t\tthis->m_psp.pResource = lpDialogTemplate;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tATLASSERT(FALSE && _T(\"CAxPropertyPageImpl - ActiveX initializtion failed!\"));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tATLASSERT(FALSE && _T(\"CAxPropertyPageImpl - Cannot find dialog template!\"));\n\t\t}\n\t}\n\n\t~CAxPropertyPageImpl()\n\t{\n\t\tif(m_hInitData != NULL)\n\t\t{\n\t\t\tUnlockResource(m_hInitData);\n\t\t\tFreeResource(m_hInitData);\n\t\t}\n\t\tif(m_hDlgRes != NULL)\n\t\t{\n\t\t\tUnlockResource(m_hDlgRes);\n\t\t\tFreeResource(m_hDlgRes);\n\t\t}\n\t\tif(m_hDlgResSplit != NULL)\n\t\t{\n\t\t\t::GlobalFree(m_hDlgResSplit);\n\t\t}\n\t}\n\n// Methods\n\t// call this one to handle keyboard message for ActiveX controls\n\tBOOL PreTranslateMessage(LPMSG pMsg)\n\t{\n\t\tif (((pMsg->message < WM_KEYFIRST) || (pMsg->message > WM_KEYLAST)) &&\n\t\t   ((pMsg->message < WM_MOUSEFIRST) || (pMsg->message > WM_MOUSELAST)))\n\t\t\treturn FALSE;\n\t\t// find a direct child of the dialog from the window that has focus\n\t\tHWND hWndCtl = ::GetFocus();\n\t\tif (this->IsChild(hWndCtl) && (::GetParent(hWndCtl) != this->m_hWnd))\n\t\t{\n\t\t\tdo\n\t\t\t{\n\t\t\t\thWndCtl = ::GetParent(hWndCtl);\n\t\t\t}\n\t\t\twhile (::GetParent(hWndCtl) != this->m_hWnd);\n\t\t}\n\t\t// give controls a chance to translate this message\n\t\treturn (BOOL)::SendMessage(hWndCtl, WM_FORWARDMSG, 0, (LPARAM)pMsg);\n\t}\n\n// Overridables\n\t// new default implementation for ActiveX hosting pages\n#ifdef _WTL_NEW_PAGE_NOTIFY_HANDLERS\n\tint OnTranslateAccelerator(LPMSG lpMsg)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\treturn (pT->PreTranslateMessage(lpMsg) != FALSE) ? PSNRET_MESSAGEHANDLED : PSNRET_NOERROR;\n\t}\n#else // !_WTL_NEW_PAGE_NOTIFY_HANDLERS\n\tBOOL OnTranslateAccelerator(LPMSG lpMsg)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\treturn pT->PreTranslateMessage(lpMsg);\n\t}\n#endif // !_WTL_NEW_PAGE_NOTIFY_HANDLERS\n\n\tint GetIDD()\n\t{\n\t\treturn( static_cast<T*>(this)->IDD );\n\t}\n\n\tvirtual DLGPROC GetDialogProc()\n\t{\n\t\treturn DialogProc;\n\t}\n\n\tstatic INT_PTR CALLBACK DialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\n\t{\n\t\tCAxPropertyPageImpl< T, TBase >* pThis = (CAxPropertyPageImpl< T, TBase >*)hWnd;\n\t\tif (uMsg == WM_INITDIALOG)\n\t\t{\n\t\t\tHRESULT hr;\n\t\t\tif (FAILED(hr = pThis->CreateActiveXControls(pThis->GetIDD())))\n\t\t\t{\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\treturn CPropertyPageImpl< T, TBase >::DialogProc(hWnd, uMsg, wParam, lParam);\n\t}\n\n// ActiveX controls creation\n\tvirtual HRESULT CreateActiveXControls(UINT nID)\n\t{\n\t\t// Load dialog template and InitData\n\t\tHRSRC hDlgInit = ::FindResource(ATL::_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(nID), (LPTSTR)_ATL_RT_DLGINIT);\n\t\tBYTE* pInitData = NULL;\n\t\tHGLOBAL hData = NULL;\n\t\tHRESULT hr = S_OK;\n\t\tif (hDlgInit != NULL)\n\t\t{\n\t\t\thData = ::LoadResource(ATL::_AtlBaseModule.GetResourceInstance(), hDlgInit);\n\t\t\tif (hData != NULL)\n\t\t\t\tpInitData = (BYTE*) ::LockResource(hData);\n\t\t}\n\n\t\tHRSRC hDlg = ::FindResource(ATL::_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(nID), (LPTSTR)RT_DIALOG);\n\t\tif (hDlg != NULL)\n\t\t{\n\t\t\tHGLOBAL hResource = ::LoadResource(ATL::_AtlBaseModule.GetResourceInstance(), hDlg);\n\t\t\tDLGTEMPLATE* pDlg = NULL;\n\t\t\tif (hResource != NULL)\n\t\t\t{\n\t\t\t\tpDlg = (DLGTEMPLATE*) ::LockResource(hResource);\n\t\t\t\tif (pDlg != NULL)\n\t\t\t\t{\n\t\t\t\t\t// Get first control on the template\n\t\t\t\t\tBOOL bDialogEx = ATL::_DialogSplitHelper::IsDialogEx(pDlg);\n\t\t\t\t\tWORD nItems = ATL::_DialogSplitHelper::DlgTemplateItemCount(pDlg);\n\n\t\t\t\t\t// Get first control on the dialog\n\t\t\t\t\tDLGITEMTEMPLATE* pItem = ATL::_DialogSplitHelper::FindFirstDlgItem(pDlg);\n\t\t\t\t\tHWND hWndPrev = this->GetWindow(GW_CHILD);\n\n\t\t\t\t\t// Create all ActiveX cotnrols in the dialog template and place them in the correct tab order (z-order)\n\t\t\t\t\tfor (WORD nItem = 0; nItem < nItems; nItem++)\n\t\t\t\t\t{\n\t\t\t\t\t\tDWORD wID = bDialogEx ? ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->id : pItem->id;\n\t\t\t\t\t\tif (ATL::_DialogSplitHelper::IsActiveXControl(pItem, bDialogEx))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBYTE* pData = NULL;\n\t\t\t\t\t\t\tDWORD dwLen = ATL::_DialogSplitHelper::FindCreateData(wID, pInitData, &pData);\n\t\t\t\t\t\t\tATL::CComPtr<IStream> spStream;\n\t\t\t\t\t\t\tif (dwLen != 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tHGLOBAL h = GlobalAlloc(GHND, dwLen);\n\t\t\t\t\t\t\t\tif (h != NULL)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tBYTE* pBytes = (BYTE*) GlobalLock(h);\n\t\t\t\t\t\t\t\t\tBYTE* pSource = pData; \n\t\t\t\t\t\t\t\t\tATL::Checked::memcpy_s(pBytes, dwLen, pSource, dwLen);\n\t\t\t\t\t\t\t\t\tGlobalUnlock(h);\n\t\t\t\t\t\t\t\t\tCreateStreamOnHGlobal(h, TRUE, &spStream);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thr = E_OUTOFMEMORY;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tATL::CComBSTR bstrLicKey;\n\t\t\t\t\t\t\thr = ATL::_DialogSplitHelper::ParseInitData(spStream, &bstrLicKey.m_str);\n\t\t\t\t\t\t\tif (SUCCEEDED(hr))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tATL::CAxWindow2 wnd;\n\t\t\t\t\t\t\t\t// Get control caption.\n\t\t\t\t\t\t\t\tLPWSTR pszClassName = \n\t\t\t\t\t\t\t\t\tbDialogEx ? \n\t\t\t\t\t\t\t\t\t\t(LPWSTR)(((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem) + 1) :\n\t\t\t\t\t\t\t\t\t\t(LPWSTR)(pItem + 1);\n\t\t\t\t\t\t\t\t// Get control rect.\n\t\t\t\t\t\t\t\tRECT rect = {};\n\t\t\t\t\t\t\t\trect.left = bDialogEx ? ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->x : pItem->x;\n\t\t\t\t\t\t\t\trect.top = bDialogEx ? ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->y : pItem->y;\n\t\t\t\t\t\t\t\trect.right = rect.left + (bDialogEx ? ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->cx : pItem->cx);\n\t\t\t\t\t\t\t\trect.bottom = rect.top + (bDialogEx ? ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->cy : pItem->cy);\n\n\t\t\t\t\t\t\t\t// Convert from dialog units to screen units\n\t\t\t\t\t\t\t\tthis->MapDialogRect(&rect);\n\n\t\t\t\t\t\t\t\t// Create AxWindow with a NULL caption.\n\t\t\t\t\t\t\t\twnd.Create(this->m_hWnd,\n\t\t\t\t\t\t\t\t\t&rect, \n\t\t\t\t\t\t\t\t\tNULL, \n\t\t\t\t\t\t\t\t\t(bDialogEx ? \n\t\t\t\t\t\t\t\t\t\t((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->style : \n\t\t\t\t\t\t\t\t\t\tpItem->style) | WS_TABSTOP, \n\t\t\t\t\t\t\t\t\tbDialogEx ? \n\t\t\t\t\t\t\t\t\t\t((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->exStyle : \n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\tbDialogEx ? \n\t\t\t\t\t\t\t\t\t\t((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->id : \n\t\t\t\t\t\t\t\t\t\tpItem->id,\n\t\t\t\t\t\t\t\t\tNULL);\n\n\t\t\t\t\t\t\t\tif (wnd != NULL)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Set the Help ID\n\t\t\t\t\t\t\t\t\tif (bDialogEx && ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->helpID != 0)\n\t\t\t\t\t\t\t\t\t\twnd.SetWindowContextHelpId(((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->helpID);\n\t\t\t\t\t\t\t\t\t// Try to create the ActiveX control.\n\t\t\t\t\t\t\t\t\thr = wnd.CreateControlLic(pszClassName, spStream, NULL, bstrLicKey);\n\t\t\t\t\t\t\t\t\tif (FAILED(hr))\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t// Set the correct tab position.\n\t\t\t\t\t\t\t\t\tif (nItem == 0)\n\t\t\t\t\t\t\t\t\t\thWndPrev = HWND_TOP;\n\t\t\t\t\t\t\t\t\twnd.SetWindowPos(hWndPrev, 0,0,0,0,SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);\n\t\t\t\t\t\t\t\t\thWndPrev = wnd;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thr = ATL::AtlHresultFromLastError();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (nItem != 0)\n\t\t\t\t\t\t\t\thWndPrev = ::GetWindow(hWndPrev, GW_HWNDNEXT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpItem = ATL::_DialogSplitHelper::FindNextDlgItem(pItem, bDialogEx);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\thr = ATL::AtlHresultFromLastError();\n\t\t\t}\n\t\t\telse\n\t\t\t\thr = ATL::AtlHresultFromLastError();\n\t\t}\n\t\treturn hr;\n\t}\n\n// Event handling support\n\tHRESULT AdviseSinkMap(bool bAdvise)\n\t{\n\t\tif(!bAdvise && (this->m_hWnd == NULL))\n\t\t{\n\t\t\t// window is gone, controls are already unadvised\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"CAxPropertyPageImpl::AdviseSinkMap called after the window was destroyed\\n\"));\n\t\t\treturn S_OK;\n\t\t}\n\t\tHRESULT hRet = E_NOTIMPL;\n\t\t__if_exists(T::_GetSinkMapFinder)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\thRet = AtlAdviseSinkMap(pT, bAdvise);\n\t\t}\n\t\treturn hRet;\n\t}\n\n// Message map and handlers\n\ttypedef CPropertyPageImpl< T, TBase>   _baseClass;\n\tBEGIN_MSG_MAP(CAxPropertyPageImpl)\n\t\tMESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)\n\t\tMESSAGE_HANDLER(WM_DESTROY, OnDestroy)\n\t\tCHAIN_MSG_MAP(_baseClass)\n\tEND_MSG_MAP()\n\n\tLRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\t// initialize controls in dialog with DLGINIT resource section\n\t\tthis->ExecuteDlgInit(static_cast<T*>(this)->IDD);\n\t\tAdviseSinkMap(true);\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tAdviseSinkMap(false);\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n};\n\n// for non-customized pages\ntemplate <WORD t_wDlgTemplateID>\nclass CAxPropertyPage : public CAxPropertyPageImpl<CAxPropertyPage<t_wDlgTemplateID> >\n{\npublic:\n\tenum { IDD = t_wDlgTemplateID };\n\n\tCAxPropertyPage(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : CAxPropertyPageImpl<CAxPropertyPage>(title)\n\t{ }\n\n\tBEGIN_MSG_MAP(CAxPropertyPage)\n\t\tCHAIN_MSG_MAP(CAxPropertyPageImpl<CAxPropertyPage<t_wDlgTemplateID> >)\n\tEND_MSG_MAP()\n};\n\n#endif // _ATL_NO_HOSTING\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Wizard97 Support\n\n// Sample wizard dialog resources:\n//\n// IDD_WIZ97_INTERIOR_BLANK DIALOG  0, 0, 317, 143\n// STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION\n// CAPTION \"Wizard97 Property Page - Interior\"\n// FONT 8, \"MS Shell Dlg\"\n// BEGIN\n// END\n//\n// IDD_WIZ97_EXTERIOR_BLANK DIALOGEX 0, 0, 317, 193\n// STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION\n// CAPTION \"Wizard97 Property Page - Welcome/Complete\"\n// FONT 8, \"MS Shell Dlg\", 0, 0, 0x0\n// BEGIN\n//    LTEXT           \"Welcome to the X Wizard\",IDC_WIZ97_EXTERIOR_TITLE,115,8,\n//                    195,24\n//    LTEXT           \"Wizard Explanation\\r\\n(The height of the static text should be in multiples of 8 dlus)\",\n//                    IDC_STATIC,115,40,195,16\n//    LTEXT           \"h\",IDC_WIZ97_BULLET1,118,64,8,8\n//    LTEXT           \"List Item 1 (the h is turned into a bullet)\",IDC_STATIC,\n//                    127,63,122,8\n//    LTEXT           \"h\",IDC_WIZ97_BULLET2,118,79,8,8\n//    LTEXT           \"List Item 2. Keep 7 dlus between paragraphs\",IDC_STATIC,\n//                    127,78,33,8\n//    CONTROL         \"&Do not show this Welcome page again\",\n//                    IDC_WIZ97_WELCOME_NOTAGAIN,\"Button\",BS_AUTOCHECKBOX | \n//                    WS_TABSTOP,115,169,138,10\n// END\n//\n// GUIDELINES DESIGNINFO \n// BEGIN\n//    IDD_WIZ97_INTERIOR_BLANK, DIALOG\n//    BEGIN\n//        LEFTMARGIN, 7\n//        RIGHTMARGIN, 310\n//        VERTGUIDE, 21\n//        VERTGUIDE, 31\n//        VERTGUIDE, 286\n//        VERTGUIDE, 296\n//        TOPMARGIN, 7\n//        BOTTOMMARGIN, 136\n//        HORZGUIDE, 8\n//    END\n//\n//    IDD_WIZ97_EXTERIOR_BLANK, DIALOG\n//    BEGIN\n//        RIGHTMARGIN, 310\n//        VERTGUIDE, 115\n//        VERTGUIDE, 118\n//        VERTGUIDE, 127\n//        TOPMARGIN, 7\n//        BOTTOMMARGIN, 186\n//        HORZGUIDE, 8\n//        HORZGUIDE, 32\n//        HORZGUIDE, 40\n//        HORZGUIDE, 169\n//    END\n// END\n\n///////////////////////////////////////////////////////////////////////////////\n// CWizard97SheetWindow - client side for a Wizard 97 style wizard sheet\n\nclass CWizard97SheetWindow : public CPropertySheetWindow\n{\npublic:\n// Constructors\n\tCWizard97SheetWindow(HWND hWnd = NULL) : CPropertySheetWindow(hWnd)\n\t{ }\n\n\tCWizard97SheetWindow& operator =(HWND hWnd)\n\t{\n\t\tm_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n// Operations\n\tHFONT GetExteriorPageTitleFont(void)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (HFONT)::SendMessage(m_hWnd, GetMessage_GetExteriorPageTitleFont(), 0, 0L);\n\t}\n\n\tHFONT GetBulletFont(void)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn (HFONT)::SendMessage(m_hWnd, GetMessage_GetBulletFont(), 0, 0L);\n\t}\n\n// Helpers\n\tstatic UINT GetMessage_GetExteriorPageTitleFont()\n\t{\n\t\tstatic UINT uGetExteriorPageTitleFont = 0;\n\t\tif(uGetExteriorPageTitleFont == 0)\n\t\t{\n\t\t\tCStaticDataInitCriticalSectionLock lock;\n\t\t\tif(FAILED(lock.Lock()))\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CWizard97SheetWindow::GetMessage_GetExteriorPageTitleFont().\\n\"));\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif(uGetExteriorPageTitleFont == 0)\n\t\t\t\tuGetExteriorPageTitleFont = ::RegisterWindowMessage(_T(\"GetExteriorPageTitleFont_531AF056-B8BE-4c4c-B786-AC608DF0DF12\"));\n\n\t\t\tlock.Unlock();\n\t\t}\n\t\tATLASSERT(uGetExteriorPageTitleFont != 0);\n\t\treturn uGetExteriorPageTitleFont;\n\t}\n\n\tstatic UINT GetMessage_GetBulletFont()\n\t{\n\t\tstatic UINT uGetBulletFont = 0;\n\t\tif(uGetBulletFont == 0)\n\t\t{\n\t\t\tCStaticDataInitCriticalSectionLock lock;\n\t\t\tif(FAILED(lock.Lock()))\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CWizard97SheetWindow::GetMessage_GetBulletFont().\\n\"));\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif(uGetBulletFont == 0)\n\t\t\t\tuGetBulletFont = ::RegisterWindowMessage(_T(\"GetBulletFont_AD347D08-8F65-45ef-982E-6352E8218AD5\"));\n\n\t\t\tlock.Unlock();\n\t\t}\n\t\tATLASSERT(uGetBulletFont != 0);\n\t\treturn uGetBulletFont;\n\t}\n\n// Implementation - override to prevent usage\n\tHWND Create(LPCTSTR, HWND, ATL::_U_RECT = NULL, LPCTSTR = NULL, DWORD = 0, DWORD = 0, ATL::_U_MENUorID = 0U, LPVOID = NULL)\n\t{\n\t\tATLASSERT(FALSE);\n\t\treturn NULL;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CWizard97SheetImpl - implements a Wizard 97 style wizard sheet\n\ntemplate <class T, class TBase = CWizard97SheetWindow>\nclass ATL_NO_VTABLE CWizard97SheetImpl : public CPropertySheetImpl< T, TBase >\n{\nprotected:\n// Typedefs\n\ttypedef CWizard97SheetImpl< T, TBase > thisClass;\n\ttypedef CPropertySheetImpl< T, TBase > baseClass;\n\n// Member variables\n\tCFont m_fontExteriorPageTitle;   // Welcome and Completion page title font\n\tCFont m_fontBullet;              // Bullet font (used on static text 'h' to produce a small bullet)\n\tbool m_bReceivedFirstSizeMessage;   \n\npublic:\n\tCWizard97SheetImpl(ATL::_U_STRINGorID title, ATL::_U_STRINGorID headerBitmap, ATL::_U_STRINGorID watermarkBitmap, UINT uStartPage = 0, HWND hWndParent = NULL) :\n\t\t\tbaseClass(title, uStartPage, hWndParent),\n\t\t\tm_bReceivedFirstSizeMessage(false)\n\t{\n\t\tthis->m_psh.dwFlags &= ~(PSH_NOCONTEXTHELP);\n\t\tthis->m_psh.dwFlags &= ~(PSH_WIZARD | PSH_WIZARD_LITE);\n\n\t\tthis->m_psh.dwFlags |= (PSH_HASHELP | PSH_WIZARDCONTEXTHELP);\n\t\tthis->m_psh.dwFlags |= PSH_WIZARD97;\n\n\t\tbaseClass::SetHeader(headerBitmap.m_lpstr);\n\t\tbaseClass::SetWatermark(watermarkBitmap.m_lpstr);\n\t}\n\n// Overrides from base class\n\tvoid OnSheetInitialized()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->_InitializeFonts();\n\n\t\t// We'd like to center the wizard here, but its too early.\n\t\t// Instead, we'll do CenterWindow upon our first WM_SIZE message\n\t}\n\n// Initialization\n\tvoid _InitializeFonts()\n\t{\n\t\t// Setup the Title and Bullet Font\n\t\t// (Property pages can send the \"get external page title font\" and \"get bullet font\" messages)\n\t\t// The derived class needs to do the actual SetFont for the dialog items)\n\n\t\tCFontHandle fontThisDialog = this->GetFont();\n\t\tCClientDC dcScreen(NULL);\n\n\t\tLOGFONT titleLogFont = {};\n\t\tLOGFONT bulletLogFont = {};\n\t\tfontThisDialog.GetLogFont(&titleLogFont);\n\t\tfontThisDialog.GetLogFont(&bulletLogFont);\n\n\t\t// The Wizard 97 Spec recommends to do the Title Font\n\t\t// as Verdana Bold, 12pt.\n\t\ttitleLogFont.lfCharSet = DEFAULT_CHARSET;\n\t\ttitleLogFont.lfWeight = FW_BOLD;\n\t\tATL::Checked::tcscpy_s(titleLogFont.lfFaceName, _countof(titleLogFont.lfFaceName), _T(\"Verdana Bold\"));\n\t\tINT titleFontPointSize = 12;\n\t\ttitleLogFont.lfHeight = -::MulDiv(titleFontPointSize, dcScreen.GetDeviceCaps(LOGPIXELSY), 72);\n\t\tm_fontExteriorPageTitle.CreateFontIndirect(&titleLogFont);\n\n\t\t// The Wizard 97 Spec recommends to do Bullets by having\n\t\t// static text of \"h\" in the Marlett font.\n\t\tbulletLogFont.lfCharSet = DEFAULT_CHARSET;\n\t\tbulletLogFont.lfWeight = FW_NORMAL;\n\t\tATL::Checked::tcscpy_s(bulletLogFont.lfFaceName, _countof(bulletLogFont.lfFaceName), _T(\"Marlett\"));\n\t\tINT bulletFontSize = 8;\n\t\tbulletLogFont.lfHeight = -::MulDiv(bulletFontSize, dcScreen.GetDeviceCaps(LOGPIXELSY), 72);\n\t\tm_fontBullet.CreateFontIndirect(&bulletLogFont);\n\t}\n\n// Message Handling\n\tBEGIN_MSG_MAP(thisClass)\n\t\tMESSAGE_HANDLER(CWizard97SheetWindow::GetMessage_GetExteriorPageTitleFont(), OnGetExteriorPageTitleFont)\n\t\tMESSAGE_HANDLER(CWizard97SheetWindow::GetMessage_GetBulletFont(), OnGetBulletFont)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\t\tCHAIN_MSG_MAP(baseClass)\n\tEND_MSG_MAP()\n\n\tLRESULT OnGetExteriorPageTitleFont(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn (LRESULT)(HFONT)m_fontExteriorPageTitle;\n\t}\n\n\tLRESULT OnGetBulletFont(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn (LRESULT)(HFONT)m_fontBullet;\n\t}\n\n\tLRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(!m_bReceivedFirstSizeMessage)\n\t\t{\n\t\t\tm_bReceivedFirstSizeMessage = true;\n\t\t\tthis->CenterWindow();\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n};\n\n// for non-customized sheets\nclass CWizard97Sheet : public CWizard97SheetImpl<CWizard97Sheet>\n{\nprotected:\n// Typedefs\n\ttypedef CWizard97Sheet thisClass;\n\ttypedef CWizard97SheetImpl<CWizard97Sheet> baseClass;\n\npublic:\n\tCWizard97Sheet(ATL::_U_STRINGorID title, ATL::_U_STRINGorID headerBitmap, ATL::_U_STRINGorID watermarkBitmap, UINT uStartPage = 0, HWND hWndParent = NULL) :\n\t\tbaseClass(title, headerBitmap, watermarkBitmap, uStartPage, hWndParent)\n\t{ }\n\n\tBEGIN_MSG_MAP(thisClass)\n\t\tCHAIN_MSG_MAP(baseClass)\n\tEND_MSG_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CWizard97PageWindow - client side for a Wizard 97 style wizard page\n\n#define WIZARD97_EXTERIOR_CXDLG 317\n#define WIZARD97_EXTERIOR_CYDLG 193\n\n#define WIZARD97_INTERIOR_CXDLG 317\n#define WIZARD97_INTERIOR_CYDLG 143\n\nclass CWizard97PageWindow : public CPropertyPageWindow\n{\npublic:\n// Constructors\n\tCWizard97PageWindow(HWND hWnd = NULL) : CPropertyPageWindow(hWnd)\n\t{ }\n\n\tCWizard97PageWindow& operator =(HWND hWnd)\n\t{\n\t\tm_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n// Attributes\n\tCWizard97SheetWindow GetPropertySheet() const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn CWizard97SheetWindow(GetParent());\n\t}\n\n// Operations\n\tHFONT GetExteriorPageTitleFont(void)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn GetPropertySheet().GetExteriorPageTitleFont();\n\t}\n\n\tHFONT GetBulletFont(void)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn GetPropertySheet().GetBulletFont();\n\t}\n\n// Implementation - overrides to prevent usage\n\tHWND Create(LPCTSTR, HWND, ATL::_U_RECT = NULL, LPCTSTR = NULL, DWORD = 0, DWORD = 0, ATL::_U_MENUorID = 0U, LPVOID = NULL)\n\t{\n\t\tATLASSERT(FALSE);\n\t\treturn NULL;\n\t}\n\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CWizard97PageImpl - implements a Wizard 97 style wizard page\n\ntemplate <class T, class TBase = CWizard97PageWindow>\nclass ATL_NO_VTABLE CWizard97PageImpl : public CPropertyPageImpl< T, TBase >\n{\nprotected:\n// Typedefs\n\ttypedef CWizard97PageImpl< T, TBase > thisClass;\n\ttypedef CPropertyPageImpl< T, TBase > baseClass;\n\npublic:\n\tCWizard97PageImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : baseClass(title)\n\t{ }\n\n// Message Handling\n\tBEGIN_MSG_MAP(thisClass)\n\t\tCHAIN_MSG_MAP(baseClass)\n\tEND_MSG_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CWizard97ExteriorPageImpl - implements a Wizard 97 style exterior wizard page\n\ntemplate <class T, class TBase = CWizard97PageWindow>\nclass ATL_NO_VTABLE CWizard97ExteriorPageImpl : public CPropertyPageImpl< T, TBase >\n{\nprotected:\n// Typedefs\n\ttypedef CWizard97ExteriorPageImpl< T, TBase > thisClass;\n\ttypedef CPropertyPageImpl< T, TBase > baseClass;\n\npublic:\n// Constructors\n\tCWizard97ExteriorPageImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : baseClass(title)\n\t{\n\t\tthis->m_psp.dwFlags |= PSP_HASHELP;\n\t\tthis->m_psp.dwFlags |= PSP_HIDEHEADER;\n\t}\n\n// Message Handling\n\tBEGIN_MSG_MAP(thisClass)\n\t\tCHAIN_MSG_MAP(baseClass)\n\tEND_MSG_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CWizard97InteriorPageImpl - implements a Wizard 97 style interior wizard page\n\ntemplate <class T, class TBase = CWizard97PageWindow>\nclass ATL_NO_VTABLE CWizard97InteriorPageImpl : public CPropertyPageImpl< T, TBase >\n{\nprotected:\n// Typedefs\n\ttypedef CWizard97InteriorPageImpl< T, TBase > thisClass;\n\ttypedef CPropertyPageImpl< T, TBase > baseClass;\n\npublic:\n// Constructors\n\tCWizard97InteriorPageImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : baseClass(title)\n\t{\n\t\tthis->m_psp.dwFlags |= PSP_HASHELP;\n\t\tthis->m_psp.dwFlags &= ~PSP_HIDEHEADER;\n\t\tthis->m_psp.dwFlags |= PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;\n\n\t\t// Be sure to have the derived class define this in the constructor.\n\t\t// We'll default it to something obvious in case its forgotten.\n\t\tbaseClass::SetHeaderTitle(_T(\"Call SetHeaderTitle in Derived Class\"));\n\t\tbaseClass::SetHeaderSubTitle(_T(\"Call SetHeaderSubTitle in the constructor of the Derived Class.\"));\n\t}\n\n// Message Handling\n\tBEGIN_MSG_MAP(thisClass)\n\t\tCHAIN_MSG_MAP(baseClass)\n\tEND_MSG_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Aero Wizard support\n\n#if (_WIN32_WINNT >= 0x0600)\n\n///////////////////////////////////////////////////////////////////////////////\n// CAeroWizardFrameWindow - client side for an Aero Wizard frame window\n\nclass CAeroWizardFrameWindow : public CPropertySheetWindow\n{\npublic:\n// Constructors\n\tCAeroWizardFrameWindow(HWND hWnd = NULL) : CPropertySheetWindow(hWnd)\n\t{ }\n\n\tCAeroWizardFrameWindow& operator =(HWND hWnd)\n\t{\n\t\tm_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n// Operations - new, Aero Wizard only\n\tvoid SetNextText(LPCWSTR lpszText)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\t::SendMessage(m_hWnd, PSM_SETNEXTTEXT, 0, (LPARAM)lpszText);\n\t}\n\n\tvoid ShowWizardButtons(DWORD dwButtons, DWORD dwStates)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\t::PostMessage(m_hWnd, PSM_SHOWWIZBUTTONS, (WPARAM)dwStates, (LPARAM)dwButtons);\n\t}\n\n\tvoid EnableWizardButtons(DWORD dwButtons, DWORD dwStates)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\t::PostMessage(m_hWnd, PSM_ENABLEWIZBUTTONS, (WPARAM)dwStates, (LPARAM)dwButtons);\n\t}\n\n\tvoid SetButtonText(DWORD dwButton, LPCWSTR lpszText)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\t::SendMessage(m_hWnd, PSM_SETBUTTONTEXT, (WPARAM)dwButton, (LPARAM)lpszText);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CAeroWizardFrameImpl - implements an Aero Wizard frame\n\ntemplate <class T, class TBase = CAeroWizardFrameWindow>\nclass ATL_NO_VTABLE CAeroWizardFrameImpl : public CPropertySheetImpl<T, TBase >\n{\npublic:\n// Constructor\n\tCAeroWizardFrameImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL, UINT uStartPage = 0, HWND hWndParent = NULL) :\n\t\tCPropertySheetImpl<T, TBase >(title, uStartPage, hWndParent)\n\t{\n\t\tthis->m_psh.dwFlags |= PSH_WIZARD | PSH_AEROWIZARD;\n\t}\n\n// Operations\n\tvoid EnableResizing()\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);   // can't do this after it's created\n\t\tthis->m_psh.dwFlags |= PSH_RESIZABLE;\n\t}\n\n\tvoid UseHeaderBitmap()\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);   // can't do this after it's created\n\t\tthis->m_psh.dwFlags |= PSH_HEADERBITMAP;\n\t}\n\n\tvoid SetNoMargin()\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);   // can't do this after it's created\n\t\tthis->m_psh.dwFlags |= PSH_NOMARGIN;\n\t}\n\n// Override to prevent use\n\tHWND Create(HWND /*hWndParent*/ = NULL)\n\t{\n\t\tATLASSERT(FALSE);   // not supported for Aero Wizard\n\t\treturn NULL;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CAeroWizardFrame - for non-customized frames\n\nclass CAeroWizardFrame : public CAeroWizardFrameImpl<CAeroWizardFrame>\n{\npublic:\n\tCAeroWizardFrame(ATL::_U_STRINGorID title = (LPCTSTR)NULL, UINT uStartPage = 0, HWND hWndParent = NULL)\n\t\t: CAeroWizardFrameImpl<CAeroWizardFrame>(title, uStartPage, hWndParent)\n\t{ }\n\n\tBEGIN_MSG_MAP(CAeroWizardFrame)\n\t\tMESSAGE_HANDLER(WM_COMMAND, CAeroWizardFrameImpl<CAeroWizardFrame>::OnCommand)\n\tEND_MSG_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CAeroWizardPageWindow - client side for an Aero Wizard page\n\nclass CAeroWizardPageWindow : public CPropertyPageWindow\n{\npublic:\n// Constructors\n\tCAeroWizardPageWindow(HWND hWnd = NULL) : CPropertyPageWindow(hWnd)\n\t{ }\n\n\tCAeroWizardPageWindow& operator =(HWND hWnd)\n\t{\n\t\tm_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n// Attributes\n\tCAeroWizardFrameWindow GetAeroWizardFrame() const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\t// This is not really top-level frame window, but it processes all frame messages\n\t\treturn CAeroWizardFrameWindow(GetParent());\n\t}\n\n// Operations - new, Aero Wizard only\n\tvoid SetNextText(LPCWSTR lpszText)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(GetParent() != NULL);\n\t\tGetAeroWizardFrame().SetNextText(lpszText);\n\t}\n\n\tvoid ShowWizardButtons(DWORD dwButtons, DWORD dwStates)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(GetParent() != NULL);\n\t\tGetAeroWizardFrame().ShowWizardButtons(dwButtons, dwStates);\n\t}\n\n\tvoid EnableWizardButtons(DWORD dwButtons, DWORD dwStates)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(GetParent() != NULL);\n\t\tGetAeroWizardFrame().EnableWizardButtons(dwButtons, dwStates);\n\t}\n\n\tvoid SetButtonText(DWORD dwButton, LPCWSTR lpszText)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT(GetParent() != NULL);\n\t\tGetAeroWizardFrame().SetButtonText(dwButton, lpszText);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CAeroWizardPageImpl - implements an Aero Wizard page\n\ntemplate <class T, class TBase = CAeroWizardPageWindow>\nclass ATL_NO_VTABLE CAeroWizardPageImpl : public CPropertyPageImpl<T, TBase >\n{\npublic:\n\tCAeroWizardPageImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : CPropertyPageImpl<T, TBase >(title)\n\t{ }\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CAeroWizardPage - for non-customized pages\n\ntemplate <WORD t_wDlgTemplateID>\nclass CAeroWizardPage : public CAeroWizardPageImpl<CAeroWizardPage<t_wDlgTemplateID> >\n{\npublic:\n\tenum { IDD = t_wDlgTemplateID };\n\n\tCAeroWizardPage(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : CAeroWizardPageImpl<CAeroWizardPage>(title)\n\t{ }\n\n\tDECLARE_EMPTY_MSG_MAP()\n};\n\n\n#ifndef _ATL_NO_HOSTING\n\n// Note: You must #include <atlhost.h> to use these classes\n\n///////////////////////////////////////////////////////////////////////////////\n// CAeroWizardAxPageImpl - Aero Wizard page that hosts ActiveX controls\n\ntemplate <class T, class TBase = CAeroWizardPageWindow>\nclass ATL_NO_VTABLE CAeroWizardAxPageImpl : public CAxPropertyPageImpl< T, TBase >\n{\npublic:\n\tCAeroWizardAxPageImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : CAxPropertyPageImpl< T, TBase >(title)\n\t{ }\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CAeroWizardAxPage - for non-customized pages\n\ntemplate <WORD t_wDlgTemplateID>\nclass CAeroWizardAxPage : public CAeroWizardAxPageImpl<CAeroWizardAxPage<t_wDlgTemplateID> >\n{\npublic:\n\tenum { IDD = t_wDlgTemplateID };\n\n\tCAeroWizardAxPage(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : CAeroWizardAxPageImpl<CAeroWizardAxPage>(title)\n\t{ }\n\n\tBEGIN_MSG_MAP(CAeroWizardAxPage)\n\t\tCHAIN_MSG_MAP(CAeroWizardAxPageImpl<CAeroWizardAxPage<t_wDlgTemplateID> >)\n\tEND_MSG_MAP()\n};\n\n#endif // _ATL_NO_HOSTING\n\n#endif // (_WIN32_WINNT >= 0x0600)\n\n\n///////////////////////////////////////////////////////////////////////////////\n// TaskDialog support\n\n#if (_WIN32_WINNT >= 0x0600) || defined(_WTL_TASKDIALOG)\n\n///////////////////////////////////////////////////////////////////////////////\n// AtlTaskDialog - support for TaskDialog() function\n\ninline int AtlTaskDialog(HWND hWndParent, \n                         ATL::_U_STRINGorID WindowTitle, ATL::_U_STRINGorID MainInstructionText, ATL::_U_STRINGorID ContentText, \n                         TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons = 0U, ATL::_U_STRINGorID Icon = (LPCTSTR)NULL)\n{\n\tint nRet = -1;\n\n#ifdef _WTL_TASKDIALOG_DIRECT\n\tUSES_CONVERSION;\n\tHRESULT hRet = ::TaskDialog(hWndParent, ModuleHelper::GetResourceInstance(), \n\t\tIS_INTRESOURCE(WindowTitle.m_lpstr) ? (LPCWSTR) WindowTitle.m_lpstr : T2CW(WindowTitle.m_lpstr), \n\t\tIS_INTRESOURCE(MainInstructionText.m_lpstr) ? (LPCWSTR) MainInstructionText.m_lpstr : T2CW(MainInstructionText.m_lpstr), \n\t\tIS_INTRESOURCE(ContentText.m_lpstr) ?  (LPCWSTR) ContentText.m_lpstr : T2CW(ContentText.m_lpstr), \n\t\tdwCommonButtons, \n\t\tIS_INTRESOURCE(Icon.m_lpstr) ? (LPCWSTR) Icon.m_lpstr : T2CW(Icon.m_lpstr),\n\t\t&nRet);\n\tATLVERIFY(SUCCEEDED(hRet));\n#else\n\t// This allows apps to run on older versions of Windows\n\ttypedef HRESULT (STDAPICALLTYPE *PFN_TaskDialog)(HWND hwndParent, HINSTANCE hInstance, PCWSTR pszWindowTitle, PCWSTR pszMainInstruction, PCWSTR pszContent, TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons, PCWSTR pszIcon, int* pnButton);\n\n\tHMODULE m_hCommCtrlDLL = ::LoadLibrary(_T(\"comctl32.dll\"));\n\tif(m_hCommCtrlDLL != NULL)\n\t{\n\t\tPFN_TaskDialog pfnTaskDialog = (PFN_TaskDialog)::GetProcAddress(m_hCommCtrlDLL, \"TaskDialog\");\n\t\tif(pfnTaskDialog != NULL)\n\t\t{\n\t\t\tUSES_CONVERSION;\n\t\t\tHRESULT hRet = pfnTaskDialog(hWndParent, ModuleHelper::GetResourceInstance(), \n\t\t\t\tIS_INTRESOURCE(WindowTitle.m_lpstr) ? (LPCWSTR) WindowTitle.m_lpstr : T2CW(WindowTitle.m_lpstr), \n\t\t\t\tIS_INTRESOURCE(MainInstructionText.m_lpstr) ? (LPCWSTR) MainInstructionText.m_lpstr : T2CW(MainInstructionText.m_lpstr), \n\t\t\t\tIS_INTRESOURCE(ContentText.m_lpstr) ?  (LPCWSTR) ContentText.m_lpstr : T2CW(ContentText.m_lpstr), \n\t\t\t\tdwCommonButtons, \n\t\t\t\tIS_INTRESOURCE(Icon.m_lpstr) ? (LPCWSTR) Icon.m_lpstr : T2CW(Icon.m_lpstr),\n\t\t\t\t&nRet);\n\t\t\tATLVERIFY(SUCCEEDED(hRet));\n\t\t}\n\n\t\t::FreeLibrary(m_hCommCtrlDLL);\n\t}\n#endif\n\n\treturn nRet;\n}\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CTaskDialogConfig - TASKDIALOGCONFIG wrapper\n\nclass CTaskDialogConfig : public TASKDIALOGCONFIG\n{\npublic:\n// Constructor\n\tCTaskDialogConfig()\n\t{\n\t\tInit();\n\t}\n\n\tvoid Init()\n\t{\n\t\tmemset(this, 0, sizeof(TASKDIALOGCONFIG));   // initialize structure to 0/NULL\n\t\tthis->cbSize = sizeof(TASKDIALOGCONFIG);\n\t\tthis->hInstance = ModuleHelper::GetResourceInstance();\n\t}\n\n// Operations - setting values\n\t// common buttons\n\tvoid SetCommonButtons(TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtonsArg)\n\t{\n\t\tthis->dwCommonButtons = dwCommonButtonsArg;\n\t}\n\n\t// window title text\n\tvoid SetWindowTitle(UINT nID)\n\t{\n\t\tthis->pszWindowTitle = MAKEINTRESOURCEW(nID);\n\t}\n\n\tvoid SetWindowTitle(LPCWSTR lpstrWindowTitle)\n\t{\n\t\tthis->pszWindowTitle = lpstrWindowTitle;\n\t}\n\n\t// main icon\n\tvoid SetMainIcon(HICON hIcon)\n\t{\n\t\tthis->dwFlags |= TDF_USE_HICON_MAIN;\n\t\tthis->hMainIcon = hIcon;\n\t}\n\n\tvoid SetMainIcon(UINT nID)\n\t{\n\t\tthis->dwFlags &= ~TDF_USE_HICON_MAIN;\n\t\tthis->pszMainIcon = MAKEINTRESOURCEW(nID);\n\t}\n\n\tvoid SetMainIcon(LPCWSTR lpstrMainIcon)\n\t{\n\t\tthis->dwFlags &= ~TDF_USE_HICON_MAIN;\n\t\tthis->pszMainIcon = lpstrMainIcon;\n\t}\n\n\t// main instruction text\n\tvoid SetMainInstructionText(UINT nID)\n\t{\n\t\tthis->pszMainInstruction = MAKEINTRESOURCEW(nID);\n\t}\n\n\tvoid SetMainInstructionText(LPCWSTR lpstrMainInstruction)\n\t{\n\t\tthis->pszMainInstruction = lpstrMainInstruction;\n\t}\n\n\t// content text\n\tvoid SetContentText(UINT nID)\n\t{\n\t\tthis->pszContent = MAKEINTRESOURCEW(nID);\n\t}\n\n\tvoid SetContentText(LPCWSTR lpstrContent)\n\t{\n\t\tthis->pszContent = lpstrContent;\n\t}\n\n\t// buttons\n\tvoid SetButtons(const TASKDIALOG_BUTTON* pButtonsArg, UINT cButtonsArg, int nDefaultButtonArg = 0)\n\t{\n\t\tthis->pButtons = pButtonsArg;\n\t\tthis->cButtons = cButtonsArg;\n\t\tif(nDefaultButtonArg != 0)\n\t\t\tthis->nDefaultButton = nDefaultButtonArg;\n\t}\n\n\tvoid SetDefaultButton(int nDefaultButtonArg)\n\t{\n\t\tthis->nDefaultButton = nDefaultButtonArg;\n\t}\n\n\t// radio buttons\n\tvoid SetRadioButtons(const TASKDIALOG_BUTTON* pRadioButtonsArg, UINT cRadioButtonsArg, int nDefaultRadioButtonArg = 0)\n\t{\n\t\tthis->pRadioButtons = pRadioButtonsArg;\n\t\tthis->cRadioButtons = cRadioButtonsArg;\n\t\tif(nDefaultRadioButtonArg != 0)\n\t\t\tthis->nDefaultRadioButton = nDefaultRadioButtonArg;\n\t}\n\n\tvoid SetDefaultRadioButton(int nDefaultRadioButtonArg)\n\t{\n\t\tthis->nDefaultRadioButton = nDefaultRadioButtonArg;\n\t}\n\n\t// verification text\n\tvoid SetVerificationText(UINT nID)\n\t{\n\t\tthis->pszVerificationText = MAKEINTRESOURCEW(nID);\n\t}\n\n\tvoid SetVerificationText(LPCWSTR lpstrVerificationText)\n\t{\n\t\tthis->pszVerificationText = lpstrVerificationText;\n\t}\n\n\t// expanded information text\n\tvoid SetExpandedInformationText(UINT nID)\n\t{\n\t\tthis->pszExpandedInformation = MAKEINTRESOURCEW(nID);\n\t}\n\n\tvoid SetExpandedInformationText(LPCWSTR lpstrExpandedInformation)\n\t{\n\t\tthis->pszExpandedInformation = lpstrExpandedInformation;\n\t}\n\n\t// expanded control text\n\tvoid SetExpandedControlText(UINT nID)\n\t{\n\t\tthis->pszExpandedControlText = MAKEINTRESOURCEW(nID);\n\t}\n\n\tvoid SetExpandedControlText(LPCWSTR lpstrExpandedControlText)\n\t{\n\t\tthis->pszExpandedControlText = lpstrExpandedControlText;\n\t}\n\n\t// collapsed control text\n\tvoid SetCollapsedControlText(UINT nID)\n\t{\n\t\tthis->pszCollapsedControlText = MAKEINTRESOURCEW(nID);\n\t}\n\n\tvoid SetCollapsedControlText(LPCWSTR lpstrCollapsedControlText)\n\t{\n\t\tthis->pszCollapsedControlText = lpstrCollapsedControlText;\n\t}\n\n\t// footer icon\n\tvoid SetFooterIcon(HICON hIcon)\n\t{\n\t\tthis->dwFlags |= TDF_USE_HICON_FOOTER;\n\t\tthis->hFooterIcon = hIcon;\n\t}\n\n\tvoid SetFooterIcon(UINT nID)\n\t{\n\t\tthis->dwFlags &= ~TDF_USE_HICON_FOOTER;\n\t\tthis->pszFooterIcon = MAKEINTRESOURCEW(nID);\n\t}\n\n\tvoid SetFooterIcon(LPCWSTR lpstrFooterIcon)\n\t{\n\t\tthis->dwFlags &= ~TDF_USE_HICON_FOOTER;\n\t\tthis->pszFooterIcon = lpstrFooterIcon;\n\t}\n\n\t// footer text\n\tvoid SetFooterText(UINT nID)\n\t{\n\t\tthis->pszFooter = MAKEINTRESOURCEW(nID);\n\t}\n\n\tvoid SetFooterText(LPCWSTR lpstrFooterText)\n\t{\n\t\tthis->pszFooter = lpstrFooterText;\n\t}\n\n\t// width (in DLUs)\n\tvoid SetWidth(UINT cxWidthArg)\n\t{\n\t\tthis->cxWidth = cxWidthArg;\n\t}\n\n\t// modify flags\n\tvoid ModifyFlags(DWORD dwRemove, DWORD dwAdd)\n\t{\n\t\tthis->dwFlags = (this->dwFlags & ~dwRemove) | dwAdd;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CTaskDialogImpl - implements a Task Dialog\n\ntemplate <class T>\nclass ATL_NO_VTABLE CTaskDialogImpl\n{\npublic:\n\tCTaskDialogConfig m_tdc;\n\tHWND m_hWnd;   // used only in callback functions\n\n// Constructor\n\tCTaskDialogImpl(HWND hWndParent = NULL) : m_hWnd(NULL)\n\t{\n\t\tm_tdc.hwndParent = hWndParent;\n\t\tm_tdc.pfCallback = T::TaskDialogCallback;\n\t\tm_tdc.lpCallbackData = (LONG_PTR)static_cast<T*>(this);\n\t}\n\n// Operations\n\tHRESULT DoModal(HWND hWndParent = ::GetActiveWindow(), int* pnButton = NULL, int* pnRadioButton = NULL, BOOL* pfVerificationFlagChecked = NULL)\n\t{\n\t\tif(m_tdc.hwndParent == NULL)\n\t\t\tm_tdc.hwndParent = hWndParent;\n\n#ifdef _WTL_TASKDIALOG_DIRECT\n\t\treturn ::TaskDialogIndirect(&m_tdc, pnButton, pnRadioButton, pfVerificationFlagChecked);\n#else\n\n\t\t// This allows apps to run on older versions of Windows\n\t\ttypedef HRESULT (STDAPICALLTYPE *PFN_TaskDialogIndirect)(const TASKDIALOGCONFIG* pTaskConfig, int* pnButton, int* pnRadioButton, BOOL* pfVerificationFlagChecked);\n\n\t\tHRESULT hRet = E_UNEXPECTED;\n\t\tHMODULE m_hCommCtrlDLL = ::LoadLibrary(_T(\"comctl32.dll\"));\n\t\tif(m_hCommCtrlDLL != NULL)\n\t\t{\n\t\t\tPFN_TaskDialogIndirect pfnTaskDialogIndirect = (PFN_TaskDialogIndirect)::GetProcAddress(m_hCommCtrlDLL, \"TaskDialogIndirect\");\n\t\t\tif(pfnTaskDialogIndirect != NULL)\n\t\t\t\thRet = pfnTaskDialogIndirect(&m_tdc, pnButton, pnRadioButton, pfVerificationFlagChecked);\n\n\t\t\t::FreeLibrary(m_hCommCtrlDLL);\n\t\t}\n\n\t\treturn hRet;\n#endif\n\t}\n\n// Operations - setting values of TASKDIALOGCONFIG\n\t// common buttons\n\tvoid SetCommonButtons(TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons)\n\t{\tm_tdc.SetCommonButtons(dwCommonButtons); }\n\t// window title text\n\tvoid SetWindowTitle(UINT nID)\n\t{\tm_tdc.SetWindowTitle(nID); }\n\tvoid SetWindowTitle(LPCWSTR lpstrWindowTitle)\n\t{\tm_tdc.SetWindowTitle(lpstrWindowTitle); }\n\t// main icon\n\tvoid SetMainIcon(HICON hIcon)\n\t{\tm_tdc.SetMainIcon(hIcon); }\n\tvoid SetMainIcon(UINT nID)\n\t{\tm_tdc.SetMainIcon(nID); }\n\tvoid SetMainIcon(LPCWSTR lpstrMainIcon)\n\t{\tm_tdc.SetMainIcon(lpstrMainIcon); }\n\t// main instruction text\n\tvoid SetMainInstructionText(UINT nID)\n\t{\tm_tdc.SetMainInstructionText(nID); }\n\tvoid SetMainInstructionText(LPCWSTR lpstrMainInstruction)\n\t{\tm_tdc.SetMainInstructionText(lpstrMainInstruction); }\n\t// content text\n\tvoid SetContentText(UINT nID)\n\t{\tm_tdc.SetContentText(nID); }\n\tvoid SetContentText(LPCWSTR lpstrContent)\n\t{\tm_tdc.SetContentText(lpstrContent); }\n\t// buttons\n\tvoid SetButtons(const TASKDIALOG_BUTTON* pButtons, UINT cButtons, int nDefaultButton = 0)\n\t{\tm_tdc.SetButtons(pButtons, cButtons, nDefaultButton); }\n\tvoid SetDefaultButton(int nDefaultButton)\n\t{\tm_tdc.SetDefaultButton(nDefaultButton); }\n\t// radio buttons\n\tvoid SetRadioButtons(const TASKDIALOG_BUTTON* pRadioButtons, UINT cRadioButtons, int nDefaultRadioButton = 0)\n\t{\tm_tdc.SetRadioButtons(pRadioButtons, cRadioButtons, nDefaultRadioButton); }\n\tvoid SetDefaultRadioButton(int nDefaultRadioButton)\n\t{\tm_tdc.SetDefaultRadioButton(nDefaultRadioButton); }\n\t// verification text\n\tvoid SetVerificationText(UINT nID)\n\t{\tm_tdc.SetVerificationText(nID); }\n\tvoid SetVerificationText(LPCWSTR lpstrVerificationText)\n\t{\tm_tdc.SetVerificationText(lpstrVerificationText); }\n\t// expanded information text\n\tvoid SetExpandedInformationText(UINT nID)\n\t{\tm_tdc.SetExpandedInformationText(nID); }\n\tvoid SetExpandedInformationText(LPCWSTR lpstrExpandedInformation)\n\t{\tm_tdc.SetExpandedInformationText(lpstrExpandedInformation); }\n\t// expanded control text\n\tvoid SetExpandedControlText(UINT nID)\n\t{\tm_tdc.SetExpandedControlText(nID); }\n\tvoid SetExpandedControlText(LPCWSTR lpstrExpandedControlText)\n\t{\tm_tdc.SetExpandedControlText(lpstrExpandedControlText); }\n\t// collapsed control text\n\tvoid SetCollapsedControlText(UINT nID)\n\t{\tm_tdc.SetCollapsedControlText(nID); }\n\tvoid SetCollapsedControlText(LPCWSTR lpstrCollapsedControlText)\n\t{\tm_tdc.SetCollapsedControlText(lpstrCollapsedControlText); }\n\t// footer icon\n\tvoid SetFooterIcon(HICON hIcon)\n\t{\tm_tdc.SetFooterIcon(hIcon); }\n\tvoid SetFooterIcon(UINT nID)\n\t{\tm_tdc.SetFooterIcon(nID); }\n\tvoid SetFooterIcon(LPCWSTR lpstrFooterIcon)\n\t{\tm_tdc.SetFooterIcon(lpstrFooterIcon); }\n\t// footer text\n\tvoid SetFooterText(UINT nID)\n\t{\tm_tdc.SetFooterText(nID); }\n\tvoid SetFooterText(LPCWSTR lpstrFooterText)\n\t{\tm_tdc.SetFooterText(lpstrFooterText); }\n\t// width (in DLUs)\n\tvoid SetWidth(UINT cxWidth)\n\t{\tm_tdc.SetWidth(cxWidth); }\n\t// modify flags\n\tvoid ModifyFlags(DWORD dwRemove, DWORD dwAdd)\n\t{\tm_tdc.ModifyFlags(dwRemove, dwAdd); }\n\n// Implementation\n\tstatic HRESULT CALLBACK TaskDialogCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LONG_PTR lpRefData)\n\t{\n\t\tT* pT = (T*)lpRefData;\n\t\tATLASSERT((pT->m_hWnd == NULL) || (pT->m_hWnd == hWnd));\n\n\t\tBOOL bRet = FALSE;\n\t\tswitch(uMsg)\n\t\t{\n\t\tcase TDN_DIALOG_CONSTRUCTED:\n\t\t\tpT->m_hWnd = hWnd;\n\t\t\tpT->OnDialogConstructed();\n\t\t\tbreak;\n\t\tcase TDN_CREATED:\n\t\t\tpT->OnCreated();\n\t\t\tbreak;\n\t\tcase TDN_BUTTON_CLICKED:\n\t\t\tbRet = pT->OnButtonClicked((int)wParam);\n\t\t\tbreak;\n\t\tcase TDN_RADIO_BUTTON_CLICKED:\n\t\t\tpT->OnRadioButtonClicked((int)wParam);\n\t\t\tbreak;\n\t\tcase TDN_HYPERLINK_CLICKED:\n\t\t\tpT->OnHyperlinkClicked((LPCWSTR)lParam);\n\t\t\tbreak;\n\t\tcase TDN_EXPANDO_BUTTON_CLICKED:\n\t\t\tpT->OnExpandoButtonClicked((wParam != 0));\n\t\t\tbreak;\n\t\tcase TDN_VERIFICATION_CLICKED:\n\t\t\tpT->OnVerificationClicked((wParam != 0));\n\t\t\tbreak;\n\t\tcase TDN_HELP:\n\t\t\tpT->OnHelp();\n\t\t\tbreak;\n\t\tcase TDN_TIMER:\n\t\t\tbRet = pT->OnTimer((DWORD)wParam);\n\t\t\tbreak;\n\t\tcase TDN_NAVIGATED:\n\t\t\tpT->OnNavigated();\n\t\t\tbreak;\n\t\tcase TDN_DESTROYED:\n\t\t\tpT->OnDestroyed();\n\t\t\tpT->m_hWnd = NULL;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"Unknown notification received in CTaskDialogImpl::TaskDialogCallback\\n\"));\n\t\t\tbreak;\n\t\t}\n\n\t\treturn (bRet != FALSE) ? S_OK : S_FALSE;\n\t}\n\n// Overrideables - notification handlers\n\tvoid OnDialogConstructed()\n\t{\n\t}\n\n\tvoid OnCreated()\n\t{\n\t}\n\n\tBOOL OnButtonClicked(int /*nButton*/)\n\t{\n\t\treturn FALSE;   // don't prevent dialog to close\n\t}\n\n\tvoid OnRadioButtonClicked(int /*nRadioButton*/)\n\t{\n\t}\n\n\tvoid OnHyperlinkClicked(LPCWSTR /*pszHREF*/)\n\t{\n\t}\n\n\tvoid OnExpandoButtonClicked(bool /*bExpanded*/)\n\t{\n\t}\n\n\tvoid OnVerificationClicked(bool /*bChecked*/)\n\t{\n\t}\n\n\tvoid OnHelp()\n\t{\n\t}\n\n\tBOOL OnTimer(DWORD /*dwTickCount*/)\n\t{\n\t\treturn FALSE;   // don't reset counter\n\t}\n\n\tvoid OnNavigated()\n\t{\n\t}\n\n\tvoid OnDestroyed()\n\t{\n\t}\n\n// Commands - valid to call only from handlers\n\tvoid NavigatePage(TASKDIALOGCONFIG& tdc)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\n\t\ttdc.cbSize = sizeof(TASKDIALOGCONFIG);\n\t\tif(tdc.hwndParent == NULL)\n\t\t\ttdc.hwndParent = m_tdc.hwndParent;\n\t\ttdc.pfCallback = m_tdc.pfCallback;\n\t\ttdc.lpCallbackData = m_tdc.lpCallbackData;\n\t\t(TASKDIALOGCONFIG)m_tdc = tdc;\n\n\t\t::SendMessage(m_hWnd, TDM_NAVIGATE_PAGE, 0, (LPARAM)&tdc);\n\t}\n\n\t// modify TASKDIALOGCONFIG values, then call this to update task dialog\n\tvoid NavigatePage()\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, TDM_NAVIGATE_PAGE, 0, (LPARAM)&m_tdc);\n\t}\n\n\tvoid ClickButton(int nButton)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, TDM_CLICK_BUTTON, nButton, 0L);\n\t}\n\n\tvoid SetMarqueeProgressBar(BOOL bMarquee)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, TDM_SET_MARQUEE_PROGRESS_BAR, bMarquee, 0L);\n\t}\n\n\tBOOL SetProgressBarState(int nNewState)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\treturn (BOOL)::SendMessage(m_hWnd, TDM_SET_PROGRESS_BAR_STATE, nNewState, 0L);\n\t}\n\n\tDWORD SetProgressBarRange(int nMinRange, int nMaxRange)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\treturn (DWORD)::SendMessage(m_hWnd, TDM_SET_PROGRESS_BAR_RANGE, 0, MAKELPARAM(nMinRange, nMaxRange));\n\t}\n\n\tint SetProgressBarPos(int nNewPos)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\treturn (int)::SendMessage(m_hWnd, TDM_SET_PROGRESS_BAR_POS, nNewPos, 0L);\n\t}\n\n\tBOOL SetProgressBarMarquee(BOOL bMarquee, UINT uSpeed)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\treturn (BOOL)::SendMessage(m_hWnd, TDM_SET_PROGRESS_BAR_MARQUEE, bMarquee, uSpeed);\n\t}\n\n\tvoid SetElementText(TASKDIALOG_ELEMENTS element, LPCWSTR lpstrText)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, TDM_SET_ELEMENT_TEXT, element, (LPARAM)lpstrText);\n\t}\n\n\tvoid ClickRadioButton(int nRadioButton)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, TDM_CLICK_RADIO_BUTTON, nRadioButton, 0L);\n\t}\n\n\tvoid EnableButton(int nButton, BOOL bEnable)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, TDM_ENABLE_BUTTON, nButton, bEnable);\n\t}\n\n\tvoid EnableRadioButton(int nButton, BOOL bEnable)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, TDM_ENABLE_RADIO_BUTTON, nButton, bEnable);\n\t}\n\n\tvoid ClickVerification(BOOL bCheck, BOOL bFocus)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, TDM_CLICK_VERIFICATION, bCheck, bFocus);\n\t}\n\n\tvoid UpdateElementText(TASKDIALOG_ELEMENTS element, LPCWSTR lpstrText)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, TDM_UPDATE_ELEMENT_TEXT, element, (LPARAM)lpstrText);\n\t}\n\n\tvoid SetButtonElevationRequiredState(int nButton, BOOL bElevation)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n\t\t::SendMessage(m_hWnd, TDM_SET_BUTTON_ELEVATION_REQUIRED_STATE, nButton, bElevation);\n\t}\n\n\tvoid UpdateIcon(TASKDIALOG_ICON_ELEMENTS element, HICON hIcon)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n#ifdef _DEBUG\n\t\tif(element == TDIE_ICON_MAIN)\n\t\t\tATLASSERT((m_tdc.dwFlags & TDF_USE_HICON_MAIN) != 0);\n\t\telse if(element == TDIE_ICON_FOOTER)\n\t\t\tATLASSERT((m_tdc.dwFlags & TDF_USE_HICON_FOOTER) != 0);\n#endif // _DEBUG\n\t\t::SendMessage(m_hWnd, TDM_UPDATE_ICON, element, (LPARAM)hIcon);\n\t}\n\n\tvoid UpdateIcon(TASKDIALOG_ICON_ELEMENTS element, LPCWSTR lpstrIcon)\n\t{\n\t\tATLASSERT(m_hWnd != NULL);\n#ifdef _DEBUG\n\t\tif(element == TDIE_ICON_MAIN)\n\t\t\tATLASSERT((m_tdc.dwFlags & TDF_USE_HICON_MAIN) == 0);\n\t\telse if(element == TDIE_ICON_FOOTER)\n\t\t\tATLASSERT((m_tdc.dwFlags & TDF_USE_HICON_FOOTER) == 0);\n#endif // _DEBUG\n\t\t::SendMessage(m_hWnd, TDM_UPDATE_ICON, element, (LPARAM)lpstrIcon);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CTaskDialog - for non-customized task dialogs\n\nclass CTaskDialog : public CTaskDialogImpl<CTaskDialog>\n{\npublic:\n\tCTaskDialog(HWND hWndParent = NULL) : CTaskDialogImpl<CTaskDialog>(hWndParent)\n\t{\n\t\tm_tdc.pfCallback = NULL;\n\t}\n};\n\n#endif // (_WIN32_WINNT >= 0x0600) || defined(_WTL_TASKDIALOG)\n\n} // namespace WTL\n\n#endif // __ATLDLGS_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atldwm.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLDWM_H__\n#define __ATLDWM_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atldwm.h requires atlapp.h to be included first\n#endif\n\n#ifndef __ATLWIN_H__\n\t#error atldwm.h requires atlwin.h to be included first\n#endif\n\n#if (_WIN32_WINNT < 0x0600)\n\t#error atldwm.h requires _WIN32_WINNT >= 0x0600\n#endif\n\n#ifndef _DWMAPI_H_\n  #include <dwmapi.h>\n#endif\n#pragma comment(lib, \"dwmapi.lib\")\n\n// Note: To create an application that also runs on older versions of Windows,\n// use delay load of dwmapi.dll and ensure that no calls to the DWM API are\n// Delay load is NOT AUTOMATIC for VC++ 7, you have to link to delayimp.lib, \n// and add dwmapi.dll in the Linker.Input.Delay Loaded DLLs section of the \n// project properties.\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CDwm\n// CDwmImpl<T, TBase>\n// CDwmWindowT<TBase> - CDwmWindow\n// CDwmThumbnailT<t_bManaged, TBase>\n// CDwmThumbnail\n// CDwmThumbnailHandle\n// CAeroControlImpl\n\n\nnamespace WTL\n{\n\n///////////////////////////////////////////////////////////////////////////////\n// CDwm - wrapper for DWM handle\n\nclass CDwm\n{\npublic:\n// Data members\n\tstatic int m_nIsDwmSupported;\n\n// Constructor\n\tCDwm()\n\t{\n\t\tIsDwmSupported();\n\t}\n\n// Dwm support helper\n\tstatic bool IsDwmSupported()\n\t{\n\t\tif(m_nIsDwmSupported == -1)\n\t\t{\n\t\t\tCStaticDataInitCriticalSectionLock lock;\n\t\t\tif(FAILED(lock.Lock()))\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CDwm::IsDwmSupported.\\n\"));\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif(m_nIsDwmSupported == -1)\n\t\t\t{\n\t\t\t\tHMODULE hDwmDLL = ::LoadLibrary(_T(\"dwmapi.dll\"));\n\t\t\t\tm_nIsDwmSupported = (hDwmDLL != NULL) ? 1 : 0;\n\t\t\t\tif(hDwmDLL != NULL)\n\t\t\t\t\t::FreeLibrary(hDwmDLL);\n\t\t\t}\n\n\t\t\tlock.Unlock();\n\t\t}\n\n\t\tATLASSERT(m_nIsDwmSupported != -1);\n\t\treturn (m_nIsDwmSupported == 1);\n\t}\n\n// Operations\n\tBOOL DwmIsCompositionEnabled() const\n\t{\n\t\tif(!IsDwmSupported())\n\t\t\treturn FALSE;\n\n\t\tBOOL bRes = FALSE;\n\t\treturn (SUCCEEDED(::DwmIsCompositionEnabled(&bRes)) && bRes) ? TRUE : FALSE;\n\t}\n\n\tBOOL DwmEnableComposition(UINT fEnable)\n\t{\n\t\tif(!IsDwmSupported())\n\t\t\treturn FALSE;\n\n\t\treturn SUCCEEDED(::DwmEnableComposition(fEnable)) ? TRUE : FALSE;\n\t}\n\n\tBOOL DwmEnableMMCSS(BOOL fEnableMMCSS)\n\t{\n\t\tif(!IsDwmSupported())\n\t\t\treturn FALSE;\n\n\t\treturn SUCCEEDED(::DwmEnableMMCSS(fEnableMMCSS)) ? TRUE : FALSE;\n\t}\n\n\tHRESULT DwmGetColorizationColor(DWORD* pcrColorization, BOOL* pfOpaqueBlend)\n\t{\n\t\tif(!IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\treturn ::DwmGetColorizationColor(pcrColorization, pfOpaqueBlend);\n\t}\n\n\tHRESULT DwmFlush()\n\t{\n\t\tif(!IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\treturn ::DwmFlush();\n\t}\n};\n\n__declspec(selectany) int CDwm::m_nIsDwmSupported = -1;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CDwmImpl - DWM window support\n\ntemplate <class T, class TBase = CDwm>\nclass CDwmImpl : public TBase\n{\npublic:\n\tHRESULT DwmEnableBlurBehindWindow(const DWM_BLURBEHIND* pBB)\n\t{\n\t\tif(!this->IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::DwmEnableBlurBehindWindow(pT->m_hWnd, pBB);\n\t}\n\n\tHRESULT DwmExtendFrameIntoClientArea(const MARGINS* pMargins)\n\t{\n\t\tif(!this->IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::DwmExtendFrameIntoClientArea(pT->m_hWnd, pMargins);\n\t}\n\n\tHRESULT DwmExtendFrameIntoEntireClientArea()\n\t{\n\t\tMARGINS margins = { -1 };\n\t\treturn DwmExtendFrameIntoClientArea(&margins);\n\t}\n\n\tHRESULT DwmGetCompositionTimingInfo(DWM_TIMING_INFO* pTimingInfo)\n\t{\n\t\tif(!this->IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::DwmGetCompositionTimingInfo(pT->m_hWnd, pTimingInfo);\n\t}\n\n\tHRESULT DwmGetWindowAttribute(DWORD dwAttribute, PVOID pvAttribute, DWORD cbAttribute)\n\t{\n\t\tif(!this->IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::DwmGetWindowAttribute(pT->m_hWnd, dwAttribute, pvAttribute, cbAttribute);\n\t}\n\n\tHRESULT DwmModifyPreviousDxFrameDuration(INT cRefreshes, BOOL fRelative)\n\t{\n\t\tif(!this->IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::DwmModifyPreviousDxFrameDuration(pT->m_hWnd, cRefreshes, fRelative);\n\t}\n\n\tHRESULT DwmSetDxFrameDuration(INT cRefreshes)\n\t{\n\t\tif(!this->IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::DwmSetDxFrameDuration(pT->m_hWnd, cRefreshes);\n\t}\n\n\tHRESULT DwmSetPresentParameters(DWM_PRESENT_PARAMETERS* pPresentParams)\n\t{\n\t\tif(!this->IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::DwmSetPresentParameters(pT->m_hWnd, pPresentParams);\n\t}\n\n\tHRESULT DwmSetWindowAttribute(DWORD dwAttribute, LPCVOID pvAttribute, DWORD cbAttribute)\n\t{\n\t\tif(!this->IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::DwmSetWindowAttribute(pT->m_hWnd, dwAttribute, pvAttribute, cbAttribute);\n\t}\n\n\tHRESULT DwmAttachMilContent()\n\t{\n\t\tif(!this->IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::DwmAttachMilContent(pT->m_hWnd);\n\t}\n\n\tHRESULT DwmDetachMilContent()\n\t{\n\t\tif(!this->IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::DwmDetachMilContent(pT->m_hWnd);\n\t}\n};\n\ntemplate <class TBase>\nclass CDwmWindowT : public TBase, public CDwmImpl<CDwmWindowT< TBase > >\n{\npublic:\n\tCDwmWindowT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCDwmWindowT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n};\n\ntypedef CDwmWindowT<ATL::CWindow>\tCDwmWindow;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CDwmThumbnail - provides DWM thumbnail support\n\ntemplate <bool t_bManaged, class TBase = CDwm>\nclass CDwmThumbnailT : public TBase\n{\npublic:\n// Data members\n\tHTHUMBNAIL m_hThumbnail;\n\n// Constructor\n\tCDwmThumbnailT(HTHUMBNAIL hThumbnail = NULL) : m_hThumbnail(hThumbnail)\n\t{ }\n\n\t~CDwmThumbnailT()\n\t{\n\t\tif(t_bManaged && (m_hThumbnail != NULL))\n\t\t\tUnregister();\n\t}\n\n// Operations\n\tCDwmThumbnailT<t_bManaged, TBase>& operator =(HTHUMBNAIL hThumbnail)\n\t{\n\t\tAttach(hThumbnail);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HTHUMBNAIL hThumbnailNew)\n\t{\n\t\tif(t_bManaged && (m_hThumbnail != NULL) && (m_hThumbnail != hThumbnailNew))\n\t\t\tUnregister();\n\t\tm_hThumbnail = hThumbnailNew;\n\t}\n\n\tHTHUMBNAIL Detach()\n\t{\n\t\tHTHUMBNAIL hThumbnail = m_hThumbnail;\n\t\tm_hThumbnail = NULL;\n\t\treturn hThumbnail;\n\t}\n\n\tHRESULT Register(HWND hwndDestination, HWND hwndSource)\n\t{\n\t\tATLASSERT(::IsWindow(hwndDestination));\n\t\tATLASSERT(::IsWindow(hwndSource));\n\t\tATLASSERT(m_hThumbnail==NULL);\n\n\t\tif(!this->IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\treturn ::DwmRegisterThumbnail(hwndDestination, hwndSource, &m_hThumbnail);\n\t}\n\n\tHRESULT Unregister()\n\t{\n\t\tif(!this->IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\t\tif(m_hThumbnail == NULL)\n\t\t\treturn S_FALSE;\n\n\t\tHRESULT Hr = ::DwmUnregisterThumbnail(m_hThumbnail);\n\t\tif(SUCCEEDED(Hr))\n\t\t\tm_hThumbnail = NULL;\n\n\t\treturn Hr;\n\t}\n\n\toperator HTHUMBNAIL() const { return m_hThumbnail; }\n\n\tbool IsNull() const { return (m_hThumbnail == NULL); }\n\n\tHRESULT UpdateProperties(const DWM_THUMBNAIL_PROPERTIES* ptnProperties)\n\t{\n\t\tif(!this->IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\tATLASSERT(m_hThumbnail != NULL);\n\t\treturn ::DwmUpdateThumbnailProperties(m_hThumbnail, ptnProperties);\n\t}\n\n// Attributes\n\tHRESULT QuerySourceSize(PSIZE pSize)\n\t{\n\t\tif(!this->IsDwmSupported())\n\t\t\treturn E_NOTIMPL;\n\n\t\tATLASSERT(m_hThumbnail != NULL);\n\t\treturn ::DwmQueryThumbnailSourceSize(m_hThumbnail, pSize);\n\t}\n};\n\ntypedef CDwmThumbnailT<true, CDwm> CDwmThumbnail;\ntypedef CDwmThumbnailT<false, CDwm> CDwmThumbnailHandle;\n\n\n#ifdef __ATLTHEME_H__\n\n///////////////////////////////////////////////////////////////////////////////\n// CAeroControlImpl - Base class for controls on Glass\n\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\nclass CAeroControlImpl : public CThemeImpl<T>,\n                         public CBufferedPaintImpl<T>,\n                         public ATL::CWindowImpl<T, TBase, TWinTraits>\n{\npublic:\n\ttypedef CThemeImpl<T> _themeClass;\n\ttypedef CBufferedPaintImpl<T> _baseClass;\n\ttypedef ATL::CWindowImpl<T, TBase, TWinTraits> _windowClass;\n\n\tCAeroControlImpl()\n\t{\n\t\tthis->m_PaintParams.dwFlags = BPPF_ERASE;\n\t}\n\n\tstatic LPCWSTR GetThemeName()\n\t{\n#ifdef _UNICODE\n\t\treturn TBase::GetWndClassName();\n#else\n\t\tATLASSERT(!_T(\"Return UNICODE string of window classname / theme class\"));\n\t\treturn NULL;\n#endif // _UNICODE\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CAeroControlImpl)\n\t\tMESSAGE_HANDLER(WM_CREATE, OnCreate)\n\t\tMESSAGE_HANDLER(WM_ACTIVATE, OnActivate)\n\t\tCHAIN_MSG_MAP(_themeClass)\n\t\tCHAIN_MSG_MAP(_baseClass)\n\tEND_MSG_MAP()\n\n\tLRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Init();\n\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnActivate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(this->IsThemingSupported())\n\t\t\tthis->Invalidate(FALSE);\n\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n// Operations\n\tBOOL SubclassWindow(HWND hWnd)\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);\n\t\tATLASSERT(::IsWindow(hWnd));\n\t\tBOOL bRet = _windowClass::SubclassWindow(hWnd);\n\t\tif(bRet)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->Init();\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n// Implementation\n\tLRESULT DefWindowProc()\n\t{\n\t\tconst ATL::_ATL_MSG* pMsg = this->m_pCurrentMsg;\n\t\tLRESULT lRes = 0;\n\t\tif(pMsg != NULL)\n\t\t\tlRes = DefWindowProc(pMsg->message, pMsg->wParam, pMsg->lParam);\n\n\t\treturn lRes;\n\t}\n\n\tLRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tLRESULT lRes = 0;\n\t\tif(::DwmDefWindowProc(pT->m_hWnd, uMsg, wParam, lParam, &lRes) != FALSE)\n\t\t\treturn lRes;\n\n\t\treturn _windowClass::DefWindowProc(uMsg, wParam, lParam);\n\t}\n\n\tvoid DoBufferedPaint(HDC hDC, RECT& rcPaint)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tHDC hDCPaint = NULL;\n\t\tRECT rcClient = {};\n\t\tthis->GetClientRect(&rcClient);\n\t\tthis->m_BufferedPaint.Begin(hDC, &rcClient, this->m_dwFormat, &this->m_PaintParams, &hDCPaint);\n\t\tATLASSERT(hDCPaint != NULL);\n\t\tpT->DoAeroPaint(hDCPaint, rcClient, rcPaint);\n\t\tthis->m_BufferedPaint.End();\n\t}\n\n\tvoid DoPaint(HDC /*hdc*/, RECT& /*rcClient*/)\n\t{\n\t\tDefWindowProc();\n\t}\n\n// Overridables\n\tvoid Init()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\t(void)pT;   // avoid level 4 warning\n\t\tthis->SetThemeClassList(pT->GetThemeName());\n\t\tif(this->m_lpstrThemeClassList != NULL)\n\t\t\tthis->OpenThemeData();\n\t}\n\n\tvoid DoAeroPaint(HDC hDC, RECT& /*rcClient*/, RECT& rcPaint)\n\t{\n\t\tDefWindowProc(WM_PAINT, (WPARAM) hDC, 0L);\n\t\tthis->m_BufferedPaint.MakeOpaque(&rcPaint);\n\t}\n};\n\n#endif // __ATLTHEME_H__\n\n} // namespace WTL\n\n#endif // __ATLDWM_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlfind.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLFIND_H__\n#define __ATLFIND_H__\n\n#pragma once\n\n#ifndef __ATLCTRLS_H__\n\t#error atlfind.h requires atlctrls.h to be included first\n#endif\n\n#ifndef __ATLDLGS_H__\n\t#error atlfind.h requires atldlgs.h to be included first\n#endif\n\n#ifndef __ATLSTR_H__\n\t#error atlfind.h requires CString\n#endif\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CEditFindReplaceImplBase<T, TFindReplaceDialog>\n// CEditFindReplaceImpl<T, TFindReplaceDialog>\n// CRichEditFindReplaceImpl<T, TFindReplaceDialog>\n\n\nnamespace WTL\n{\n\n///////////////////////////////////////////////////////////////////////////////\n// CEditFindReplaceImplBase - Base class for mixin classes that\n// help implement Find/Replace for CEdit or CRichEditCtrl based window classes.\n\ntemplate <class T, class TFindReplaceDialog = CFindReplaceDialog>\nclass CEditFindReplaceImplBase\n{\nprotected:\n// Typedefs\n\ttypedef CEditFindReplaceImplBase<T, TFindReplaceDialog> thisClass;\n\n// Enumerations\n\tenum TranslationTextItem\n\t{\n\t\teText_OnReplaceAllMessage   = 0,\n\t\teText_OnReplaceAllTitle     = 1,\n\t\teText_OnTextNotFoundMessage = 2,\n\t\teText_OnTextNotFoundTitle   = 3\n\t};\n\npublic:\n// Data members\n\tTFindReplaceDialog* m_pFindReplaceDialog;\n\tATL::CString m_sFindNext, m_sReplaceWith;\n\tBOOL m_bFindOnly, m_bFirstSearch, m_bMatchCase, m_bWholeWord, m_bFindDown;\n\tLONG m_nInitialSearchPos;\n\tHCURSOR m_hOldCursor;\n\n// Constructors\n\tCEditFindReplaceImplBase() :\n\t\tm_pFindReplaceDialog(NULL),\n\t\tm_bFindOnly(TRUE),\n\t\tm_bFirstSearch(TRUE),\n\t\tm_bMatchCase(FALSE),\n\t\tm_bWholeWord(FALSE),\n\t\tm_bFindDown(TRUE),\n\t\tm_nInitialSearchPos(0),\n\t\tm_hOldCursor(NULL)\n\t{\n\t}\n\n// Message Handlers\n\tBEGIN_MSG_MAP(thisClass)\n\tALT_MSG_MAP(1)\n\t\tMESSAGE_HANDLER(TFindReplaceDialog::GetFindReplaceMsg(), OnFindReplaceCmd)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_FIND, OnEditFind)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_REPEAT, OnEditRepeat)\n\t\tCOMMAND_ID_HANDLER(ID_EDIT_REPLACE, OnEditReplace)\n\tEND_MSG_MAP()\n\n\tLRESULT OnFindReplaceCmd(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tTFindReplaceDialog* pDialog = TFindReplaceDialog::GetNotifier(lParam);\n\t\tif(pDialog == NULL)\n\t\t{\n\t\t\tATLASSERT(FALSE);\n\t\t\t::MessageBeep(MB_ICONERROR);\n\t\t\treturn 1;\n\t\t}\n\t\tATLASSERT(pDialog == m_pFindReplaceDialog);\n\n\t\tLPFINDREPLACE findReplace = (LPFINDREPLACE)lParam;\n\t\tif((m_pFindReplaceDialog != NULL) && (findReplace != NULL))\n\t\t{\n\t\t\tif(pDialog->FindNext())\n\t\t\t{\n\t\t\t\tpT->OnFindNext(pDialog->GetFindString(), pDialog->SearchDown(),\n\t\t\t\t\tpDialog->MatchCase(), pDialog->MatchWholeWord());\n\t\t\t}\n\t\t\telse if(pDialog->ReplaceCurrent())\n\t\t\t{\n\t\t\t\tpT->OnReplaceSel(pDialog->GetFindString(),\n\t\t\t\t\tpDialog->SearchDown(), pDialog->MatchCase(), pDialog->MatchWholeWord(),\n\t\t\t\t\tpDialog->GetReplaceString());\n\t\t\t}\n\t\t\telse if(pDialog->ReplaceAll())\n\t\t\t{\n\t\t\t\tpT->OnReplaceAll(pDialog->GetFindString(), pDialog->GetReplaceString(),\n\t\t\t\t\tpDialog->MatchCase(), pDialog->MatchWholeWord());\n\t\t\t}\n\t\t\telse if(pDialog->IsTerminating())\n\t\t\t{\n\t\t\t\t// Dialog is going away (but hasn't gone away yet)\n\t\t\t\t// OnFinalMessage will \"delete this\"\n\t\t\t\tpT->OnTerminatingFindReplaceDialog(m_pFindReplaceDialog);\n\t\t\t\tm_pFindReplaceDialog = NULL;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnEditFind(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->FindReplace(TRUE);\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnEditRepeat(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\n\t\t// If the user is holding down SHIFT when hitting F3, we'll\n\t\t// search in reverse. Otherwise, we'll search forward.\n\t\t// (be sure to have an accelerator mapped to ID_EDIT_REPEAT\n\t\t// for both F3 and Shift+F3)\n\t\tm_bFindDown = !((::GetKeyState(VK_SHIFT) & 0x8000) == 0x8000);\n\n\t\tif(m_sFindNext.IsEmpty())\n\t\t{\n\t\t\tpT->FindReplace(TRUE);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(!pT->FindTextSimple(m_sFindNext, m_bMatchCase, m_bWholeWord, m_bFindDown))\n\t\t\t\tpT->TextNotFound(m_sFindNext);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnEditReplace(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tDWORD style = pT->GetStyle();\n\t\tif((style & ES_READONLY) != ES_READONLY)\n\t\t{\n\t\t\tpT->FindReplace(FALSE);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Don't allow replace when the edit control is read only\n\t\t\tbHandled = FALSE;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n// Operations (overrideable)\n\tTFindReplaceDialog* CreateFindReplaceDialog(BOOL bFindOnly, // TRUE for Find, FALSE for FindReplace\n\t\t\tLPCTSTR lpszFindWhat,\n\t\t\tLPCTSTR lpszReplaceWith = NULL,\n\t\t\tDWORD dwFlags = FR_DOWN,\n\t\t\tHWND hWndParent = NULL)\n\t{\n\t\t// You can override all of this in a derived class\n\n\t\tTFindReplaceDialog* findReplaceDialog = NULL;\n\t\tATLTRY(findReplaceDialog = new TFindReplaceDialog());\n\t\tif(findReplaceDialog == NULL)\n\t\t{\n\t\t\t::MessageBeep(MB_ICONHAND);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tHWND hWndFindReplace = findReplaceDialog->Create(bFindOnly,\n\t\t\t\tlpszFindWhat, lpszReplaceWith, dwFlags, hWndParent);\n\t\t\tif(hWndFindReplace == NULL)\n\t\t\t{\n\t\t\t\tdelete findReplaceDialog;\n\t\t\t\tfindReplaceDialog = NULL;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfindReplaceDialog->SetActiveWindow();\n\t\t\t\tfindReplaceDialog->ShowWindow(SW_SHOW);\n\t\t\t}\n\t\t}\n\n\t\treturn findReplaceDialog;\n\t}\n\n\tvoid AdjustDialogPosition(HWND hWndDialog)\n\t{\n\t\tATLASSERT((hWndDialog != NULL) && ::IsWindow(hWndDialog));\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tLONG nStartChar = 0, nEndChar = 0;\n\t\t// Send EM_GETSEL so we can use both Edit and RichEdit\n\t\t// (CEdit::GetSel uses int&, and CRichEditCtrlT::GetSel uses LONG&)\n\t\t::SendMessage(pT->m_hWnd, EM_GETSEL, (WPARAM)&nStartChar, (LPARAM)&nEndChar);\n\t\tPOINT point = pT->PosFromChar(nStartChar);\n\t\tpT->ClientToScreen(&point);\n\t\tRECT rect = {};\n\t\t::GetWindowRect(hWndDialog, &rect);\n\t\tif(::PtInRect(&rect, point) != FALSE)\n\t\t{\n\t\t\tif(point.y > (rect.bottom - rect.top))\n\t\t\t{\n\t\t\t\t::OffsetRect(&rect, 0, point.y - rect.bottom - 20);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tint nVertExt = GetSystemMetrics(SM_CYSCREEN);\n\t\t\t\tif((point.y + (rect.bottom - rect.top)) < nVertExt)\n\t\t\t\t\t::OffsetRect(&rect, 0, 40 + point.y - rect.top);\n\t\t\t}\n\n\t\t\t::MoveWindow(hWndDialog, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE);\n\t\t}\n\t}\n\n\tDWORD GetFindReplaceDialogFlags() const\n\t{\n\t\tDWORD dwFlags = 0;\n\t\tif(m_bFindDown)\n\t\t\tdwFlags |= FR_DOWN;\n\t\tif(m_bMatchCase)\n\t\t\tdwFlags |= FR_MATCHCASE;\n\t\tif(m_bWholeWord)\n\t\t\tdwFlags |= FR_WHOLEWORD;\n\n\t\treturn dwFlags;\n\t}\n\n\tvoid FindReplace(BOOL bFindOnly)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tm_bFirstSearch = TRUE;\n\t\tif(m_pFindReplaceDialog != NULL)\n\t\t{\n\t\t\tif(m_bFindOnly == bFindOnly)\n\t\t\t{\n\t\t\t\tm_pFindReplaceDialog->SetActiveWindow();\n\t\t\t\tm_pFindReplaceDialog->ShowWindow(SW_SHOW);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_pFindReplaceDialog->SendMessage(WM_CLOSE);\n\t\t\t\tATLASSERT(m_pFindReplaceDialog == NULL);\n\t\t\t}\n\t\t}\n\n\t\tATLASSERT(m_pFindReplaceDialog == NULL);\n\n\t\tATL::CString findNext;\n\t\tpT->GetSelText(findNext);\n\t\t// if selection is empty or spans multiple lines use old find text\n\t\tif(findNext.IsEmpty() || (findNext.FindOneOf(_T(\"\\n\\r\")) != -1))\n\t\t\tfindNext = m_sFindNext;\n\t\tATL::CString replaceWith = m_sReplaceWith;\n\t\tDWORD dwFlags = pT->GetFindReplaceDialogFlags();\n\n\t\tm_pFindReplaceDialog = pT->CreateFindReplaceDialog(bFindOnly,\n\t\t\tfindNext, replaceWith, dwFlags, pT->operator HWND());\n\t\tATLASSERT(m_pFindReplaceDialog != NULL);\n\t\tif(m_pFindReplaceDialog != NULL)\n\t\t\tm_bFindOnly = bFindOnly;\n\t}\n\n\tBOOL SameAsSelected(LPCTSTR lpszCompare, BOOL bMatchCase, BOOL /*bWholeWord*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\n\t\t// check length first\n\t\tsize_t nLen = lstrlen(lpszCompare);\n\t\tLONG nStartChar = 0, nEndChar = 0;\n\t\t// Send EM_GETSEL so we can use both Edit and RichEdit\n\t\t// (CEdit::GetSel uses int&, and CRichEditCtrlT::GetSel uses LONG&)\n\t\t::SendMessage(pT->m_hWnd, EM_GETSEL, (WPARAM)&nStartChar, (LPARAM)&nEndChar);\n\t\tif(nLen != (size_t)(nEndChar - nStartChar))\n\t\t\treturn FALSE;\n\n\t\t// length is the same, check contents\n\t\tATL::CString selectedText;\n\t\tpT->GetSelText(selectedText);\n\n\t\treturn (bMatchCase && (selectedText.Compare(lpszCompare) == 0)) ||\n\t\t\t(!bMatchCase && (selectedText.CompareNoCase(lpszCompare) == 0));\n\t}\n\n\tvoid TextNotFound(LPCTSTR lpszFind)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tm_bFirstSearch = TRUE;\n\t\tpT->OnTextNotFound(lpszFind);\n\t}\n\n\tATL::CString GetTranslationText(enum TranslationTextItem eItem) const\n\t{\n\t\tATL::CString text;\n\t\tswitch(eItem)\n\t\t{\n\t\tcase eText_OnReplaceAllMessage:\n\t\t\ttext = _T(\"Replaced %d occurances of \\\"%s\\\" with \\\"%s\\\"\");\n\t\t\tbreak;\n\t\tcase eText_OnReplaceAllTitle:\n\t\t\ttext = _T(\"Replace All\");\n\t\t\tbreak;\n\t\tcase eText_OnTextNotFoundMessage:\n\t\t\ttext = _T(\"Unable to find the text \\\"%s\\\"\");\n\t\t\tbreak;\n\t\tcase eText_OnTextNotFoundTitle:\n\t\t\ttext = _T(\"Text not found\");\n\t\t\tbreak;\n\t\t}\n\n\t\treturn text;\n\t}\n\n// Overrideable Handlers\n\tvoid OnFindNext(LPCTSTR lpszFind, BOOL bFindDown, BOOL bMatchCase, BOOL bWholeWord)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tm_sFindNext = lpszFind;\n\t\tm_bMatchCase = bMatchCase;\n\t\tm_bWholeWord = bWholeWord;\n\t\tm_bFindDown = bFindDown;\n\n\t\tif(!pT->FindTextSimple(m_sFindNext, m_bMatchCase, m_bWholeWord, m_bFindDown))\n\t\t\tpT->TextNotFound(m_sFindNext);\n\t\telse\n\t\t\tpT->AdjustDialogPosition(m_pFindReplaceDialog->operator HWND());\n\t}\n\n\tvoid OnReplaceSel(LPCTSTR lpszFind, BOOL bFindDown, BOOL bMatchCase, BOOL bWholeWord, LPCTSTR lpszReplace)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tm_sFindNext = lpszFind;\n\t\tm_sReplaceWith = lpszReplace;\n\t\tm_bMatchCase = bMatchCase;\n\t\tm_bWholeWord = bWholeWord;\n\t\tm_bFindDown = bFindDown;\n\n\t\tif(pT->SameAsSelected(m_sFindNext, m_bMatchCase, m_bWholeWord))\n\t\t\tpT->ReplaceSel(m_sReplaceWith);\n\n\t\tif(!pT->FindTextSimple(m_sFindNext, m_bMatchCase, m_bWholeWord, m_bFindDown))\n\t\t\tpT->TextNotFound(m_sFindNext);\n\t\telse\n\t\t\tpT->AdjustDialogPosition(m_pFindReplaceDialog->operator HWND());\n\t}\n\n\tvoid OnReplaceAll(LPCTSTR lpszFind, LPCTSTR lpszReplace, BOOL bMatchCase, BOOL bWholeWord)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tm_sFindNext = lpszFind;\n\t\tm_sReplaceWith = lpszReplace;\n\t\tm_bMatchCase = bMatchCase;\n\t\tm_bWholeWord = bWholeWord;\n\t\tm_bFindDown = TRUE;\n\n\t\t// no selection or different than what looking for\n\t\tif(!pT->SameAsSelected(m_sFindNext, m_bMatchCase, m_bWholeWord))\n\t\t{\n\t\t\tif(!pT->FindTextSimple(m_sFindNext, m_bMatchCase, m_bWholeWord, m_bFindDown))\n\t\t\t{\n\t\t\t\tpT->TextNotFound(m_sFindNext);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tpT->OnReplaceAllCoreBegin();\n\n\t\tint replaceCount=0;\n\t\tdo\n\t\t{\n\t\t\t++replaceCount;\n\t\t\tpT->ReplaceSel(m_sReplaceWith);\n\t\t} while(pT->FindTextSimple(m_sFindNext, m_bMatchCase, m_bWholeWord, m_bFindDown));\n\n\t\tpT->OnReplaceAllCoreEnd(replaceCount);\n\t}\n\n\tvoid OnReplaceAllCoreBegin()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tm_hOldCursor = ::SetCursor(::LoadCursor(NULL, IDC_WAIT));\n\n\t\tpT->HideSelection(TRUE, FALSE);\n\n\t}\n\n\tvoid OnReplaceAllCoreEnd(int replaceCount)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->HideSelection(FALSE, FALSE);\n\n\t\t::SetCursor(m_hOldCursor);\n\n\t\tATL::CString message = pT->GetTranslationText(eText_OnReplaceAllMessage);\n\t\tif(message.GetLength() > 0)\n\t\t{\n\t\t\tATL::CString formattedMessage;\n\t\t\tformattedMessage.Format(message, replaceCount, (LPCTSTR)m_sFindNext, (LPCTSTR)m_sReplaceWith);\n\t\t\tif(m_pFindReplaceDialog != NULL)\n\t\t\t{\n\t\t\t\tm_pFindReplaceDialog->MessageBox(formattedMessage,\n\t\t\t\t\tpT->GetTranslationText(eText_OnReplaceAllTitle),\n\t\t\t\t\tMB_OK | MB_ICONINFORMATION | MB_APPLMODAL);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpT->MessageBox(formattedMessage,\n\t\t\t\t\tpT->GetTranslationText(eText_OnReplaceAllTitle),\n\t\t\t\t\tMB_OK | MB_ICONINFORMATION | MB_APPLMODAL);\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid OnTextNotFound(LPCTSTR lpszFind)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATL::CString message = pT->GetTranslationText(eText_OnTextNotFoundMessage);\n\t\tif(message.GetLength() > 0)\n\t\t{\n\t\t\tATL::CString formattedMessage;\n\t\t\tformattedMessage.Format(message, lpszFind);\n\t\t\tif(m_pFindReplaceDialog != NULL)\n\t\t\t{\n\t\t\t\tm_pFindReplaceDialog->MessageBox(formattedMessage,\n\t\t\t\t\tpT->GetTranslationText(eText_OnTextNotFoundTitle),\n\t\t\t\t\tMB_OK | MB_ICONINFORMATION | MB_APPLMODAL);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpT->MessageBox(formattedMessage,\n\t\t\t\t\tpT->GetTranslationText(eText_OnTextNotFoundTitle),\n\t\t\t\t\tMB_OK | MB_ICONINFORMATION | MB_APPLMODAL);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t::MessageBeep(MB_ICONHAND);\n\t\t}\n\t}\n\n\tvoid OnTerminatingFindReplaceDialog(TFindReplaceDialog*& /*findReplaceDialog*/)\n\t{\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CEditFindReplaceImpl - Mixin class for implementing Find/Replace for CEdit\n// based window classes.\n\n// Chain to CEditFindReplaceImpl message map. Your class must also derive from CEdit.\n// Example:\n// class CMyEdit : public CWindowImpl<CMyEdit, CEdit>,\n//                 public CEditFindReplaceImpl<CMyEdit>\n// {\n// public:\n//      BEGIN_MSG_MAP(CMyEdit)\n//              // your handlers...\n//              CHAIN_MSG_MAP_ALT(CEditFindReplaceImpl<CMyEdit>, 1)\n//      END_MSG_MAP()\n//      // other stuff...\n// };\n\ntemplate <class T, class TFindReplaceDialog = CFindReplaceDialog>\nclass CEditFindReplaceImpl : public CEditFindReplaceImplBase<T, TFindReplaceDialog>\n{\nprotected:\n\ttypedef CEditFindReplaceImpl<T, TFindReplaceDialog> thisClass;\n\ttypedef CEditFindReplaceImplBase<T, TFindReplaceDialog> baseClass;\n\npublic:\n// Message Handlers\n\tBEGIN_MSG_MAP(thisClass)\n\tALT_MSG_MAP(1)\n\t\tCHAIN_MSG_MAP_ALT(baseClass, 1)\n\tEND_MSG_MAP()\n\n// Operations\n\t// Supported only for RichEdit, so this does nothing for Edit\n\tvoid HideSelection(BOOL /*bHide*/ = TRUE, BOOL /*bChangeStyle*/ = FALSE)\n\t{\n\t}\n\n// Operations (overrideable)\n\tBOOL FindTextSimple(LPCTSTR lpszFind, BOOL bMatchCase, BOOL bWholeWord, BOOL bFindDown = TRUE)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tATLASSERT(lpszFind != NULL);\n\t\tATLASSERT(*lpszFind != _T('\\0'));\n\n\t\tUINT nLen = pT->GetBufferLength();\n\t\tint nStartChar = 0, nEndChar = 0;\n\t\tpT->GetSel(nStartChar, nEndChar);\n\t\tUINT nStart = nStartChar;\n\t\tint iDir = bFindDown ? +1 : -1;\n\n\t\t// can't find a match before the first character\n\t\tif((nStart == 0) && (iDir < 0))\n\t\t\treturn FALSE;\n\n\t\tLPCTSTR lpszText = pT->LockBuffer();\n\n\t\tbool isDBCS = false;\n#ifdef _MBCS\n\t\tCPINFO info = {};\n\t\t::GetCPInfo(::GetOEMCP(), &info);\n\t\tisDBCS = (info.MaxCharSize > 1);\n#endif\n\n\t\tif(iDir < 0)\n\t\t{\n\t\t\t// always go back one for search backwards\n\t\t\tnStart -= int((lpszText + nStart) - ::CharPrev(lpszText, lpszText + nStart));\n\t\t}\n\t\telse if((nStartChar != nEndChar) && (pT->SameAsSelected(lpszFind, bMatchCase, bWholeWord)))\n\t\t{\n\t\t\t// easy to go backward/forward with SBCS\n#ifndef _UNICODE\n\t\t\tif(::IsDBCSLeadByte(lpszText[nStart]))\n\t\t\t\tnStart++;\n#endif\n\t\t\tnStart += iDir;\n\t\t}\n\n\t\t// handle search with nStart past end of buffer\n\t\tUINT nLenFind = ::lstrlen(lpszFind);\n\t\tif((nStart + nLenFind - 1) >= nLen)\n\t\t{\n\t\t\tif((iDir < 0) && (nLen >= nLenFind))\n\t\t\t{\n\t\t\t\tif(isDBCS)\n\t\t\t\t{\n\t\t\t\t\t// walk back to previous character n times\n\t\t\t\t\tnStart = nLen;\n\t\t\t\t\tint n = nLenFind;\n\t\t\t\t\twhile(n--)\n\t\t\t\t\t{\n\t\t\t\t\t\tnStart -= int((lpszText + nStart) - ::CharPrev(lpszText, lpszText + nStart));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// single-byte character set is easy and fast\n\t\t\t\t\tnStart = nLen - nLenFind;\n\t\t\t\t}\n\t\t\t\tATLASSERT((nStart + nLenFind - 1) <= nLen);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpT->UnlockBuffer();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// start the search at nStart\n\t\tLPCTSTR lpsz = lpszText + nStart;\n\t\ttypedef int (WINAPI* CompareProc)(LPCTSTR str1, LPCTSTR str2);\n\t\tCompareProc pfnCompare = bMatchCase ? lstrcmp : lstrcmpi;\n\n\t\tif(isDBCS)\n\t\t{\n\t\t\t// double-byte string search\n\t\t\tLPCTSTR lpszStop = NULL;\n\t\t\tif(iDir > 0)\n\t\t\t{\n\t\t\t\t// start at current and find _first_ occurrance\n\t\t\t\tlpszStop = lpszText + nLen - nLenFind + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// start at top and find _last_ occurrance\n\t\t\t\tlpszStop = lpsz;\n\t\t\t\tlpsz = lpszText;\n\t\t\t}\n\n\t\t\tLPCTSTR lpszFound = NULL;\n\t\t\twhile(lpsz <= lpszStop)\n\t\t\t{\n#ifndef _UNICODE\n\t\t\t\tif(!bMatchCase || ((*lpsz == *lpszFind) && (!::IsDBCSLeadByte(*lpsz) || (lpsz[1] == lpszFind[1]))))\n#else\n\t\t\t\tif(!bMatchCase || ((*lpsz == *lpszFind) && (lpsz[1] == lpszFind[1])))\n#endif\n\t\t\t\t{\n\t\t\t\t\tLPTSTR lpch = (LPTSTR)(lpsz + nLenFind);\n\t\t\t\t\tTCHAR chSave = *lpch;\n\t\t\t\t\t*lpch = _T('\\0');\n\t\t\t\t\tint nResult = (*pfnCompare)(lpsz, lpszFind);\n\t\t\t\t\t*lpch = chSave;\n\t\t\t\t\tif(nResult == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlpszFound = lpsz;\n\t\t\t\t\t\tif(iDir > 0)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlpsz = ::CharNext(lpsz);\n\t\t\t}\n\t\t\tpT->UnlockBuffer();\n\n\t\t\tif(lpszFound != NULL)\n\t\t\t{\n\t\t\t\tint n = (int)(lpszFound - lpszText);\n\t\t\t\tpT->SetSel(n, n + nLenFind);\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// single-byte string search\n\t\t\tUINT nCompare = 0;\n\t\t\tif(iDir < 0)\n\t\t\t\tnCompare = (UINT)(lpsz - lpszText) + 1;\n\t\t\telse\n\t\t\t\tnCompare = nLen - (UINT)(lpsz - lpszText) - nLenFind + 1;\n\n\t\t\twhile(nCompare > 0)\n\t\t\t{\n\t\t\t\tATLASSERT(lpsz >= lpszText);\n\t\t\t\tATLASSERT((lpsz + nLenFind - 1) <= (lpszText + nLen - 1));\n\n\t\t\t\tLPSTR lpch = (LPSTR)(lpsz + nLenFind);\n\t\t\t\tchar chSave = *lpch;\n\t\t\t\t*lpch = '\\0';\n\t\t\t\tint nResult = (*pfnCompare)(lpsz, lpszFind);\n\t\t\t\t*lpch = chSave;\n\t\t\t\tif(nResult == 0)\n\t\t\t\t{\n\t\t\t\t\tpT->UnlockBuffer();\n\t\t\t\t\tint n = (int)(lpsz - lpszText);\n\t\t\t\t\tpT->SetSel(n, n + nLenFind);\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\n\t\t\t\t// restore character at end of search\n\t\t\t\t*lpch = chSave;\n\n\t\t\t\t// move on to next substring\n\t\t\t\tnCompare--;\n\t\t\t\tlpsz += iDir;\n\t\t\t}\n\t\t\tpT->UnlockBuffer();\n\t\t}\n\n\t\treturn FALSE;\n\t}\n\n\tLPCTSTR LockBuffer() const\n\t{\n\t\tconst T* pT = static_cast<const T*>(this);\n\t\tATLASSERT(pT->m_hWnd != NULL);\n\n#ifndef _UNICODE\n\t\t// If common controls version 6 is in use (such as via theming), then EM_GETHANDLE \n\t\t// will always return a UNICODE string. You're really not supposed to superclass \n\t\t// or subclass common controls with an ANSI windows procedure.\n\t\tDWORD dwMajor = 0, dwMinor = 0;\n\t\tHRESULT hRet = ATL::AtlGetCommCtrlVersion(&dwMajor, &dwMinor);\n\t\tif(SUCCEEDED(hRet) && (dwMajor >= 6))\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"AtlFind Warning: You have compiled for MBCS/ANSI but are using common controls version 6 or later which are always Unicode.\\r\\n\"));\n\t\t\tATLASSERT(FALSE);\n\t\t}\n#endif // !_UNICODE\n\n\t\tHLOCAL hLocal = pT->GetHandle();\n\t\tATLASSERT(hLocal != NULL);\n\t\tLPCTSTR lpszText = (LPCTSTR)::LocalLock(hLocal);\n\t\tATLASSERT(lpszText != NULL);\n\n\t\treturn lpszText;\n\t}\n\n\tvoid UnlockBuffer() const\n\t{\n\t\tconst T* pT = static_cast<const T*>(this);\n\t\tATLASSERT(pT->m_hWnd != NULL);\n\n\t\tHLOCAL hLocal = pT->GetHandle();\n\t\tATLASSERT(hLocal != NULL);\n\t\t::LocalUnlock(hLocal);\n\t}\n\n\tUINT GetBufferLength() const\n\t{\n\t\tconst T* pT = static_cast<const T*>(this);\n\t\tATLASSERT(pT->m_hWnd != NULL);\n\n\t\tUINT nLen = 0;\n\t\tLPCTSTR lpszText = pT->LockBuffer();\n\t\tif(lpszText != NULL)\n\t\t\tnLen = ::lstrlen(lpszText);\n\t\tpT->UnlockBuffer();\n\n\t\treturn nLen;\n\t}\n\n\tLONG EndOfLine(LPCTSTR lpszText, UINT nLen, UINT nIndex) const\n\t{\n\t\tLPCTSTR lpsz = lpszText + nIndex;\n\t\tLPCTSTR lpszStop = lpszText + nLen;\n\t\twhile((lpsz < lpszStop) && (*lpsz != _T('\\r')))\n\t\t\t++lpsz;\n\t\treturn LONG(lpsz - lpszText);\n\t}\n\n\tLONG GetSelText(ATL::CString& strText) const\n\t{\n\t\tconst T* pT = static_cast<const T*>(this);\n\n\t\tint nStartChar = 0, nEndChar = 0;\n\t\tpT->GetSel(nStartChar, nEndChar);\n\t\tATLASSERT((UINT)nEndChar <= pT->GetBufferLength());\n\t\tLPCTSTR lpszText = pT->LockBuffer();\n\t\tLONG nLen = pT->EndOfLine(lpszText, nEndChar, nStartChar) - nStartChar;\n\t\tATL::Checked::memcpy_s(strText.GetBuffer(nLen), nLen * sizeof(TCHAR), lpszText + nStartChar, nLen * sizeof(TCHAR));\n\t\tstrText.ReleaseBuffer(nLen);\n\t\tpT->UnlockBuffer();\n\n\t\treturn nLen;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CRichEditFindReplaceImpl - Mixin class for implementing Find/Replace for CRichEditCtrl\n// based window classes.\n\n// Chain to CRichEditFindReplaceImpl message map. Your class must also derive from CRichEditCtrl.\n// Example:\n// class CMyRichEdit : public CWindowImpl<CMyRichEdit, CRichEditCtrl>,\n//                     public CRichEditFindReplaceImpl<CMyRichEdit>\n// {\n// public:\n//      BEGIN_MSG_MAP(CMyRichEdit)\n//              // your handlers...\n//              CHAIN_MSG_MAP_ALT(CRichEditFindReplaceImpl<CMyRichEdit>, 1)\n//      END_MSG_MAP()\n//      // other stuff...\n// };\n\ntemplate <class T, class TFindReplaceDialog = CFindReplaceDialog>\nclass CRichEditFindReplaceImpl : public CEditFindReplaceImplBase<T, TFindReplaceDialog>\n{\nprotected:\n\ttypedef CRichEditFindReplaceImpl<T, TFindReplaceDialog> thisClass;\n\ttypedef CEditFindReplaceImplBase<T, TFindReplaceDialog> baseClass;\n\npublic:\n\tBEGIN_MSG_MAP(thisClass)\n\tALT_MSG_MAP(1)\n\t\tCHAIN_MSG_MAP_ALT(baseClass, 1)\n\tEND_MSG_MAP()\n\n// Operations (overrideable)\n\tBOOL FindTextSimple(LPCTSTR lpszFind, BOOL bMatchCase, BOOL bWholeWord, BOOL bFindDown = TRUE)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tATLASSERT(lpszFind != NULL);\n\t\tFINDTEXTEX ft = {};\n\n\t\tpT->GetSel(ft.chrg);\n\t\tif(this->m_bFirstSearch)\n\t\t{\n\t\t\tif(bFindDown)\n\t\t\t\tthis->m_nInitialSearchPos = ft.chrg.cpMin;\n\t\t\telse\n\t\t\t\tthis->m_nInitialSearchPos = ft.chrg.cpMax;\n\t\t\tthis->m_bFirstSearch = FALSE;\n\t\t}\n\n\t\tft.lpstrText = (LPTSTR)lpszFind;\n\n\t\tif(ft.chrg.cpMin != ft.chrg.cpMax) // i.e. there is a selection\n\t\t{\n\t\t\tif(bFindDown)\n\t\t\t{\n\t\t\t\tft.chrg.cpMin++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// won't wraparound backwards\n\t\t\t\tft.chrg.cpMin = __max(ft.chrg.cpMin, 0);\n\t\t\t}\n\t\t}\n\n\t\tDWORD dwFlags = bMatchCase ? FR_MATCHCASE : 0;\n\t\tdwFlags |= bWholeWord ? FR_WHOLEWORD : 0;\n\n\t\tft.chrg.cpMax = pT->GetTextLength() + this->m_nInitialSearchPos;\n\n\t\tif(bFindDown)\n\t\t{\n\t\t\tif(this->m_nInitialSearchPos >= 0)\n\t\t\t\tft.chrg.cpMax = pT->GetTextLength();\n\n\t\t\tdwFlags |= FR_DOWN;\n\t\t\tATLASSERT(ft.chrg.cpMax >= ft.chrg.cpMin);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(this->m_nInitialSearchPos >= 0)\n\t\t\t\tft.chrg.cpMax = 0;\n\n\t\t\tdwFlags &= ~FR_DOWN;\n\t\t\tATLASSERT(ft.chrg.cpMax <= ft.chrg.cpMin);\n\t\t}\n\n\t\tBOOL bRet = FALSE;\n\t\tif(pT->FindAndSelect(dwFlags, ft) != -1)\n\t\t{\n\t\t\tbRet = TRUE;   // we found the text\n\t\t}\n\t\telse if(this->m_nInitialSearchPos > 0)\n\t\t{\n\t\t\t// if the original starting point was not the beginning\n\t\t\t// of the buffer and we haven't already been here\n\t\t\tif(bFindDown)\n\t\t\t{\n\t\t\t\tft.chrg.cpMin = 0;\n\t\t\t\tft.chrg.cpMax = this->m_nInitialSearchPos;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tft.chrg.cpMin = pT->GetTextLength();\n\t\t\t\tft.chrg.cpMax = this->m_nInitialSearchPos;\n\t\t\t}\n\t\t\tthis->m_nInitialSearchPos = this->m_nInitialSearchPos - pT->GetTextLength();\n\n\t\t\tbRet = (pT->FindAndSelect(dwFlags, ft) != -1) ? TRUE : FALSE;\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\tlong FindAndSelect(DWORD dwFlags, FINDTEXTEX& ft)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tLONG index = pT->FindText(dwFlags, ft);\n\t\tif(index != -1) // i.e. we found something\n\t\t\tpT->SetSel(ft.chrgText);\n\n\t\treturn index;\n\t}\n};\n\n} // namespace WTL\n\n#endif // __ATLFIND_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlframe.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLFRAME_H__\n#define __ATLFRAME_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atlframe.h requires atlapp.h to be included first\n#endif\n\n#ifndef __ATLWIN_H__\n\t#error atlframe.h requires atlwin.h to be included first\n#endif\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CFrameWindowImpl<T, TBase, TWinTraits>\n// CMDIWindow\n// CMDIFrameWindowImpl<T, TBase, TWinTraits>\n// CMDIChildWindowImpl<T, TBase, TWinTraits>\n// COwnerDraw<T>\n// CUpdateUIBase\n// CUpdateUI<T>\n// CDynamicUpdateUI<T>\n// CAutoUpdateUI<T>\n// CDialogResize<T>\n// CDynamicDialogLayout<T>\n// CDoubleBufferImpl<T>\n// CDoubleBufferWindowImpl<T, TBase, TWinTraits>\n//\n// Global functions:\n//   AtlCreateSimpleToolBar()\n\n\nnamespace WTL\n{\n\n///////////////////////////////////////////////////////////////////////////////\n// CFrameWndClassInfo - Manages frame window Windows class information\n\nclass CFrameWndClassInfo\n{\npublic:\n\tenum { cchAutoName = 5 + sizeof(void*) * 2 };   // sizeof(void*) * 2 is the number of digits %p outputs\n\tWNDCLASSEX m_wc;\n\tLPCTSTR m_lpszOrigName;\n\tWNDPROC pWndProc;\n\tLPCTSTR m_lpszCursorID;\n\tBOOL m_bSystemCursor;\n\tATOM m_atom;\n\tTCHAR m_szAutoName[cchAutoName];\n\tUINT m_uCommonResourceID;\n\n\tATOM Register(WNDPROC* pProc)\n\t{\n\t\tif (m_atom == 0)\n\t\t{\n\t\t\tCWindowCreateCriticalSectionLock lock;\n\t\t\tif(FAILED(lock.Lock()))\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CFrameWndClassInfo::Register.\\n\"));\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif(m_atom == 0)\n\t\t\t{\n\t\t\t\tHINSTANCE hInst = ModuleHelper::GetModuleInstance();\n\n\t\t\t\tif (m_lpszOrigName != NULL)\n\t\t\t\t{\n\t\t\t\t\tATLASSERT(pProc != NULL);\n\t\t\t\t\tLPCTSTR lpsz = m_wc.lpszClassName;\n\t\t\t\t\tWNDPROC proc = m_wc.lpfnWndProc;\n\n\t\t\t\t\tWNDCLASSEX wc = { sizeof(WNDCLASSEX) };\n\t\t\t\t\t// try process local class first\n\t\t\t\t\tif(!::GetClassInfoEx(ModuleHelper::GetModuleInstance(), m_lpszOrigName, &wc))\n\t\t\t\t\t{\n\t\t\t\t\t\t// try global class\n\t\t\t\t\t\tif(!::GetClassInfoEx(NULL, m_lpszOrigName, &wc))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock.Unlock();\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tm_wc = wc;\n\t\t\t\t\tpWndProc = m_wc.lpfnWndProc;\n\t\t\t\t\tm_wc.lpszClassName = lpsz;\n\t\t\t\t\tm_wc.lpfnWndProc = proc;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tm_wc.hCursor = ::LoadCursor(m_bSystemCursor ? NULL : hInst, m_lpszCursorID);\n\t\t\t\t}\n\n\t\t\t\tm_wc.hInstance = hInst;\n\t\t\t\tm_wc.style &= ~CS_GLOBALCLASS;   // we don't register global classes\n\t\t\t\tif (m_wc.lpszClassName == NULL)\n\t\t\t\t{\n\t\t\t\t\t_stprintf_s(m_szAutoName, cchAutoName, _T(\"ATL:%p\"), &m_wc);\n\t\t\t\t\tm_wc.lpszClassName = m_szAutoName;\n\t\t\t\t}\n\n\t\t\t\tWNDCLASSEX wcTemp = m_wc;\n\t\t\t\tm_atom = (ATOM)::GetClassInfoEx(m_wc.hInstance, m_wc.lpszClassName, &wcTemp);\n\t\t\t\tif (m_atom == 0)\n\t\t\t\t{\n\t\t\t\t\tif(m_uCommonResourceID != 0)   // use it if not zero\n\t\t\t\t\t{\n\t\t\t\t\t\tm_wc.hIcon = (HICON)::LoadImage(ModuleHelper::GetResourceInstance(), \n\t\t\t\t\t\t\tMAKEINTRESOURCE(m_uCommonResourceID), IMAGE_ICON, \n\t\t\t\t\t\t\t::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);\n\t\t\t\t\t\tm_wc.hIconSm = (HICON)::LoadImage(ModuleHelper::GetResourceInstance(), \n\t\t\t\t\t\t\tMAKEINTRESOURCE(m_uCommonResourceID), IMAGE_ICON, \n\t\t\t\t\t\t\t::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);\n\t\t\t\t\t}\n\t\t\t\t\tm_atom = ::RegisterClassEx(&m_wc);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlock.Unlock();\n\t\t}\n\n\t\tif (m_lpszOrigName != NULL)\n\t\t{\n\t\t\tATLASSERT(pProc != NULL);\n\t\t\tATLASSERT(pWndProc != NULL);\n\t\t\t*pProc = pWndProc;\n\t\t}\n\n\t\treturn m_atom;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Macros for declaring frame window WNDCLASS\n\n#define DECLARE_FRAME_WND_CLASS(WndClassName, uCommonResourceID) \\\nstatic WTL::CFrameWndClassInfo& GetWndClassInfo() \\\n{ \\\n\tstatic WTL::CFrameWndClassInfo wc = \\\n\t{ \\\n\t\t{ sizeof(WNDCLASSEX), 0, StartWindowProc, \\\n\t\t  0, 0, NULL, NULL, NULL, (HBRUSH)(COLOR_WINDOW + 1), NULL, WndClassName, NULL }, \\\n\t\tNULL, NULL, IDC_ARROW, TRUE, 0, _T(\"\"), uCommonResourceID \\\n\t}; \\\n\treturn wc; \\\n}\n\n#define DECLARE_FRAME_WND_CLASS_EX(WndClassName, uCommonResourceID, style, bkgnd) \\\nstatic WTL::CFrameWndClassInfo& GetWndClassInfo() \\\n{ \\\n\tstatic WTL::CFrameWndClassInfo wc = \\\n\t{ \\\n\t\t{ sizeof(WNDCLASSEX), style, StartWindowProc, \\\n\t\t  0, 0, NULL, NULL, NULL, (HBRUSH)(bkgnd + 1), NULL, WndClassName, NULL }, \\\n\t\tNULL, NULL, IDC_ARROW, TRUE, 0, _T(\"\"), uCommonResourceID \\\n\t}; \\\n\treturn wc; \\\n}\n\n#define DECLARE_FRAME_WND_SUPERCLASS(WndClassName, OrigWndClassName, uCommonResourceID) \\\nstatic WTL::CFrameWndClassInfo& GetWndClassInfo() \\\n{ \\\n\tstatic WTL::CFrameWndClassInfo wc = \\\n\t{ \\\n\t\t{ sizeof(WNDCLASSEX), 0, StartWindowProc, \\\n\t\t  0, 0, NULL, NULL, NULL, NULL, NULL, WndClassName, NULL }, \\\n\t\tOrigWndClassName, NULL, NULL, TRUE, 0, _T(\"\"), uCommonResourceID \\\n\t}; \\\n\treturn wc; \\\n}\n\n// These are for templated classes\n#define DECLARE_FRAME_WND_CLASS2(WndClassName, EnclosingClass, uCommonResourceID) \\\nstatic WTL::CFrameWndClassInfo& GetWndClassInfo() \\\n{ \\\n\tstatic WTL::CFrameWndClassInfo wc = \\\n\t{ \\\n\t\t{ sizeof(WNDCLASSEX), 0, EnclosingClass::StartWindowProc, \\\n\t\t  0, 0, NULL, NULL, NULL, (HBRUSH)(COLOR_WINDOW + 1), NULL, WndClassName, NULL }, \\\n\t\tNULL, NULL, IDC_ARROW, TRUE, 0, _T(\"\"), uCommonResourceID \\\n\t}; \\\n\treturn wc; \\\n}\n\n#define DECLARE_FRAME_WND_CLASS_EX2(WndClassName, EnclosingClass, uCommonResourceID, style, bkgnd) \\\nstatic WTL::CFrameWndClassInfo& GetWndClassInfo() \\\n{ \\\n\tstatic WTL::CFrameWndClassInfo wc = \\\n\t{ \\\n\t\t{ sizeof(WNDCLASSEX), style, EnclosingClass::StartWindowProc, \\\n\t\t  0, 0, NULL, NULL, NULL, (HBRUSH)(bkgnd + 1), NULL, WndClassName, NULL }, \\\n\t\tNULL, NULL, IDC_ARROW, TRUE, 0, _T(\"\"), uCommonResourceID \\\n\t}; \\\n\treturn wc; \\\n}\n\n#define DECLARE_FRAME_WND_SUPERCLASS2(WndClassName, EnclosingClass, OrigWndClassName, uCommonResourceID) \\\nstatic WTL::CFrameWndClassInfo& GetWndClassInfo() \\\n{ \\\n\tstatic WTL::CFrameWndClassInfo wc = \\\n\t{ \\\n\t\t{ sizeof(WNDCLASSEX), 0, EnclosingClass::StartWindowProc, \\\n\t\t  0, 0, NULL, NULL, NULL, NULL, NULL, WndClassName, NULL }, \\\n\t\tOrigWndClassName, NULL, NULL, TRUE, 0, _T(\"\"), uCommonResourceID \\\n\t}; \\\n\treturn wc; \\\n}\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CFrameWindowImpl\n\n// Client window command chaining macro (only for frame windows)\n#define CHAIN_CLIENT_COMMANDS() \\\n\tif((uMsg == WM_COMMAND) && (this->m_hWndClient != NULL)) \\\n\t\t::SendMessage(this->m_hWndClient, uMsg, wParam, lParam);\n\n// standard toolbar styles\n#define ATL_SIMPLE_TOOLBAR_STYLE \\\n\t(WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | TBSTYLE_TOOLTIPS)\n// toolbar in a rebar pane\n#define ATL_SIMPLE_TOOLBAR_PANE_STYLE \\\n\t(WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CCS_NODIVIDER | CCS_NORESIZE | CCS_NOPARENTALIGN | TBSTYLE_TOOLTIPS | TBSTYLE_FLAT)\n// standard rebar styles\n  #define ATL_SIMPLE_REBAR_STYLE \\\n\t(WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | RBS_VARHEIGHT | RBS_BANDBORDERS | RBS_AUTOSIZE)\n// rebar without borders\n  #define ATL_SIMPLE_REBAR_NOBORDER_STYLE \\\n\t(WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | RBS_VARHEIGHT | RBS_BANDBORDERS | RBS_AUTOSIZE | CCS_NODIVIDER)\n\n// command bar support\n#if !defined(__ATLCTRLW_H__)\n\n#define CBRM_GETCMDBAR\t\t\t(WM_USER + 301) // returns command bar HWND\n#define CBRM_GETMENU\t\t\t(WM_USER + 302) // returns loaded or attached menu\n#define CBRM_TRACKPOPUPMENU\t\t(WM_USER + 303) // displays a popup menu\n\nstruct _AtlFrameWnd_CmdBarPopupMenu\n{\n\tint cbSize;\n\tHMENU hMenu;\n\tUINT uFlags;\n\tint x;\n\tint y;\n\tLPTPMPARAMS lptpm;\n};\n\n#define CBRPOPUPMENU _AtlFrameWnd_CmdBarPopupMenu\n\n#endif // !defined(__ATLCTRLW_H__)\n\n\ntemplate <class TBase = ATL::CWindow, class TWinTraits = ATL::CFrameWinTraits>\nclass ATL_NO_VTABLE CFrameWindowImplBase : public ATL::CWindowImplBaseT< TBase, TWinTraits >\n{\npublic:\n\ttypedef CFrameWindowImplBase<TBase, TWinTraits >\t_thisClass;\n\tDECLARE_FRAME_WND_CLASS2(NULL, _thisClass, 0)\n\n\tstruct _ChevronMenuInfo\n\t{\n\t\tHMENU hMenu;\n\t\tLPNMREBARCHEVRON lpnm;\n\t\tbool bCmdBar;\n\t};\n\n// Data members\n\tHWND m_hWndToolBar;\n\tHWND m_hWndStatusBar;\n\tHWND m_hWndClient;\n\n\tHACCEL m_hAccel;\n\n// Constructor\n\tCFrameWindowImplBase() : \n\t\tm_hWndToolBar(NULL), \n\t\tm_hWndStatusBar(NULL), \n\t\tm_hWndClient(NULL), \n\t\tm_hAccel(NULL)\n\t{ }\n\n// Methods\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect, LPCTSTR szWindowName, DWORD dwStyle, DWORD dwExStyle, ATL::_U_MENUorID MenuOrID, ATOM atom, LPVOID lpCreateParam)\n\t{\n\t\tATLASSERT(this->m_hWnd == NULL);\n\n\t\t// Allocate the thunk structure here, where we can fail gracefully.\n\t\tBOOL bRet = this->m_thunk.Init(NULL, NULL);\n\t\tif(bRet == FALSE)\n\t\t{\n\t\t\t::SetLastError(ERROR_OUTOFMEMORY);\n\t\t\treturn NULL;\n\t\t}\n\n\t\tif(atom == 0)\n\t\t\treturn NULL;\n\n\t\tModuleHelper::AddCreateWndData(&this->m_thunk.cd, this);\n\n\t\tif((MenuOrID.m_hMenu == NULL) && (dwStyle & WS_CHILD))\n\t\t\tMenuOrID.m_hMenu = (HMENU)(UINT_PTR)this;\n\t\tif(rect.m_lpRect == NULL)\n\t\t\trect.m_lpRect = &TBase::rcDefault;\n\n\t\tHWND hWnd = ::CreateWindowEx(dwExStyle, MAKEINTATOM(atom), szWindowName,\n\t\t\tdwStyle, rect.m_lpRect->left, rect.m_lpRect->top, rect.m_lpRect->right - rect.m_lpRect->left,\n\t\t\trect.m_lpRect->bottom - rect.m_lpRect->top, hWndParent, MenuOrID.m_hMenu,\n\t\t\tModuleHelper::GetModuleInstance(), lpCreateParam);\n\n\t\tATLASSERT((hWnd == NULL) || (this->m_hWnd == hWnd));\n\n\t\treturn hWnd;\n\t}\n\n\tstatic HWND CreateSimpleToolBarCtrl(HWND hWndParent, UINT nResourceID, BOOL bInitialSeparator = FALSE, \n\t\t\tDWORD dwStyle = ATL_SIMPLE_TOOLBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\n\t{\n\t\tHINSTANCE hInst = ModuleHelper::GetResourceInstance();\n\t\tHRSRC hRsrc = ::FindResource(hInst, MAKEINTRESOURCE(nResourceID), RT_TOOLBAR);\n\t\tif (hRsrc == NULL)\n\t\t\treturn NULL;\n\n\t\tHGLOBAL hGlobal = ::LoadResource(hInst, hRsrc);\n\t\tif (hGlobal == NULL)\n\t\t\treturn NULL;\n\n\t\t_AtlToolBarData* pData = (_AtlToolBarData*)::LockResource(hGlobal);\n\t\tif (pData == NULL)\n\t\t\treturn NULL;\n\t\tATLASSERT(pData->wVersion == 1);\n\n\t\tWORD* pItems = pData->items();\n\t\tint nItems = pData->wItemCount + (bInitialSeparator ? 1 : 0);\n\t\tATL::CTempBuffer<TBBUTTON, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tTBBUTTON* pTBBtn = buff.Allocate(nItems);\n\t\tATLASSERT(pTBBtn != NULL);\n\t\tif(pTBBtn == NULL)\n\t\t\treturn NULL;\n\n\t\tconst int cxSeparator = 8;\n\n\t\t// set initial separator (half width)\n\t\tif(bInitialSeparator)\n\t\t{\n\t\t\tpTBBtn[0].iBitmap = cxSeparator / 2;\n\t\t\tpTBBtn[0].idCommand = 0;\n\t\t\tpTBBtn[0].fsState = 0;\n\t\t\tpTBBtn[0].fsStyle = BTNS_SEP;\n\t\t\tpTBBtn[0].dwData = 0;\n\t\t\tpTBBtn[0].iString = 0;\n\t\t}\n\n\t\tint nBmp = 0;\n\t\tfor(int i = 0, j = bInitialSeparator ? 1 : 0; i < pData->wItemCount; i++, j++)\n\t\t{\n\t\t\tif(pItems[i] != 0)\n\t\t\t{\n\t\t\t\tpTBBtn[j].iBitmap = nBmp++;\n\t\t\t\tpTBBtn[j].idCommand = pItems[i];\n\t\t\t\tpTBBtn[j].fsState = TBSTATE_ENABLED;\n\t\t\t\tpTBBtn[j].fsStyle = BTNS_BUTTON;\n\t\t\t\tpTBBtn[j].dwData = 0;\n\t\t\t\tpTBBtn[j].iString = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpTBBtn[j].iBitmap = cxSeparator;\n\t\t\t\tpTBBtn[j].idCommand = 0;\n\t\t\t\tpTBBtn[j].fsState = 0;\n\t\t\t\tpTBBtn[j].fsStyle = BTNS_SEP;\n\t\t\t\tpTBBtn[j].dwData = 0;\n\t\t\t\tpTBBtn[j].iString = 0;\n\t\t\t}\n\t\t}\n\n\t\tHWND hWnd = ::CreateWindowEx(0, TOOLBARCLASSNAME, NULL, dwStyle, 0, 0, 100, 100, hWndParent, (HMENU)LongToHandle(nID), ModuleHelper::GetModuleInstance(), NULL);\n\t\tif(hWnd == NULL)\n\t\t{\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn NULL;\n\t\t}\n\n\t\t::SendMessage(hWnd, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0L);\n\n\t\t// check if font is taller than our bitmaps\n\t\tCFontHandle font = (HFONT)::SendMessage(hWnd, WM_GETFONT, 0, 0L);\n\t\tif(font.IsNull())\n\t\t\tfont = (HFONT)::GetStockObject(SYSTEM_FONT);\n\t\tLOGFONT lf = {};\n\t\tfont.GetLogFont(lf);\n\t\tWORD cyFontHeight = (WORD)abs(lf.lfHeight);\n\n\t\tWORD bitsPerPixel = AtlGetBitmapResourceBitsPerPixel(nResourceID);\n\t\tif(bitsPerPixel > 4)\n\t\t{\n\t\t\tCOLORREF crMask = CLR_DEFAULT;\n\t\t\tif(bitsPerPixel == 32)\n\t\t\t{\n\t\t\t\t// 32-bit color bitmap with alpha channel (valid for Windows XP and later)\n\t\t\t\tcrMask = CLR_NONE;\n\t\t\t}\n\t\t\tHIMAGELIST hImageList = ImageList_LoadImage(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(nResourceID), pData->wWidth, 1, crMask, IMAGE_BITMAP, LR_CREATEDIBSECTION | LR_DEFAULTSIZE);\n\t\t\tATLASSERT(hImageList != NULL);\n\t\t\t::SendMessage(hWnd, TB_SETIMAGELIST, 0, (LPARAM)hImageList);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tTBADDBITMAP tbab = {};\n\t\t\ttbab.hInst = hInst;\n\t\t\ttbab.nID = nResourceID;\n\t\t\t::SendMessage(hWnd, TB_ADDBITMAP, nBmp, (LPARAM)&tbab);\n\t\t}\n\n\t\t::SendMessage(hWnd, TB_ADDBUTTONS, nItems, (LPARAM)pTBBtn);\n\t\t::SendMessage(hWnd, TB_SETBITMAPSIZE, 0, MAKELONG(pData->wWidth, __max(pData->wHeight, cyFontHeight)));\n\t\tconst int cxyButtonMargin = 7;\n\t\t::SendMessage(hWnd, TB_SETBUTTONSIZE, 0, MAKELONG(pData->wWidth + cxyButtonMargin, __max(pData->wHeight, cyFontHeight) + cxyButtonMargin));\n\n\t\treturn hWnd;\n\t}\n\n\tstatic HWND CreateSimpleReBarCtrl(HWND hWndParent, DWORD dwStyle = ATL_SIMPLE_REBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\n\t{\n\t\t// Ensure style combinations for proper rebar painting\n\t\tif(dwStyle & CCS_NODIVIDER && (dwStyle & WS_BORDER))\n\t\t\tdwStyle &= ~WS_BORDER;\n\t\telse if(!(dwStyle & WS_BORDER) && !(dwStyle & CCS_NODIVIDER))\n\t\t\tdwStyle |= CCS_NODIVIDER;\n\n\t\t// Create rebar window\n\t\tHWND hWndReBar = ::CreateWindowEx(0, REBARCLASSNAME, NULL, dwStyle, 0, 0, 100, 100, hWndParent, (HMENU)LongToHandle(nID), ModuleHelper::GetModuleInstance(), NULL);\n\t\tif(hWndReBar == NULL)\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"Failed to create rebar.\\n\"));\n\t\t\treturn NULL;\n\t\t}\n\n\t\t// Initialize and send the REBARINFO structure\n\t\tREBARINFO rbi = { sizeof(REBARINFO), 0 };\n\t\tif(::SendMessage(hWndReBar, RB_SETBARINFO, 0, (LPARAM)&rbi) == 0)\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"Failed to initialize rebar.\\n\"));\n\t\t\t::DestroyWindow(hWndReBar);\n\t\t\treturn NULL;\n\t\t}\n\n\t\treturn hWndReBar;\n\t}\n\n\tBOOL CreateSimpleReBar(DWORD dwStyle = ATL_SIMPLE_REBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\n\t{\n\t\tATLASSERT(!::IsWindow(m_hWndToolBar));\n\t\tm_hWndToolBar = CreateSimpleReBarCtrl(this->m_hWnd, dwStyle, nID);\n\t\treturn (m_hWndToolBar != NULL);\n\t}\n\n\tstatic BOOL AddSimpleReBarBandCtrl(HWND hWndReBar, HWND hWndBand, int nID = 0, LPCTSTR lpstrTitle = NULL, BOOL bNewRow = FALSE, int cxWidth = 0, BOOL bFullWidthAlways = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(hWndReBar));   // must be already created\n#ifdef _DEBUG\n\t\t// block - check if this is really a rebar\n\t\t{\n\t\t\tTCHAR lpszClassName[sizeof(REBARCLASSNAME)] = {};\n\t\t\t::GetClassName(hWndReBar, lpszClassName, sizeof(REBARCLASSNAME));\n\t\t\tATLASSERT(lstrcmp(lpszClassName, REBARCLASSNAME) == 0);\n\t\t}\n#endif // _DEBUG\n\t\tATLASSERT(::IsWindow(hWndBand));   // must be already created\n\n\t\t// Get number of buttons on the toolbar\n\t\tint nBtnCount = (int)::SendMessage(hWndBand, TB_BUTTONCOUNT, 0, 0L);\n\n\t\t// Set band info structure\n\t\tREBARBANDINFO rbBand = { RunTimeHelper::SizeOf_REBARBANDINFO() };\n\t\trbBand.fMask = RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_STYLE | RBBIM_ID | RBBIM_SIZE | RBBIM_IDEALSIZE;\n\t\tif(lpstrTitle != NULL)\n\t\t\trbBand.fMask |= RBBIM_TEXT;\n\t\trbBand.fStyle = RBBS_CHILDEDGE;\n\t\tif(nBtnCount > 0)   // add chevron style for toolbar with buttons\n\t\t\trbBand.fStyle |= RBBS_USECHEVRON;\n\t\tif(bNewRow)\n\t\t\trbBand.fStyle |= RBBS_BREAK;\n\n\t\trbBand.lpText = (LPTSTR)lpstrTitle;\n\t\trbBand.hwndChild = hWndBand;\n\t\tif(nID == 0)   // calc band ID\n\t\t\tnID = ATL_IDW_BAND_FIRST + (int)::SendMessage(hWndReBar, RB_GETBANDCOUNT, 0, 0L);\n\t\trbBand.wID = nID;\n\n\t\t// Calculate the size of the band\n\t\tBOOL bRet = FALSE;\n\t\tRECT rcTmp = {};\n\t\tif(nBtnCount > 0)\n\t\t{\n\t\t\tbRet = (BOOL)::SendMessage(hWndBand, TB_GETITEMRECT, nBtnCount - 1, (LPARAM)&rcTmp);\n\t\t\tATLASSERT(bRet);\n\t\t\trbBand.cx = (cxWidth != 0) ? cxWidth : rcTmp.right;\n\t\t\trbBand.cyMinChild = rcTmp.bottom - rcTmp.top;\n\t\t\tif(bFullWidthAlways)\n\t\t\t{\n\t\t\t\trbBand.cxMinChild = rbBand.cx;\n\t\t\t}\n\t\t\telse if(lpstrTitle == NULL)\n\t\t\t{\n\t\t\t\tbRet = (BOOL)::SendMessage(hWndBand, TB_GETITEMRECT, 0, (LPARAM)&rcTmp);\n\t\t\t\tATLASSERT(bRet);\n\t\t\t\trbBand.cxMinChild = rcTmp.right;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\trbBand.cxMinChild = 0;\n\t\t\t}\n\t\t}\n\t\telse\t// no buttons, either not a toolbar or really has no buttons\n\t\t{\n\t\t\tbRet = ::GetWindowRect(hWndBand, &rcTmp);\n\t\t\tATLASSERT(bRet);\n\t\t\trbBand.cx = (cxWidth != 0) ? cxWidth : (rcTmp.right - rcTmp.left);\n\t\t\trbBand.cxMinChild = bFullWidthAlways ? rbBand.cx : 0;\n\t\t\trbBand.cyMinChild = rcTmp.bottom - rcTmp.top;\n\t\t}\n\n\t\trbBand.cxIdeal = rbBand.cx;\n\n\t\t// Add the band\n\t\tLRESULT lRes = ::SendMessage(hWndReBar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);\n\t\tif(lRes == 0)\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"Failed to add a band to the rebar.\\n\"));\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tDWORD dwExStyle = (DWORD)::SendMessage(hWndBand, TB_GETEXTENDEDSTYLE, 0, 0L);\n\t\t::SendMessage(hWndBand, TB_SETEXTENDEDSTYLE, 0, dwExStyle | TBSTYLE_EX_HIDECLIPPEDBUTTONS);\n\n\t\treturn TRUE;\n\t}\n\n\tBOOL AddSimpleReBarBand(HWND hWndBand, LPCTSTR lpstrTitle = NULL, BOOL bNewRow = FALSE, int cxWidth = 0, BOOL bFullWidthAlways = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWndToolBar));   // must be an existing rebar\n\t\tATLASSERT(::IsWindow(hWndBand));        // must be created\n\t\treturn AddSimpleReBarBandCtrl(m_hWndToolBar, hWndBand, 0, lpstrTitle, bNewRow, cxWidth, bFullWidthAlways);\n\t}\n\n\tvoid SizeSimpleReBarBands()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWndToolBar));   // must be an existing rebar\n\n\t\tint nCount = (int)::SendMessage(m_hWndToolBar, RB_GETBANDCOUNT, 0, 0L);\n\n\t\tfor(int i = 0; i < nCount; i++)\n\t\t{\n\t\t\tREBARBANDINFO rbBand = { RunTimeHelper::SizeOf_REBARBANDINFO() };\n\t\t\trbBand.fMask = RBBIM_SIZE;\n\t\t\tBOOL bRet = (BOOL)::SendMessage(m_hWndToolBar, RB_GETBANDINFO, i, (LPARAM)&rbBand);\n\t\t\tATLASSERT(bRet);\n\t\t\tRECT rect = {};\n\t\t\t::SendMessage(m_hWndToolBar, RB_GETBANDBORDERS, i, (LPARAM)&rect);\n\t\t\trbBand.cx += rect.left + rect.right;\n\t\t\tbRet = (BOOL)::SendMessage(m_hWndToolBar, RB_SETBANDINFO, i, (LPARAM)&rbBand);\n\t\t\tATLASSERT(bRet);\n\t\t}\n\t}\n\n\tBOOL CreateSimpleStatusBar(LPCTSTR lpstrText, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP, UINT nID = ATL_IDW_STATUS_BAR)\n\t{\n\t\tATLASSERT(!::IsWindow(m_hWndStatusBar));\n\t\tm_hWndStatusBar = ::CreateStatusWindow(dwStyle, lpstrText, this->m_hWnd, nID);\n\t\treturn (m_hWndStatusBar != NULL);\n\t}\n\n\tBOOL CreateSimpleStatusBar(UINT nTextID = ATL_IDS_IDLEMESSAGE, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP, UINT nID = ATL_IDW_STATUS_BAR)\n\t{\n\t\tconst int cchMax = 128;   // max text length is 127 for status bars (+1 for null)\n\t\tTCHAR szText[cchMax] = {};\n\t\t::LoadString(ModuleHelper::GetResourceInstance(), nTextID, szText, cchMax);\n\t\treturn CreateSimpleStatusBar(szText, dwStyle, nID);\n\t}\n\n\tvoid UpdateLayout(BOOL bResizeBars = TRUE)\n\t{\n\t\tRECT rect = {};\n\t\tthis->GetClientRect(&rect);\n\n\t\t// position bars and offset their dimensions\n\t\tUpdateBarsPosition(rect, bResizeBars);\n\n\t\t// resize client window\n\t\tif(m_hWndClient != NULL)\n\t\t\t::SetWindowPos(m_hWndClient, NULL, rect.left, rect.top,\n\t\t\t\trect.right - rect.left, rect.bottom - rect.top,\n\t\t\t\tSWP_NOZORDER | SWP_NOACTIVATE);\n\t}\n\n\tvoid UpdateBarsPosition(RECT& rect, BOOL bResizeBars = TRUE)\n\t{\n\t\t// resize toolbar\n\t\tif((m_hWndToolBar != NULL) && ((DWORD)::GetWindowLong(m_hWndToolBar, GWL_STYLE) & WS_VISIBLE))\n\t\t{\n\t\t\tif(bResizeBars != FALSE)\n\t\t\t{\n\t\t\t\t::SendMessage(m_hWndToolBar, WM_SIZE, 0, 0);\n\t\t\t\t::InvalidateRect(m_hWndToolBar, NULL, TRUE);\n\t\t\t}\n\t\t\tRECT rectTB = {};\n\t\t\t::GetWindowRect(m_hWndToolBar, &rectTB);\n\t\t\trect.top += rectTB.bottom - rectTB.top;\n\t\t}\n\n\t\t// resize status bar\n\t\tif((m_hWndStatusBar != NULL) && ((DWORD)::GetWindowLong(m_hWndStatusBar, GWL_STYLE) & WS_VISIBLE))\n\t\t{\n\t\t\tif(bResizeBars != FALSE)\n\t\t\t\t::SendMessage(m_hWndStatusBar, WM_SIZE, 0, 0);\n\t\t\tRECT rectSB = {};\n\t\t\t::GetWindowRect(m_hWndStatusBar, &rectSB);\n\t\t\trect.bottom -= rectSB.bottom - rectSB.top;\n\t\t}\n\t}\n\n\tBOOL PreTranslateMessage(MSG* pMsg)\n\t{\n\t\tif((m_hAccel != NULL) && ::TranslateAccelerator(this->m_hWnd, m_hAccel, pMsg))\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}\n\n\tBEGIN_MSG_MAP(CFrameWindowImplBase)\n\t\tMESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\n\t\tMESSAGE_HANDLER(WM_MENUSELECT, OnMenuSelect)\n\t\tMESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)\n\t\tMESSAGE_HANDLER(WM_DESTROY, OnDestroy)\n\t\tNOTIFY_CODE_HANDLER(TTN_GETDISPINFOA, OnToolTipTextA)\n\t\tNOTIFY_CODE_HANDLER(TTN_GETDISPINFOW, OnToolTipTextW)\n\tEND_MSG_MAP()\n\n\tLRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(m_hWndClient != NULL)   // view will paint itself instead\n\t\t\treturn 1;\n\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnMenuSelect(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tbHandled = FALSE;\n\n\t\tif(m_hWndStatusBar == NULL)\n\t\t\treturn 1;\n\n\t\tWORD wFlags = HIWORD(wParam);\n\t\tif((wFlags == 0xFFFF) && (lParam == NULL))   // menu closing\n\t\t{\n\t\t\t::SendMessage(m_hWndStatusBar, SB_SIMPLE, FALSE, 0L);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconst int cchBuff = 256;\n\t\t\tTCHAR szBuff[cchBuff] = {};\n\t\t\tif(!(wFlags & MF_POPUP))\n\t\t\t{\n\t\t\t\tWORD wID = LOWORD(wParam);\n\t\t\t\t// check for special cases\n\t\t\t\tif((wID >= 0xF000) && (wID < 0xF1F0))   // system menu IDs\n\t\t\t\t\twID = (WORD)(((wID - 0xF000) >> 4) + ATL_IDS_SCFIRST);\n\t\t\t\telse if((wID >= ID_FILE_MRU_FIRST) && (wID <= ID_FILE_MRU_LAST))   // MRU items\n\t\t\t\t\twID = ATL_IDS_MRU_FILE;\n\t\t\t\telse if((wID >= ATL_IDM_FIRST_MDICHILD) && (wID <= ATL_IDM_LAST_MDICHILD))   // MDI child windows\n\t\t\t\t\twID = ATL_IDS_MDICHILD;\n\n\t\t\t\tint nRet = ::LoadString(ModuleHelper::GetResourceInstance(), wID, szBuff, cchBuff);\n\t\t\t\tfor(int i = 0; i < nRet; i++)\n\t\t\t\t{\n\t\t\t\t\tif(szBuff[i] == _T('\\n'))\n\t\t\t\t\t{\n\t\t\t\t\t\tszBuff[i] = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t::SendMessage(m_hWndStatusBar, SB_SIMPLE, TRUE, 0L);\n\t\t\t::SendMessage(m_hWndStatusBar, SB_SETTEXT, (255 | SBT_NOBORDERS), (LPARAM)szBuff);\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tLRESULT OnSetFocus(UINT, WPARAM, LPARAM, BOOL& bHandled)\n\t{\n\t\tif(m_hWndClient != NULL)\n\t\t\t::SetFocus(m_hWndClient);\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnDestroy(UINT, WPARAM, LPARAM, BOOL& bHandled)\n\t{\n\t\tif((this->GetStyle() & (WS_CHILD | WS_POPUP)) == 0)\n\t\t\t::PostQuitMessage(1);\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnToolTipTextA(int idCtrl, LPNMHDR pnmh, BOOL& /*bHandled*/)\n\t{\n\t\tLPNMTTDISPINFOA pDispInfo = (LPNMTTDISPINFOA)pnmh;\n\t\tif((idCtrl != 0) && !(pDispInfo->uFlags & TTF_IDISHWND))\n\t\t{\n\t\t\tconst int cchBuff = 256;\n\t\t\tchar szBuff[cchBuff] = {};\n\t\t\tint nRet = ::LoadStringA(ModuleHelper::GetResourceInstance(), idCtrl, szBuff, cchBuff);\n\t\t\tfor(int i = 0; i < nRet; i++)\n\t\t\t{\n\t\t\t\tif(szBuff[i] == '\\n')\n\t\t\t\t{\n\t\t\t\t\tATL::Checked::strncpy_s(pDispInfo->szText, _countof(pDispInfo->szText), &szBuff[i + 1], _TRUNCATE);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(nRet > 0)   // string was loaded, save it\n\t\t\t\tpDispInfo->uFlags |= TTF_DI_SETITEM;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnToolTipTextW(int idCtrl, LPNMHDR pnmh, BOOL& /*bHandled*/)\n\t{\n\t\tLPNMTTDISPINFOW pDispInfo = (LPNMTTDISPINFOW)pnmh;\n\t\tif((idCtrl != 0) && !(pDispInfo->uFlags & TTF_IDISHWND))\n\t\t{\n\t\t\tconst int cchBuff = 256;\n\t\t\twchar_t szBuff[cchBuff] = {};\n\t\t\tint nRet = ::LoadStringW(ModuleHelper::GetResourceInstance(), idCtrl, szBuff, cchBuff);\n\t\t\tfor(int i = 0; i < nRet; i++)\n\t\t\t{\n\t\t\t\tif(szBuff[i] == L'\\n')\n\t\t\t\t{\n\t\t\t\t\tATL::Checked::wcsncpy_s(pDispInfo->szText, _countof(pDispInfo->szText), &szBuff[i + 1], _TRUNCATE);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(nRet > 0)   // string was loaded, save it\n\t\t\t\tpDispInfo->uFlags |= TTF_DI_SETITEM;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n// Implementation - chevron menu support\n\tbool PrepareChevronMenu(_ChevronMenuInfo& cmi)\n\t{\n\t\t// get rebar and toolbar\n\t\tREBARBANDINFO rbbi = { RunTimeHelper::SizeOf_REBARBANDINFO() };\n\t\trbbi.fMask = RBBIM_CHILD;\n\t\tBOOL bRet = (BOOL)::SendMessage(cmi.lpnm->hdr.hwndFrom, RB_GETBANDINFO, cmi.lpnm->uBand, (LPARAM)&rbbi);\n\t\tATLASSERT(bRet);\n\n\t\t// assume the band is a toolbar\n\t\tATL::CWindow wnd = rbbi.hwndChild;\n\t\tint nCount = (int)wnd.SendMessage(TB_BUTTONCOUNT);\n\t\tif(nCount <= 0)   // probably not a toolbar\n\t\t\treturn false;\n\n\t\t// check if it's a command bar\n\t\tCMenuHandle menuCmdBar = (HMENU)wnd.SendMessage(CBRM_GETMENU);\n\t\tcmi.bCmdBar = (menuCmdBar.m_hMenu != NULL);\n\n\t\t// build a menu from hidden items\n\t\tCMenuHandle menu;\n\t\tbRet = menu.CreatePopupMenu();\n\t\tATLASSERT(bRet);\n\t\tRECT rcClient = {};\n\t\tbRet = wnd.GetClientRect(&rcClient);\n\t\tATLASSERT(bRet);\n\t\tfor(int i = 0; i < nCount; i++)\n\t\t{\n\t\t\tTBBUTTON tbb = {};\n\t\t\tbRet = (BOOL)wnd.SendMessage(TB_GETBUTTON, i, (LPARAM)&tbb);\n\t\t\tATLASSERT(bRet);\n\t\t\t// skip hidden buttons\n\t\t\tif((tbb.fsState & TBSTATE_HIDDEN) != 0)\n\t\t\t\tcontinue;\n\t\t\tRECT rcButton = {};\n\t\t\tbRet = (BOOL)wnd.SendMessage(TB_GETITEMRECT, i, (LPARAM)&rcButton);\n\t\t\tATLASSERT(bRet);\n\t\t\tbool bEnabled = ((tbb.fsState & TBSTATE_ENABLED) != 0);\n\t\t\tif((rcButton.right > rcClient.right) || (rcButton.bottom > rcClient.bottom))\n\t\t\t{\n\t\t\t\tif(tbb.fsStyle & BTNS_SEP)\n\t\t\t\t{\n\t\t\t\t\tif(menu.GetMenuItemCount() > 0)\n\t\t\t\t\t\tmenu.AppendMenu(MF_SEPARATOR);\n\t\t\t\t}\n\t\t\t\telse if(cmi.bCmdBar)\n\t\t\t\t{\n\t\t\t\t\tconst int cchBuff = 200;\n\t\t\t\t\tTCHAR szBuff[cchBuff] = {};\n\t\t\t\t\tCMenuItemInfo mii;\n\t\t\t\t\tmii.fMask = MIIM_TYPE | MIIM_SUBMENU;\n\t\t\t\t\tmii.dwTypeData = szBuff;\n\t\t\t\t\tmii.cch = cchBuff;\n\t\t\t\t\tbRet = menuCmdBar.GetMenuItemInfo(i, TRUE, &mii);\n\t\t\t\t\tATLASSERT(bRet);\n\t\t\t\t\t// Note: CmdBar currently supports only drop-down items\n\t\t\t\t\tATLASSERT(::IsMenu(mii.hSubMenu));\n\t\t\t\t\tbRet = menu.AppendMenu(MF_STRING | MF_POPUP | (bEnabled ? MF_ENABLED : MF_GRAYED), (UINT_PTR)mii.hSubMenu, mii.dwTypeData);\n\t\t\t\t\tATLASSERT(bRet);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// get button's text\n\t\t\t\t\tconst int cchBuff = 200;\n\t\t\t\t\tTCHAR szBuff[cchBuff] = {};\n\t\t\t\t\tLPCTSTR lpstrText = szBuff;\n\t\t\t\t\tTBBUTTONINFO tbbi = {};\n\t\t\t\t\ttbbi.cbSize = sizeof(TBBUTTONINFO);\n\t\t\t\t\ttbbi.dwMask = TBIF_TEXT;\n\t\t\t\t\ttbbi.pszText = szBuff;\n\t\t\t\t\ttbbi.cchText = cchBuff;\n\t\t\t\t\tif((wnd.SendMessage(TB_GETBUTTONINFO, tbb.idCommand, (LPARAM)&tbbi) == -1) || (szBuff[0] == 0))\n\t\t\t\t\t{\n\t\t\t\t\t\t// no text for this button, try a resource string\n\t\t\t\t\t\tlpstrText = _T(\"\");\n\t\t\t\t\t\tint nRet = ::LoadString(ModuleHelper::GetResourceInstance(), tbb.idCommand, szBuff, cchBuff);\n\t\t\t\t\t\tfor(int n = 0; n < nRet; n++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(szBuff[n] == _T('\\n'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlpstrText = &szBuff[n + 1];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbRet = menu.AppendMenu(MF_STRING | (bEnabled ? MF_ENABLED : MF_GRAYED), tbb.idCommand, lpstrText);\n\t\t\t\t\tATLASSERT(bRet);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(menu.GetMenuItemCount() == 0)   // no hidden buttons after all\n\t\t{\n\t\t\tmenu.DestroyMenu();\n\t\t\t::MessageBeep((UINT)-1);\n\t\t\treturn false;\n\t\t}\n\n\t\tcmi.hMenu = menu;\n\t\treturn true;\n\t}\n\n\tvoid DisplayChevronMenu(_ChevronMenuInfo& cmi)\n\t{\n\t\t// convert chevron rect to screen coordinates\n\t\tATL::CWindow wndFrom = cmi.lpnm->hdr.hwndFrom;\n\t\tPOINT pt = { cmi.lpnm->rc.left, cmi.lpnm->rc.bottom };\n\t\twndFrom.MapWindowPoints(NULL, &pt, 1);\n\t\tRECT rc = cmi.lpnm->rc;\n\t\twndFrom.MapWindowPoints(NULL, &rc);\n\t\t// set up flags and rect\n\t\tUINT uMenuFlags = TPM_LEFTBUTTON | TPM_VERTICAL | TPM_LEFTALIGN | TPM_TOPALIGN | TPM_VERPOSANIMATION;\n\t\tTPMPARAMS TPMParams = {};\n\t\tTPMParams.cbSize = sizeof(TPMPARAMS);\n\t\tTPMParams.rcExclude = rc;\n\t\t// check if this window has a command bar\n\t\tHWND hWndCmdBar = (HWND)::SendMessage(this->m_hWnd, CBRM_GETCMDBAR, 0, 0L);\n\t\tif(::IsWindow(hWndCmdBar))\n\t\t{\n\t\t\tCBRPOPUPMENU CBRPopupMenu = { sizeof(CBRPOPUPMENU), cmi.hMenu, uMenuFlags, pt.x, pt.y, &TPMParams };\n\t\t\t::SendMessage(hWndCmdBar, CBRM_TRACKPOPUPMENU, 0, (LPARAM)&CBRPopupMenu);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCMenuHandle menu = cmi.hMenu;\n\t\t\tmenu.TrackPopupMenuEx(uMenuFlags, pt.x, pt.y, this->m_hWnd, &TPMParams);\n\t\t}\n\t}\n\n\tvoid CleanupChevronMenu(_ChevronMenuInfo& cmi)\n\t{\n\t\tCMenuHandle menu = cmi.hMenu;\n\t\t// if menu is from a command bar, detach submenus so they are not destroyed\n\t\tif(cmi.bCmdBar)\n\t\t{\n\t\t\tfor(int i = menu.GetMenuItemCount() - 1; i >=0; i--)\n\t\t\t\tmenu.RemoveMenu(i, MF_BYPOSITION);\n\t\t}\n\t\t// destroy menu\n\t\tmenu.DestroyMenu();\n\t\t// convert chevron rect to screen coordinates\n\t\tATL::CWindow wndFrom = cmi.lpnm->hdr.hwndFrom;\n\t\tRECT rc = cmi.lpnm->rc;\n\t\twndFrom.MapWindowPoints(NULL, &rc);\n\t\t// eat next message if click is on the same button\n\t\tMSG msg = {};\n\t\tif(::PeekMessage(&msg, this->m_hWnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_NOREMOVE) && ::PtInRect(&rc, msg.pt))\n\t\t\t::PeekMessage(&msg, this->m_hWnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_REMOVE);\n\t}\n};\n\n\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CFrameWinTraits>\nclass ATL_NO_VTABLE CFrameWindowImpl : public CFrameWindowImplBase< TBase, TWinTraits >\n{\npublic:\n\tHWND Create(HWND hWndParent = NULL, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tHMENU hMenu = NULL, LPVOID lpCreateParam = NULL)\n\t{\n\t\tATOM atom = T::GetWndClassInfo().Register(&this->m_pfnSuperWindowProc);\n\n\t\tdwStyle = T::GetWndStyle(dwStyle);\n\t\tdwExStyle = T::GetWndExStyle(dwExStyle);\n\n\t\tif(rect.m_lpRect == NULL)\n\t\t\trect.m_lpRect = &TBase::rcDefault;\n\n\t\treturn CFrameWindowImplBase< TBase, TWinTraits >::Create(hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, hMenu, atom, lpCreateParam);\n\t}\n\n\tHWND CreateEx(HWND hWndParent = NULL, ATL::_U_RECT rect = NULL, DWORD dwStyle = 0, DWORD dwExStyle = 0, LPVOID lpCreateParam = NULL)\n\t{\n\t\tconst int cchName = 256;\n\t\tTCHAR szWindowName[cchName] = {};\n\t\t::LoadString(ModuleHelper::GetResourceInstance(), T::GetWndClassInfo().m_uCommonResourceID, szWindowName, cchName);\n\t\tHMENU hMenu = ::LoadMenu(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(T::GetWndClassInfo().m_uCommonResourceID));\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tHWND hWnd = pT->Create(hWndParent, rect, szWindowName, dwStyle, dwExStyle, hMenu, lpCreateParam);\n\n\t\tif(hWnd != NULL)\n\t\t\tthis->m_hAccel = ::LoadAccelerators(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(T::GetWndClassInfo().m_uCommonResourceID));\n\n\t\treturn hWnd;\n\t}\n\n\tBOOL CreateSimpleToolBar(UINT nResourceID = 0, DWORD dwStyle = ATL_SIMPLE_TOOLBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\n\t{\n\t\tif(nResourceID == 0)\n\t\t\tnResourceID = T::GetWndClassInfo().m_uCommonResourceID;\n\t\tATLASSERT(!::IsWindow(this->m_hWndToolBar));\n\t\tthis->m_hWndToolBar = T::CreateSimpleToolBarCtrl(this->m_hWnd, nResourceID, TRUE, dwStyle, nID);\n\t\treturn (this->m_hWndToolBar != NULL);\n\t}\n\n// message map and handlers\n\ttypedef CFrameWindowImplBase< TBase, TWinTraits >   _baseClass;\n\n\tBEGIN_MSG_MAP(CFrameWindowImpl)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n#ifndef _ATL_NO_REBAR_SUPPORT\n\t\tNOTIFY_CODE_HANDLER(RBN_AUTOSIZE, OnReBarAutoSize)\n\t\tNOTIFY_CODE_HANDLER(RBN_CHEVRONPUSHED, OnChevronPushed)\n#endif // !_ATL_NO_REBAR_SUPPORT\n\t\tCHAIN_MSG_MAP(_baseClass)\n\tEND_MSG_MAP()\n\n\tLRESULT OnSize(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(wParam != SIZE_MINIMIZED)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->UpdateLayout();\n\t\t}\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n#ifndef _ATL_NO_REBAR_SUPPORT\n\tLRESULT OnReBarAutoSize(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->UpdateLayout(FALSE);\n\t\treturn 0;\n\t}\n\n\tLRESULT OnChevronPushed(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\ttypename CFrameWindowImplBase< TBase, TWinTraits >::_ChevronMenuInfo cmi = { NULL, (LPNMREBARCHEVRON)pnmh, false };\n\t\tif(!pT->PrepareChevronMenu(cmi))\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\t\t// display a popup menu with hidden items\n\t\tpT->DisplayChevronMenu(cmi);\n\t\t// cleanup\n\t\tpT->CleanupChevronMenu(cmi);\n\t\treturn 0;\n\t}\n#endif // !_ATL_NO_REBAR_SUPPORT\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// AtlCreateSimpleToolBar - helper for creating simple toolbars\n\ninline HWND AtlCreateSimpleToolBar(HWND hWndParent, UINT nResourceID, BOOL bInitialSeparator = FALSE, \n\t\tDWORD dwStyle = ATL_SIMPLE_TOOLBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\n{\n\treturn CFrameWindowImplBase<>::CreateSimpleToolBarCtrl(hWndParent, nResourceID, bInitialSeparator, dwStyle, nID);\n}\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CMDIWindow\n\n#ifndef _WTL_MDIWINDOWMENU_TEXT\n  #define _WTL_MDIWINDOWMENU_TEXT\t_T(\"&Window\")\n#endif\n\nclass CMDIWindow : public ATL::CWindow\n{\npublic:\n// Data members\n\tHWND m_hWndMDIClient;\n\tHMENU m_hMenu;\n\n// Constructors\n\tCMDIWindow(HWND hWnd = NULL) : ATL::CWindow(hWnd), m_hWndMDIClient(NULL), m_hMenu(NULL)\n\t{ }\n\n\tCMDIWindow& operator =(HWND hWnd)\n\t{\n\t\tm_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n// Operations\n\tHWND MDIGetActive(BOOL* lpbMaximized = NULL)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWndMDIClient));\n\t\treturn (HWND)::SendMessage(m_hWndMDIClient, WM_MDIGETACTIVE, 0, (LPARAM)lpbMaximized);\n\t}\n\n\tvoid MDIActivate(HWND hWndChildToActivate)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWndMDIClient));\n\t\tATLASSERT(::IsWindow(hWndChildToActivate));\n\t\t::SendMessage(m_hWndMDIClient, WM_MDIACTIVATE, (WPARAM)hWndChildToActivate, 0);\n\t}\n\n\tvoid MDINext(HWND hWndChild, BOOL bPrevious = FALSE)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWndMDIClient));\n\t\tATLASSERT((hWndChild == NULL) || ::IsWindow(hWndChild));\n\t\t::SendMessage(m_hWndMDIClient, WM_MDINEXT, (WPARAM)hWndChild, (LPARAM)bPrevious);\n\t}\n\n\tvoid MDIMaximize(HWND hWndChildToMaximize)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWndMDIClient));\n\t\tATLASSERT(::IsWindow(hWndChildToMaximize));\n\t\t::SendMessage(m_hWndMDIClient, WM_MDIMAXIMIZE, (WPARAM)hWndChildToMaximize, 0);\n\t}\n\n\tvoid MDIRestore(HWND hWndChildToRestore)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWndMDIClient));\n\t\tATLASSERT(::IsWindow(hWndChildToRestore));\n\t\t::SendMessage(m_hWndMDIClient, WM_MDIRESTORE, (WPARAM)hWndChildToRestore, 0);\n\t}\n\n\tvoid MDIDestroy(HWND hWndChildToDestroy)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWndMDIClient));\n\t\tATLASSERT(::IsWindow(hWndChildToDestroy));\n\t\t::SendMessage(m_hWndMDIClient, WM_MDIDESTROY, (WPARAM)hWndChildToDestroy, 0);\n\t}\n\n\tBOOL MDICascade(UINT uFlags = 0)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWndMDIClient));\n\t\treturn (BOOL)::SendMessage(m_hWndMDIClient, WM_MDICASCADE, (WPARAM)uFlags, 0);\n\t}\n\n\tBOOL MDITile(UINT uFlags = MDITILE_HORIZONTAL)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWndMDIClient));\n\t\treturn (BOOL)::SendMessage(m_hWndMDIClient, WM_MDITILE, (WPARAM)uFlags, 0);\n\t}\n\n\tvoid MDIIconArrange()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWndMDIClient));\n\t\t::SendMessage(m_hWndMDIClient, WM_MDIICONARRANGE, 0, 0);\n\t}\n\n\tHMENU MDISetMenu(HMENU hMenuFrame, HMENU hMenuWindow)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWndMDIClient));\n\t\treturn (HMENU)::SendMessage(m_hWndMDIClient, WM_MDISETMENU, (WPARAM)hMenuFrame, (LPARAM)hMenuWindow);\n\t}\n\n\tHMENU MDIRefreshMenu()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWndMDIClient));\n\t\treturn (HMENU)::SendMessage(m_hWndMDIClient, WM_MDIREFRESHMENU, 0, 0);\n\t}\n\n// Additional operations\n\tstatic HMENU GetStandardWindowMenu(HMENU hMenu)\n\t{\n\t\tint nCount = ::GetMenuItemCount(hMenu);\n\t\tif(nCount == -1)\n\t\t\treturn NULL;\n\t\tint nLen = ::GetMenuString(hMenu, nCount - 2, NULL, 0, MF_BYPOSITION);\n\t\tif(nLen == 0)\n\t\t\treturn NULL;\n\t\tATL::CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tLPTSTR lpszText = buff.Allocate(nLen + 1);\n\t\tif(lpszText == NULL)\n\t\t\treturn NULL;\n\t\tif(::GetMenuString(hMenu, nCount - 2, lpszText, nLen + 1, MF_BYPOSITION) != nLen)\n\t\t\treturn NULL;\n\t\tif(lstrcmp(lpszText, _WTL_MDIWINDOWMENU_TEXT) != 0)\n\t\t\treturn NULL;\n\t\treturn ::GetSubMenu(hMenu, nCount - 2);\n\t}\n\n\tvoid SetMDIFrameMenu()\n\t{\n\t\tHMENU hWindowMenu = GetStandardWindowMenu(m_hMenu);\n\t\tMDISetMenu(m_hMenu, hWindowMenu);\n\t\tMDIRefreshMenu();\n\t\t::DrawMenuBar(GetMDIFrame());\n\t}\n\n\tHWND GetMDIFrame() const\n\t{\n\t\treturn ::GetParent(m_hWndMDIClient);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CMDIFrameWindowImpl\n\n// MDI child command chaining macro (only for MDI frame windows)\n#define CHAIN_MDI_CHILD_COMMANDS() \\\n\tif(uMsg == WM_COMMAND) \\\n\t{ \\\n\t\tHWND hWndChild = this->MDIGetActive(); \\\n\t\tif(hWndChild != NULL) \\\n\t\t\t::SendMessage(hWndChild, uMsg, wParam, lParam); \\\n\t}\n\ntemplate <class T, class TBase = CMDIWindow, class TWinTraits = ATL::CFrameWinTraits>\nclass ATL_NO_VTABLE CMDIFrameWindowImpl : public CFrameWindowImplBase<TBase, TWinTraits >\n{\npublic:\n\tHWND Create(HWND hWndParent = NULL, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tHMENU hMenu = NULL, LPVOID lpCreateParam = NULL)\n\t{\n\t\tthis->m_hMenu = hMenu;\n\t\tATOM atom = T::GetWndClassInfo().Register(&this->m_pfnSuperWindowProc);\n\n\t\tdwStyle = T::GetWndStyle(dwStyle);\n\t\tdwExStyle = T::GetWndExStyle(dwExStyle);\n\n\t\tif(rect.m_lpRect == NULL)\n\t\t\trect.m_lpRect = &TBase::rcDefault;\n\n\t\treturn CFrameWindowImplBase<TBase, TWinTraits >::Create(hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, hMenu, atom, lpCreateParam);\n\t}\n\n\tHWND CreateEx(HWND hWndParent = NULL, ATL::_U_RECT rect = NULL, DWORD dwStyle = 0, DWORD dwExStyle = 0, LPVOID lpCreateParam = NULL)\n\t{\n\t\tconst int cchName = 256;\n\t\tTCHAR szWindowName[cchName] = {};\n\t\t::LoadString(ModuleHelper::GetResourceInstance(), T::GetWndClassInfo().m_uCommonResourceID, szWindowName, cchName);\n\t\tHMENU hMenu = ::LoadMenu(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(T::GetWndClassInfo().m_uCommonResourceID));\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tHWND hWnd = pT->Create(hWndParent, rect, szWindowName, dwStyle, dwExStyle, hMenu, lpCreateParam);\n\n\t\tif(hWnd != NULL)\n\t\t\tthis->m_hAccel = ::LoadAccelerators(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(T::GetWndClassInfo().m_uCommonResourceID));\n\n\t\treturn hWnd;\n\t}\n\n\tBOOL CreateSimpleToolBar(UINT nResourceID = 0, DWORD dwStyle = ATL_SIMPLE_TOOLBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\n\t{\n\t\tATLASSERT(!::IsWindow(this->m_hWndToolBar));\n\t\tif(nResourceID == 0)\n\t\t\tnResourceID = T::GetWndClassInfo().m_uCommonResourceID;\n\t\tthis->m_hWndToolBar = T::CreateSimpleToolBarCtrl(this->m_hWnd, nResourceID, TRUE, dwStyle, nID);\n\t\treturn (this->m_hWndToolBar != NULL);\n\t}\n\n\tvirtual WNDPROC GetWindowProc()\n\t{\n\t\treturn MDIFrameWindowProc;\n\t}\n\n\tstatic LRESULT CALLBACK MDIFrameWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\n\t{\n\t\tCMDIFrameWindowImpl< T, TBase, TWinTraits >* pThis = (CMDIFrameWindowImpl< T, TBase, TWinTraits >*)hWnd;\n\t\t// set a ptr to this message and save the old value\n\t\tATL::_ATL_MSG msg(pThis->m_hWnd, uMsg, wParam, lParam);\n\t\tconst ATL::_ATL_MSG* pOldMsg = pThis->m_pCurrentMsg;\n\t\tpThis->m_pCurrentMsg = &msg;\n\t\t// pass to the message map to process\n\t\tLRESULT lRes = 0;\n\t\tBOOL bRet = pThis->ProcessWindowMessage(pThis->m_hWnd, uMsg, wParam, lParam, lRes, 0);\n\t\t// restore saved value for the current message\n\t\tATLASSERT(pThis->m_pCurrentMsg == &msg);\n\t\tpThis->m_pCurrentMsg = pOldMsg;\n\t\t// do the default processing if message was not handled\n\t\tif(!bRet)\n\t\t{\n\t\t\tif(uMsg != WM_NCDESTROY)\n\t\t\t{\n\t\t\t\tlRes = pThis->DefWindowProc(uMsg, wParam, lParam);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// unsubclass, if needed\n\t\t\t\tLONG_PTR pfnWndProc = ::GetWindowLongPtr(pThis->m_hWnd, GWLP_WNDPROC);\n\t\t\t\tlRes = pThis->DefWindowProc(uMsg, wParam, lParam);\n\t\t\t\tif((pThis->m_pfnSuperWindowProc != ::DefWindowProc) && (::GetWindowLongPtr(pThis->m_hWnd, GWLP_WNDPROC) == pfnWndProc))\n\t\t\t\t\t::SetWindowLongPtr(pThis->m_hWnd, GWLP_WNDPROC, (LONG_PTR)pThis->m_pfnSuperWindowProc);\n\t\t\t\t// mark window as destryed\n\t\t\t\tpThis->m_dwState |= ATL::CWindowImplRoot< TBase >::WINSTATE_DESTROYED;\n\t\t\t}\n\t\t}\n\t\tif((pThis->m_dwState & ATL::CWindowImplRoot< TBase >::WINSTATE_DESTROYED) && (pThis->m_pCurrentMsg == NULL))\n\t\t{\n\t\t\t// clear out window handle\n\t\t\tHWND hWndThis = pThis->m_hWnd;\n\t\t\tpThis->m_hWnd = NULL;\n\t\t\tpThis->m_dwState &= ~ATL::CWindowImplRoot< TBase >::WINSTATE_DESTROYED;\n\t\t\t// clean up after window is destroyed\n\t\t\tpThis->OnFinalMessage(hWndThis);\n\t\t}\n\t\treturn lRes;\n\t}\n\n\t// Overriden to call DefWindowProc which uses DefFrameProc\n\tLRESULT DefWindowProc()\n\t{\n\t\tconst ATL::_ATL_MSG* pMsg = this->m_pCurrentMsg;\n\t\tLRESULT lRes = 0;\n\t\tif (pMsg != NULL)\n\t\t\tlRes = DefWindowProc(pMsg->message, pMsg->wParam, pMsg->lParam);\n\t\treturn lRes;\n\t}\n\n\tLRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)\n\t{\n\t\treturn ::DefFrameProc(this->m_hWnd, this->m_hWndMDIClient, uMsg, wParam, lParam);\n\t}\n\n\tBOOL PreTranslateMessage(MSG* pMsg)\n\t{\n\t\tif(CFrameWindowImplBase<TBase, TWinTraits>::PreTranslateMessage(pMsg))\n\t\t\treturn TRUE;\n\t\treturn ::TranslateMDISysAccel(this->m_hWndMDIClient, pMsg);\n\t}\n\n\tHWND CreateMDIClient(HMENU hWindowMenu = NULL, UINT nID = ATL_IDW_CLIENT, UINT nFirstChildID = ATL_IDM_FIRST_MDICHILD)\n\t{\n\t\tDWORD dwStyle = WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | MDIS_ALLCHILDSTYLES;\n\t\tDWORD dwExStyle = WS_EX_CLIENTEDGE;\n\n\t\tCLIENTCREATESTRUCT ccs = {};\n\t\tccs.hWindowMenu = hWindowMenu;\n\t\tccs.idFirstChild = nFirstChildID;\n\n\t\tif((this->GetStyle() & (WS_HSCROLL | WS_VSCROLL)) != 0)\n\t\t{\n\t\t\t// parent MDI frame's scroll styles move to the MDICLIENT\n\t\t\tdwStyle |= (this->GetStyle() & (WS_HSCROLL | WS_VSCROLL));\n\n\t\t\t// fast way to turn off the scrollbar bits (without a resize)\n\t\t\tthis->ModifyStyle(WS_HSCROLL | WS_VSCROLL, 0, SWP_NOREDRAW | SWP_FRAMECHANGED);\n\t\t}\n\n\t\t// Create MDICLIENT window\n\t\tthis->m_hWndClient = ::CreateWindowEx(dwExStyle, _T(\"MDIClient\"), NULL,\n\t\t\tdwStyle, 0, 0, 1, 1, this->m_hWnd, (HMENU)LongToHandle(nID),\n\t\t\tModuleHelper::GetModuleInstance(), (LPVOID)&ccs);\n\t\tif (this->m_hWndClient == NULL)\n\t\t{\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"MDI Frame failed to create MDICLIENT.\\n\"));\n\t\t\treturn NULL;\n\t\t}\n\n\t\t// Move it to the top of z-order\n\t\t::BringWindowToTop(this->m_hWndClient);\n\n\t\t// set as MDI client window\n\t\tthis->m_hWndMDIClient = this->m_hWndClient;\n\n\t\t// update to proper size\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->UpdateLayout();\n\n\t\treturn this->m_hWndClient;\n\t}\n\n\ttypedef CFrameWindowImplBase<TBase, TWinTraits >   _baseClass;\n\n\tBEGIN_MSG_MAP(CMDIFrameWindowImpl)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\t\tMESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)\n\t\tMESSAGE_HANDLER(WM_MDISETMENU, OnMDISetMenu)\n#ifndef _ATL_NO_REBAR_SUPPORT\n\t\tNOTIFY_CODE_HANDLER(RBN_AUTOSIZE, OnReBarAutoSize)\n\t\tNOTIFY_CODE_HANDLER(RBN_CHEVRONPUSHED, OnChevronPushed)\n#endif // !_ATL_NO_REBAR_SUPPORT\n\t\tCHAIN_MSG_MAP(_baseClass)\n\tEND_MSG_MAP()\n\n\tLRESULT OnSize(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tif(wParam != SIZE_MINIMIZED)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->UpdateLayout();\n\t\t}\n\t\t// message must be handled, otherwise DefFrameProc would resize the client again\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\t// don't allow CFrameWindowImplBase to handle this one\n\t\treturn DefWindowProc(uMsg, wParam, lParam);\n\t}\n\n\tLRESULT OnMDISetMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tthis->SetMDIFrameMenu();\n\t\treturn 0;\n\t}\n\n#ifndef _ATL_NO_REBAR_SUPPORT\n\tLRESULT OnReBarAutoSize(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->UpdateLayout(FALSE);\n\t\treturn 0;\n\t}\n\n\tLRESULT OnChevronPushed(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\ttypename CFrameWindowImplBase<TBase, TWinTraits >::_ChevronMenuInfo cmi = { NULL, (LPNMREBARCHEVRON)pnmh, false };\n\t\tif(!pT->PrepareChevronMenu(cmi))\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\t\t// display a popup menu with hidden items\n\t\tpT->DisplayChevronMenu(cmi);\n\t\t// cleanup\n\t\tpT->CleanupChevronMenu(cmi);\n\t\treturn 0;\n\t}\n#endif // !_ATL_NO_REBAR_SUPPORT\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CMDIChildWindowImpl\n\ntemplate <class T, class TBase = CMDIWindow, class TWinTraits = ATL::CMDIChildWinTraits>\nclass ATL_NO_VTABLE CMDIChildWindowImpl : public CFrameWindowImplBase<TBase, TWinTraits >\n{\npublic:\n\tHWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\n\t\t\tDWORD dwStyle = 0, DWORD dwExStyle = 0,\n\t\t\tUINT nMenuID = 0, LPVOID lpCreateParam = NULL)\n\t{\n\t\tATOM atom = T::GetWndClassInfo().Register(&this->m_pfnSuperWindowProc);\n\n\t\tif(nMenuID != 0)\n\t\t\tthis->m_hMenu = ::LoadMenu(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(nMenuID));\n\n\t\tdwStyle = T::GetWndStyle(dwStyle);\n\t\tdwExStyle = T::GetWndExStyle(dwExStyle);\n\n\t\tdwExStyle |= WS_EX_MDICHILD;   // force this one\n\t\tthis->m_pfnSuperWindowProc = ::DefMDIChildProc;\n\t\tthis->m_hWndMDIClient = hWndParent;\n\t\tATLASSERT(::IsWindow(this->m_hWndMDIClient));\n\n\t\tif(rect.m_lpRect == NULL)\n\t\t\trect.m_lpRect = &TBase::rcDefault;\n\n\t\t// If the currently active MDI child is maximized, we want to create this one maximized too\n\t\tATL::CWindow wndParent = hWndParent;\n\t\tBOOL bMaximized = FALSE;\n\t\twndParent.SendMessage(WM_MDIGETACTIVE, 0, (LPARAM)&bMaximized);\n\t\tif(bMaximized)\n\t\t\twndParent.SetRedraw(FALSE);\n\n\t\tHWND hWnd = CFrameWindowImplBase<TBase, TWinTraits >::Create(hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, (UINT)0U, atom, lpCreateParam);\n\n\t\tif(bMaximized)\n\t\t{\n\t\t\t// Maximize and redraw everything\n\t\t\tif(hWnd != NULL)\n\t\t\t\tthis->MDIMaximize(hWnd);\n\t\t\twndParent.SetRedraw(TRUE);\n\t\t\twndParent.RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN);\n\t\t\t::SetFocus(this->GetMDIFrame());   // focus will be set back to this window\n\t\t}\n\t\telse if((hWnd != NULL) && ::IsWindowVisible(this->m_hWnd) && !::IsChild(hWnd, ::GetFocus()))\n\t\t{\n\t\t\t::SetFocus(hWnd);\n\t\t}\n\n\t\treturn hWnd;\n\t}\n\n\tHWND CreateEx(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR lpcstrWindowName = NULL, DWORD dwStyle = 0, DWORD dwExStyle = 0, LPVOID lpCreateParam = NULL)\n\t{\n\t\tconst int cchName = 256;\n\t\tTCHAR szWindowName[cchName] = {};\n\t\tif(lpcstrWindowName == NULL)\n\t\t{\n\t\t\t::LoadString(ModuleHelper::GetResourceInstance(), T::GetWndClassInfo().m_uCommonResourceID, szWindowName, cchName);\n\t\t\tlpcstrWindowName = szWindowName;\n\t\t}\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tHWND hWnd = pT->Create(hWndParent, rect, lpcstrWindowName, dwStyle, dwExStyle, T::GetWndClassInfo().m_uCommonResourceID, lpCreateParam);\n\n\t\tif(hWnd != NULL)\n\t\t\tthis->m_hAccel = ::LoadAccelerators(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(T::GetWndClassInfo().m_uCommonResourceID));\n\n\t\treturn hWnd;\n\t}\n\n\tBOOL CreateSimpleToolBar(UINT nResourceID = 0, DWORD dwStyle = ATL_SIMPLE_TOOLBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\n\t{\n\t\tATLASSERT(!::IsWindow(this->m_hWndToolBar));\n\t\tif(nResourceID == 0)\n\t\t\tnResourceID = T::GetWndClassInfo().m_uCommonResourceID;\n\t\tthis->m_hWndToolBar = T::CreateSimpleToolBarCtrl(this->m_hWnd, nResourceID, TRUE, dwStyle, nID);\n\t\treturn (this->m_hWndToolBar != NULL);\n\t}\n\n\tBOOL UpdateClientEdge(LPRECT lpRect = NULL)\n\t{\n\t\t// only adjust for active MDI child window\n\t\tHWND hWndChild = this->MDIGetActive();\n\t\tif((hWndChild != NULL) && (hWndChild != this->m_hWnd))\n\t\t\treturn FALSE;\n\n\t\t// need to adjust the client edge style as max/restore happens\n\t\tDWORD dwStyle = ::GetWindowLong(this->m_hWndMDIClient, GWL_EXSTYLE);\n\t\tDWORD dwNewStyle = dwStyle;\n\t\tif((hWndChild != NULL) && ((this->GetExStyle() & WS_EX_CLIENTEDGE) == 0) && ((this->GetStyle() & WS_MAXIMIZE) != 0))\n\t\t\tdwNewStyle &= ~(WS_EX_CLIENTEDGE);\n\t\telse\n\t\t\tdwNewStyle |= WS_EX_CLIENTEDGE;\n\n\t\tif(dwStyle != dwNewStyle)\n\t\t{\n\t\t\t// SetWindowPos will not move invalid bits\n\t\t\t::RedrawWindow(this->m_hWndMDIClient, NULL, NULL,\n\t\t\t\tRDW_INVALIDATE | RDW_ALLCHILDREN);\n\t\t\t// remove/add WS_EX_CLIENTEDGE to MDI client area\n\t\t\t::SetWindowLong(this->m_hWndMDIClient, GWL_EXSTYLE, dwNewStyle);\n\t\t\t::SetWindowPos(this->m_hWndMDIClient, NULL, 0, 0, 0, 0,\n\t\t\t\tSWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE |\n\t\t\t\tSWP_NOZORDER | SWP_NOCOPYBITS);\n\n\t\t\t// return new client area\n\t\t\tif (lpRect != NULL)\n\t\t\t\t::GetClientRect(this->m_hWndMDIClient, lpRect);\n\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}\n\n\ttypedef CFrameWindowImplBase<TBase, TWinTraits >   _baseClass;\n\tBEGIN_MSG_MAP(CMDIChildWindowImpl)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\t\tMESSAGE_HANDLER(WM_WINDOWPOSCHANGED, OnWindowPosChanged)\n\t\tMESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate)\n\t\tMESSAGE_HANDLER(WM_MENUSELECT, OnMenuSelect)\n\t\tMESSAGE_HANDLER(WM_MDIACTIVATE, OnMDIActivate)\n\t\tMESSAGE_HANDLER(WM_DESTROY, OnDestroy)\n#ifndef _ATL_NO_REBAR_SUPPORT\n\t\tNOTIFY_CODE_HANDLER(RBN_AUTOSIZE, OnReBarAutoSize)\n\t\tNOTIFY_CODE_HANDLER(RBN_CHEVRONPUSHED, OnChevronPushed)\n#endif // !_ATL_NO_REBAR_SUPPORT\n\t\tCHAIN_MSG_MAP(_baseClass)\n\tEND_MSG_MAP()\n\n\tLRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tthis->DefWindowProc(uMsg, wParam, lParam);   // needed for MDI children\n\t\tif(wParam != SIZE_MINIMIZED)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->UpdateLayout();\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnWindowPosChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\t// update MDI client edge and adjust MDI child rect\n\t\tLPWINDOWPOS lpWndPos = (LPWINDOWPOS)lParam;\n\n\t\tif(!(lpWndPos->flags & SWP_NOSIZE))\n\t\t{\n\t\t\tRECT rectClient = {};\n\t\t\tif(UpdateClientEdge(&rectClient) && ((this->GetStyle() & WS_MAXIMIZE) != 0))\n\t\t\t{\n\t\t\t\t::AdjustWindowRectEx(&rectClient, this->GetStyle(), FALSE, this->GetExStyle());\n\t\t\t\tlpWndPos->x = rectClient.left;\n\t\t\t\tlpWndPos->y = rectClient.top;\n\t\t\t\tlpWndPos->cx = rectClient.right - rectClient.left;\n\t\t\t\tlpWndPos->cy = rectClient.bottom - rectClient.top;\n\t\t\t}\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnMouseActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tLRESULT lRes = this->DefWindowProc(uMsg, wParam, lParam);\n\n\t\t// Activate this MDI window if needed\n\t\tif((lRes == MA_ACTIVATE) || (lRes == MA_ACTIVATEANDEAT))\n\t\t{\n\t\t\tif(this->MDIGetActive() != this->m_hWnd)\n\t\t\t\tthis->MDIActivate(this->m_hWnd);\n\t\t}\n\n\t\treturn lRes;\n\t}\n\n\tLRESULT OnMenuSelect(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\treturn ::SendMessage(this->GetMDIFrame(), uMsg, wParam, lParam);\n\t}\n\n\tLRESULT OnMDIActivate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif(((HWND)lParam == this->m_hWnd) && (this->m_hMenu != NULL))\n\t\t\tthis->SetMDIFrameMenu();\n\t\telse if((HWND)lParam == NULL)\n\t\t\t::SendMessage(this->GetMDIFrame(), WM_MDISETMENU, 0, 0);\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(this->m_hMenu != NULL)\n\t\t{\n\t\t\t::DestroyMenu(this->m_hMenu);\n\t\t\tthis->m_hMenu = NULL;\n\t\t}\n\t\tUpdateClientEdge();\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n#ifndef _ATL_NO_REBAR_SUPPORT\n\tLRESULT OnReBarAutoSize(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->UpdateLayout(FALSE);\n\t\treturn 0;\n\t}\n\n\tLRESULT OnChevronPushed(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\ttypename CFrameWindowImplBase<TBase, TWinTraits >::_ChevronMenuInfo cmi = { NULL, (LPNMREBARCHEVRON)pnmh, false };\n\t\tif(!pT->PrepareChevronMenu(cmi))\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t\treturn 1;\n\t\t}\n\t\t// display a popup menu with hidden items\n\t\tpT->DisplayChevronMenu(cmi);\n\t\t// cleanup\n\t\tpT->CleanupChevronMenu(cmi);\n\t\treturn 0;\n\t}\n#endif // !_ATL_NO_REBAR_SUPPORT\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// COwnerDraw - MI class for owner-draw support\n\ntemplate <class T>\nclass COwnerDraw\n{\npublic:\n// Message map and handlers\n\tBEGIN_MSG_MAP(COwnerDraw< T >)\n\t\tMESSAGE_HANDLER(WM_DRAWITEM, OnDrawItem)\n\t\tMESSAGE_HANDLER(WM_MEASUREITEM, OnMeasureItem)\n\t\tMESSAGE_HANDLER(WM_COMPAREITEM, OnCompareItem)\n\t\tMESSAGE_HANDLER(WM_DELETEITEM, OnDeleteItem)\n\tALT_MSG_MAP(1)\n\t\tMESSAGE_HANDLER(OCM_DRAWITEM, OnDrawItem)\n\t\tMESSAGE_HANDLER(OCM_MEASUREITEM, OnMeasureItem)\n\t\tMESSAGE_HANDLER(OCM_COMPAREITEM, OnCompareItem)\n\t\tMESSAGE_HANDLER(OCM_DELETEITEM, OnDeleteItem)\n\tEND_MSG_MAP()\n\n\tLRESULT OnDrawItem(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->SetMsgHandled(TRUE);\n\t\tpT->DrawItem((LPDRAWITEMSTRUCT)lParam);\n\t\tbHandled = pT->IsMsgHandled();\n\t\treturn (LRESULT)TRUE;\n\t}\n\n\tLRESULT OnMeasureItem(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->SetMsgHandled(TRUE);\n\t\tpT->MeasureItem((LPMEASUREITEMSTRUCT)lParam);\n\t\tbHandled = pT->IsMsgHandled();\n\t\treturn (LRESULT)TRUE;\n\t}\n\n\tLRESULT OnCompareItem(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->SetMsgHandled(TRUE);\n\t\tbHandled = pT->IsMsgHandled();\n\t\treturn (LRESULT)pT->CompareItem((LPCOMPAREITEMSTRUCT)lParam);\n\t}\n\n\tLRESULT OnDeleteItem(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->SetMsgHandled(TRUE);\n\t\tpT->DeleteItem((LPDELETEITEMSTRUCT)lParam);\n\t\tbHandled = pT->IsMsgHandled();\n\t\treturn (LRESULT)TRUE;\n\t}\n\n// Overrideables\n\tvoid DrawItem(LPDRAWITEMSTRUCT /*lpDrawItemStruct*/)\n\t{\n\t\t// must be implemented\n\t\tATLASSERT(FALSE);\n\t}\n\n\tvoid MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)\n\t{\n\t\tif(lpMeasureItemStruct->CtlType != ODT_MENU)\n\t\t{\n\t\t\t// return default height for a system font\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tHWND hWnd = pT->GetDlgItem(lpMeasureItemStruct->CtlID);\n\t\t\tCClientDC dc(hWnd);\n\t\t\tTEXTMETRIC tm = {};\n\t\t\tdc.GetTextMetrics(&tm);\n\n\t\t\tlpMeasureItemStruct->itemHeight = tm.tmHeight;\n\t\t}\n\t\telse\n\t\t\tlpMeasureItemStruct->itemHeight = ::GetSystemMetrics(SM_CYMENU);\n\t}\n\n\tint CompareItem(LPCOMPAREITEMSTRUCT /*lpCompareItemStruct*/)\n\t{\n\t\t// all items are equal\n\t\treturn 0;\n\t}\n\n\tvoid DeleteItem(LPDELETEITEMSTRUCT /*lpDeleteItemStruct*/)\n\t{\n\t\t// default - nothing\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Update UI macros\n\n// these build the Update UI map inside a class definition\n#define BEGIN_UPDATE_UI_MAP(thisClass) \\\n\tstatic const CUpdateUIBase::_AtlUpdateUIMap* GetUpdateUIMap() \\\n\t{ \\\n\t\tstatic const CUpdateUIBase::_AtlUpdateUIMap theMap[] = \\\n\t\t{\n\n#define UPDATE_ELEMENT(nID, wType) \\\n\t\t\t{ nID,  wType },\n\n#define END_UPDATE_UI_MAP() \\\n\t\t\t{ (WORD)-1, 0 } \\\n\t\t}; \\\n\t\treturn theMap; \\\n\t}\n\n///////////////////////////////////////////////////////////////////////////////\n// CUpdateUI - manages UI elements updating\n\nclass CUpdateUIBase\n{\npublic:\n\t// constants\n\tenum\n\t{\n\t\t// UI element type\n\t\tUPDUI_MENUPOPUP\t\t= 0x0001,\n\t\tUPDUI_MENUBAR\t\t= 0x0002,\n\t\tUPDUI_CHILDWINDOW\t= 0x0004,\n\t\tUPDUI_TOOLBAR\t\t= 0x0008,\n\t\tUPDUI_STATUSBAR\t\t= 0x0010,\n\t\t// state\n\t\tUPDUI_ENABLED\t\t= 0x0000,\n\t\tUPDUI_DISABLED\t\t= 0x0100,\n\t\tUPDUI_CHECKED\t\t= 0x0200,\n\t\tUPDUI_CHECKED2\t\t= 0x0400,\n\t\tUPDUI_RADIO\t\t= 0x0800,\n\t\tUPDUI_DEFAULT\t\t= 0x1000,\n\t\tUPDUI_TEXT\t\t= 0x2000,\n\t\t// internal state\n\t\tUPDUI_CLEARDEFAULT\t= 0x4000,\n\t};\n\n\t// element data\n\tstruct _AtlUpdateUIElement\n\t{\n\t\tHWND m_hWnd;\n\t\tWORD m_wType;\n\n\t\tbool operator ==(const _AtlUpdateUIElement& e) const\n\t\t{ return ((m_hWnd == e.m_hWnd) && (m_wType == e.m_wType)); }\n\t};\n\n\t// map data\n\tstruct _AtlUpdateUIMap\n\t{\n\t\tWORD m_nID;\n\t\tWORD m_wType;\n\n\t\tbool operator ==(const _AtlUpdateUIMap& e) const\n\t\t{ return ((m_nID == e.m_nID) && (m_wType == e.m_wType)); }\n\t};\n\n\t// instance data\n#pragma warning(push)\n#pragma warning(disable: 4201)   // nameless unions are part of C++\n\n\tstruct _AtlUpdateUIData\n\t{\n\t\tWORD m_wState;\n\t\tunion\n\t\t{\n\t\t\tvoid* m_lpData;\n\t\t\tLPTSTR m_lpstrText;\n\t\t\tstruct\n\t\t\t{\n\t\t\t\tWORD m_nIDFirst;\n\t\t\t\tWORD m_nIDLast;\n\t\t\t};\n\t\t};\n\n\t\tbool operator ==(const _AtlUpdateUIData& e) const\n\t\t{ return ((m_wState == e.m_wState) && (m_lpData == e.m_lpData)); }\n\t};\n\n#pragma warning(pop)\n\n\tATL::CSimpleArray<_AtlUpdateUIElement> m_UIElements;   // elements data\n\tconst _AtlUpdateUIMap* m_pUIMap;                       // static UI data\n\t_AtlUpdateUIData* m_pUIData;                           // instance UI data\n\tWORD m_wDirtyType;                                     // global dirty flag\n\n\tbool m_bBlockAccelerators;\n\n\n// Constructor, destructor\n\tCUpdateUIBase() : m_pUIMap(NULL), m_pUIData(NULL), m_wDirtyType(0), m_bBlockAccelerators(false)\n\t{ }\n\n\t~CUpdateUIBase()\n\t{\n\t\tif((m_pUIMap != NULL) && (m_pUIData != NULL))\n\t\t{\n\t\t\tconst _AtlUpdateUIMap* pUIMap = m_pUIMap;\n\t\t\t_AtlUpdateUIData* pUIData = m_pUIData;\n\t\t\twhile(pUIMap->m_nID != (WORD)-1)\n\t\t\t{\n\t\t\t\tif(pUIData->m_wState & UPDUI_TEXT)\n\t\t\t\t\tdelete [] pUIData->m_lpstrText;\n\t\t\t\tpUIMap++;\n\t\t\t\tpUIData++;\n\t\t\t}\n\t\t\tdelete [] m_pUIData;\n\t\t}\n\t}\n\n// Check for disabled commands\n\tbool UIGetBlockAccelerators() const\n\t{\n\t\treturn m_bBlockAccelerators;\n\t}\n\n\tbool UISetBlockAccelerators(bool bBlock)\n\t{\n\t\tbool bOld = m_bBlockAccelerators;\n\t\tm_bBlockAccelerators = bBlock;\n\t\treturn bOld;\n\t}\n\n// Add elements\n\tBOOL UIAddMenuBar(HWND hWnd)                // menu bar (main menu)\n\t{\n\t\tif(hWnd == NULL)\n\t\t\treturn FALSE;\n\t\t_AtlUpdateUIElement e;\n\t\te.m_hWnd = hWnd;\n\t\te.m_wType = UPDUI_MENUBAR;\n\t\treturn m_UIElements.Add(e);\n\t}\n\n\tBOOL UIAddToolBar(HWND hWnd)                // toolbar\n\t{\n\t\tif(hWnd == NULL)\n\t\t\treturn FALSE;\n\t\t_AtlUpdateUIElement e;\n\t\te.m_hWnd = hWnd;\n\t\te.m_wType = UPDUI_TOOLBAR;\n\t\treturn m_UIElements.Add(e);\n\t}\n\n\tBOOL UIAddStatusBar(HWND hWnd)              // status bar\n\t{\n\t\tif(hWnd == NULL)\n\t\t\treturn FALSE;\n\t\t_AtlUpdateUIElement e;\n\t\te.m_hWnd = hWnd;\n\t\te.m_wType = UPDUI_STATUSBAR;\n\t\treturn m_UIElements.Add(e);\n\t}\n\n\tBOOL UIAddChildWindowContainer(HWND hWnd)   // child window\n\t{\n\t\tif(hWnd == NULL)\n\t\t\treturn FALSE;\n\t\t_AtlUpdateUIElement e;\n\t\te.m_hWnd = hWnd;\n\t\te.m_wType = UPDUI_CHILDWINDOW;\n\t\treturn m_UIElements.Add(e);\n\t}\n\n// Message map for popup menu updates and accelerator blocking\n\tBEGIN_MSG_MAP(CUpdateUIBase)\n\t\tMESSAGE_HANDLER(WM_INITMENUPOPUP, OnInitMenuPopup)\n\t\tMESSAGE_HANDLER(WM_COMMAND, OnCommand)\n\tEND_MSG_MAP()\n\n\tLRESULT OnInitMenuPopup(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tbHandled = FALSE;\n\t\tHMENU hMenu = (HMENU)wParam;\n\t\tif(hMenu == NULL)\n\t\t\treturn 1;\n\t\t_AtlUpdateUIData* pUIData = m_pUIData;\n\t\tif(pUIData == NULL)\n\t\t\treturn 1;\n\t\tconst _AtlUpdateUIMap* pMap = m_pUIMap;\n\t\twhile(pMap->m_nID != (WORD)-1)\n\t\t{\n\t\t\tif(pMap->m_wType & UPDUI_MENUPOPUP)\n\t\t\t{\n\t\t\t\tUIUpdateMenuBarElement(pMap->m_nID, pUIData, hMenu);\n\n\t\t\t\tif((pUIData->m_wState & UPDUI_RADIO) != 0)\n\t\t\t\t\t::CheckMenuRadioItem(hMenu, pUIData->m_nIDFirst, pUIData->m_nIDLast, pMap->m_nID, MF_BYCOMMAND);\n\t\t\t}\n\t\t\tpMap++;\n\t\t\tpUIData++;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnCommand(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tbHandled = FALSE;\n\t\tif(m_bBlockAccelerators && (HIWORD(wParam) == 1))   // accelerators only\n\t\t{\n\t\t\tint nID = LOWORD(wParam);\n\t\t\tif((UIGetState(nID) & UPDUI_DISABLED) == UPDUI_DISABLED)\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"CUpdateUIBase::OnCommand - blocked disabled command 0x%4.4X\\n\"), nID);\n\t\t\t\tbHandled = TRUE;   // eat the command, UI item is disabled\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\n// methods for setting UI element state\n\tBOOL UIEnable(int nID, BOOL bEnable, BOOL bForceUpdate = FALSE)\n\t{\n\t\tconst _AtlUpdateUIMap* pMap = m_pUIMap;\n\t\t_AtlUpdateUIData* pUIData = m_pUIData;\n\t\tif(pUIData == NULL)\n\t\t\treturn FALSE;\n\n\t\tfor( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\n\t\t{\n\t\t\tif(nID == (int)pMap->m_nID)\n\t\t\t{\n\t\t\t\tif(bEnable)\n\t\t\t\t{\n\t\t\t\t\tif(pUIData->m_wState & UPDUI_DISABLED)\n\t\t\t\t\t{\n\t\t\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\t\t\tpUIData->m_wState &= ~UPDUI_DISABLED;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!(pUIData->m_wState & UPDUI_DISABLED))\n\t\t\t\t\t{\n\t\t\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\t\t\tpUIData->m_wState |= UPDUI_DISABLED;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(bForceUpdate)\n\t\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\tif(pUIData->m_wState & pMap->m_wType)\n\t\t\t\t\tm_wDirtyType |= pMap->m_wType;\n\n\t\t\t\tbreak;   // found\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}\n\n\tBOOL UISetCheck(int nID, int nCheck, BOOL bForceUpdate = FALSE)\n\t{\n\t\tconst _AtlUpdateUIMap* pMap = m_pUIMap;\n\t\t_AtlUpdateUIData* pUIData = m_pUIData;\n\t\tif(pUIData == NULL)\n\t\t\treturn FALSE;\n\n\t\tfor( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\n\t\t{\n\t\t\tif(nID == (int)pMap->m_nID)\n\t\t\t{\n\t\t\t\tswitch(nCheck)\n\t\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\tif((pUIData->m_wState & UPDUI_CHECKED) || (pUIData->m_wState & UPDUI_CHECKED2))\n\t\t\t\t\t{\n\t\t\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\t\t\tpUIData->m_wState &= ~(UPDUI_CHECKED | UPDUI_CHECKED2);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tif(!(pUIData->m_wState & UPDUI_CHECKED))\n\t\t\t\t\t{\n\t\t\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\t\t\tpUIData->m_wState &= ~UPDUI_CHECKED2;\n\t\t\t\t\t\tpUIData->m_wState |= UPDUI_CHECKED;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tif(!(pUIData->m_wState & UPDUI_CHECKED2))\n\t\t\t\t\t{\n\t\t\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\t\t\tpUIData->m_wState &= ~UPDUI_CHECKED;\n\t\t\t\t\t\tpUIData->m_wState |= UPDUI_CHECKED2;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif(bForceUpdate)\n\t\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\tif(pUIData->m_wState & pMap->m_wType)\n\t\t\t\t\tm_wDirtyType |= pMap->m_wType;\n\n\t\t\t\tbreak;   // found\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}\n\n\t// variant that supports bool (checked/not-checked, no intermediate state)\n\tBOOL UISetCheck(int nID, bool bCheck, BOOL bForceUpdate = FALSE)\n\t{\n\t\treturn UISetCheck(nID, bCheck ? 1 : 0, bForceUpdate);\n\t}\n\n\tBOOL UISetRadio(int nID, BOOL bRadio, BOOL bForceUpdate = FALSE)\n\t{\n\t\tconst _AtlUpdateUIMap* pMap = m_pUIMap;\n\t\t_AtlUpdateUIData* pUIData = m_pUIData;\n\t\tif(pUIData == NULL)\n\t\t\treturn FALSE;\n\n\t\tfor( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\n\t\t{\n\t\t\tif(nID == (int)pMap->m_nID)\n\t\t\t{\n\t\t\t\tif(bRadio)\n\t\t\t\t{\n\t\t\t\t\tif(!(pUIData->m_wState & UPDUI_RADIO))\n\t\t\t\t\t{\n\t\t\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\t\t\tpUIData->m_wState |= UPDUI_RADIO;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(pUIData->m_wState & UPDUI_RADIO)\n\t\t\t\t\t{\n\t\t\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\t\t\tpUIData->m_wState &= ~UPDUI_RADIO;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(bForceUpdate)\n\t\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\tif(pUIData->m_wState & pMap->m_wType)\n\t\t\t\t\tm_wDirtyType |= pMap->m_wType;\n\n\t\t\t\tbreak;   // found\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}\n\n\t// for menu items\n\tBOOL UISetRadioMenuItem(int nID, int nIDFirst, int nIDLast, BOOL bForceUpdate = FALSE)\n\t{\n\t\tconst _AtlUpdateUIMap* pMap = m_pUIMap;\n\t\t_AtlUpdateUIData* pUIData = m_pUIData;\n\t\tif(pUIData == NULL)\n\t\t\treturn FALSE;\n\n\t\tfor( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\n\t\t{\n\t\t\tif(nID == (int)pMap->m_nID)\n\t\t\t{\n\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\tpUIData->m_wState |= UPDUI_RADIO;\n\t\t\t\tpUIData->m_nIDFirst = (WORD)nIDFirst;\n\t\t\t\tpUIData->m_nIDLast = (WORD)nIDLast;\n\n\t\t\t\tif(bForceUpdate)\n\t\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\tif(pUIData->m_wState & pMap->m_wType)\n\t\t\t\t\tm_wDirtyType |= pMap->m_wType;\n\t\t\t}\n\t\t\telse if((pMap->m_nID >= nIDFirst) && (pMap->m_nID <= nIDLast))\n\t\t\t{\n\t\t\t\tif(pUIData->m_wState & UPDUI_RADIO)\n\t\t\t\t{\n\t\t\t\t\tpUIData->m_wState &= ~pMap->m_wType;\n\t\t\t\t\tpUIData->m_wState &= ~UPDUI_RADIO;\n\t\t\t\t\tpUIData->m_nIDFirst = 0;\n\t\t\t\t\tpUIData->m_nIDLast = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(pMap->m_nID == nIDLast)\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn TRUE;\n\t}\n\n\tBOOL UISetText(int nID, LPCTSTR lpstrText, BOOL bForceUpdate = FALSE)\n\t{\n\t\tconst _AtlUpdateUIMap* pMap = m_pUIMap;\n\t\t_AtlUpdateUIData* pUIData = m_pUIData;\n\t\tif(pUIData == NULL)\n\t\t\treturn FALSE;\n\t\tif(lpstrText == NULL)\n\t\t\tlpstrText = _T(\"\");\n\n\t\tfor( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\n\t\t{\n\t\t\tif(nID == (int)pMap->m_nID)\n\t\t\t{\n\t\t\t\tif((pUIData->m_lpstrText == NULL) || (lstrcmp(pUIData->m_lpstrText, lpstrText) != 0))\n\t\t\t\t{\n\t\t\t\t\tdelete [] pUIData->m_lpstrText;\n\t\t\t\t\tpUIData->m_lpstrText = NULL;\n\t\t\t\t\tint nStrLen = lstrlen(lpstrText);\n\t\t\t\t\tATLTRY(pUIData->m_lpstrText = new TCHAR[nStrLen + 1]);\n\t\t\t\t\tif(pUIData->m_lpstrText == NULL)\n\t\t\t\t\t{\n\t\t\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"UISetText - memory allocation failed\\n\"));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tATL::Checked::tcscpy_s(pUIData->m_lpstrText, nStrLen + 1, lpstrText);\n\t\t\t\t\tpUIData->m_wState |= (UPDUI_TEXT | pMap->m_wType);\n\t\t\t\t}\n\n\t\t\t\tif(bForceUpdate)\n\t\t\t\t\tpUIData->m_wState |= (UPDUI_TEXT | pMap->m_wType);\n\t\t\t\tif(pUIData->m_wState & pMap->m_wType)\n\t\t\t\t\tm_wDirtyType |= pMap->m_wType;\n\n\t\t\t\tbreak;   // found\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}\n\n\tBOOL UISetDefault(int nID, BOOL bDefault, BOOL bForceUpdate = FALSE)\n\t{\n\t\tconst _AtlUpdateUIMap* pMap = m_pUIMap;\n\t\t_AtlUpdateUIData* pUIData = m_pUIData;\n\t\tif(pUIData == NULL)\n\t\t\treturn FALSE;\n\n\t\tfor( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\n\t\t{\n\t\t\tif(nID == (int)pMap->m_nID)\n\t\t\t{\n\t\t\t\tif(bDefault)\n\t\t\t\t{\n\t\t\t\t\tif((pUIData->m_wState & UPDUI_DEFAULT) == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\t\t\tpUIData->m_wState |= UPDUI_DEFAULT;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif((pUIData->m_wState & UPDUI_DEFAULT) != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\t\t\tpUIData->m_wState &= ~UPDUI_DEFAULT;\n\t\t\t\t\t\tpUIData->m_wState |= UPDUI_CLEARDEFAULT;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(bForceUpdate)\n\t\t\t\t\tpUIData->m_wState |= pMap->m_wType;\n\t\t\t\tif(pUIData->m_wState & pMap->m_wType)\n\t\t\t\t\tm_wDirtyType |= pMap->m_wType;\n\n\t\t\t\tbreak;   // found\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}\n\n// methods for complete state set/get\n\tBOOL UISetState(int nID, DWORD dwState)\n\t{\n\t\tconst _AtlUpdateUIMap* pMap = m_pUIMap;\n\t\t_AtlUpdateUIData* pUIData = m_pUIData;\n\t\tif(pUIData == NULL)\n\t\t\treturn FALSE;\n\t\tfor( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\n\t\t{\n\t\t\tif(nID == (int)pMap->m_nID)\n\t\t\t{\t\t\n\t\t\t\tpUIData->m_wState = (WORD)(dwState | pMap->m_wType);\n\t\t\t\tm_wDirtyType |= pMap->m_wType;\n\t\t\t\tbreak;   // found\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}\n\n\tDWORD UIGetState(int nID)\n\t{\n\t\tconst _AtlUpdateUIMap* pMap = m_pUIMap;\n\t\t_AtlUpdateUIData* pUIData = m_pUIData;\n\t\tif(pUIData == NULL)\n\t\t\treturn 0;\n\t\tfor( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\n\t\t{\n\t\t\tif(nID == (int)pMap->m_nID)\n\t\t\t\treturn pUIData->m_wState;\n\t\t}\n\t\treturn 0;\n\t}\n\n// methods for updating UI\n\tBOOL UIUpdateMenuBar(BOOL bForceUpdate = FALSE, BOOL bMainMenu = FALSE)\n\t{\n\t\tif(!(m_wDirtyType & UPDUI_MENUBAR) && !bForceUpdate)\n\t\t\treturn TRUE;\n\n\t\tconst _AtlUpdateUIMap* pMap = m_pUIMap;\n\t\t_AtlUpdateUIData* pUIData = m_pUIData;\n\t\tif(pUIData == NULL)\n\t\t\treturn FALSE;\n\n\t\twhile(pMap->m_nID != (WORD)-1)\n\t\t{\n\t\t\tfor(int i = 0; i < m_UIElements.GetSize(); i++)\n\t\t\t{\n\t\t\t\tif(m_UIElements[i].m_wType == UPDUI_MENUBAR)\n\t\t\t\t{\n\t\t\t\t\tHMENU hMenu = ::GetMenu(m_UIElements[i].m_hWnd);\n\t\t\t\t\tif((hMenu != NULL) && (pUIData->m_wState & UPDUI_MENUBAR) && (pMap->m_wType & UPDUI_MENUBAR))\n\t\t\t\t\t\tUIUpdateMenuBarElement(pMap->m_nID, pUIData, hMenu);\n\t\t\t\t}\n\t\t\t\tif(bMainMenu)\n\t\t\t\t\t::DrawMenuBar(m_UIElements[i].m_hWnd);\n\t\t\t}\n\t\t\tpMap++;\n\t\t\tpUIData->m_wState &= ~UPDUI_MENUBAR;\n\t\t\tif(pUIData->m_wState & UPDUI_TEXT)\n\t\t\t{\n\t\t\t\tdelete [] pUIData->m_lpstrText;\n\t\t\t\tpUIData->m_lpstrText = NULL;\n\t\t\t\tpUIData->m_wState &= ~UPDUI_TEXT;\n\t\t\t}\n\t\t\tpUIData++;\n\t\t}\n\n\t\tm_wDirtyType &= ~UPDUI_MENUBAR;\n\t\treturn TRUE;\n\t}\n\n\tBOOL UIUpdateToolBar(BOOL bForceUpdate = FALSE)\n\t{\n\t\tif(!(m_wDirtyType & UPDUI_TOOLBAR) && !bForceUpdate)\n\t\t\treturn TRUE;\n\n\t\tconst _AtlUpdateUIMap* pMap = m_pUIMap;\n\t\t_AtlUpdateUIData* pUIData = m_pUIData;\n\t\tif(pUIData == NULL)\n\t\t\treturn FALSE;\n\n\t\twhile(pMap->m_nID != (WORD)-1)\n\t\t{\n\t\t\tfor(int i = 0; i < m_UIElements.GetSize(); i++)\n\t\t\t{\n\t\t\t\tif(m_UIElements[i].m_wType == UPDUI_TOOLBAR)\n\t\t\t\t{\n\t\t\t\t\tif((pUIData->m_wState & UPDUI_TOOLBAR) && (pMap->m_wType & UPDUI_TOOLBAR))\n\t\t\t\t\t\tUIUpdateToolBarElement(pMap->m_nID, pUIData, m_UIElements[i].m_hWnd);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpMap++;\n\t\t\tpUIData->m_wState &= ~UPDUI_TOOLBAR;\n\t\t\tpUIData++;\n\t\t}\n\n\t\tm_wDirtyType &= ~UPDUI_TOOLBAR;\n\t\treturn TRUE;\n\t}\n\n\tBOOL UIUpdateStatusBar(BOOL bForceUpdate = FALSE)\n\t{\n\t\tif(!(m_wDirtyType & UPDUI_STATUSBAR) && !bForceUpdate)\n\t\t\treturn TRUE;\n\n\t\tconst _AtlUpdateUIMap* pMap = m_pUIMap;\n\t\t_AtlUpdateUIData* pUIData = m_pUIData;\n\t\tif(pUIData == NULL)\n\t\t\treturn FALSE;\n\n\t\twhile(pMap->m_nID != (WORD)-1)\n\t\t{\n\t\t\tfor(int i = 0; i < m_UIElements.GetSize(); i++)\n\t\t\t{\n\t\t\t\tif(m_UIElements[i].m_wType == UPDUI_STATUSBAR)\n\t\t\t\t{\n\t\t\t\t\tif((pUIData->m_wState & UPDUI_STATUSBAR) && (pMap->m_wType & UPDUI_STATUSBAR))\n\t\t\t\t\t\tUIUpdateStatusBarElement(pMap->m_nID, pUIData, m_UIElements[i].m_hWnd);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpMap++;\n\t\t\tpUIData->m_wState &= ~UPDUI_STATUSBAR;\n\t\t\tif(pUIData->m_wState & UPDUI_TEXT)\n\t\t\t{\n\t\t\t\tdelete [] pUIData->m_lpstrText;\n\t\t\t\tpUIData->m_lpstrText = NULL;\n\t\t\t\tpUIData->m_wState &= ~UPDUI_TEXT;\n\t\t\t}\n\t\t\tpUIData++;\n\t\t}\n\n\t\tm_wDirtyType &= ~UPDUI_STATUSBAR;\n\t\treturn TRUE;\n\t}\n\n\tBOOL UIUpdateChildWindows(BOOL bForceUpdate = FALSE)\n\t{\n\t\tif(!(m_wDirtyType & UPDUI_CHILDWINDOW) && !bForceUpdate)\n\t\t\treturn TRUE;\n\n\t\tconst _AtlUpdateUIMap* pMap = m_pUIMap;\n\t\t_AtlUpdateUIData* pUIData = m_pUIData;\n\t\tif(pUIData == NULL)\n\t\t\treturn FALSE;\n\n\t\twhile(pMap->m_nID != (WORD)-1)\n\t\t{\n\t\t\tfor(int i = 0; i < m_UIElements.GetSize(); i++)\n\t\t\t{\n\t\t\t\tif(m_UIElements[i].m_wType == UPDUI_CHILDWINDOW)\n\t\t\t\t{\n\t\t\t\t\tif((pUIData->m_wState & UPDUI_CHILDWINDOW) && (pMap->m_wType & UPDUI_CHILDWINDOW))\n\t\t\t\t\t\tUIUpdateChildWindow(pMap->m_nID, pUIData, m_UIElements[i].m_hWnd);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpMap++;\n\t\t\tpUIData->m_wState &= ~UPDUI_CHILDWINDOW;\n\t\t\tif(pUIData->m_wState & UPDUI_TEXT)\n\t\t\t{\n\t\t\t\tdelete [] pUIData->m_lpstrText;\n\t\t\t\tpUIData->m_lpstrText = NULL;\n\t\t\t\tpUIData->m_wState &= ~UPDUI_TEXT;\n\t\t\t}\n\t\t\tpUIData++;\n\t\t}\n\n\t\tm_wDirtyType &= ~UPDUI_CHILDWINDOW;\n\t\treturn TRUE;\n\t}\n\n// internal element specific methods\n\tstatic void UIUpdateMenuBarElement(int nID, _AtlUpdateUIData* pUIData, HMENU hMenu)\n\t{\n\t\tif((pUIData->m_wState & UPDUI_CLEARDEFAULT) != 0)\n\t\t{\n\t\t\t::SetMenuDefaultItem(hMenu, (UINT)-1, 0);\n\t\t\tpUIData->m_wState &= ~UPDUI_CLEARDEFAULT;\n\t\t}\n\n\t\tCMenuItemInfo mii;\n\t\tmii.fMask = MIIM_STATE;\n\t\tmii.wID = nID;\n\n\t\tif((pUIData->m_wState & UPDUI_DISABLED) != 0)\n\t\t\tmii.fState |= MFS_DISABLED | MFS_GRAYED;\n\t\telse\n\t\t\tmii.fState |= MFS_ENABLED;\n\n\t\tif((pUIData->m_wState & UPDUI_CHECKED) != 0)\n\t\t\tmii.fState |= MFS_CHECKED;\n\t\telse\n\t\t\tmii.fState |= MFS_UNCHECKED;\n\n\t\tif((pUIData->m_wState & UPDUI_DEFAULT) != 0)\n\t\t\tmii.fState |= MFS_DEFAULT;\n\n\t\tif((pUIData->m_wState & UPDUI_TEXT) != 0)\n\t\t{\n\t\t\tCMenuItemInfo miiNow;\n\t\t\tmiiNow.fMask = MIIM_TYPE;\n\t\t\tmiiNow.wID = nID;\n\t\t\tif(::GetMenuItemInfo(hMenu, nID, FALSE, &miiNow))\n\t\t\t{\n\t\t\t\tmii.fMask |= MIIM_TYPE;\n\t\t\t\t// MFT_BITMAP and MFT_SEPARATOR don't go together with MFT_STRING\n\t\t\t\tmii.fType |= (miiNow.fType & ~(MFT_BITMAP | MFT_SEPARATOR)) | MFT_STRING;\n\t\t\t\tmii.dwTypeData = pUIData->m_lpstrText;\n\t\t\t}\n\t\t}\n\n\t\t::SetMenuItemInfo(hMenu, nID, FALSE, &mii);\n\t}\n\n\tstatic void UIUpdateToolBarElement(int nID, _AtlUpdateUIData* pUIData, HWND hWndToolBar)\n\t{\n\t\t// Note: only handles enabled/disabled, checked state, and radio (press)\n\t\t::SendMessage(hWndToolBar, TB_ENABLEBUTTON, nID, (LPARAM)(pUIData->m_wState & UPDUI_DISABLED) ? FALSE : TRUE);\n\t\t::SendMessage(hWndToolBar, TB_CHECKBUTTON, nID, (LPARAM)(pUIData->m_wState & UPDUI_CHECKED) ? TRUE : FALSE);\n\t\t::SendMessage(hWndToolBar, TB_INDETERMINATE, nID, (LPARAM)(pUIData->m_wState & UPDUI_CHECKED2) ? TRUE : FALSE);\n\t\t::SendMessage(hWndToolBar, TB_PRESSBUTTON, nID, (LPARAM)(pUIData->m_wState & UPDUI_RADIO) ? TRUE : FALSE);\n\t}\n\n\tstatic void UIUpdateStatusBarElement(int nID, _AtlUpdateUIData* pUIData, HWND hWndStatusBar)\n\t{\n\t\t// Note: only handles text\n\t\tif(pUIData->m_wState & UPDUI_TEXT)\n\t\t\t::SendMessage(hWndStatusBar, SB_SETTEXT, nID, (LPARAM)pUIData->m_lpstrText);\n\t}\n\n\tstatic void UIUpdateChildWindow(int nID, _AtlUpdateUIData* pUIData, HWND hWnd)\n\t{\n\t\tHWND hChild = ::GetDlgItem(hWnd, nID);\n\n\t\t::EnableWindow(hChild, (pUIData->m_wState & UPDUI_DISABLED) ? FALSE : TRUE);\n\t\t// for check and radio, assume that window is a button\n\t\tint nCheck = BST_UNCHECKED;\n\t\tif((pUIData->m_wState & UPDUI_CHECKED) || (pUIData->m_wState & UPDUI_RADIO))\n\t\t\tnCheck = BST_CHECKED;\n\t\telse if(pUIData->m_wState & UPDUI_CHECKED2)\n\t\t\tnCheck = BST_INDETERMINATE;\n\t\t::SendMessage(hChild, BM_SETCHECK, nCheck, 0L);\n\t\tif(pUIData->m_wState & UPDUI_DEFAULT)\n\t\t{\n\t\t\tDWORD dwRet = (DWORD)::SendMessage(hWnd, DM_GETDEFID, 0, 0L);\n\t\t\tif(HIWORD(dwRet) == DC_HASDEFID)\n\t\t\t{\n\t\t\t\tHWND hOldDef = ::GetDlgItem(hWnd, (int)(short)LOWORD(dwRet));\n\t\t\t\t// remove BS_DEFPUSHBUTTON\n\t\t\t\t::SendMessage(hOldDef, BM_SETSTYLE, BS_PUSHBUTTON, MAKELPARAM(TRUE, 0));\n\t\t\t}\n\t\t\t::SendMessage(hWnd, DM_SETDEFID, nID, 0L);\n\t\t}\n\t\tif(pUIData->m_wState & UPDUI_TEXT)\n\t\t\t::SetWindowText(hChild, pUIData->m_lpstrText);\n\t}\n};\n\ntemplate <class T>\nclass CUpdateUI : public CUpdateUIBase\n{\npublic:\n\tCUpdateUI()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\t(void)pT;   // avoid level 4 warning\n\t\tconst _AtlUpdateUIMap* pMap = pT->GetUpdateUIMap();\n\t\tm_pUIMap = pMap;\n\t\tATLASSERT(m_pUIMap != NULL);\n\t\tint nCount = 1;\n\t\tfor( ; pMap->m_nID != (WORD)-1; nCount++)\n\t\t\tpMap++;\n\n\t\t// check for duplicates (debug only)\n#ifdef _DEBUG\n\t\tfor(int i = 0; i < nCount; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < nCount; j++)\n\t\t\t{\n\t\t\t\t// shouldn't have duplicates in the update UI map\n\t\t\t\tif(i != j)\n\t\t\t\t\tATLASSERT(m_pUIMap[j].m_nID != m_pUIMap[i].m_nID);\n\t\t\t}\n\t\t}\n#endif // _DEBUG\n\n\t\tATLTRY(m_pUIData = new _AtlUpdateUIData[nCount]);\n\t\tATLASSERT(m_pUIData != NULL);\n\n\t\tif(m_pUIData != NULL)\n\t\t\tmemset(m_pUIData, 0, sizeof(_AtlUpdateUIData) * nCount);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CDynamicUpdateUI - allows update elements to dynamically added and removed\n//                    in addition to a static update UI map\n\ntemplate <class T>\nclass CDynamicUpdateUI : public CUpdateUIBase\n{\npublic:\n// Data members\n\tATL::CSimpleArray<_AtlUpdateUIMap> m_arrUIMap;     // copy of the static UI data\n\tATL::CSimpleArray<_AtlUpdateUIData> m_arrUIData;   // instance UI data\n\n// Constructor/destructor\n\tCDynamicUpdateUI()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\t(void)pT;   // avoid level 4 warning\n\t\tconst _AtlUpdateUIMap* pMap = pT->GetUpdateUIMap();\n\t\tATLASSERT(pMap != NULL);\n\n\t\tfor(;;)\n\t\t{\n\t\t\tBOOL bRet = m_arrUIMap.Add(*(_AtlUpdateUIMap*)pMap);\n\t\t\tATLASSERT(bRet);\n\n\t\t\tif(bRet != FALSE)\n\t\t\t{\n\t\t\t\t_AtlUpdateUIData data = { 0, NULL };\n\t\t\t\tbRet = m_arrUIData.Add(data);\n\t\t\t\tATLASSERT(bRet);\n\t\t\t}\n\n\t\t\tif(pMap->m_nID == (WORD)-1)\n\t\t\t\tbreak;\n\n\t\t\tpMap++;\n\t\t}\n\n\t\tATLASSERT(m_arrUIMap.GetSize() == m_arrUIData.GetSize());\n\n#ifdef _DEBUG\n\t\t// check for duplicates (debug only)\n\t\tfor(int i = 0; i < m_arrUIMap.GetSize(); i++)\n\t\t{\n\t\t\tfor(int j = 0; j < m_arrUIMap.GetSize(); j++)\n\t\t\t{\n\t\t\t\t// shouldn't have duplicates in the update UI map\n\t\t\t\tif(i != j)\n\t\t\t\t\tATLASSERT(m_arrUIMap[j].m_nID != m_arrUIMap[i].m_nID);\n\t\t\t}\n\t\t}\n#endif // _DEBUG\n\n\t\t// Set internal data pointers to point to the new data arrays\n\t\tm_pUIMap = m_arrUIMap.m_aT;\n\t\tm_pUIData = m_arrUIData.m_aT;\n\t}\n\n\t~CDynamicUpdateUI()\n\t{\n\t\tfor(int i = 0; i < m_arrUIData.GetSize(); i++)\n\t\t{\n\t\t\tif((m_arrUIData[i].m_wState & UPDUI_TEXT) != 0)\n\t\t\t\tdelete [] m_arrUIData[i].m_lpstrText;\n\t\t}\n\n\t\t// Reset internal data pointers (memory will be released by CSimpleArray d-tor)\n\t\tm_pUIMap = NULL;\n\t\tm_pUIData = NULL;\n\t}\n\n// Methods for dynamically adding and removing update elements\n\tbool UIAddUpdateElement(WORD nID, WORD wType)\n\t{\n\t\t// check for duplicates\n\t\tfor(int i = 0; i < m_arrUIMap.GetSize(); i++)\n\t\t{\n\t\t\t// shouldn't have duplicates in the update UI map\n\t\t\tATLASSERT(m_arrUIMap[i].m_nID != nID);\n\t\t\tif(m_arrUIMap[i].m_nID == nID)\n\t\t\t\treturn false;\n\t\t}\n\n\t\tbool bRetVal = false;\n\n\t\t// Add new end element\n\t\t_AtlUpdateUIMap uumEnd = { (WORD)-1, 0 };\n\t\tBOOL bRet = m_arrUIMap.Add(uumEnd);\n\t\tATLASSERT(bRet);\n\n\t\tif(bRet != FALSE)\n\t\t{\n\t\t\t_AtlUpdateUIData uud = { 0, NULL };\n\t\t\tbRet = m_arrUIData.Add(uud);\n\t\t\tATLASSERT(bRet);\n\n\t\t\t// Set new data to the previous end element\n\t\t\tif(bRet != FALSE)\n\t\t\t{\n\t\t\t\tint nSize = m_arrUIMap.GetSize();\n\t\t\t\t_AtlUpdateUIMap uum = { nID, wType };\n\t\t\t\tm_arrUIMap.SetAtIndex(nSize - 2, uum);\n\t\t\t\tm_arrUIData.SetAtIndex(nSize - 2, uud);\n\n\t\t\t\t// Set internal data pointers again, just in case that memory moved\n\t\t\t\tm_pUIMap = m_arrUIMap.m_aT;\n\t\t\t\tm_pUIData = m_arrUIData.m_aT;\n\n\t\t\t\tbRetVal = true;\n\t\t\t}\n\t\t}\n\n\t\treturn bRetVal;\n\t}\n\n\tbool UIRemoveUpdateElement(WORD nID)\n\t{\n\t\tbool bRetVal = false;\n\n\t\tfor(int i = 0; i < m_arrUIMap.GetSize(); i++)\n\t\t{\n\t\t\tif(m_arrUIMap[i].m_nID == nID)\n\t\t\t{\n\t\t\t\tif((m_arrUIData[i].m_wState & UPDUI_TEXT) != 0)\n\t\t\t\t\tdelete [] m_arrUIData[i].m_lpstrText;\n\n\t\t\t\tBOOL bRet = m_arrUIMap.RemoveAt(i);\n\t\t\t\tATLASSERT(bRet);\n\t\t\t\tbRet = m_arrUIData.RemoveAt(i);\n\t\t\t\tATLASSERT(bRet);\n\n\t\t\t\tbRetVal = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn bRetVal;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CAutoUpdateUI : Automatic mapping of UI elements\n\ntemplate <class T>\nclass CAutoUpdateUI : public CDynamicUpdateUI<T>\n{\npublic:\n\tLPCTSTR UIGetText(int nID)\n\t{\n\t\tfor(int i = 0; i < this->m_arrUIMap.GetSize(); i++)\n\t\t{\n\t\t\tif(this->m_arrUIMap[i].m_nID == nID)\n \t\t\t\treturn this->m_arrUIData[i].m_lpstrText;\n\t\t}\n\n\t\treturn NULL;\n\t}\n\n// Element\n\ttemplate <WORD t_wType>\n\tbool UIAddElement(UINT nID)\n\t{\n\t\t// check for existing UI map element\n\t\tfor(int i = 0; i < this->m_arrUIMap.GetSize(); i++)\n\t\t{\n\t\t\tif(this->m_arrUIMap[i].m_nID == nID)\n\t\t\t{\n\t\t\t\t// set requested type\n\t\t\t\tthis->m_arrUIMap[i].m_wType |= t_wType;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// Add element to UI map with requested type\n\t\treturn this->UIAddUpdateElement((WORD)nID, t_wType);\n\t}\n\n\ttemplate <WORD t_wType>\n\tbool UIRemoveElement(UINT nID)\n\t{\n\t\tfor(int i = 0; i < this->m_arrUIMap.GetSize(); i++)\n\t\t{\n\t\t\tif(this->m_arrUIMap[i].m_nID == nID) // matching UI map element\n\t\t\t{\n\t\t\t\tWORD wType = this->m_arrUIMap[i].m_wType & ~t_wType;\n\t\t\t\tif (wType != 0)   // has other types \n\t\t\t\t{\n\t\t\t\t\tthis->m_arrUIMap[i].m_wType = wType; // keep other types\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn this->UIRemoveUpdateElement((WORD)nID);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n// Menu\n\tbool UIAddMenu(HMENU hMenu, bool bSetText = false)\n\t{\n\t\tATLASSERT(::IsMenu(hMenu));\n\t\tMENUITEMINFO mii = {sizeof(MENUITEMINFO), MIIM_TYPE | MIIM_ID | MIIM_SUBMENU};\n\n\t\t// Complete the UI map\n\t\tfor (INT uItem = 0; CMenuHandle(hMenu).GetMenuItemInfo(uItem, TRUE, &mii); uItem++)\n\t\t{\n\t\t\tif(mii.hSubMenu)\n\t\t\t{\n\t\t\t\t// Add submenu to UI map\n\t\t\t\tUIAddMenu(mii.hSubMenu, bSetText);\n\t\t\t}\n\t\t\telse if (mii.wID != 0)\n\t\t\t{\n\t\t\t\t// Add element to UI map\n\t\t\t\tUIAddElement<CDynamicUpdateUI<T>::UPDUI_MENUPOPUP>(mii.wID);\n\t\t\t\tif (bSetText)\n\t\t\t\t{\n\t\t\t\t\tTCHAR sText[64] = {};\n\t\t\t\t\tif (GetMenuString(hMenu, uItem, sText, 64, MF_BYPOSITION))\n\t\t\t\t\t\tthis->UISetText(mii.wID, sText);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tbool UIAddMenu(UINT uID, bool bSetText = false)\n\t{\n\t\tCMenu menu;\n\t\tATLVERIFY(menu.LoadMenu(uID));\n\t\treturn UIAddMenu(menu, bSetText);\n\t}\n\n// ToolBar\n\tbool UIAddToolBar(HWND hWndToolBar)\n\t{\n\t\tATLASSERT(::IsWindow(hWndToolBar));\n\t\tTBBUTTONINFO tbbi = { sizeof(TBBUTTONINFO), TBIF_COMMAND | TBIF_STYLE | TBIF_BYINDEX };\n\n\t\t// Add toolbar buttons\n\t\tfor (int uItem = 0; ::SendMessage(hWndToolBar, TB_GETBUTTONINFO, uItem, (LPARAM)&tbbi) != -1; uItem++)\n\t\t{\n\t\t\tif (tbbi.fsStyle ^ BTNS_SEP)\n\t\t\t\tUIAddElement<CDynamicUpdateUI<T>::UPDUI_TOOLBAR>(tbbi.idCommand);\n\t\t}\n\n\t\t// Add embedded controls if any\n\t\tif (::GetWindow(hWndToolBar, GW_CHILD))\n\t\t\tUIAddChildWindowContainer(hWndToolBar);\n\n\t\treturn (CUpdateUIBase::UIAddToolBar(hWndToolBar) != FALSE);\n\t}\n\n// Container\n\tbool UIAddChildWindowContainer(HWND hWnd)\n\t{\n\t\tATLASSERT(::IsWindow(hWnd));\n\n\t\t// Add children controls if any\n\t\tfor (ATL::CWindow wCtl = ::GetWindow(hWnd, GW_CHILD); wCtl.IsWindow(); wCtl = wCtl.GetWindow(GW_HWNDNEXT))\n\t\t{\n\t\t\tint id = wCtl.GetDlgCtrlID();\n\t\t\tif(id != 0)\n\t\t\t\tUIAddElement<CDynamicUpdateUI<T>::UPDUI_CHILDWINDOW>(id);\n\t\t}\n\n\t\treturn (CUpdateUIBase::UIAddChildWindowContainer(hWnd) != FALSE);\n\t}\n\n// StatusBar\n\tBOOL UIUpdateStatusBar(BOOL bForceUpdate = FALSE)\n\t{\n\t\tif(!(this->m_wDirtyType & CDynamicUpdateUI<T>::UPDUI_STATUSBAR) && !bForceUpdate)\n\t\t\treturn TRUE;\n\n\t\tfor(int i = 0; i < this->m_arrUIMap.GetSize(); i++)\n\t\t{\n\t\t\tfor(int e = 0; e < this->m_UIElements.GetSize(); e++)\n\t\t\t{\n\t\t\t\tif((this->m_UIElements[e].m_wType == CDynamicUpdateUI<T>::UPDUI_STATUSBAR) && \n\t\t\t\t   (this->m_arrUIMap[i].m_wType & CDynamicUpdateUI<T>::UPDUI_STATUSBAR) && \n\t\t\t\t   (this->m_arrUIData[i].m_wState & CDynamicUpdateUI<T>::UPDUI_STATUSBAR))\n\t\t\t\t{\n\t\t\t\t\tthis->UIUpdateStatusBarElement(this->m_arrUIMap[i].m_nID, &this->m_arrUIData[i], this->m_UIElements[e].m_hWnd);\n\t\t\t\t\tthis->m_arrUIData[i].m_wState &= ~CDynamicUpdateUI<T>::UPDUI_STATUSBAR;\n\t\t\t\t\tif(this->m_arrUIData[i].m_wState & CDynamicUpdateUI<T>::UPDUI_TEXT)\n\t\t\t\t\t\tthis->m_arrUIData[i].m_wState &= ~CDynamicUpdateUI<T>::UPDUI_TEXT;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis->m_wDirtyType &= ~CDynamicUpdateUI<T>::UPDUI_STATUSBAR;\n\t\treturn TRUE;\n\t}\n\n\tbool UIAddStatusBar(HWND hWndStatusBar, INT nPanes = 1)\n\t{\n\t\tATLASSERT(::IsWindow(hWndStatusBar));\n\n\t\t// Add StatusBar panes\n\t\tfor (int iPane = 0; iPane < nPanes; iPane++)\n\t\t\tUIAddElement<CDynamicUpdateUI<T>::UPDUI_STATUSBAR>(ID_DEFAULT_PANE + iPane);\n\n\t\treturn (CUpdateUIBase::UIAddStatusBar(hWndStatusBar) != FALSE);\n\t}\n\n// UI Map used if derived class has none\n\tBEGIN_UPDATE_UI_MAP(CAutoUpdateUI)\n\tEND_UPDATE_UI_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CDialogResize - provides support for resizing dialog controls\n//                 (works for any window that has child controls)\n\n// Put CDialogResize in the list of base classes for a dialog (or even plain window),\n// then implement DLGRESIZE map by specifying controls and groups of control\n// and using DLSZ_* values to specify how are they supposed to be resized.\n//\n// Notes:\n// - Resizeable border (WS_THICKFRAME style) should be set in the dialog template\n//   for top level dialogs (popup or overlapped), so that users can resize the dialog.\n// - Some flags cannot be combined; for instance DLSZ_CENTER_X overrides DLSZ_SIZE_X,\n//   DLSZ_SIZE_X overrides DLSZ_MOVE_X. X and Y flags can be combined.\n// - Order of controls is important - group controls are resized and moved based\n//   on the position of the previous control in a group.\n\n// dialog resize map macros\nstruct _AtlDlgResizeMap\n{\n\tint m_nCtlID;\n\tDWORD m_dwResizeFlags;\n};\n\n#define BEGIN_DLGRESIZE_MAP(thisClass) \\\n\tstatic const WTL::_AtlDlgResizeMap* GetDlgResizeMap() \\\n\t{ \\\n\t\tstatic const WTL::_AtlDlgResizeMap theMap[] = \\\n\t\t{\n\n#define END_DLGRESIZE_MAP() \\\n\t\t\t{ -1, 0 }, \\\n\t\t}; \\\n\t\treturn theMap; \\\n\t}\n\n#define DLGRESIZE_CONTROL(id, flags) \\\n\t\t{ id, flags },\n\n#define BEGIN_DLGRESIZE_GROUP() \\\n\t\t{ -1, _DLSZ_BEGIN_GROUP },\n\n#define END_DLGRESIZE_GROUP() \\\n\t\t{ -1, _DLSZ_END_GROUP },\n\n\ntemplate <class T>\nclass CDialogResize\n{\npublic:\n// Data declarations and members\n\tenum\n\t{\n\t\tDLSZ_SIZE_X\t\t= 0x00000001,\n\t\tDLSZ_SIZE_Y\t\t= 0x00000002,\n\t\tDLSZ_MOVE_X\t\t= 0x00000004,\n\t\tDLSZ_MOVE_Y\t\t= 0x00000008,\n\t\tDLSZ_REPAINT\t\t= 0x00000010,\n\t\tDLSZ_CENTER_X\t\t= 0x00000020,\n\t\tDLSZ_CENTER_Y\t\t= 0x00000040,\n\n\t\t// internal use only\n\t\t_DLSZ_BEGIN_GROUP\t= 0x00001000,\n\t\t_DLSZ_END_GROUP\t\t= 0x00002000,\n\t\t_DLSZ_GRIPPER\t\t= 0x00004000\n\t};\n\n\tstruct _AtlDlgResizeData\n\t{\n\t\tint m_nCtlID;\n\t\tDWORD m_dwResizeFlags;\n\t\tRECT m_rect;\n\n\t\tint GetGroupCount() const\n\t\t{\n\t\t\treturn (int)LOBYTE(HIWORD(m_dwResizeFlags));\n\t\t}\n\n\t\tvoid SetGroupCount(int nCount)\n\t\t{\n\t\t\tATLASSERT((nCount > 0) && (nCount < 256));\n\t\t\tDWORD dwCount = (DWORD)MAKELONG(0, MAKEWORD(nCount, 0));\n\t\t\tm_dwResizeFlags &= 0xFF00FFFF;\n\t\t\tm_dwResizeFlags |= dwCount;\n\t\t}\n\n\t\tbool operator ==(const _AtlDlgResizeData& r) const\n\t\t{ return ((m_nCtlID == r.m_nCtlID) && (m_dwResizeFlags == r.m_dwResizeFlags)); }\n\t};\n\n\tATL::CSimpleArray<_AtlDlgResizeData> m_arrData;\n\tSIZE m_sizeDialog;\n\tPOINT m_ptMinTrackSize;\n\tbool m_bGripper;\n\n\n// Constructor\n\tCDialogResize() : m_bGripper(false)\n\t{\n\t\tm_sizeDialog.cx = 0;\n\t\tm_sizeDialog.cy = 0;\n\t\tm_ptMinTrackSize.x = -1;\n\t\tm_ptMinTrackSize.y = -1;\n\t}\n\n// Operations\n\tvoid DlgResize_Init(bool bAddGripper = true, bool bUseMinTrackSize = true, DWORD dwForceStyle = WS_CLIPCHILDREN)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\n\t\tDWORD dwStyle = pT->GetStyle();\n\n#ifdef _DEBUG\n\t\t// Debug only: Check if top level dialogs have a resizeable border.\n\t\tif(((dwStyle & WS_CHILD) == 0) && ((dwStyle & WS_THICKFRAME) == 0))\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"DlgResize_Init - warning: top level dialog without the WS_THICKFRAME style - user cannot resize it\\n\"));\n#endif // _DEBUG\n\n\t\t// Force specified styles (default WS_CLIPCHILDREN reduces flicker)\n\t\tif((dwStyle & dwForceStyle) != dwForceStyle)\n\t\t\tpT->ModifyStyle(0, dwForceStyle);\n\n\t\t// Adding this style removes an empty icon that dialogs with WS_THICKFRAME have.\n\t\t// Setting icon to NULL is required when XP themes are active.\n\t\t// Note: This will not prevent adding an icon for the dialog using SetIcon()\n\t\tif((dwStyle & WS_CHILD) == 0)\n\t\t{\n\t\t\tpT->ModifyStyleEx(0, WS_EX_DLGMODALFRAME);\n\t\t\tif(pT->GetIcon(FALSE) == NULL)\n\t\t\t\tpT->SetIcon(NULL, FALSE);\n\t\t}\n\n\t\t// Cleanup in case of multiple initialization\n\t\t// block: first check for the gripper control, destroy it if needed\n\t\t{\n\t\t\tATL::CWindow wndGripper = pT->GetDlgItem(ATL_IDW_STATUS_BAR);\n\t\t\tif(wndGripper.IsWindow() && (m_arrData.GetSize() > 0) && (m_arrData[0].m_dwResizeFlags & _DLSZ_GRIPPER) != 0)\n\t\t\t\twndGripper.DestroyWindow();\n\t\t}\n\t\t// clear out everything else\n\t\tm_arrData.RemoveAll();\n\t\tm_sizeDialog.cx = 0;\n\t\tm_sizeDialog.cy = 0;\n\t\tm_ptMinTrackSize.x = -1;\n\t\tm_ptMinTrackSize.y = -1;\n\n\t\t// Get initial dialog client size\n\t\tRECT rectDlg = {};\n\t\tpT->GetClientRect(&rectDlg);\n\t\tm_sizeDialog.cx = rectDlg.right;\n\t\tm_sizeDialog.cy = rectDlg.bottom;\n\n\t\t// Create gripper if requested\n\t\tm_bGripper = false;\n\t\tif(bAddGripper)\n\t\t{\n\t\t\t// shouldn't exist already\n\t\t\tATLASSERT(!pT->GetDlgItem(ATL_IDW_STATUS_BAR).IsWindow());\n\t\t\tif(!pT->GetDlgItem(ATL_IDW_STATUS_BAR).IsWindow())\n\t\t\t{\n\t\t\t\tATL::CWindow wndGripper;\n\t\t\t\twndGripper.Create(_T(\"SCROLLBAR\"), pT->m_hWnd, rectDlg, NULL, WS_CHILD | WS_VISIBLE | WS_GROUP | WS_CLIPSIBLINGS | SBS_SIZEBOX | SBS_SIZEGRIP | SBS_SIZEBOXBOTTOMRIGHTALIGN, 0, ATL_IDW_STATUS_BAR);\n\t\t\t\tATLASSERT(wndGripper.IsWindow());\n\t\t\t\tif(wndGripper.IsWindow())\n\t\t\t\t{\n\t\t\t\t\tm_bGripper = true;\n\t\t\t\t\tRECT rectCtl = {};\n\t\t\t\t\twndGripper.GetWindowRect(&rectCtl);\n\t\t\t\t\t::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rectCtl, 2);\n\t\t\t\t\t_AtlDlgResizeData data = { ATL_IDW_STATUS_BAR, DLSZ_MOVE_X | DLSZ_MOVE_Y | DLSZ_REPAINT | _DLSZ_GRIPPER, { rectCtl.left, rectCtl.top, rectCtl.right, rectCtl.bottom } };\n\t\t\t\t\tm_arrData.Add(data);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Get min track position if requested\n\t\tif(bUseMinTrackSize)\n\t\t{\n\t\t\tif((dwStyle & WS_CHILD) != 0)\n\t\t\t{\n\t\t\t\tRECT rect = {};\n\t\t\t\tpT->GetClientRect(&rect);\n\t\t\t\tm_ptMinTrackSize.x = rect.right - rect.left;\n\t\t\t\tm_ptMinTrackSize.y = rect.bottom - rect.top;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tRECT rect = {};\n\t\t\t\tpT->GetWindowRect(&rect);\n\t\t\t\tm_ptMinTrackSize.x = rect.right - rect.left;\n\t\t\t\tm_ptMinTrackSize.y = rect.bottom - rect.top;\n\t\t\t}\n\t\t}\n\n\t\t// Walk the map and initialize data\n\t\tconst _AtlDlgResizeMap* pMap = pT->GetDlgResizeMap();\n\t\tATLASSERT(pMap != NULL);\n\t\tint nGroupStart = -1;\n\t\tfor(int nCount = 1; !((pMap->m_nCtlID == -1) && (pMap->m_dwResizeFlags == 0)); nCount++, pMap++)\n\t\t{\n\t\t\tif(pMap->m_nCtlID == -1)\n\t\t\t{\n\t\t\t\tswitch(pMap->m_dwResizeFlags)\n\t\t\t\t{\n\t\t\t\tcase _DLSZ_BEGIN_GROUP:\n\t\t\t\t\tATLASSERT(nGroupStart == -1);\n\t\t\t\t\tnGroupStart = m_arrData.GetSize();\n\t\t\t\t\tbreak;\n\t\t\t\tcase _DLSZ_END_GROUP:\n\t\t\t\t\t{\n\t\t\t\t\t\tATLASSERT(nGroupStart != -1);\n\t\t\t\t\t\tint nGroupCount = m_arrData.GetSize() - nGroupStart;\n\t\t\t\t\t\tm_arrData[nGroupStart].SetGroupCount(nGroupCount);\n\t\t\t\t\t\tnGroupStart = -1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tATLASSERT(FALSE && _T(\"Invalid DLGRESIZE Map Entry\"));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// this ID conflicts with the default gripper one\n\t\t\t\tATLASSERT(m_bGripper ? (pMap->m_nCtlID != ATL_IDW_STATUS_BAR) : TRUE);\n\n\t\t\t\tATL::CWindow ctl = pT->GetDlgItem(pMap->m_nCtlID);\n\t\t\t\tATLASSERT(ctl.IsWindow());\n\t\t\t\tRECT rectCtl = {};\n\t\t\t\tctl.GetWindowRect(&rectCtl);\n\t\t\t\t::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rectCtl, 2);\n\n\t\t\t\tDWORD dwGroupFlag = ((nGroupStart != -1) && (m_arrData.GetSize() == nGroupStart)) ? _DLSZ_BEGIN_GROUP : 0;\n\t\t\t\t_AtlDlgResizeData data = { pMap->m_nCtlID, pMap->m_dwResizeFlags | dwGroupFlag, { rectCtl.left, rectCtl.top, rectCtl.right, rectCtl.bottom } };\n\t\t\t\tm_arrData.Add(data);\n\t\t\t}\n\t\t}\n\t\tATLASSERT((nGroupStart == -1) && _T(\"No End Group Entry in the DLGRESIZE Map\"));\n\t}\n\n\tvoid DlgResize_UpdateLayout(int cxWidth, int cyHeight)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\n\t\t// Restrict minimum size if requested\n\t\tif(((pT->GetStyle() & WS_CHILD) != 0) && (m_ptMinTrackSize.x != -1) && (m_ptMinTrackSize.y != -1))\n\t\t{\n\t\t\tif(cxWidth < m_ptMinTrackSize.x)\n\t\t\t\tcxWidth = m_ptMinTrackSize.x;\n\t\t\tif(cyHeight < m_ptMinTrackSize.y)\n\t\t\t\tcyHeight = m_ptMinTrackSize.y;\n\t\t}\n\n\t\tBOOL bVisible = pT->IsWindowVisible();\n\t\tif(bVisible)\n\t\t\tpT->SetRedraw(FALSE);\n\n\t\tfor(int i = 0; i < m_arrData.GetSize(); i++)\n\t\t{\n\t\t\tif((m_arrData[i].m_dwResizeFlags & _DLSZ_BEGIN_GROUP) != 0)   // start of a group\n\t\t\t{\n\t\t\t\tint nGroupCount = m_arrData[i].GetGroupCount();\n\t\t\t\tATLASSERT((nGroupCount > 0) && ((i + nGroupCount - 1) < m_arrData.GetSize()));\n\t\t\t\tRECT rectGroup = m_arrData[i].m_rect;\n\n\t\t\t\tint j = 1;\n\t\t\t\tfor(j = 1; j < nGroupCount; j++)\n\t\t\t\t{\n\t\t\t\t\trectGroup.left = __min(rectGroup.left, m_arrData[i + j].m_rect.left);\n\t\t\t\t\trectGroup.top = __min(rectGroup.top, m_arrData[i + j].m_rect.top);\n\t\t\t\t\trectGroup.right = __max(rectGroup.right, m_arrData[i + j].m_rect.right);\n\t\t\t\t\trectGroup.bottom = __max(rectGroup.bottom, m_arrData[i + j].m_rect.bottom);\n\t\t\t\t}\n\n\t\t\t\tfor(j = 0; j < nGroupCount; j++)\n\t\t\t\t{\n\t\t\t\t\t_AtlDlgResizeData* pDataPrev = NULL;\n\t\t\t\t\tif(j > 0)\n\t\t\t\t\t\tpDataPrev = &(m_arrData[i + j - 1]);\n\t\t\t\t\tpT->DlgResize_PositionControl(cxWidth, cyHeight, rectGroup, m_arrData[i + j], true, pDataPrev);\n\t\t\t\t}\n\n\t\t\t\ti += nGroupCount - 1;   // increment to skip all group controls\n\t\t\t}\n\t\t\telse // one control entry\n\t\t\t{\n\t\t\t\tRECT rectGroup = {};\n\t\t\t\tpT->DlgResize_PositionControl(cxWidth, cyHeight, rectGroup, m_arrData[i], false);\n\t\t\t}\n\t\t}\n\n\t\tif(bVisible)\n\t\t\tpT->SetRedraw(TRUE);\n\n\t\tpT->RedrawWindow(NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CDialogResize)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\t\tMESSAGE_HANDLER(WM_GETMINMAXINFO, OnGetMinMaxInfo)\n\tEND_MSG_MAP()\n\n\tLRESULT OnSize(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(m_bGripper)\n\t\t{\n\t\t\tATL::CWindow wndGripper = pT->GetDlgItem(ATL_IDW_STATUS_BAR);\n\t\t\tif(wParam == SIZE_MAXIMIZED)\n\t\t\t\twndGripper.ShowWindow(SW_HIDE);\n\t\t\telse if(wParam == SIZE_RESTORED)\n\t\t\t\twndGripper.ShowWindow(SW_SHOW);\n\t\t}\n\t\tif(wParam != SIZE_MINIMIZED)\n\t\t{\n\t\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\t\tpT->DlgResize_UpdateLayout(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnGetMinMaxInfo(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tif((m_ptMinTrackSize.x != -1) && (m_ptMinTrackSize.y != -1))\n\t\t{\n\t\t\tLPMINMAXINFO lpMMI = (LPMINMAXINFO)lParam;\n\t\t\tlpMMI->ptMinTrackSize =  m_ptMinTrackSize;\n\t\t}\n\t\treturn 0;\n\t}\n\n// Implementation\n\tbool DlgResize_PositionControl(int cxWidth, int cyHeight, RECT& rectGroup, _AtlDlgResizeData& data, bool bGroup, \n\t                               _AtlDlgResizeData* pDataPrev = NULL)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tATL::CWindow ctl;\n\t\tRECT rectCtl = {};\n\n\t\tctl = pT->GetDlgItem(data.m_nCtlID);\n\t\tif(!ctl.GetWindowRect(&rectCtl))\n\t\t\treturn false;\n\t\t::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rectCtl, 2);\n\n\t\tif(bGroup)\n\t\t{\n\t\t\tif((data.m_dwResizeFlags & DLSZ_CENTER_X) != 0)\n\t\t\t{\n\t\t\t\tint cxRight = rectGroup.right + cxWidth - m_sizeDialog.cx;\n\t\t\t\tint cxCtl = data.m_rect.right - data.m_rect.left;\n\t\t\t\trectCtl.left = rectGroup.left + (cxRight - rectGroup.left - cxCtl) / 2;\n\t\t\t\trectCtl.right = rectCtl.left + cxCtl;\n\t\t\t}\n\t\t\telse if((data.m_dwResizeFlags & (DLSZ_SIZE_X | DLSZ_MOVE_X)) != 0)\n\t\t\t{\n\t\t\t\trectCtl.left = rectGroup.left + ::MulDiv(data.m_rect.left - rectGroup.left, rectGroup.right - rectGroup.left + (cxWidth - m_sizeDialog.cx), rectGroup.right - rectGroup.left);\n\n\t\t\t\tif((data.m_dwResizeFlags & DLSZ_SIZE_X) != 0)\n\t\t\t\t{\n\t\t\t\t\trectCtl.right = rectGroup.left + ::MulDiv(data.m_rect.right - rectGroup.left, rectGroup.right - rectGroup.left + (cxWidth - m_sizeDialog.cx), rectGroup.right - rectGroup.left);\n\n\t\t\t\t\tif(pDataPrev != NULL)\n\t\t\t\t\t{\n\t\t\t\t\t\tATL::CWindow ctlPrev = pT->GetDlgItem(pDataPrev->m_nCtlID);\n\t\t\t\t\t\tRECT rcPrev = {};\n\t\t\t\t\t\tctlPrev.GetWindowRect(&rcPrev);\n\t\t\t\t\t\t::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rcPrev, 2);\n\t\t\t\t\t\tint dxAdjust = (rectCtl.left - rcPrev.right) - (data.m_rect.left - pDataPrev->m_rect.right);\n\t\t\t\t\t\trcPrev.right += dxAdjust;\n\t\t\t\t\t\tctlPrev.SetWindowPos(NULL, &rcPrev, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\trectCtl.right = rectCtl.left + (data.m_rect.right - data.m_rect.left);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif((data.m_dwResizeFlags & DLSZ_CENTER_Y) != 0)\n\t\t\t{\n\t\t\t\tint cyBottom = rectGroup.bottom + cyHeight - m_sizeDialog.cy;\n\t\t\t\tint cyCtl = data.m_rect.bottom - data.m_rect.top;\n\t\t\t\trectCtl.top = rectGroup.top + (cyBottom - rectGroup.top - cyCtl) / 2;\n\t\t\t\trectCtl.bottom = rectCtl.top + cyCtl;\n\t\t\t}\n\t\t\telse if((data.m_dwResizeFlags & (DLSZ_SIZE_Y | DLSZ_MOVE_Y)) != 0)\n\t\t\t{\n\t\t\t\trectCtl.top = rectGroup.top + ::MulDiv(data.m_rect.top - rectGroup.top, rectGroup.bottom - rectGroup.top + (cyHeight - m_sizeDialog.cy), rectGroup.bottom - rectGroup.top);\n\n\t\t\t\tif((data.m_dwResizeFlags & DLSZ_SIZE_Y) != 0)\n\t\t\t\t{\n\t\t\t\t\trectCtl.bottom = rectGroup.top + ::MulDiv(data.m_rect.bottom - rectGroup.top, rectGroup.bottom - rectGroup.top + (cyHeight - m_sizeDialog.cy), rectGroup.bottom - rectGroup.top);\n\n\t\t\t\t\tif(pDataPrev != NULL)\n\t\t\t\t\t{\n\t\t\t\t\t\tATL::CWindow ctlPrev = pT->GetDlgItem(pDataPrev->m_nCtlID);\n\t\t\t\t\t\tRECT rcPrev = {};\n\t\t\t\t\t\tctlPrev.GetWindowRect(&rcPrev);\n\t\t\t\t\t\t::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rcPrev, 2);\n\t\t\t\t\t\tint dxAdjust = (rectCtl.top - rcPrev.bottom) - (data.m_rect.top - pDataPrev->m_rect.bottom);\n\t\t\t\t\t\trcPrev.bottom += dxAdjust;\n\t\t\t\t\t\tctlPrev.SetWindowPos(NULL, &rcPrev, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\trectCtl.bottom = rectCtl.top + (data.m_rect.bottom - data.m_rect.top);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse // no group\n\t\t{\n\t\t\tif((data.m_dwResizeFlags & DLSZ_CENTER_X) != 0)\n\t\t\t{\n\t\t\t\tint cxCtl = data.m_rect.right - data.m_rect.left;\n\t\t\t\trectCtl.left = (cxWidth - cxCtl) / 2;\n\t\t\t\trectCtl.right = rectCtl.left + cxCtl;\n\t\t\t}\n\t\t\telse if((data.m_dwResizeFlags & (DLSZ_SIZE_X | DLSZ_MOVE_X)) != 0)\n\t\t\t{\n\t\t\t\trectCtl.right = data.m_rect.right + (cxWidth - m_sizeDialog.cx);\n\n\t\t\t\tif((data.m_dwResizeFlags & DLSZ_MOVE_X) != 0)\n\t\t\t\t\trectCtl.left = rectCtl.right - (data.m_rect.right - data.m_rect.left);\n\t\t\t}\n\n\t\t\tif((data.m_dwResizeFlags & DLSZ_CENTER_Y) != 0)\n\t\t\t{\n\t\t\t\tint cyCtl = data.m_rect.bottom - data.m_rect.top;\n\t\t\t\trectCtl.top = (cyHeight - cyCtl) / 2;\n\t\t\t\trectCtl.bottom = rectCtl.top + cyCtl;\n\t\t\t}\n\t\t\telse if((data.m_dwResizeFlags & (DLSZ_SIZE_Y | DLSZ_MOVE_Y)) != 0)\n\t\t\t{\n\t\t\t\trectCtl.bottom = data.m_rect.bottom + (cyHeight - m_sizeDialog.cy);\n\n\t\t\t\tif((data.m_dwResizeFlags & DLSZ_MOVE_Y) != 0)\n\t\t\t\t\trectCtl.top = rectCtl.bottom - (data.m_rect.bottom - data.m_rect.top);\n\t\t\t}\n\t\t}\n\n\t\tif((data.m_dwResizeFlags & DLSZ_REPAINT) != 0)\n\t\t\tctl.Invalidate();\n\n\t\tif((data.m_dwResizeFlags & (DLSZ_SIZE_X | DLSZ_SIZE_Y | DLSZ_MOVE_X | DLSZ_MOVE_Y | DLSZ_REPAINT | DLSZ_CENTER_X | DLSZ_CENTER_Y)) != 0)\n\t\t\tctl.SetWindowPos(NULL, &rectCtl, SWP_NOZORDER | SWP_NOACTIVATE);\n\n\t\treturn true;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CDynamicDialogLayout - support for dialog dynamic layout resource info\n//                        (AFX_DIALOG_LAYOUT) in VS2015 and higher\n\n#if (_MSC_VER >= 1900)\n\ntemplate<class T>\nclass CDynamicDialogLayout\n{\npublic:\n// Data declarations\n\tstruct _AtlDynamicLayoutData\n\t{\n\t\tHWND m_hWnd;\n\t\tchar m_nMoveRatioX;\n\t\tchar m_nMoveRatioY;\n\t\tchar m_nSizeRatioX;\n\t\tchar m_nSizeRatioY;\n\t\tRECT m_rcInit;\n\t};\n\n// Data members\n\tATL::CSimpleArray<_AtlDynamicLayoutData> m_arrLayoutData;\n\tSIZE m_szParentInit;\n\tPOINT m_ptMinTrackSize;\n\tbool m_bGripper;\n\n// Constructor\n\tCDynamicDialogLayout() : m_bGripper(false)\n\t{\n\t\tm_szParentInit.cx = 0;\n\t\tm_szParentInit.cy = 0;\n\t\tm_ptMinTrackSize.x = -1;\n\t\tm_ptMinTrackSize.y = -1;\n\t}\n\n// Methods\n\tvoid InitDynamicLayout(bool bAddGripper = true, bool bMinTrackSize = true)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\n\t\t// Cleanup in case of multiple initialization\n\t\t// block: first check for the gripper control, destroy it if needed\n\t\t{\n\t\t\tATL::CWindow wndGripper = pT->GetDlgItem(ATL_IDW_STATUS_BAR);\n\t\t\tif(wndGripper.IsWindow() != FALSE)\n\t\t\t\twndGripper.DestroyWindow();\n\t\t}\n\t\t// clear out everything else\n\t\tm_arrLayoutData.RemoveAll();\n\t\tm_ptMinTrackSize.x = -1;\n\t\tm_ptMinTrackSize.y = -1;\n\t\tm_szParentInit.cx = 0;\n\t\tm_szParentInit.cy = 0;\n\t\tm_bGripper = false;\n\n\t\tCResource rcLayout;\n\t\tif(rcLayout.Load(_T(\"AFX_DIALOG_LAYOUT\"), pT->IDD))\n\t\t{\n\t\t\tint nCount = rcLayout.GetSize() / sizeof(WORD);\n\t\t\tif(nCount > 1)\n\t\t\t{\n\t\t\t\tRECT rcParent = {};\n\t\t\t\tpT->GetWindowRect(&rcParent);\n\t\t\t\tm_szParentInit.cx = rcParent.right - rcParent.left;\n\t\t\t\tm_szParentInit.cy = rcParent.bottom - rcParent.top;\n\n\t\t\t\tWORD* pnData = (WORD*)rcLayout.Lock();\n\t\t\t\tWORD wVersion = *pnData;   // AFX_DIALOG_LAYOUT version\n\t\t\t\tATLASSERT(wVersion == 0);\n\t\t\t\tif(wVersion == 0)\n\t\t\t\t{\n\t\t\t\t\tpnData++;   // skip version\n\t\t\t\t\tATL::CWindow wndChild = pT->GetWindow(GW_CHILD);\n\t\t\t\t\tfor(int i = 0; (i < nCount) && (wndChild.m_hWnd != NULL); i += 4)\n\t\t\t\t\t{\n\t\t\t\t\t\tchar nMoveRatioX = _GetDataPct(pnData[i]);\n\t\t\t\t\t\tchar nMoveRatioY = _GetDataPct(pnData[i + 1]);\n\t\t\t\t\t\tchar nSizeRatioX = _GetDataPct(pnData[i + 2]);\n\t\t\t\t\t\tchar nSizeRatioY = _GetDataPct(pnData[i + 3]);\n\n\t\t\t\t\t\tbool bValid = ((nMoveRatioX != -1) && (nMoveRatioY != -1) && (nSizeRatioX != -1) && (nSizeRatioY != -1));\n\t\t\t\t\t\tbool bAction = ((nMoveRatioX != 0) || (nMoveRatioY != 0) || (nSizeRatioX != 0) || (nSizeRatioY != 0));\n\t\t\t\t\t\tif(bValid && bAction)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_AtlDynamicLayoutData LayoutData = { wndChild.m_hWnd, nMoveRatioX, nMoveRatioY, nSizeRatioX, nSizeRatioY };\n\t\t\t\t\t\t\twndChild.GetWindowRect(&LayoutData.m_rcInit);\n\t\t\t\t\t\t\tpT->ScreenToClient(&LayoutData.m_rcInit);\n\t\t\t\t\t\t\tm_arrLayoutData.Add(LayoutData);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twndChild = wndChild.GetWindow(GW_HWNDNEXT);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\trcLayout.Release();\n\t\t\t}\n\t\t}\n\n\t\tif(bAddGripper)\n\t\t{\n\t\t\tRECT rcDialog = {};\n\t\t\tpT->GetClientRect(&rcDialog);\n\n\t\t\tATL::CWindow wndGripper = pT->GetDlgItem(ATL_IDW_STATUS_BAR);\n\t\t\tif(wndGripper.m_hWnd != NULL)\n\t\t\t\twndGripper.DestroyWindow();\n\n\t\t\twndGripper.Create(_T(\"SCROLLBAR\"), pT->m_hWnd, rcDialog, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | SBS_SIZEBOX | SBS_SIZEGRIP | SBS_SIZEBOXBOTTOMRIGHTALIGN, 0, ATL_IDW_STATUS_BAR);\n\t\t\tATLASSERT(wndGripper.m_hWnd != NULL);\n\t\t\tif(wndGripper.m_hWnd != NULL)\n\t\t\t{\n\t\t\t\tm_bGripper = true;\n\t\t\t\t_AtlDynamicLayoutData LayoutData = { wndGripper.m_hWnd, 100, 100, 0, 0 };\n\t\t\t\twndGripper.GetWindowRect(&LayoutData.m_rcInit);\n\t\t\t\tpT->ScreenToClient(&LayoutData.m_rcInit);\n\t\t\t\tm_arrLayoutData.Add(LayoutData);\n\t\t\t}\n\t\t}\n\n\t\tif(bMinTrackSize)\n\t\t{\n\t\t\tRECT rcMinTrack = {};\n\t\t\tif((pT->GetStyle() & WS_CHILD) != 0)\n\t\t\t\tpT->GetClientRect(&rcMinTrack);\n\t\t\telse\n\t\t\t\tpT->GetWindowRect(&rcMinTrack);\n\n\t\t\tm_ptMinTrackSize.x = rcMinTrack.right - rcMinTrack.left;\n\t\t\tm_ptMinTrackSize.y = rcMinTrack.bottom - rcMinTrack.top;\n\t\t}\n\t}\n\n\tvoid UpdateDynamicLayout()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\n\t\tint nCount = m_arrLayoutData.GetSize();\n\t\tif(nCount == 0)\n\t\t\treturn;\n\n\t\tRECT rcParent = {};\n\t\tpT->GetWindowRect(&rcParent);\n\n\t\tint nDeltaWidth = rcParent.right - rcParent.left - m_szParentInit.cx;\n\t\tint nDeltaHeight = rcParent.bottom - rcParent.top - m_szParentInit.cy;\n\n\t\tHDWP hDwp = ::BeginDeferWindowPos(nCount);\n\n\t\tfor(int i = 0; i < nCount; i++)\n\t\t{\n\t\t\t_AtlDynamicLayoutData& LayoutData = m_arrLayoutData[i];\n\n\t\t\tATLASSERT(::IsWindow(LayoutData.m_hWnd) != FALSE);\n\n\t\t\tint nID = ::GetDlgCtrlID(LayoutData.m_hWnd);\n\t\t\tUINT nFlags = (SWP_NOMOVE | SWP_NOSIZE);\n\t\t\tRECT rcItem = LayoutData.m_rcInit;\n\n\t\t\tif(((nID == ATL_IDW_STATUS_BAR) || (nDeltaWidth >= 0)) && (LayoutData.m_nMoveRatioX != 0))\n\t\t\t{\n\t\t\t\trcItem.left += ::MulDiv(nDeltaWidth, LayoutData.m_nMoveRatioX, 100);\n\t\t\t\trcItem.right += ::MulDiv(nDeltaWidth, LayoutData.m_nMoveRatioX, 100);\n\t\t\t\tnFlags &= ~SWP_NOMOVE;\n\t\t\t}\n\n\t\t\tif(((nID == ATL_IDW_STATUS_BAR) || (nDeltaHeight >= 0)) && (LayoutData.m_nMoveRatioY != 0))\n\t\t\t{\n\t\t\t\trcItem.top += ::MulDiv(nDeltaHeight, LayoutData.m_nMoveRatioY, 100);\n\t\t\t\trcItem.bottom += ::MulDiv(nDeltaHeight, LayoutData.m_nMoveRatioY, 100);\n\t\t\t\tnFlags &= ~SWP_NOMOVE;\n\t\t\t}\n\n\t\t\tif((nDeltaWidth >= 0) && (LayoutData.m_nSizeRatioX != 0))\n\t\t\t{\n\t\t\t\trcItem.right += ::MulDiv(nDeltaWidth, LayoutData.m_nSizeRatioX, 100);\n\t\t\t\tnFlags &= ~SWP_NOSIZE;\n\t\t\t}\n\n\t\t\tif((nDeltaHeight >= 0) && (LayoutData.m_nSizeRatioY != 0))\n\t\t\t{\n\t\t\t\trcItem.bottom += ::MulDiv(nDeltaHeight, LayoutData.m_nSizeRatioY, 100);\n\t\t\t\tnFlags &= ~SWP_NOSIZE;\n\t\t\t}\n\n\t\t\tif(nFlags != (SWP_NOMOVE | SWP_NOSIZE))\n\t\t\t\t::DeferWindowPos(hDwp, LayoutData.m_hWnd, NULL, rcItem.left, rcItem.top, rcItem.right - rcItem.left, rcItem.bottom - rcItem.top, nFlags | SWP_NOZORDER | SWP_NOREPOSITION | SWP_NOACTIVATE | SWP_NOCOPYBITS);\n\t\t}\n\n\t\t::EndDeferWindowPos(hDwp);\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CDynamicDialogLayout)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\t\tMESSAGE_HANDLER(WM_GETMINMAXINFO, OnGetMinMaxInfo)\n\tEND_MSG_MAP()\n\n\tLRESULT OnSize(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tif(m_bGripper)\n\t\t{\n\t\t\tATL::CWindow wndGripper = pT->GetDlgItem(ATL_IDW_STATUS_BAR);\n\t\t\tif(wndGripper.m_hWnd != NULL)\n\t\t\t{\n\t\t\t\tif(wParam == SIZE_MAXIMIZED)\n\t\t\t\t\twndGripper.ShowWindow(SW_HIDE);\n\t\t\t\telse if(wParam == SIZE_RESTORED)\n\t\t\t\t\twndGripper.ShowWindow(SW_SHOW);\n\t\t\t}\n\t\t}\n\n\t\tif(wParam != SIZE_MINIMIZED)\n\t\t\tpT->UpdateDynamicLayout();\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnGetMinMaxInfo(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tif((m_ptMinTrackSize.x != -1) && (m_ptMinTrackSize.y != -1))\n\t\t{\n\t\t\tLPMINMAXINFO lpMMI = (LPMINMAXINFO)lParam;\n\t\t\tlpMMI->ptMinTrackSize =  m_ptMinTrackSize;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n// Implementation\n\tchar _GetDataPct(WORD wResData)\n\t{\n\t\tATLASSERT((wResData >= 0) && (wResData <= 100));\n\t\tchar nPct = (char)LOBYTE(wResData);\n\t\tif((nPct < 0) || (nPct > 100))\n\t\t\tnPct = -1;\n\n\t\treturn nPct;\n\t}\n};\n\n#endif // (_MSC_VER >= 1900)\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CDoubleBufferImpl - Provides double-buffer painting support to any window\n\ntemplate <class T>\nclass CDoubleBufferImpl\n{\npublic:\n// Overrideables\n\tvoid DoPaint(CDCHandle /*dc*/)\n\t{\n\t\t// must be implemented in a derived class\n\t\tATLASSERT(FALSE);\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CDoubleBufferImpl)\n\t\tMESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\n\t\tMESSAGE_HANDLER(WM_PAINT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\n\tEND_MSG_MAP()\n\n\tLRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn 1;   // no background painting needed\n\t}\n\n\tLRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\n\t\tif(wParam != NULL)\n\t\t{\n\t\t\tRECT rect = {};\n\t\t\tpT->GetClientRect(&rect);\n\t\t\tCMemoryDC dcMem((HDC)wParam, rect);\n\t\t\tpT->DoPaint(dcMem.m_hDC);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCPaintDC dc(pT->m_hWnd);\n\t\t\tCMemoryDC dcMem(dc.m_hDC, dc.m_ps.rcPaint);\n\t\t\tpT->DoPaint(dcMem.m_hDC);\n\t\t}\n\n\t\treturn 0;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CDoubleBufferWindowImpl - Implements a double-buffer painting window\n\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CDoubleBufferWindowImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >, public CDoubleBufferImpl< T >\n{\npublic:\n\tBEGIN_MSG_MAP(CDoubleBufferWindowImpl)\n\t\tCHAIN_MSG_MAP(CDoubleBufferImpl< T >)\n\tEND_MSG_MAP()\n};\n\n\n// command bar support\n#if !defined(__ATLCTRLW_H__)\n  #undef CBRM_GETMENU\n  #undef CBRM_TRACKPOPUPMENU\n  #undef CBRM_GETCMDBAR\n  #undef CBRPOPUPMENU\n#endif // !defined(__ATLCTRLW_H__)\n\n} // namespace WTL\n\n#endif // __ATLFRAME_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlgdi.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLGDI_H__\n#define __ATLGDI_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atlgdi.h requires atlapp.h to be included first\n#endif\n\n\n// protect template members from windowsx.h macros\n#ifdef _INC_WINDOWSX\n  #undef CopyRgn\n  #undef CreateBrush\n  #undef CreatePen\n  #undef SelectBrush\n  #undef SelectPen\n  #undef SelectFont\n  #undef SelectBitmap\n#endif // _INC_WINDOWSX\n\n// required libraries\n#pragma comment(lib, \"msimg32.lib\")\n#if !defined(_ATL_NO_OPENGL)\n  #pragma comment(lib, \"opengl32.lib\")\n#endif\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CPenT<t_bManaged>\n// CBrushT<t_bManaged>\n// CLogFont\n// CFontT<t_bManaged>\n// CBitmapT<t_bManaged>\n// CPaletteT<t_bManaged>\n// CRgnT<t_bManaged>\n// CDCT<t_bManaged>\n// CPaintDC\n// CClientDC\n// CWindowDC\n// CMemoryDC\n// CEnhMetaFileInfo\n// CEnhMetaFileT<t_bManaged>\n// CEnhMetaFileDC\n\n\nnamespace WTL\n{\n\n///////////////////////////////////////////////////////////////////////////////\n// Bitmap resource helpers to extract bitmap information for a bitmap resource\n\ninline LPBITMAPINFOHEADER AtlGetBitmapResourceInfo(HMODULE hModule, ATL::_U_STRINGorID image)\n{\n\tHRSRC hResource = ::FindResource(hModule, image.m_lpstr, RT_BITMAP);\n\tATLASSERT(hResource != NULL);\n\tHGLOBAL hGlobal = ::LoadResource(hModule, hResource);\n\tATLASSERT(hGlobal != NULL);\n\tLPBITMAPINFOHEADER pBitmapInfoHeader = (LPBITMAPINFOHEADER)::LockResource(hGlobal);\n\tATLASSERT(pBitmapInfoHeader != NULL);\n\treturn pBitmapInfoHeader;\n}\n\ninline WORD AtlGetBitmapResourceBitsPerPixel(HMODULE hModule, ATL::_U_STRINGorID image)\n{\n\tLPBITMAPINFOHEADER pBitmapInfoHeader = AtlGetBitmapResourceInfo(hModule, image);\n\tATLASSERT(pBitmapInfoHeader != NULL);\n\treturn pBitmapInfoHeader->biBitCount;\n}\n\ninline WORD AtlGetBitmapResourceBitsPerPixel(ATL::_U_STRINGorID image)\n{\n\treturn AtlGetBitmapResourceBitsPerPixel(ModuleHelper::GetResourceInstance(), image);\n}\n\n///////////////////////////////////////////////////////////////////////////////\n// 32-bit (alpha channel) bitmap resource helper\n\n// Note: 32-bit (alpha channel) images work only on Windows XP with Common Controls version 6.\n// If you want your app to work on older version of Windows, load non-alpha images if Common\n// Controls version is less than 6.\n\ninline bool AtlIsAlphaBitmapResource(ATL::_U_STRINGorID image)\n{\n\treturn (AtlGetBitmapResourceBitsPerPixel(image) == 32);\n}\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CPen\n\ntemplate <bool t_bManaged>\nclass CPenT\n{\npublic:\n// Data members\n\tHPEN m_hPen;\n\n// Constructor/destructor/operators\n\tCPenT(HPEN hPen = NULL) : m_hPen(hPen)\n\t{ }\n\n\t~CPenT()\n\t{\n\t\tif(t_bManaged && (m_hPen != NULL))\n\t\t\tDeleteObject();\n\t}\n\n\tCPenT<t_bManaged>& operator =(HPEN hPen)\n\t{\n\t\tAttach(hPen);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HPEN hPen)\n\t{\n\t\tif(t_bManaged && (m_hPen != NULL) && (m_hPen != hPen))\n\t\t\t::DeleteObject(m_hPen);\n\t\tm_hPen = hPen;\n\t}\n\n\tHPEN Detach()\n\t{\n\t\tHPEN hPen = m_hPen;\n\t\tm_hPen = NULL;\n\t\treturn hPen;\n\t}\n\n\toperator HPEN() const { return m_hPen; }\n\n\tbool IsNull() const { return (m_hPen == NULL); }\n\n// Create methods\n\tHPEN CreatePen(int nPenStyle, int nWidth, COLORREF crColor)\n\t{\n\t\tATLASSERT(m_hPen == NULL);\n\t\tm_hPen = ::CreatePen(nPenStyle, nWidth, crColor);\n\t\treturn m_hPen;\n\t}\n\n\tHPEN CreatePen(int nPenStyle, int nWidth, const LOGBRUSH* pLogBrush, int nStyleCount = 0, const DWORD* lpStyle = NULL)\n\t{\n\t\tATLASSERT(m_hPen == NULL);\n\t\tm_hPen = ::ExtCreatePen(nPenStyle, nWidth, pLogBrush, nStyleCount, lpStyle);\n\t\treturn m_hPen;\n\t}\n\n\tHPEN CreatePenIndirect(LPLOGPEN lpLogPen)\n\t{\n\t\tATLASSERT(m_hPen == NULL);\n\t\tm_hPen = ::CreatePenIndirect(lpLogPen);\n\t\treturn m_hPen;\n\t}\n\n\tBOOL DeleteObject()\n\t{\n\t\tATLASSERT(m_hPen != NULL);\n\t\tBOOL bRet = ::DeleteObject(m_hPen);\n\t\tif(bRet)\n\t\t\tm_hPen = NULL;\n\t\treturn bRet;\n\t}\n\n// Attributes\n\tint GetLogPen(LOGPEN* pLogPen) const\n\t{\n\t\tATLASSERT(m_hPen != NULL);\n\t\treturn ::GetObject(m_hPen, sizeof(LOGPEN), pLogPen);\n\t}\n\n\tbool GetLogPen(LOGPEN& LogPen) const\n\t{\n\t\tATLASSERT(m_hPen != NULL);\n\t\treturn (::GetObject(m_hPen, sizeof(LOGPEN), &LogPen) == sizeof(LOGPEN));\n\t}\n\n\tint GetExtLogPen(EXTLOGPEN* pLogPen, int nSize = sizeof(EXTLOGPEN)) const\n\t{\n\t\tATLASSERT(m_hPen != NULL);\n\t\treturn ::GetObject(m_hPen, nSize, pLogPen);\n\t}\n\n\tbool GetExtLogPen(EXTLOGPEN& ExtLogPen, int nSize = sizeof(EXTLOGPEN)) const\n\t{\n\t\tATLASSERT(m_hPen != NULL);\n\t\tint nRet = ::GetObject(m_hPen, nSize, &ExtLogPen);\n\t\treturn ((nRet > 0) && (nRet <= nSize));\n\t}\n};\n\ntypedef CPenT<false>   CPenHandle;\ntypedef CPenT<true>    CPen;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CBrush\n\ntemplate <bool t_bManaged>\nclass CBrushT\n{\npublic:\n// Data members\n\tHBRUSH m_hBrush;\n\n// Constructor/destructor/operators\n\tCBrushT(HBRUSH hBrush = NULL) : m_hBrush(hBrush)\n\t{ }\n\n\t~CBrushT()\n\t{\n\t\tif(t_bManaged && (m_hBrush != NULL))\n\t\t\tDeleteObject();\n\t}\n\n\tCBrushT<t_bManaged>& operator =(HBRUSH hBrush)\n\t{\n\t\tAttach(hBrush);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HBRUSH hBrush)\n\t{\n\t\tif(t_bManaged && (m_hBrush != NULL) && (m_hBrush != hBrush))\n\t\t\t::DeleteObject(m_hBrush);\n\t\tm_hBrush = hBrush;\n\t}\n\n\tHBRUSH Detach()\n\t{\n\t\tHBRUSH hBrush = m_hBrush;\n\t\tm_hBrush = NULL;\n\t\treturn hBrush;\n\t}\n\n\toperator HBRUSH() const { return m_hBrush; }\n\n\tbool IsNull() const { return (m_hBrush == NULL); }\n\n// Create methods\n\tHBRUSH CreateSolidBrush(COLORREF crColor)\n\t{\n\t\tATLASSERT(m_hBrush == NULL);\n\t\tm_hBrush = ::CreateSolidBrush(crColor);\n\t\treturn m_hBrush;\n\t}\n\n\tHBRUSH CreateHatchBrush(int nIndex, COLORREF crColor)\n\t{\n\t\tATLASSERT(m_hBrush == NULL);\n\t\tm_hBrush = ::CreateHatchBrush(nIndex, crColor);\n\t\treturn m_hBrush;\n\t}\n\n\tHBRUSH CreateBrushIndirect(const LOGBRUSH* lpLogBrush)\n\t{\n\t\tATLASSERT(m_hBrush == NULL);\n\t\tm_hBrush = ::CreateBrushIndirect(lpLogBrush);\n\t\treturn m_hBrush;\n\t}\n\n\tHBRUSH CreatePatternBrush(HBITMAP hBitmap)\n\t{\n\t\tATLASSERT(m_hBrush == NULL);\n\t\tm_hBrush = ::CreatePatternBrush(hBitmap);\n\t\treturn m_hBrush;\n\t}\n\n\tHBRUSH CreateDIBPatternBrush(HGLOBAL hPackedDIB, UINT nUsage)\n\t{\n\t\tATLASSERT(hPackedDIB != NULL);\n\t\tconst void* lpPackedDIB = GlobalLock(hPackedDIB);\n\t\tATLASSERT(lpPackedDIB != NULL);\n\t\tm_hBrush = ::CreateDIBPatternBrushPt(lpPackedDIB, nUsage);\n\t\tGlobalUnlock(hPackedDIB);\n\t\treturn m_hBrush;\n\t}\n\n\tHBRUSH CreateDIBPatternBrush(const void* lpPackedDIB, UINT nUsage)\n\t{\n\t\tATLASSERT(m_hBrush == NULL);\n\t\tm_hBrush = ::CreateDIBPatternBrushPt(lpPackedDIB, nUsage);\n\t\treturn m_hBrush;\n\t}\n\n\tHBRUSH CreateSysColorBrush(int nIndex)\n\t{\n\t\tATLASSERT(m_hBrush == NULL);\n\t\tm_hBrush = ::GetSysColorBrush(nIndex);\n\t\treturn m_hBrush;\n\t}\n\n\tBOOL DeleteObject()\n\t{\n\t\tATLASSERT(m_hBrush != NULL);\n\t\tBOOL bRet = ::DeleteObject(m_hBrush);\n\t\tif(bRet)\n\t\t\tm_hBrush = NULL;\n\t\treturn bRet;\n\t}\n\n// Attributes\n\tint GetLogBrush(LOGBRUSH* pLogBrush) const\n\t{\n\t\tATLASSERT(m_hBrush != NULL);\n\t\treturn ::GetObject(m_hBrush, sizeof(LOGBRUSH), pLogBrush);\n\t}\n\n\tbool GetLogBrush(LOGBRUSH& LogBrush) const\n\t{\n\t\tATLASSERT(m_hBrush != NULL);\n\t\treturn (::GetObject(m_hBrush, sizeof(LOGBRUSH), &LogBrush) == sizeof(LOGBRUSH));\n\t}\n};\n\ntypedef CBrushT<false>   CBrushHandle;\ntypedef CBrushT<true>    CBrush;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CFont\n\nclass CLogFont : public LOGFONT\n{\npublic:\n\tCLogFont()\n\t{\n\t\tmemset(this, 0, sizeof(LOGFONT));\n\t}\n\n\tCLogFont(const LOGFONT& lf)\n\t{\n\t\tCopy(&lf);\n\t}\n\n\tCLogFont(HFONT hFont)\n\t{\n\t\tATLASSERT(::GetObjectType(hFont) == OBJ_FONT);\n\t\t::GetObject(hFont, sizeof(LOGFONT), (LOGFONT*)this);\n\t}\n\n\tHFONT CreateFontIndirect()\n\t{\n\t\treturn ::CreateFontIndirect(this);\n\t}\n\n\tvoid SetBold()\n\t{\n\t\tlfWeight = FW_BOLD;\n\t}\n\n\tbool IsBold() const\n\t{\n\t\treturn (lfWeight >= FW_BOLD);\n\t}\n\n\tvoid MakeBolder(int iScale = 1)\n\t{\n\t\tlfWeight += FW_BOLD * iScale;\n\t}\n\n\tvoid MakeLarger(int iScale)\n\t{\n\t\tif(lfHeight > 0)\n\t\t\tlfHeight += iScale;\n\t\telse\n\t\t\tlfHeight -= iScale;\n\t}\n\n\tvoid SetHeight(LONG nPointSize, HDC hDC = NULL)\n\t{\n\t\tHDC hDC1 = (hDC != NULL) ? hDC : ::GetDC(NULL);\n\t\t// For MM_TEXT mapping mode\n\t\tlfHeight = -::MulDiv(nPointSize, ::GetDeviceCaps(hDC1, LOGPIXELSY), 72);\n\t\tif(hDC == NULL)\n\t\t\t::ReleaseDC(NULL, hDC1);\n\t}\n\n\tLONG GetHeight(HDC hDC = NULL) const\n\t{\n\t\tHDC hDC1 = (hDC != NULL) ? hDC : ::GetDC(NULL);\n\t\t// For MM_TEXT mapping mode\n\t\tLONG nPointSize = ::MulDiv(-lfHeight, 72, ::GetDeviceCaps(hDC1, LOGPIXELSY));\n\t\tif(hDC == NULL)\n\t\t\t::ReleaseDC(NULL, hDC1);\n\n\t\treturn nPointSize;\n\t}\n\n\tLONG GetDeciPointHeight(HDC hDC = NULL) const\n\t{\n\t\tHDC hDC1 = (hDC != NULL) ? hDC : ::GetDC(NULL);\n\t\tPOINT ptOrg = { 0, 0 };\n\t\t::DPtoLP(hDC1, &ptOrg, 1);\n\t\tPOINT pt = { 0, 0 };\n\t\tpt.y = abs(lfHeight) + ptOrg.y;\n\t\t::LPtoDP(hDC1, &pt, 1);\n\t\tLONG nDeciPoint = ::MulDiv(pt.y, 720, ::GetDeviceCaps(hDC1, LOGPIXELSY));   // 72 points/inch, 10 decipoints/point\n\t\tif(hDC == NULL)\n\t\t\t::ReleaseDC(NULL, hDC1);\n\n\t\treturn nDeciPoint;\n\t}\n\n\tvoid SetHeightFromDeciPoint(LONG nDeciPtHeight, HDC hDC = NULL)\n\t{\n\t\tHDC hDC1 = (hDC != NULL) ? hDC : ::GetDC(NULL);\n\t\tPOINT pt = { 0, 0 };\n\t\tpt.y = ::MulDiv(::GetDeviceCaps(hDC1, LOGPIXELSY), nDeciPtHeight, 720);   // 72 points/inch, 10 decipoints/point\n\t\t::DPtoLP(hDC1, &pt, 1);\n\t\tPOINT ptOrg = { 0, 0 };\n\t\t::DPtoLP(hDC1, &ptOrg, 1);\n\t\tlfHeight = -abs(pt.y - ptOrg.y);\n\t\tif(hDC == NULL)\n\t\t\t::ReleaseDC(NULL, hDC1);\n\t}\n\n\tvoid SetCaptionFont()\n\t{\n\t\tNONCLIENTMETRICS ncm = { RunTimeHelper::SizeOf_NONCLIENTMETRICS() };\n\t\tATLVERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0));\n\t\tCopy(&ncm.lfCaptionFont);\n\t}\n\n\tvoid SetMenuFont()\n\t{\n\t\tNONCLIENTMETRICS ncm = { RunTimeHelper::SizeOf_NONCLIENTMETRICS() };\n\t\tATLVERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0));\n\t\tCopy(&ncm.lfMenuFont);\n\t}\n\n\tvoid SetStatusFont()\n\t{\n\t\tNONCLIENTMETRICS ncm = { RunTimeHelper::SizeOf_NONCLIENTMETRICS() };\n\t\tATLVERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0));\n\t\tCopy(&ncm.lfStatusFont);\n\t}\n\n\tvoid SetMessageBoxFont()\n\t{\n\t\tNONCLIENTMETRICS ncm = { RunTimeHelper::SizeOf_NONCLIENTMETRICS() };\n\t\tATLVERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0));\n\t\tCopy(&ncm.lfMessageFont);\n\t}\n\n\tvoid Copy(const LOGFONT* pLogFont)\n\t{\n\t\tATLASSERT(pLogFont != NULL);\n\t\t*(LOGFONT*)this = *pLogFont;\n\t}\n\n\tCLogFont& operator =(const CLogFont& src)\n\t{\n\t\tCopy(&src);\n\t\treturn *this;\n\t}\n\n\tCLogFont& operator =(const LOGFONT& src)\n\t{\n\t\tCopy(&src);\n\t\treturn *this;\n\t}\n\n\tCLogFont& operator =(HFONT hFont)\n\t{\n\t\tATLASSERT(::GetObjectType(hFont) == OBJ_FONT);\n\t\t::GetObject(hFont, sizeof(LOGFONT), (LOGFONT*)this);\n\t\treturn *this;\n\t}\n\n\tbool operator ==(const LOGFONT& logfont) const\n\t{\n\t\treturn((logfont.lfHeight == lfHeight) &&\n\t\t       (logfont.lfWidth == lfWidth) &&\n\t\t       (logfont.lfEscapement == lfEscapement) &&\n\t\t       (logfont.lfOrientation == lfOrientation) &&\n\t\t       (logfont.lfWeight == lfWeight) &&\n\t\t       (logfont.lfItalic == lfItalic) &&\n\t\t       (logfont.lfUnderline == lfUnderline) &&\n\t\t       (logfont.lfStrikeOut == lfStrikeOut) &&\n\t\t       (logfont.lfCharSet == lfCharSet) &&\n\t\t       (logfont.lfOutPrecision == lfOutPrecision) &&\n\t\t       (logfont.lfClipPrecision == lfClipPrecision) &&\n\t\t       (logfont.lfQuality == lfQuality) &&\n\t\t       (logfont.lfPitchAndFamily == lfPitchAndFamily) &&\n\t\t       (lstrcmp(logfont.lfFaceName, lfFaceName) == 0));\n\t}\n};\n\n\ntemplate <bool t_bManaged>\nclass CFontT\n{\npublic:\n// Data members\n\tHFONT m_hFont;\n\n// Constructor/destructor/operators\n\tCFontT(HFONT hFont = NULL) : m_hFont(hFont)\n\t{ }\n\n\t~CFontT()\n\t{\n\t\tif(t_bManaged && (m_hFont != NULL))\n\t\t\tDeleteObject();\n\t}\n\n\tCFontT<t_bManaged>& operator =(HFONT hFont)\n\t{\n\t\tAttach(hFont);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HFONT hFont)\n\t{\n\t\tif(t_bManaged && (m_hFont != NULL) && (m_hFont != hFont))\n\t\t\t::DeleteObject(m_hFont);\n\t\tm_hFont = hFont;\n\t}\n\n\tHFONT Detach()\n\t{\n\t\tHFONT hFont = m_hFont;\n\t\tm_hFont = NULL;\n\t\treturn hFont;\n\t}\n\n\toperator HFONT() const { return m_hFont; }\n\n\tbool IsNull() const { return (m_hFont == NULL); }\n\n// Create methods\n\tHFONT CreateFontIndirect(const LOGFONT* lpLogFont)\n\t{\n\t\tATLASSERT(m_hFont == NULL);\n\t\tm_hFont = ::CreateFontIndirect(lpLogFont);\n\t\treturn m_hFont;\n\t}\n\n\tHFONT CreateFontIndirectEx(CONST ENUMLOGFONTEXDV* penumlfex)\n\t{\n\t\tATLASSERT(m_hFont == NULL);\n\t\tm_hFont = ::CreateFontIndirectEx(penumlfex);\n\t\treturn m_hFont;\n\t}\n\n\tHFONT CreateFont(int nHeight, int nWidth, int nEscapement,\n\t\t\tint nOrientation, int nWeight, BYTE bItalic, BYTE bUnderline,\n\t\t\tBYTE cStrikeOut, BYTE nCharSet, BYTE nOutPrecision,\n\t\t\tBYTE nClipPrecision, BYTE nQuality, BYTE nPitchAndFamily,\n\t\t\tLPCTSTR lpszFacename)\n\t{\n\t\tATLASSERT(m_hFont == NULL);\n\t\tm_hFont = ::CreateFont(nHeight, nWidth, nEscapement,\n\t\t\tnOrientation, nWeight, bItalic, bUnderline, cStrikeOut,\n\t\t\tnCharSet, nOutPrecision, nClipPrecision, nQuality,\n\t\t\tnPitchAndFamily, lpszFacename);\n\t\treturn m_hFont;\n\t}\n\n\tHFONT CreatePointFont(int nPointSize, LPCTSTR lpszFaceName, HDC hDC = NULL, bool bBold = false, bool bItalic = false)\n\t{\n\t\tLOGFONT logFont = {};\n\t\tlogFont.lfCharSet = DEFAULT_CHARSET;\n\t\tlogFont.lfHeight = nPointSize;\n\t\tATL::Checked::tcsncpy_s(logFont.lfFaceName, _countof(logFont.lfFaceName), lpszFaceName, _TRUNCATE);\n\n\t\tif(bBold)\n\t\t\tlogFont.lfWeight = FW_BOLD;\n\t\tif(bItalic)\n\t\t\tlogFont.lfItalic = (BYTE)TRUE;\n\n\t\treturn CreatePointFontIndirect(&logFont, hDC);\n\t}\n\n\tHFONT CreatePointFontIndirect(const LOGFONT* lpLogFont, HDC hDC = NULL)\n\t{\n\t\tHDC hDC1 = (hDC != NULL) ? hDC : ::GetDC(NULL);\n\n\t\t// convert nPointSize to logical units based on hDC\n\t\tLOGFONT logFont = *lpLogFont;\n\t\tPOINT pt = { 0, 0 };\n\t\tpt.y = ::MulDiv(::GetDeviceCaps(hDC1, LOGPIXELSY), logFont.lfHeight, 720);   // 72 points/inch, 10 decipoints/point\n\t\t::DPtoLP(hDC1, &pt, 1);\n\t\tPOINT ptOrg = { 0, 0 };\n\t\t::DPtoLP(hDC1, &ptOrg, 1);\n\t\tlogFont.lfHeight = -abs(pt.y - ptOrg.y);\n\n\t\tif(hDC == NULL)\n\t\t\t::ReleaseDC(NULL, hDC1);\n\n\t\treturn CreateFontIndirect(&logFont);\n\t}\n\n\tBOOL DeleteObject()\n\t{\n\t\tATLASSERT(m_hFont != NULL);\n\t\tBOOL bRet = ::DeleteObject(m_hFont);\n\t\tif(bRet)\n\t\t\tm_hFont = NULL;\n\t\treturn bRet;\n\t}\n\n// Attributes\n\tint GetLogFont(LOGFONT* pLogFont) const\n\t{\n\t\tATLASSERT(m_hFont != NULL);\n\t\treturn ::GetObject(m_hFont, sizeof(LOGFONT), pLogFont);\n\t}\n\n\tbool GetLogFont(LOGFONT& LogFont) const\n\t{\n\t\tATLASSERT(m_hFont != NULL);\n\t\treturn (::GetObject(m_hFont, sizeof(LOGFONT), &LogFont) == sizeof(LOGFONT));\n\t}\n};\n\ntypedef CFontT<false>   CFontHandle;\ntypedef CFontT<true>    CFont;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CBitmap\n\ntemplate <bool t_bManaged>\nclass CBitmapT\n{\npublic:\n// Data members\n\tHBITMAP m_hBitmap;\n\n// Constructor/destructor/operators\n\tCBitmapT(HBITMAP hBitmap = NULL) : m_hBitmap(hBitmap)\n\t{ }\n\n\t~CBitmapT()\n\t{\n\t\tif(t_bManaged && (m_hBitmap != NULL))\n\t\t\tDeleteObject();\n\t}\n\n\tCBitmapT<t_bManaged>& operator =(HBITMAP hBitmap)\n\t{\n\t\tAttach(hBitmap);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HBITMAP hBitmap)\n\t{\n\t\tif(t_bManaged && (m_hBitmap != NULL) && (m_hBitmap != hBitmap))\n\t\t\t::DeleteObject(m_hBitmap);\n\t\tm_hBitmap = hBitmap;\n\t}\n\n\tHBITMAP Detach()\n\t{\n\t\tHBITMAP hBitmap = m_hBitmap;\n\t\tm_hBitmap = NULL;\n\t\treturn hBitmap;\n\t}\n\n\toperator HBITMAP() const { return m_hBitmap; }\n\n\tbool IsNull() const { return (m_hBitmap == NULL); }\n\n// Create and load methods\n\tHBITMAP LoadBitmap(ATL::_U_STRINGorID bitmap)\n\t{\n\t\tATLASSERT(m_hBitmap == NULL);\n\t\tm_hBitmap = ::LoadBitmap(ModuleHelper::GetResourceInstance(), bitmap.m_lpstr);\n\t\treturn m_hBitmap;\n\t}\n\n\tHBITMAP LoadOEMBitmap(UINT nIDBitmap) // for OBM_/OCR_/OIC_\n\t{\n\t\tATLASSERT(m_hBitmap == NULL);\n\t\tm_hBitmap = ::LoadBitmap(NULL, MAKEINTRESOURCE(nIDBitmap));\n\t\treturn m_hBitmap;\n\t}\n\n\tHBITMAP LoadMappedBitmap(UINT nIDBitmap, UINT nFlags = 0, LPCOLORMAP lpColorMap = NULL, int nMapSize = 0)\n\t{\n\t\tATLASSERT(m_hBitmap == NULL);\n\t\tm_hBitmap = ::CreateMappedBitmap(ModuleHelper::GetResourceInstance(), nIDBitmap, (WORD)nFlags, lpColorMap, nMapSize);\n\t\treturn m_hBitmap;\n\t}\n\n\tHBITMAP CreateBitmap(int nWidth, int nHeight, UINT nPlanes, UINT nBitsPerPixel, const void* lpBits)\n\t{\n\t\tATLASSERT(m_hBitmap == NULL);\n\t\tm_hBitmap = ::CreateBitmap(nWidth, nHeight, nPlanes, nBitsPerPixel, lpBits);\n\t\treturn m_hBitmap;\n\t}\n\n\tHBITMAP CreateBitmapIndirect(LPBITMAP lpBitmap)\n\t{\n\t\tATLASSERT(m_hBitmap == NULL);\n\t\tm_hBitmap = ::CreateBitmapIndirect(lpBitmap);\n\t\treturn m_hBitmap;\n\t}\n\n\tHBITMAP CreateCompatibleBitmap(HDC hDC, int nWidth, int nHeight)\n\t{\n\t\tATLASSERT(m_hBitmap == NULL);\n\t\tm_hBitmap = ::CreateCompatibleBitmap(hDC, nWidth, nHeight);\n\t\treturn m_hBitmap;\n\t}\n\n\tHBITMAP CreateDiscardableBitmap(HDC hDC, int nWidth, int nHeight)\n\t{\n\t\tATLASSERT(m_hBitmap == NULL);\n\t\tm_hBitmap = ::CreateDiscardableBitmap(hDC, nWidth, nHeight);\n\t\treturn m_hBitmap;\n\t}\n\n\tBOOL DeleteObject()\n\t{\n\t\tATLASSERT(m_hBitmap != NULL);\n\t\tBOOL bRet = ::DeleteObject(m_hBitmap);\n\t\tif(bRet)\n\t\t\tm_hBitmap = NULL;\n\t\treturn bRet;\n\t}\n\n// Attributes\n\tint GetBitmap(BITMAP* pBitMap) const\n\t{\n\t\tATLASSERT(m_hBitmap != NULL);\n\t\treturn ::GetObject(m_hBitmap, sizeof(BITMAP), pBitMap);\n\t}\n\n\tbool GetBitmap(BITMAP& bm) const\n\t{\n\t\tATLASSERT(m_hBitmap != NULL);\n\t\treturn (::GetObject(m_hBitmap, sizeof(BITMAP), &bm) == sizeof(BITMAP));\n\t}\n\n\tbool GetSize(SIZE& size) const\n\t{\n\t\tATLASSERT(m_hBitmap != NULL);\n\t\tBITMAP bm = {};\n\t\tif(!GetBitmap(&bm))\n\t\t\treturn false;\n\t\tsize.cx = bm.bmWidth;\n\t\tsize.cy = bm.bmHeight;\n\t\treturn true;\n\t}\n\n\tDWORD GetBitmapBits(DWORD dwCount, LPVOID lpBits) const\n\t{\n\t\tATLASSERT(m_hBitmap != NULL);\n\t\treturn ::GetBitmapBits(m_hBitmap, dwCount, lpBits);\n\t}\n\n\tDWORD SetBitmapBits(DWORD dwCount, const void* lpBits)\n\t{\n\t\tATLASSERT(m_hBitmap != NULL);\n\t\treturn ::SetBitmapBits(m_hBitmap, dwCount, lpBits);\n\t}\n\n\tBOOL GetBitmapDimension(LPSIZE lpSize) const\n\t{\n\t\tATLASSERT(m_hBitmap != NULL);\n\t\treturn ::GetBitmapDimensionEx(m_hBitmap, lpSize);\n\t}\n\n\tBOOL SetBitmapDimension(int nWidth, int nHeight, LPSIZE lpSize = NULL)\n\t{\n\t\tATLASSERT(m_hBitmap != NULL);\n\t\treturn ::SetBitmapDimensionEx(m_hBitmap, nWidth, nHeight, lpSize);\n\t}\n\n// DIB support\n\tHBITMAP CreateDIBitmap(HDC hDC, CONST BITMAPINFOHEADER* lpbmih, DWORD dwInit, CONST VOID* lpbInit, CONST BITMAPINFO* lpbmi, UINT uColorUse)\n\t{\n\t\tATLASSERT(m_hBitmap == NULL);\n\t\tm_hBitmap = ::CreateDIBitmap(hDC, lpbmih, dwInit, lpbInit, lpbmi, uColorUse);\n\t\treturn m_hBitmap;\n\t}\n\n\tHBITMAP CreateDIBSection(HDC hDC, CONST BITMAPINFO* lpbmi, UINT uColorUse, VOID** ppvBits, HANDLE hSection, DWORD dwOffset)\n\t{\n\t\tATLASSERT(m_hBitmap == NULL);\n\t\tm_hBitmap = ::CreateDIBSection(hDC, lpbmi, uColorUse, ppvBits, hSection, dwOffset);\n\t\treturn m_hBitmap;\n\t}\n\n\tint GetDIBits(HDC hDC, UINT uStartScan, UINT cScanLines,  LPVOID lpvBits, LPBITMAPINFO lpbmi, UINT uColorUse) const\n\t{\n\t\tATLASSERT(m_hBitmap != NULL);\n\t\treturn ::GetDIBits(hDC, m_hBitmap, uStartScan, cScanLines,  lpvBits, lpbmi, uColorUse);\n\t}\n\n\tint SetDIBits(HDC hDC, UINT uStartScan, UINT cScanLines, CONST VOID* lpvBits, CONST BITMAPINFO* lpbmi, UINT uColorUse)\n\t{\n\t\tATLASSERT(m_hBitmap != NULL);\n\t\treturn ::SetDIBits(hDC, m_hBitmap, uStartScan, cScanLines, lpvBits, lpbmi, uColorUse);\n\t}\n};\n\ntypedef CBitmapT<false>   CBitmapHandle;\ntypedef CBitmapT<true>    CBitmap;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CPalette\n\ntemplate <bool t_bManaged>\nclass CPaletteT\n{\npublic:\n// Data members\n\tHPALETTE m_hPalette;\n\n// Constructor/destructor/operators\n\tCPaletteT(HPALETTE hPalette = NULL) : m_hPalette(hPalette)\n\t{ }\n\n\t~CPaletteT()\n\t{\n\t\tif(t_bManaged && (m_hPalette != NULL))\n\t\t\tDeleteObject();\n\t}\n\n\tCPaletteT<t_bManaged>& operator =(HPALETTE hPalette)\n\t{\n\t\tAttach(hPalette);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HPALETTE hPalette)\n\t{\n\t\tif(t_bManaged && (m_hPalette != NULL) && (m_hPalette != hPalette))\n\t\t\t::DeleteObject(m_hPalette);\n\t\tm_hPalette = hPalette;\n\t}\n\n\tHPALETTE Detach()\n\t{\n\t\tHPALETTE hPalette = m_hPalette;\n\t\tm_hPalette = NULL;\n\t\treturn hPalette;\n\t}\n\n\toperator HPALETTE() const { return m_hPalette; }\n\n\tbool IsNull() const { return (m_hPalette == NULL); }\n\n// Create methods\n\tHPALETTE CreatePalette(LPLOGPALETTE lpLogPalette)\n\t{\n\t\tATLASSERT(m_hPalette == NULL);\n\t\tm_hPalette = ::CreatePalette(lpLogPalette);\n\t\treturn m_hPalette;\n\t}\n\n\tHPALETTE CreateHalftonePalette(HDC hDC)\n\t{\n\t\tATLASSERT(m_hPalette == NULL);\n\t\tATLASSERT(hDC != NULL);\n\t\tm_hPalette = ::CreateHalftonePalette(hDC);\n\t\treturn m_hPalette;\n\t}\n\n\tBOOL DeleteObject()\n\t{\n\t\tATLASSERT(m_hPalette != NULL);\n\t\tBOOL bRet = ::DeleteObject(m_hPalette);\n\t\tif(bRet)\n\t\t\tm_hPalette = NULL;\n\t\treturn bRet;\n\t}\n\n// Attributes\n\tint GetEntryCount() const\n\t{\n\t\tATLASSERT(m_hPalette != NULL);\n\t\tWORD nEntries = 0;\n\t\t::GetObject(m_hPalette, sizeof(WORD), &nEntries);\n\t\treturn (int)nEntries;\n\t}\n\n\tUINT GetPaletteEntries(UINT nStartIndex, UINT nNumEntries, LPPALETTEENTRY lpPaletteColors) const\n\t{\n\t\tATLASSERT(m_hPalette != NULL);\n\t\treturn ::GetPaletteEntries(m_hPalette, nStartIndex, nNumEntries, lpPaletteColors);\n\t}\n\n\tUINT SetPaletteEntries(UINT nStartIndex, UINT nNumEntries, LPPALETTEENTRY lpPaletteColors)\n\t{\n\t\tATLASSERT(m_hPalette != NULL);\n\t\treturn ::SetPaletteEntries(m_hPalette, nStartIndex, nNumEntries, lpPaletteColors);\n\t}\n\n// Operations\n\tvoid AnimatePalette(UINT nStartIndex, UINT nNumEntries, LPPALETTEENTRY lpPaletteColors)\n\t{\n\t\tATLASSERT(m_hPalette != NULL);\n\t\t::AnimatePalette(m_hPalette, nStartIndex, nNumEntries, lpPaletteColors);\n\t}\n\n\tBOOL ResizePalette(UINT nNumEntries)\n\t{\n\t\tATLASSERT(m_hPalette != NULL);\n\t\treturn ::ResizePalette(m_hPalette, nNumEntries);\n\t}\n\n\tUINT GetNearestPaletteIndex(COLORREF crColor) const\n\t{\n\t\tATLASSERT(m_hPalette != NULL);\n\t\treturn ::GetNearestPaletteIndex(m_hPalette, crColor);\n\t}\n};\n\ntypedef CPaletteT<false>   CPaletteHandle;\ntypedef CPaletteT<true>    CPalette;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CRgn\n\ntemplate <bool t_bManaged>\nclass CRgnT\n{\npublic:\n// Data members\n\tHRGN m_hRgn;\n\n// Constructor/destructor/operators\n\tCRgnT(HRGN hRgn = NULL) : m_hRgn(hRgn)\n\t{ }\n\n\t~CRgnT()\n\t{\n\t\tif(t_bManaged && (m_hRgn != NULL))\n\t\t\tDeleteObject();\n\t}\n\n\tCRgnT<t_bManaged>& operator =(HRGN hRgn)\n\t{\n\t\tAttach(hRgn);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HRGN hRgn)\n\t{\n\t\tif(t_bManaged && (m_hRgn != NULL) && (m_hRgn != hRgn))\n\t\t\t::DeleteObject(m_hRgn);\n\t\tm_hRgn = hRgn;\n\t}\n\n\tHRGN Detach()\n\t{\n\t\tHRGN hRgn = m_hRgn;\n\t\tm_hRgn = NULL;\n\t\treturn hRgn;\n\t}\n\n\toperator HRGN() const { return m_hRgn; }\n\n\tbool IsNull() const { return (m_hRgn == NULL); }\n\n// Create methods\n\tHRGN CreateRectRgn(int x1, int y1, int x2, int y2)\n\t{\n\t\tATLASSERT(m_hRgn == NULL);\n\t\tm_hRgn = ::CreateRectRgn(x1, y1, x2, y2);\n\t\treturn m_hRgn;\n\t}\n\n\tHRGN CreateRectRgnIndirect(LPCRECT lpRect)\n\t{\n\t\tATLASSERT(m_hRgn == NULL);\n\t\tm_hRgn = ::CreateRectRgnIndirect(lpRect);\n\t\treturn m_hRgn;\n\t}\n\n\tHRGN CreateEllipticRgn(int x1, int y1, int x2, int y2)\n\t{\n\t\tATLASSERT(m_hRgn == NULL);\n\t\tm_hRgn = ::CreateEllipticRgn(x1, y1, x2, y2);\n\t\treturn m_hRgn;\n\t}\n\n\tHRGN CreateEllipticRgnIndirect(LPCRECT lpRect)\n\t{\n\t\tATLASSERT(m_hRgn == NULL);\n\t\tm_hRgn = ::CreateEllipticRgnIndirect(lpRect);\n\t\treturn m_hRgn;\n\t}\n\n\tHRGN CreatePolygonRgn(const POINT* lpPoints, int nCount, int nMode)\n\t{\n\t\tATLASSERT(m_hRgn == NULL);\n\t\tm_hRgn = ::CreatePolygonRgn(lpPoints, nCount, nMode);\n\t\treturn m_hRgn;\n\t}\n\n\tHRGN CreatePolyPolygonRgn(const POINT* lpPoints, const INT* lpPolyCounts, int nCount, int nPolyFillMode)\n\t{\n\t\tATLASSERT(m_hRgn == NULL);\n\t\tm_hRgn = ::CreatePolyPolygonRgn(lpPoints, lpPolyCounts, nCount, nPolyFillMode);\n\t\treturn m_hRgn;\n\t}\n\n\tHRGN CreateRoundRectRgn(int x1, int y1, int x2, int y2, int x3, int y3)\n\t{\n\t\tATLASSERT(m_hRgn == NULL);\n\t\tm_hRgn = ::CreateRoundRectRgn(x1, y1, x2, y2, x3, y3);\n\t\treturn m_hRgn;\n\t}\n\n\tHRGN CreateFromPath(HDC hDC)\n\t{\n\t\tATLASSERT(m_hRgn == NULL);\n\t\tATLASSERT(hDC != NULL);\n\t\tm_hRgn = ::PathToRegion(hDC);\n\t\treturn m_hRgn;\n\t}\n\n\tHRGN CreateFromData(const XFORM* lpXForm, int nCount, const RGNDATA* pRgnData)\n\t{\n\t\tATLASSERT(m_hRgn == NULL);\n\t\tm_hRgn = ::ExtCreateRegion(lpXForm, nCount, pRgnData);\n\t\treturn m_hRgn;\n\t}\n\n\tBOOL DeleteObject()\n\t{\n\t\tATLASSERT(m_hRgn != NULL);\n\t\tBOOL bRet = ::DeleteObject(m_hRgn);\n\t\tif(bRet)\n\t\t\tm_hRgn = NULL;\n\t\treturn bRet;\n\t}\n\n// Operations\n\tvoid SetRectRgn(int x1, int y1, int x2, int y2)\n\t{\n\t\tATLASSERT(m_hRgn != NULL);\n\t\t::SetRectRgn(m_hRgn, x1, y1, x2, y2);\n\t}\n\n\tvoid SetRectRgn(LPCRECT lpRect)\n\t{\n\t\tATLASSERT(m_hRgn != NULL);\n\t\t::SetRectRgn(m_hRgn, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);\n\t}\n\n\tint CombineRgn(HRGN hRgnSrc1, HRGN hRgnSrc2, int nCombineMode)\n\t{\n\t\tATLASSERT(m_hRgn != NULL);\n\t\treturn ::CombineRgn(m_hRgn, hRgnSrc1, hRgnSrc2, nCombineMode);\n\t}\n\n\tint CombineRgn(HRGN hRgnSrc, int nCombineMode)\n\t{\n\t\tATLASSERT(m_hRgn != NULL);\n\t\treturn ::CombineRgn(m_hRgn, m_hRgn, hRgnSrc, nCombineMode);\n\t}\n\n\tint CopyRgn(HRGN hRgnSrc)\n\t{\n\t\tATLASSERT(m_hRgn != NULL);\n\t\treturn ::CombineRgn(m_hRgn, hRgnSrc, NULL, RGN_COPY);\n\t}\n\n\tBOOL EqualRgn(HRGN hRgn) const\n\t{\n\t\tATLASSERT(m_hRgn != NULL);\n\t\treturn ::EqualRgn(m_hRgn, hRgn);\n\t}\n\n\tint OffsetRgn(int x, int y)\n\t{\n\t\tATLASSERT(m_hRgn != NULL);\n\t\treturn ::OffsetRgn(m_hRgn, x, y);\n\t}\n\n\tint OffsetRgn(POINT point)\n\t{\n\t\tATLASSERT(m_hRgn != NULL);\n\t\treturn ::OffsetRgn(m_hRgn, point.x, point.y);\n\t}\n\n\tint GetRgnBox(LPRECT lpRect) const\n\t{\n\t\tATLASSERT(m_hRgn != NULL);\n\t\treturn ::GetRgnBox(m_hRgn, lpRect);\n\t}\n\n\tBOOL PtInRegion(int x, int y) const\n\t{\n\t\tATLASSERT(m_hRgn != NULL);\n\t\treturn ::PtInRegion(m_hRgn, x, y);\n\t}\n\n\tBOOL PtInRegion(POINT point) const\n\t{\n\t\tATLASSERT(m_hRgn != NULL);\n\t\treturn ::PtInRegion(m_hRgn, point.x, point.y);\n\t}\n\n\tBOOL RectInRegion(LPCRECT lpRect) const\n\t{\n\t\tATLASSERT(m_hRgn != NULL);\n\t\treturn ::RectInRegion(m_hRgn, lpRect);\n\t}\n\n\tint GetRegionData(LPRGNDATA lpRgnData, int nDataSize) const\n\t{\n\t\tATLASSERT(m_hRgn != NULL);\n\t\treturn (int)::GetRegionData(m_hRgn, nDataSize, lpRgnData);\n\t}\n};\n\ntypedef CRgnT<false>   CRgnHandle;\ntypedef CRgnT<true>    CRgn;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CDC - The device context class\n\ntemplate <bool t_bManaged>\nclass CDCT;\ntypedef CDCT<false>   CDCHandle;\ntypedef CDCT<true>    CDC;\n\ntemplate <bool t_bManaged>\nclass CDCT\n{\npublic:\n// Data members\n\tHDC m_hDC;\n\n// Constructor/destructor/operators\n\tCDCT(HDC hDC = NULL) : m_hDC(hDC)\n\t{\n\t}\n\n\t~CDCT()\n\t{\n\t\tif(t_bManaged && (m_hDC != NULL))\n\t\t\t::DeleteDC(Detach());\n\t}\n\n\tCDCT<t_bManaged>& operator =(HDC hDC)\n\t{\n\t\tAttach(hDC);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HDC hDC)\n\t{\n\t\tif(t_bManaged && (m_hDC != NULL) && (m_hDC != hDC))\n\t\t\t::DeleteDC(m_hDC);\n\t\tm_hDC = hDC;\n\t}\n\n\tHDC Detach()\n\t{\n\t\tHDC hDC = m_hDC;\n\t\tm_hDC = NULL;\n\t\treturn hDC;\n\t}\n\n\toperator HDC() const { return m_hDC; }\n\n\tbool IsNull() const { return (m_hDC == NULL); }\n\n// Operations\n\tHWND WindowFromDC() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::WindowFromDC(m_hDC);\n\t}\n\n\tCPenHandle GetCurrentPen() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn CPenHandle((HPEN)::GetCurrentObject(m_hDC, OBJ_PEN));\n\t}\n\n\tCBrushHandle GetCurrentBrush() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn CBrushHandle((HBRUSH)::GetCurrentObject(m_hDC, OBJ_BRUSH));\n\t}\n\n\tCPaletteHandle GetCurrentPalette() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn CPaletteHandle((HPALETTE)::GetCurrentObject(m_hDC, OBJ_PAL));\n\t}\n\n\tCFontHandle GetCurrentFont() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn CFontHandle((HFONT)::GetCurrentObject(m_hDC, OBJ_FONT));\n\t}\n\n\tCBitmapHandle GetCurrentBitmap() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn CBitmapHandle((HBITMAP)::GetCurrentObject(m_hDC, OBJ_BITMAP));\n\t}\n\n\tHDC CreateDC(LPCTSTR lpszDriverName, LPCTSTR lpszDeviceName, LPCTSTR lpszOutput, const DEVMODE* lpInitData)\n\t{\n\t\tATLASSERT(m_hDC == NULL);\n\t\tm_hDC = ::CreateDC(lpszDriverName, lpszDeviceName, lpszOutput, lpInitData);\n\t\treturn m_hDC;\n\t}\n\n\tHDC CreateCompatibleDC(HDC hDC = NULL)\n\t{\n\t\tATLASSERT(m_hDC == NULL);\n\t\tm_hDC = ::CreateCompatibleDC(hDC);\n\t\treturn m_hDC;\n\t}\n\n\tBOOL DeleteDC()\n\t{\n\t\tif(m_hDC == NULL)\n\t\t\treturn FALSE;\n\t\tBOOL bRet = ::DeleteDC(m_hDC);\n\t\tif(bRet)\n\t\t\tm_hDC = NULL;\n\t\treturn bRet;\n\t}\n\n// Device-Context Functions\n\tint SaveDC()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SaveDC(m_hDC);\n\t}\n\n\tBOOL RestoreDC(int nSavedDC)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::RestoreDC(m_hDC, nSavedDC);\n\t}\n\n\tint GetDeviceCaps(int nIndex) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetDeviceCaps(m_hDC, nIndex);\n\t}\n\n\tUINT SetBoundsRect(LPCRECT lpRectBounds, UINT flags)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetBoundsRect(m_hDC, lpRectBounds, flags);\n\t}\n\n\tUINT GetBoundsRect(LPRECT lpRectBounds, UINT flags) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetBoundsRect(m_hDC, lpRectBounds, flags);\n\t}\n\n\tBOOL ResetDC(const DEVMODE* lpDevMode)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::ResetDC(m_hDC, lpDevMode) != NULL;\n\t}\n\n// Drawing-Tool Functions\n\tBOOL GetBrushOrg(LPPOINT lpPoint) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetBrushOrgEx(m_hDC, lpPoint);\n\t}\n\n\tBOOL SetBrushOrg(int x, int y, LPPOINT lpPoint = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetBrushOrgEx(m_hDC, x, y, lpPoint);\n\t}\n\n\tBOOL SetBrushOrg(POINT point, LPPOINT lpPointRet = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetBrushOrgEx(m_hDC, point.x, point.y, lpPointRet);\n\t}\n\n\tint EnumObjects(int nObjectType, int (CALLBACK* lpfn)(LPVOID, LPARAM), LPARAM lpData)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n#ifdef STRICT\n\t\treturn ::EnumObjects(m_hDC, nObjectType, (GOBJENUMPROC)lpfn, lpData);\n#else\n\t\treturn ::EnumObjects(m_hDC, nObjectType, (GOBJENUMPROC)lpfn, (LPVOID)lpData);\n#endif\n\t}\n\n// Type-safe selection helpers\n\tHPEN SelectPen(HPEN hPen)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tATLASSERT((hPen == NULL) || (::GetObjectType(hPen) == OBJ_PEN) || (::GetObjectType(hPen) == OBJ_EXTPEN));\n\t\treturn (HPEN)::SelectObject(m_hDC, hPen);\n\t}\n\n\tHBRUSH SelectBrush(HBRUSH hBrush)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tATLASSERT((hBrush == NULL) || (::GetObjectType(hBrush) == OBJ_BRUSH));\n\t\treturn (HBRUSH)::SelectObject(m_hDC, hBrush);\n\t}\n\n\tHFONT SelectFont(HFONT hFont)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tATLASSERT((hFont == NULL) || (::GetObjectType(hFont) == OBJ_FONT));\n\t\treturn (HFONT)::SelectObject(m_hDC, hFont);\n\t}\n\n\tHBITMAP SelectBitmap(HBITMAP hBitmap)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tATLASSERT((hBitmap == NULL) || (::GetObjectType(hBitmap) == OBJ_BITMAP));\n\t\treturn (HBITMAP)::SelectObject(m_hDC, hBitmap);\n\t}\n\n\tint SelectRgn(HRGN hRgn)       // special return for regions\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tATLASSERT((hRgn == NULL) || (::GetObjectType(hRgn) == OBJ_REGION));\n\t\treturn PtrToInt(::SelectObject(m_hDC, hRgn));\n\t}\n\n// Type-safe selection helpers for stock objects\n\tHPEN SelectStockPen(int nPen)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tATLASSERT((nPen == WHITE_PEN) || (nPen == BLACK_PEN) || (nPen == NULL_PEN) || (nPen == DC_PEN));\n\t\treturn SelectPen((HPEN)::GetStockObject(nPen));\n\t}\n\n\tHBRUSH SelectStockBrush(int nBrush)\n\t{\n\t\tATLASSERT(((nBrush >= WHITE_BRUSH) && (nBrush <= HOLLOW_BRUSH)) || (nBrush == DC_BRUSH));\n\t\treturn SelectBrush((HBRUSH)::GetStockObject(nBrush));\n\t}\n\n\tHFONT SelectStockFont(int nFont)\n\t{\n\t\tATLASSERT(((nFont >= OEM_FIXED_FONT) && (nFont <= SYSTEM_FIXED_FONT)) || (nFont == DEFAULT_GUI_FONT));\n\t\treturn SelectFont((HFONT)::GetStockObject(nFont));\n\t}\n\n\tHPALETTE SelectStockPalette(int nPalette, BOOL bForceBackground)\n\t{\n\t\tATLASSERT(nPalette == DEFAULT_PALETTE); // the only one supported\n\t\treturn SelectPalette((HPALETTE)::GetStockObject(nPalette), bForceBackground);\n\t}\n\n// Color and Color Palette Functions\n\tCOLORREF GetNearestColor(COLORREF crColor) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetNearestColor(m_hDC, crColor);\n\t}\n\n\tHPALETTE SelectPalette(HPALETTE hPalette, BOOL bForceBackground)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\n\t\treturn ::SelectPalette(m_hDC, hPalette, bForceBackground);\n\t}\n\n\tUINT RealizePalette()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::RealizePalette(m_hDC);\n\t}\n\n\tvoid UpdateColors()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\t::UpdateColors(m_hDC);\n\t}\n\n// Drawing-Attribute Functions\n\tCOLORREF GetBkColor() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetBkColor(m_hDC);\n\t}\n\n\tint GetBkMode() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetBkMode(m_hDC);\n\t}\n\n\tint GetPolyFillMode() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetPolyFillMode(m_hDC);\n\t}\n\n\tint GetROP2() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetROP2(m_hDC);\n\t}\n\n\tint GetStretchBltMode() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetStretchBltMode(m_hDC);\n\t}\n\n\tCOLORREF GetTextColor() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetTextColor(m_hDC);\n\t}\n\n\tCOLORREF SetBkColor(COLORREF crColor)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetBkColor(m_hDC, crColor);\n\t}\n\n\tint SetBkMode(int nBkMode)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetBkMode(m_hDC, nBkMode);\n\t}\n\n\tint SetPolyFillMode(int nPolyFillMode)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetPolyFillMode(m_hDC, nPolyFillMode);\n\t}\n\n\tint SetROP2(int nDrawMode)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetROP2(m_hDC, nDrawMode);\n\t}\n\n\tint SetStretchBltMode(int nStretchMode)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetStretchBltMode(m_hDC, nStretchMode);\n\t}\n\n\tCOLORREF SetTextColor(COLORREF crColor)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetTextColor(m_hDC, crColor);\n\t}\n\n\tBOOL GetColorAdjustment(LPCOLORADJUSTMENT lpColorAdjust) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetColorAdjustment(m_hDC, lpColorAdjust);\n\t}\n\n\tBOOL SetColorAdjustment(const COLORADJUSTMENT* lpColorAdjust)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetColorAdjustment(m_hDC, lpColorAdjust);\n\t}\n\n// Mapping Functions\n\tint GetMapMode() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetMapMode(m_hDC);\n\t}\n\n\tBOOL GetViewportOrg(LPPOINT lpPoint) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetViewportOrgEx(m_hDC, lpPoint);\n\t}\n\n\tint SetMapMode(int nMapMode)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetMapMode(m_hDC, nMapMode);\n\t}\n\n\t// Viewport Origin\n\tBOOL SetViewportOrg(int x, int y, LPPOINT lpPoint = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetViewportOrgEx(m_hDC, x, y, lpPoint);\n\t}\n\n\tBOOL SetViewportOrg(POINT point, LPPOINT lpPointRet = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn SetViewportOrg(point.x, point.y, lpPointRet);\n\t}\n\n\tBOOL OffsetViewportOrg(int nWidth, int nHeight, LPPOINT lpPoint = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::OffsetViewportOrgEx(m_hDC, nWidth, nHeight, lpPoint);\n\t}\n\n\t// Viewport Extent\n\tBOOL GetViewportExt(LPSIZE lpSize) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetViewportExtEx(m_hDC, lpSize);\n\t}\n\n\tBOOL SetViewportExt(int x, int y, LPSIZE lpSize = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetViewportExtEx(m_hDC, x, y, lpSize);\n\t}\n\n\tBOOL SetViewportExt(SIZE size, LPSIZE lpSizeRet = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn SetViewportExt(size.cx, size.cy, lpSizeRet);\n\t}\n\n\tBOOL ScaleViewportExt(int xNum, int xDenom, int yNum, int yDenom, LPSIZE lpSize = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::ScaleViewportExtEx(m_hDC, xNum, xDenom, yNum, yDenom, lpSize);\n\t}\n\n\t// Window Origin\n\tBOOL GetWindowOrg(LPPOINT lpPoint) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetWindowOrgEx(m_hDC, lpPoint);\n\t}\n\n\tBOOL SetWindowOrg(int x, int y, LPPOINT lpPoint = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetWindowOrgEx(m_hDC, x, y, lpPoint);\n\t}\n\n\tBOOL SetWindowOrg(POINT point, LPPOINT lpPointRet = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn SetWindowOrg(point.x, point.y, lpPointRet);\n\t}\n\n\tBOOL OffsetWindowOrg(int nWidth, int nHeight, LPPOINT lpPoint = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::OffsetWindowOrgEx(m_hDC, nWidth, nHeight, lpPoint);\n\t}\n\n\t// Window extent\n\tBOOL GetWindowExt(LPSIZE lpSize) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetWindowExtEx(m_hDC, lpSize);\n\t}\n\n\tBOOL SetWindowExt(int x, int y, LPSIZE lpSize = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetWindowExtEx(m_hDC, x, y, lpSize);\n\t}\n\n\tBOOL SetWindowExt(SIZE size, LPSIZE lpSizeRet = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn SetWindowExt(size.cx, size.cy, lpSizeRet);\n\t}\n\n\tBOOL ScaleWindowExt(int xNum, int xDenom, int yNum, int yDenom, LPSIZE lpSize = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::ScaleWindowExtEx(m_hDC, xNum, xDenom, yNum, yDenom, lpSize);\n\t}\n\n// Coordinate Functions\n\tBOOL DPtoLP(LPPOINT lpPoints, int nCount = 1) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DPtoLP(m_hDC, lpPoints, nCount);\n\t}\n\n\tBOOL DPtoLP(LPRECT lpRect) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DPtoLP(m_hDC, (LPPOINT)lpRect, 2);\n\t}\n\n\tBOOL DPtoLP(LPSIZE lpSize) const\n\t{\n\t\tSIZE sizeWinExt = {};\n\t\tif(!GetWindowExt(&sizeWinExt))\n\t\t\treturn FALSE;\n\t\tSIZE sizeVpExt = {};\n\t\tif(!GetViewportExt(&sizeVpExt))\n\t\t\treturn FALSE;\n\t\tlpSize->cx = ::MulDiv(lpSize->cx, abs(sizeWinExt.cx), abs(sizeVpExt.cx));\n\t\tlpSize->cy = ::MulDiv(lpSize->cy, abs(sizeWinExt.cy), abs(sizeVpExt.cy));\n\t\treturn TRUE;\n\t}\n\n\tBOOL LPtoDP(LPPOINT lpPoints, int nCount = 1) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::LPtoDP(m_hDC, lpPoints, nCount);\n\t}\n\n\tBOOL LPtoDP(LPRECT lpRect) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::LPtoDP(m_hDC, (LPPOINT)lpRect, 2);\n\t}\n\n\tBOOL LPtoDP(LPSIZE lpSize) const\n\t{\n\t\tSIZE sizeWinExt = {};\n\t\tif(!GetWindowExt(&sizeWinExt))\n\t\t\treturn FALSE;\n\t\tSIZE sizeVpExt = {};\n\t\tif(!GetViewportExt(&sizeVpExt))\n\t\t\treturn FALSE;\n\t\tlpSize->cx = ::MulDiv(lpSize->cx, abs(sizeVpExt.cx), abs(sizeWinExt.cx));\n\t\tlpSize->cy = ::MulDiv(lpSize->cy, abs(sizeVpExt.cy), abs(sizeWinExt.cy));\n\t\treturn TRUE;\n\t}\n\n// Special Coordinate Functions (useful for dealing with metafiles and OLE)\n\t#define HIMETRIC_INCH   2540    // HIMETRIC units per inch\n\n\tvoid DPtoHIMETRIC(LPSIZE lpSize)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tint nMapMode = GetMapMode();\n\t\tif((nMapMode < MM_ISOTROPIC) && (nMapMode != MM_TEXT))\n\t\t{\n\t\t\t// when using a constrained map mode, map against physical inch\n\t\t\tSetMapMode(MM_HIMETRIC);\n\t\t\tDPtoLP(lpSize);\n\t\t\tSetMapMode(nMapMode);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// map against logical inch for non-constrained mapping modes\n\t\t\tint cxPerInch = GetDeviceCaps(LOGPIXELSX);\n\t\t\tint cyPerInch = GetDeviceCaps(LOGPIXELSY);\n\t\t\tATLASSERT((cxPerInch != 0) && (cyPerInch != 0));\n\t\t\tlpSize->cx = ::MulDiv(lpSize->cx, HIMETRIC_INCH, cxPerInch);\n\t\t\tlpSize->cy = ::MulDiv(lpSize->cy, HIMETRIC_INCH, cyPerInch);\n\t\t}\n\t}\n\n\tvoid HIMETRICtoDP(LPSIZE lpSize)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tint nMapMode = GetMapMode();\n\t\tif((nMapMode < MM_ISOTROPIC) && (nMapMode != MM_TEXT))\n\t\t{\n\t\t\t// when using a constrained map mode, map against physical inch\n\t\t\tSetMapMode(MM_HIMETRIC);\n\t\t\tLPtoDP(lpSize);\n\t\t\tSetMapMode(nMapMode);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// map against logical inch for non-constrained mapping modes\n\t\t\tint cxPerInch = GetDeviceCaps(LOGPIXELSX);\n\t\t\tint cyPerInch = GetDeviceCaps(LOGPIXELSY);\n\t\t\tATLASSERT((cxPerInch != 0) && (cyPerInch != 0));\n\t\t\tlpSize->cx = ::MulDiv(lpSize->cx, cxPerInch, HIMETRIC_INCH);\n\t\t\tlpSize->cy = ::MulDiv(lpSize->cy, cyPerInch, HIMETRIC_INCH);\n\t\t}\n\t}\n\n\tvoid LPtoHIMETRIC(LPSIZE lpSize)\n\t{\n\t\tLPtoDP(lpSize);\n\t\tDPtoHIMETRIC(lpSize);\n\t}\n\n\tvoid HIMETRICtoLP(LPSIZE lpSize)\n\t{\n\t\tHIMETRICtoDP(lpSize);\n\t\tDPtoLP(lpSize);\n\t}\n\n// Region Functions\n\tBOOL FillRgn(HRGN hRgn, HBRUSH hBrush)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::FillRgn(m_hDC, hRgn, hBrush);\n\t}\n\n\tBOOL FrameRgn(HRGN hRgn, HBRUSH hBrush, int nWidth, int nHeight)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::FrameRgn(m_hDC, hRgn, hBrush, nWidth, nHeight);\n\t}\n\n\tBOOL InvertRgn(HRGN hRgn)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::InvertRgn(m_hDC, hRgn);\n\t}\n\n\tBOOL PaintRgn(HRGN hRgn)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::PaintRgn(m_hDC, hRgn);\n\t}\n\n// Clipping Functions\n\tint GetClipBox(LPRECT lpRect) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetClipBox(m_hDC, lpRect);\n\t}\n\n\tint GetClipRgn(CRgn& region) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tif(region.IsNull())\n\t\t\tregion.CreateRectRgn(0, 0, 0, 0);\n\n\t\tint nRet = ::GetClipRgn(m_hDC, region);\n\t\tif(nRet != 1)\n\t\t\tregion.DeleteObject();\n\n\t\treturn nRet;\n\t}\n\n\tBOOL PtVisible(int x, int y) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::PtVisible(m_hDC, x, y);\n\t}\n\n\tBOOL PtVisible(POINT point) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::PtVisible(m_hDC, point.x, point.y);\n\t}\n\n\tBOOL RectVisible(LPCRECT lpRect) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::RectVisible(m_hDC, lpRect);\n\t}\n\n\tint SelectClipRgn(HRGN hRgn)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SelectClipRgn(m_hDC, (HRGN)hRgn);\n\t}\n\n\tint ExcludeClipRect(int x1, int y1, int x2, int y2)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::ExcludeClipRect(m_hDC, x1, y1, x2, y2);\n\t}\n\n\tint ExcludeClipRect(LPCRECT lpRect)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::ExcludeClipRect(m_hDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);\n\t}\n\n\tint ExcludeUpdateRgn(HWND hWnd)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::ExcludeUpdateRgn(m_hDC, hWnd);\n\t}\n\n\tint IntersectClipRect(int x1, int y1, int x2, int y2)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::IntersectClipRect(m_hDC, x1, y1, x2, y2);\n\t}\n\n\tint IntersectClipRect(LPCRECT lpRect)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::IntersectClipRect(m_hDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);\n\t}\n\n\tint OffsetClipRgn(int x, int y)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::OffsetClipRgn(m_hDC, x, y);\n\t}\n\n\tint OffsetClipRgn(SIZE size)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::OffsetClipRgn(m_hDC, size.cx, size.cy);\n\t}\n\n\tint SelectClipRgn(HRGN hRgn, int nMode)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::ExtSelectClipRgn(m_hDC, hRgn, nMode);\n\t}\n\n// Line-Output Functions\n\tBOOL GetCurrentPosition(LPPOINT lpPoint) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetCurrentPositionEx(m_hDC, lpPoint);\n\t}\n\n\tBOOL MoveTo(int x, int y, LPPOINT lpPoint = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::MoveToEx(m_hDC, x, y, lpPoint);\n\t}\n\n\tBOOL MoveTo(POINT point, LPPOINT lpPointRet = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn MoveTo(point.x, point.y, lpPointRet);\n\t}\n\n\tBOOL LineTo(int x, int y)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::LineTo(m_hDC, x, y);\n\t}\n\n\tBOOL LineTo(POINT point)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn LineTo(point.x, point.y);\n\t}\n\n\tBOOL Arc(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::Arc(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4);\n\t}\n\n\tBOOL Arc(LPCRECT lpRect, POINT ptStart, POINT ptEnd)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::Arc(m_hDC, lpRect->left, lpRect->top,\n\t\t\tlpRect->right, lpRect->bottom, ptStart.x, ptStart.y,\n\t\t\tptEnd.x, ptEnd.y);\n\t}\n\n\tBOOL Polyline(const POINT* lpPoints, int nCount)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::Polyline(m_hDC, lpPoints, nCount);\n\t}\n\n\tBOOL AngleArc(int x, int y, int nRadius, float fStartAngle, float fSweepAngle)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::AngleArc(m_hDC, x, y, nRadius, fStartAngle, fSweepAngle);\n\t}\n\n\tBOOL ArcTo(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::ArcTo(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4);\n\t}\n\n\tBOOL ArcTo(LPCRECT lpRect, POINT ptStart, POINT ptEnd)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ArcTo(lpRect->left, lpRect->top, lpRect->right,\n\t\tlpRect->bottom, ptStart.x, ptStart.y, ptEnd.x, ptEnd.y);\n\t}\n\n\tint GetArcDirection() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetArcDirection(m_hDC);\n\t}\n\n\tint SetArcDirection(int nArcDirection)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetArcDirection(m_hDC, nArcDirection);\n\t}\n\n\tBOOL PolyDraw(const POINT* lpPoints, const BYTE* lpTypes, int nCount)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::PolyDraw(m_hDC, lpPoints, lpTypes, nCount);\n\t}\n\n\tBOOL PolylineTo(const POINT* lpPoints, int nCount)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::PolylineTo(m_hDC, lpPoints, nCount);\n\t}\n\n\tBOOL PolyPolyline(const POINT* lpPoints,\n\t\tconst DWORD* lpPolyPoints, int nCount)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::PolyPolyline(m_hDC, lpPoints, lpPolyPoints, nCount);\n\t}\n\n\tBOOL PolyBezier(const POINT* lpPoints, int nCount)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::PolyBezier(m_hDC, lpPoints, nCount);\n\t}\n\n\tBOOL PolyBezierTo(const POINT* lpPoints, int nCount)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::PolyBezierTo(m_hDC, lpPoints, nCount);\n\t}\n\n// Simple Drawing Functions\n\tBOOL FillRect(LPCRECT lpRect, HBRUSH hBrush)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::FillRect(m_hDC, lpRect, hBrush);\n\t}\n\n\tBOOL FillRect(LPCRECT lpRect, int nColorIndex)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::FillRect(m_hDC, lpRect, (HBRUSH)LongToPtr(nColorIndex + 1));\n\t}\n\n\tBOOL FrameRect(LPCRECT lpRect, HBRUSH hBrush)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::FrameRect(m_hDC, lpRect, hBrush);\n\t}\n\n\tBOOL InvertRect(LPCRECT lpRect)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::InvertRect(m_hDC, lpRect);\n\t}\n\n\tBOOL DrawIcon(int x, int y, HICON hIcon)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DrawIcon(m_hDC, x, y, hIcon);\n\t}\n\n\tBOOL DrawIcon(POINT point, HICON hIcon)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DrawIcon(m_hDC, point.x, point.y, hIcon);\n\t}\n\n\tBOOL DrawIconEx(int x, int y, HICON hIcon, int cxWidth, int cyWidth, UINT uStepIfAniCur = 0, HBRUSH hbrFlickerFreeDraw = NULL, UINT uFlags = DI_NORMAL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DrawIconEx(m_hDC, x, y, hIcon, cxWidth, cyWidth, uStepIfAniCur, hbrFlickerFreeDraw, uFlags);\n\t}\n\n\tBOOL DrawIconEx(POINT point, HICON hIcon, SIZE size, UINT uStepIfAniCur = 0, HBRUSH hbrFlickerFreeDraw = NULL, UINT uFlags = DI_NORMAL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DrawIconEx(m_hDC, point.x, point.y, hIcon, size.cx, size.cy, uStepIfAniCur, hbrFlickerFreeDraw, uFlags);\n\t}\n\n\tBOOL DrawState(POINT pt, SIZE size, HBITMAP hBitmap, UINT nFlags, HBRUSH hBrush = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DrawState(m_hDC, hBrush, NULL, (LPARAM)hBitmap, 0, pt.x, pt.y, size.cx, size.cy, nFlags | DST_BITMAP);\n\t}\n\n\tBOOL DrawState(POINT pt, SIZE size, HICON hIcon, UINT nFlags, HBRUSH hBrush = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DrawState(m_hDC, hBrush, NULL, (LPARAM)hIcon, 0, pt.x, pt.y, size.cx, size.cy, nFlags | DST_ICON);\n\t}\n\n\tBOOL DrawState(POINT pt, SIZE size, LPCTSTR lpszText, UINT nFlags, BOOL bPrefixText = TRUE, int nTextLen = 0, HBRUSH hBrush = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DrawState(m_hDC, hBrush, NULL, (LPARAM)lpszText, (WPARAM)nTextLen, pt.x, pt.y, size.cx, size.cy, nFlags | (bPrefixText ? DST_PREFIXTEXT : DST_TEXT));\n\t}\n\n\tBOOL DrawState(POINT pt, SIZE size, DRAWSTATEPROC lpDrawProc, LPARAM lData, UINT nFlags, HBRUSH hBrush = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DrawState(m_hDC, hBrush, lpDrawProc, lData, 0, pt.x, pt.y, size.cx, size.cy, nFlags | DST_COMPLEX);\n\t}\n\n// Ellipse and Polygon Functions\n\tBOOL Chord(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::Chord(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4);\n\t}\n\n\tBOOL Chord(LPCRECT lpRect, POINT ptStart, POINT ptEnd)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::Chord(m_hDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, ptStart.x, ptStart.y, ptEnd.x, ptEnd.y);\n\t}\n\n\tvoid DrawFocusRect(LPCRECT lpRect)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\t::DrawFocusRect(m_hDC, lpRect);\n\t}\n\n\tBOOL Ellipse(int x1, int y1, int x2, int y2)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::Ellipse(m_hDC, x1, y1, x2, y2);\n\t}\n\n\tBOOL Ellipse(LPCRECT lpRect)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::Ellipse(m_hDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);\n\t}\n\n\tBOOL Pie(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::Pie(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4);\n\t}\n\n\tBOOL Pie(LPCRECT lpRect, POINT ptStart, POINT ptEnd)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::Pie(m_hDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, ptStart.x, ptStart.y, ptEnd.x, ptEnd.y);\n\t}\n\n\tBOOL Polygon(const POINT* lpPoints, int nCount)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::Polygon(m_hDC, lpPoints, nCount);\n\t}\n\n\tBOOL PolyPolygon(const POINT* lpPoints, const INT* lpPolyCounts, int nCount)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::PolyPolygon(m_hDC, lpPoints, lpPolyCounts, nCount);\n\t}\n\n\tBOOL Rectangle(int x1, int y1, int x2, int y2)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::Rectangle(m_hDC, x1, y1, x2, y2);\n\t}\n\n\tBOOL Rectangle(LPCRECT lpRect)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::Rectangle(m_hDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);\n\t}\n\n\tBOOL RoundRect(int x1, int y1, int x2, int y2, int x3, int y3)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::RoundRect(m_hDC, x1, y1, x2, y2, x3, y3);\n\t}\n\n\tBOOL RoundRect(LPCRECT lpRect, POINT point)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::RoundRect(m_hDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, point.x, point.y);\n\t}\n\n// Bitmap Functions\n\tBOOL PatBlt(int x, int y, int nWidth, int nHeight, DWORD dwRop)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::PatBlt(m_hDC, x, y, nWidth, nHeight, dwRop);\n\t}\n\n\tBOOL BitBlt(int x, int y, int nWidth, int nHeight, HDC hSrcDC,\n\t\tint xSrc, int ySrc, DWORD dwRop)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::BitBlt(m_hDC, x, y, nWidth, nHeight, hSrcDC, xSrc, ySrc, dwRop);\n\t}\n\n\tBOOL StretchBlt(int x, int y, int nWidth, int nHeight, HDC hSrcDC, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, DWORD dwRop)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::StretchBlt(m_hDC, x, y, nWidth, nHeight, hSrcDC, xSrc, ySrc, nSrcWidth, nSrcHeight, dwRop);\n\t}\n\n\tCOLORREF GetPixel(int x, int y) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetPixel(m_hDC, x, y);\n\t}\n\n\tCOLORREF GetPixel(POINT point) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetPixel(m_hDC, point.x, point.y);\n\t}\n\n\tCOLORREF SetPixel(int x, int y, COLORREF crColor)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetPixel(m_hDC, x, y, crColor);\n\t}\n\n\tCOLORREF SetPixel(POINT point, COLORREF crColor)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetPixel(m_hDC, point.x, point.y, crColor);\n\t}\n\n\tBOOL FloodFill(int x, int y, COLORREF crColor)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::FloodFill(m_hDC, x, y, crColor);\n\t}\n\n\tBOOL ExtFloodFill(int x, int y, COLORREF crColor, UINT nFillType)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::ExtFloodFill(m_hDC, x, y, crColor, nFillType);\n\t}\n\n\tBOOL MaskBlt(int x, int y, int nWidth, int nHeight, HDC hSrcDC, int xSrc, int ySrc, HBITMAP hMaskBitmap, int xMask, int yMask, DWORD dwRop)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::MaskBlt(m_hDC, x, y, nWidth, nHeight, hSrcDC, xSrc, ySrc, hMaskBitmap, xMask, yMask, dwRop);\n\t}\n\n\tBOOL PlgBlt(LPPOINT lpPoint, HDC hSrcDC, int xSrc, int ySrc, int nWidth, int nHeight, HBITMAP hMaskBitmap, int xMask, int yMask)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::PlgBlt(m_hDC, lpPoint, hSrcDC, xSrc, ySrc, nWidth, nHeight, hMaskBitmap, xMask, yMask);\n\t}\n\n\tBOOL SetPixelV(int x, int y, COLORREF crColor)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetPixelV(m_hDC, x, y, crColor);\n\t}\n\n\tBOOL SetPixelV(POINT point, COLORREF crColor)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetPixelV(m_hDC, point.x, point.y, crColor);\n\t}\n\n\tBOOL TransparentBlt(int x, int y, int nWidth, int nHeight, HDC hSrcDC, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, UINT crTransparent)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::TransparentBlt(m_hDC, x, y, nWidth, nHeight, hSrcDC, xSrc, ySrc, nSrcWidth, nSrcHeight, crTransparent);\n\t}\n\n\tBOOL GradientFill(const PTRIVERTEX pVertices, DWORD nVertices, void* pMeshElements, DWORD nMeshElements, DWORD dwMode)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GradientFill(m_hDC, pVertices, nVertices, pMeshElements, nMeshElements, dwMode);\n\t}\n\n\tBOOL GradientFillRect(RECT& rect, COLORREF clr1, COLORREF clr2, bool bHorizontal)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\n\t\tTRIVERTEX arrTvx[2] = { { 0 }, { 0 } };\n\n\t\tarrTvx[0].x = rect.left;\n\t\tarrTvx[0].y = rect.top;\n\t\tarrTvx[0].Red = MAKEWORD(0, GetRValue(clr1));\n\t\tarrTvx[0].Green = MAKEWORD(0, GetGValue(clr1));\n\t\tarrTvx[0].Blue = MAKEWORD(0, GetBValue(clr1));\n\t\tarrTvx[0].Alpha = 0;\n\n\t\tarrTvx[1].x = rect.right;\n\t\tarrTvx[1].y = rect.bottom;\n\t\tarrTvx[1].Red = MAKEWORD(0, GetRValue(clr2));\n\t\tarrTvx[1].Green = MAKEWORD(0, GetGValue(clr2));\n\t\tarrTvx[1].Blue = MAKEWORD(0, GetBValue(clr2));\n\t\tarrTvx[1].Alpha = 0;\n\n\t\tGRADIENT_RECT gr = { 0, 1 };\n\n\t\treturn ::GradientFill(m_hDC, arrTvx, 2, &gr, 1, bHorizontal ? GRADIENT_FILL_RECT_H : GRADIENT_FILL_RECT_V);\n\t}\n\n\tBOOL AlphaBlend(int x, int y, int nWidth, int nHeight, HDC hSrcDC, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, BLENDFUNCTION bf)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::AlphaBlend(m_hDC, x, y, nWidth, nHeight, hSrcDC, xSrc, ySrc, nSrcWidth, nSrcHeight, bf);\n\t}\n\n// Extra bitmap functions\n\t// Helper function for painting a disabled toolbar or menu bitmap\n\t// This function can take either an HBITMAP (for SS) or a DC with \n\t//           the bitmap already painted (for cmdbar)\n\tBOOL DitherBlt(int x, int y, int nWidth, int nHeight, HDC hSrcDC, HBITMAP hBitmap, int xSrc, int ySrc,\n\t\t\tHBRUSH hBrushBackground = ::GetSysColorBrush(COLOR_3DFACE),\n\t\t\tHBRUSH hBrush3DEffect = ::GetSysColorBrush(COLOR_3DHILIGHT),\n\t\t\tHBRUSH hBrushDisabledImage = ::GetSysColorBrush(COLOR_3DSHADOW))\n\t{\n\t\tATLASSERT((m_hDC != NULL) || (hBitmap != NULL));\n\t\tATLASSERT((nWidth > 0) && (nHeight > 0));\n\t\t\n\t\t// Create a generic DC for all BitBlts\n\t\tCDCT<false> dc = (hSrcDC != NULL) ? hSrcDC : ::CreateCompatibleDC(m_hDC);\n\t\tATLASSERT(dc.m_hDC != NULL);\n\t\tif(dc.m_hDC == NULL)\n\t\t\treturn FALSE;\n\t\t\n\t\t// Create a DC for the monochrome DIB section\n\t\tCDCT<true> dcBW = ::CreateCompatibleDC(m_hDC);\n\t\tATLASSERT(dcBW.m_hDC != NULL);\n\t\tif(dcBW.m_hDC == NULL)\n\t\t{\n\t\t\tif(hSrcDC == NULL)\n\t\t\t\tdc.DeleteDC();\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Create the monochrome DIB section with a black and white palette\n\t\tstruct RGBBWBITMAPINFO\n\t\t{\n\t\t\tBITMAPINFOHEADER bmiHeader; \n\t\t\tRGBQUAD bmiColors[2]; \n\t\t};\n\n\t\tRGBBWBITMAPINFO rgbBWBitmapInfo = \n\t\t{\n\t\t\t{ sizeof(BITMAPINFOHEADER), nWidth, nHeight, 1, 1, BI_RGB, 0, 0, 0, 0, 0 },\n\t\t\t{ { 0x00, 0x00, 0x00, 0x00 }, { 0xFF, 0xFF, 0xFF, 0x00 } }\n\t\t};\n\n\t\tVOID* pbitsBW;\n\t\tCBitmap bmpBW = ::CreateDIBSection(dcBW, (LPBITMAPINFO)&rgbBWBitmapInfo, DIB_RGB_COLORS, &pbitsBW, NULL, 0);\n\t\tATLASSERT(bmpBW.m_hBitmap != NULL);\n\t\tif(bmpBW.m_hBitmap == NULL)\n\t\t{\n\t\t\tif(hSrcDC == NULL)\n\t\t\t\tdc.DeleteDC();\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t// Attach the monochrome DIB section and the bitmap to the DCs\n\t\tHBITMAP hbmOldBW = dcBW.SelectBitmap(bmpBW);\n\t\tHBITMAP hbmOldDC = NULL;\n\t\tif(hBitmap != NULL)\n\t\t\thbmOldDC = dc.SelectBitmap(hBitmap);\n\n\t\t// Block: Dark gray removal: we want (128, 128, 128) pixels to become black and not white\n\t\t{\n\t\t\tCDCT<true> dcTemp1 = ::CreateCompatibleDC(m_hDC);\n\t\t\tCDCT<true> dcTemp2 = ::CreateCompatibleDC(m_hDC);\n\t\t\tCBitmap bmpTemp1;\n\t\t\tbmpTemp1.CreateCompatibleBitmap(dc, nWidth, nHeight);\n\t\t\tCBitmap bmpTemp2;\n\t\t\tbmpTemp2.CreateBitmap(nWidth, nHeight, 1, 1, NULL);\n\t\t\tHBITMAP hOldBmp1 = dcTemp1.SelectBitmap(bmpTemp1);\n\t\t\tHBITMAP hOldBmp2 = dcTemp2.SelectBitmap(bmpTemp2);\n\t\t\t// Let's copy our image, it will be altered\n\t\t\tdcTemp1.BitBlt(0, 0, nWidth, nHeight, dc, xSrc, ySrc, SRCCOPY);\n\n\t\t\t// All dark gray pixels will become white, the others black\n\t\t\tdcTemp1.SetBkColor(RGB(128, 128, 128));\n\t\t\tdcTemp2.BitBlt(0, 0, nWidth, nHeight, dcTemp1, 0, 0, SRCCOPY);\n\t\t\t// Do an XOR to set to black these white pixels\n\t\t\tdcTemp1.BitBlt(0, 0, nWidth, nHeight, dcTemp2, 0, 0, SRCINVERT);\n\n\t\t\t// BitBlt the bitmap into the monochrome DIB section\n\t\t\t// The DIB section will do a true monochrome conversion\n\t\t\t// The magenta background being closer to white will become white\n\t\t\tdcBW.BitBlt(0, 0, nWidth, nHeight, dcTemp1, 0, 0, SRCCOPY);\n\n\t\t\t// Cleanup\n\t\t\tdcTemp1.SelectBitmap(hOldBmp1);\n\t\t\tdcTemp2.SelectBitmap(hOldBmp2);\n\t\t}\n\t\t\n\t\t// Paint the destination rectangle using hBrushBackground\n\t\tif(hBrushBackground != NULL)\n\t\t{\n\t\t\tRECT rc = { x, y, x + nWidth, y + nHeight };\n\t\t\tFillRect(&rc, hBrushBackground);\n\t\t}\n\n\t\t// BitBlt the black bits in the monochrome bitmap into hBrush3DEffect color in the destination DC\n\t\t// The magic ROP comes from the Charles Petzold's book\n\t\tHBRUSH hOldBrush = SelectBrush(hBrush3DEffect);\n\t\tBitBlt(x + 1, y + 1, nWidth, nHeight, dcBW, 0, 0, 0xB8074A);\n\n\t\t// BitBlt the black bits in the monochrome bitmap into hBrushDisabledImage color in the destination DC\n\t\tSelectBrush(hBrushDisabledImage);\n\t\tBitBlt(x, y, nWidth, nHeight, dcBW, 0, 0, 0xB8074A);\n\n\t\tSelectBrush(hOldBrush);\n\t\tdcBW.SelectBitmap(hbmOldBW);\n\t\tdc.SelectBitmap(hbmOldDC);\n\n\t\tif(hSrcDC == NULL)\n\t\t\tdc.DeleteDC();\n\n\t\treturn TRUE;\n\t}\n\n// Text Functions\n\tBOOL TextOut(int x, int y, LPCTSTR lpszString, int nCount = -1)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tif(nCount == -1)\n\t\t\tnCount = lstrlen(lpszString);\n\t\treturn ::TextOut(m_hDC, x, y, lpszString, nCount);\n\t}\n\n\tBOOL ExtTextOut(int x, int y, UINT nOptions, LPCRECT lpRect, LPCTSTR lpszString, int nCount = -1, LPINT lpDxWidths = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tif(nCount == -1)\n\t\t\tnCount = lstrlen(lpszString);\n\t\tATLASSERT((nCount >= 0) && (nCount <= 8192));\n\t\treturn ::ExtTextOut(m_hDC, x, y, nOptions, lpRect, lpszString, (UINT)nCount, lpDxWidths);\n\t}\n\n\tSIZE TabbedTextOut(int x, int y, LPCTSTR lpszString, int nCount = -1, int nTabPositions = 0, LPINT lpnTabStopPositions = NULL, int nTabOrigin = 0)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tif(nCount == -1)\n\t\t\tnCount = lstrlen(lpszString);\n\t\tLONG lRes = ::TabbedTextOut(m_hDC, x, y, lpszString, nCount, nTabPositions, lpnTabStopPositions, nTabOrigin);\n\t\tSIZE size = { GET_X_LPARAM(lRes), GET_Y_LPARAM(lRes) };\n\t\treturn size;\n\t}\n\n\tint DrawText(LPCTSTR lpstrText, int cchText, LPRECT lpRect, UINT uFormat)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tATLASSERT((uFormat & DT_MODIFYSTRING) == 0);\n\t\treturn ::DrawText(m_hDC, lpstrText, cchText, lpRect, uFormat);\n\t}\n\n\tint DrawText(LPTSTR lpstrText, int cchText, LPRECT lpRect, UINT uFormat)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DrawText(m_hDC, lpstrText, cchText, lpRect, uFormat);\n\t}\n\n\tint DrawTextEx(LPTSTR lpstrText, int cchText, LPRECT lpRect, UINT uFormat, LPDRAWTEXTPARAMS lpDTParams = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DrawTextEx(m_hDC, lpstrText, cchText, lpRect, uFormat, lpDTParams);\n\t}\n\n\t// Note - ::DrawShadowText() is present only if comctl32.dll version 6 is loaded\n\tint DrawShadowText(LPCWSTR lpstrText, int cchText, LPRECT lpRect, DWORD dwFlags, COLORREF clrText, COLORREF clrShadow, int xOffset, int yOffset)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tATLASSERT(lpRect != NULL);\n\t\treturn ::DrawShadowText(m_hDC, lpstrText, cchText, lpRect, dwFlags, clrText, clrShadow, xOffset, yOffset);\n\t}\n\n\tBOOL GetTextExtent(LPCTSTR lpszString, int nCount, LPSIZE lpSize) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tif(nCount == -1)\n\t\t\tnCount = lstrlen(lpszString);\n\t\treturn ::GetTextExtentPoint32(m_hDC, lpszString, nCount, lpSize);\n\t}\n\n\tBOOL GetTextExtentExPoint(LPCTSTR lpszString, int cchString, LPSIZE lpSize, int nMaxExtent, LPINT lpnFit = NULL, LPINT alpDx = NULL)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetTextExtentExPoint(m_hDC, lpszString, cchString, nMaxExtent, lpnFit, alpDx, lpSize);\n\t}\n\n\tDWORD GetTabbedTextExtent(LPCTSTR lpszString, int nCount = -1, int nTabPositions = 0, LPINT lpnTabStopPositions = NULL) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tif(nCount == -1)\n\t\t\tnCount = lstrlen(lpszString);\n\t\treturn ::GetTabbedTextExtent(m_hDC, lpszString, nCount, nTabPositions, lpnTabStopPositions);\n\t}\n\n\tBOOL GrayString(HBRUSH hBrush, BOOL (CALLBACK* lpfnOutput)(HDC, LPARAM, int), LPARAM lpData, int nCount, int x, int y, int nWidth, int nHeight)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GrayString(m_hDC, hBrush, (GRAYSTRINGPROC)lpfnOutput, lpData, nCount, x, y, nWidth, nHeight);\n\t}\n\n\tUINT GetTextAlign() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetTextAlign(m_hDC);\n\t}\n\n\tUINT SetTextAlign(UINT nFlags)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetTextAlign(m_hDC, nFlags);\n\t}\n\n\tint GetTextFace(LPTSTR lpszFacename, int nCount) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetTextFace(m_hDC, nCount, lpszFacename);\n\t}\n\n\tint GetTextFaceLen() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetTextFace(m_hDC, 0, NULL);\n\t}\n\n#ifdef _OLEAUTO_H_\n\tBOOL GetTextFace(BSTR& bstrFace) const\n\t{\n\t\tUSES_CONVERSION;\n\t\tATLASSERT(m_hDC != NULL);\n\t\tATLASSERT(bstrFace == NULL);\n\n\t\tint nLen = GetTextFaceLen();\n\t\tif(nLen == 0)\n\t\t\treturn FALSE;\n\n\t\tATL::CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tLPTSTR lpszText = buff.Allocate(nLen);\n\t\tif(lpszText == NULL)\n\t\t\treturn FALSE;\n\n\t\tif(!GetTextFace(lpszText, nLen))\n\t\t\treturn FALSE;\n\n\t\tbstrFace = ::SysAllocString(T2OLE(lpszText));\n\t\treturn (bstrFace != NULL) ? TRUE : FALSE;\n\t}\n#endif\n\n#ifdef __ATLSTR_H__\n\tint GetTextFace(ATL::CString& strFace) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\n\t\tint nLen = GetTextFaceLen();\n\t\tif(nLen == 0)\n\t\t\treturn 0;\n\n\t\tLPTSTR lpstr = strFace.GetBufferSetLength(nLen);\n\t\tif(lpstr == NULL)\n\t\t\treturn 0;\n\t\tint nRet = GetTextFace(lpstr, nLen);\n\t\tstrFace.ReleaseBuffer();\n\t\treturn nRet;\n\t}\n#endif // __ATLSTR_H__\n\n\tBOOL GetTextMetrics(LPTEXTMETRIC lpMetrics) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetTextMetrics(m_hDC, lpMetrics);\n\t}\n\n\tint SetTextJustification(int nBreakExtra, int nBreakCount)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetTextJustification(m_hDC, nBreakExtra, nBreakCount);\n\t}\n\n\tint GetTextCharacterExtra() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetTextCharacterExtra(m_hDC);\n\t}\n\n\tint SetTextCharacterExtra(int nCharExtra)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetTextCharacterExtra(m_hDC, nCharExtra);\n\t}\n\n// Advanced Drawing\n\tBOOL DrawEdge(LPRECT lpRect, UINT nEdge, UINT nFlags)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DrawEdge(m_hDC, lpRect, nEdge, nFlags);\n\t}\n\n\tBOOL DrawFrameControl(LPRECT lpRect, UINT nType, UINT nState)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DrawFrameControl(m_hDC, lpRect, nType, nState);\n\t}\n\n// Scrolling Functions\n\tBOOL ScrollDC(int dx, int dy, LPCRECT lpRectScroll, LPCRECT lpRectClip, HRGN hRgnUpdate, LPRECT lpRectUpdate)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::ScrollDC(m_hDC, dx, dy, lpRectScroll, lpRectClip, hRgnUpdate, lpRectUpdate);\n\t}\n\n// Font Functions\n\tBOOL GetCharWidth(UINT nFirstChar, UINT nLastChar, LPINT lpBuffer) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetCharWidth(m_hDC, nFirstChar, nLastChar, lpBuffer);\n\t}\n\n\t// GetCharWidth32 is not supported under Win9x\n\tBOOL GetCharWidth32(UINT nFirstChar, UINT nLastChar, LPINT lpBuffer) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetCharWidth32(m_hDC, nFirstChar, nLastChar, lpBuffer);\n\t}\n\n\tDWORD SetMapperFlags(DWORD dwFlag)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetMapperFlags(m_hDC, dwFlag);\n\t}\n\n\tBOOL GetAspectRatioFilter(LPSIZE lpSize) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetAspectRatioFilterEx(m_hDC, lpSize);\n\t}\n\n\tBOOL GetCharABCWidths(UINT nFirstChar, UINT nLastChar, LPABC lpabc) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetCharABCWidths(m_hDC, nFirstChar, nLastChar, lpabc);\n\t}\n\n\tDWORD GetFontData(DWORD dwTable, DWORD dwOffset, LPVOID lpData, DWORD cbData) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetFontData(m_hDC, dwTable, dwOffset, lpData, cbData);\n\t}\n\n\tint GetKerningPairs(int nPairs, LPKERNINGPAIR lpkrnpair) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetKerningPairs(m_hDC, nPairs, lpkrnpair);\n\t}\n\n\tUINT GetOutlineTextMetrics(UINT cbData, LPOUTLINETEXTMETRIC lpotm) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetOutlineTextMetrics(m_hDC, cbData, lpotm);\n\t}\n\n\tDWORD GetGlyphOutline(UINT nChar, UINT nFormat, LPGLYPHMETRICS lpgm, DWORD cbBuffer, LPVOID lpBuffer, const MAT2* lpmat2) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetGlyphOutline(m_hDC, nChar, nFormat, lpgm, cbBuffer, lpBuffer, lpmat2);\n\t}\n\n\tBOOL GetCharABCWidths(UINT nFirstChar, UINT nLastChar, LPABCFLOAT lpABCF) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetCharABCWidthsFloat(m_hDC, nFirstChar, nLastChar, lpABCF);\n\t}\n\n\tBOOL GetCharWidth(UINT nFirstChar, UINT nLastChar, float* lpFloatBuffer) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetCharWidthFloat(m_hDC, nFirstChar, nLastChar, lpFloatBuffer);\n\t}\n\n// Printer/Device Escape Functions\n\tint Escape(int nEscape, int nCount, LPCSTR lpszInData, LPVOID lpOutData)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::Escape(m_hDC, nEscape, nCount, lpszInData, lpOutData);\n\t}\n\n\tint Escape(int nEscape, int nInputSize, LPCSTR lpszInputData,\n\t\tint nOutputSize, LPSTR lpszOutputData)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::ExtEscape(m_hDC, nEscape, nInputSize, lpszInputData, nOutputSize, lpszOutputData);\n\t}\n\n\tint DrawEscape(int nEscape, int nInputSize, LPCSTR lpszInputData)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DrawEscape(m_hDC, nEscape, nInputSize, lpszInputData);\n\t}\n\n\t// Escape helpers\n\tint StartDoc(LPCTSTR lpszDocName)  // old Win3.0 version\n\t{\n\t\tDOCINFO di = {};\n\t\tdi.cbSize = sizeof(DOCINFO);\n\t\tdi.lpszDocName = lpszDocName;\n\t\treturn StartDoc(&di);\n\t}\n\n\tint StartDoc(LPDOCINFO lpDocInfo)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::StartDoc(m_hDC, lpDocInfo);\n\t}\n\n\tint StartPage()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::StartPage(m_hDC);\n\t}\n\n\tint EndPage()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::EndPage(m_hDC);\n\t}\n\n\tint SetAbortProc(BOOL (CALLBACK* lpfn)(HDC, int))\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetAbortProc(m_hDC, (ABORTPROC)lpfn);\n\t}\n\n\tint AbortDoc()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::AbortDoc(m_hDC);\n\t}\n\n\tint EndDoc()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::EndDoc(m_hDC);\n\t}\n\n// MetaFile Functions\n\tBOOL PlayMetaFile(HMETAFILE hMF)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tif(::GetDeviceCaps(m_hDC, TECHNOLOGY) == DT_METAFILE)\n\t\t{\n\t\t\t// playing metafile in metafile, just use core windows API\n\t\t\treturn ::PlayMetaFile(m_hDC, hMF);\n\t\t}\n\n\t\t// for special playback, lParam == pDC\n\t\treturn ::EnumMetaFile(m_hDC, hMF, EnumMetaFileProc, (LPARAM)this);\n\t}\n\n\tBOOL PlayMetaFile(HENHMETAFILE hEnhMetaFile, LPCRECT lpBounds)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::PlayEnhMetaFile(m_hDC, hEnhMetaFile, lpBounds);\n\t}\n\n\tBOOL AddMetaFileComment(UINT nDataSize, const BYTE* pCommentData) // can be used for enhanced metafiles only\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GdiComment(m_hDC, nDataSize, pCommentData);\n\t}\n\n\t// Special handling for metafile playback\n\tstatic int CALLBACK EnumMetaFileProc(HDC hDC, HANDLETABLE* pHandleTable, METARECORD* pMetaRec, int nHandles, LPARAM lParam)\n\t{\n\t\tCDCT<false>* pDC = (CDCT<false>*)lParam;\n\n\t\tswitch (pMetaRec->rdFunction)\n\t\t{\n\t\tcase META_SETMAPMODE:\n\t\t\tpDC->SetMapMode((int)(short)pMetaRec->rdParm[0]);\n\t\t\tbreak;\n\t\tcase META_SETWINDOWEXT:\n\t\t\tpDC->SetWindowExt((int)(short)pMetaRec->rdParm[1], (int)(short)pMetaRec->rdParm[0]);\n\t\t\tbreak;\n\t\tcase META_SETWINDOWORG:\n\t\t\tpDC->SetWindowOrg((int)(short)pMetaRec->rdParm[1], (int)(short)pMetaRec->rdParm[0]);\n\t\t\tbreak;\n\t\tcase META_SETVIEWPORTEXT:\n\t\t\tpDC->SetViewportExt((int)(short)pMetaRec->rdParm[1], (int)(short)pMetaRec->rdParm[0]);\n\t\t\tbreak;\n\t\tcase META_SETVIEWPORTORG:\n\t\t\tpDC->SetViewportOrg((int)(short)pMetaRec->rdParm[1], (int)(short)pMetaRec->rdParm[0]);\n\t\t\tbreak;\n\t\tcase META_SCALEWINDOWEXT:\n\t\t\tpDC->ScaleWindowExt((int)(short)pMetaRec->rdParm[3], (int)(short)pMetaRec->rdParm[2], \n\t\t\t\t(int)(short)pMetaRec->rdParm[1], (int)(short)pMetaRec->rdParm[0]);\n\t\t\tbreak;\n\t\tcase META_SCALEVIEWPORTEXT:\n\t\t\tpDC->ScaleViewportExt((int)(short)pMetaRec->rdParm[3], (int)(short)pMetaRec->rdParm[2],\n\t\t\t\t(int)(short)pMetaRec->rdParm[1], (int)(short)pMetaRec->rdParm[0]);\n\t\t\tbreak;\n\t\tcase META_OFFSETVIEWPORTORG:\n\t\t\tpDC->OffsetViewportOrg((int)(short)pMetaRec->rdParm[1], (int)(short)pMetaRec->rdParm[0]);\n\t\t\tbreak;\n\t\tcase META_SAVEDC:\n\t\t\tpDC->SaveDC();\n\t\t\tbreak;\n\t\tcase META_RESTOREDC:\n\t\t\tpDC->RestoreDC((int)(short)pMetaRec->rdParm[0]);\n\t\t\tbreak;\n\t\tcase META_SETBKCOLOR:\n\t\t\tpDC->SetBkColor(*(UNALIGNED COLORREF*)&pMetaRec->rdParm[0]);\n\t\t\tbreak;\n\t\tcase META_SETTEXTCOLOR:\n\t\t\tpDC->SetTextColor(*(UNALIGNED COLORREF*)&pMetaRec->rdParm[0]);\n\t\t\tbreak;\n\n\t\t// need to watch out for SelectObject(HFONT), for custom font mapping\n\t\tcase META_SELECTOBJECT:\n\t\t\t{\n\t\t\t\tHGDIOBJ hObject = pHandleTable->objectHandle[pMetaRec->rdParm[0]];\n\t\t\t\tUINT nObjType = ::GetObjectType(hObject);\n\t\t\t\tif(nObjType == 0)\n\t\t\t\t{\n\t\t\t\t\t// object type is unknown, determine if it is a font\n\t\t\t\t\tHFONT hStockFont = (HFONT)::GetStockObject(SYSTEM_FONT);\n\t\t\t\t\tHFONT hFontOld = (HFONT)::SelectObject(pDC->m_hDC, hStockFont);\n\t\t\t\t\tHGDIOBJ hObjOld = ::SelectObject(pDC->m_hDC, hObject);\n\t\t\t\t\tif(hObjOld == hStockFont)\n\t\t\t\t\t{\n\t\t\t\t\t\t// got the stock object back, so must be selecting a font\n\t\t\t\t\t\tpDC->SelectFont((HFONT)hObject);\n\t\t\t\t\t\tbreak;  // don't play the default record\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// didn't get the stock object back, so restore everything\n\t\t\t\t\t\t::SelectObject(pDC->m_hDC, hFontOld);\n\t\t\t\t\t\t::SelectObject(pDC->m_hDC, hObjOld);\n\t\t\t\t\t}\n\t\t\t\t\t// and fall through to PlayMetaFileRecord...\n\t\t\t\t}\n\t\t\t\telse if(nObjType == OBJ_FONT)\n\t\t\t\t{\n\t\t\t\t\t// play back as CDCHandle::SelectFont(HFONT)\n\t\t\t\t\tpDC->SelectFont((HFONT)hObject);\n\t\t\t\t\tbreak;  // don't play the default record\n\t\t\t\t}\n\t\t\t}\n\t\t\t// fall through...\n\n\t\tdefault:\n\t\t\t::PlayMetaFileRecord(hDC, pHandleTable, pMetaRec, nHandles);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n// Path Functions\n\tBOOL AbortPath()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::AbortPath(m_hDC);\n\t}\n\n\tBOOL BeginPath()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::BeginPath(m_hDC);\n\t}\n\n\tBOOL CloseFigure()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::CloseFigure(m_hDC);\n\t}\n\n\tBOOL EndPath()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::EndPath(m_hDC);\n\t}\n\n\tBOOL FillPath()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::FillPath(m_hDC);\n\t}\n\n\tBOOL FlattenPath()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::FlattenPath(m_hDC);\n\t}\n\n\tBOOL StrokeAndFillPath()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::StrokeAndFillPath(m_hDC);\n\t}\n\n\tBOOL StrokePath()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::StrokePath(m_hDC);\n\t}\n\n\tBOOL WidenPath()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::WidenPath(m_hDC);\n\t}\n\n\tBOOL GetMiterLimit(PFLOAT pfMiterLimit) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetMiterLimit(m_hDC, pfMiterLimit);\n\t}\n\n\tBOOL SetMiterLimit(float fMiterLimit)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetMiterLimit(m_hDC, fMiterLimit, NULL);\n\t}\n\n\tint GetPath(LPPOINT lpPoints, LPBYTE lpTypes, int nCount) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetPath(m_hDC, lpPoints, lpTypes, nCount);\n\t}\n\n\tBOOL SelectClipPath(int nMode)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SelectClipPath(m_hDC, nMode);\n\t}\n\n// Misc Helper Functions\n\tstatic CBrushHandle PASCAL GetHalftoneBrush()\n\t{\n\t\tHBRUSH halftoneBrush = NULL;\n\t\tWORD grayPattern[8] = {};\n\t\tfor(int i = 0; i < 8; i++)\n\t\t\tgrayPattern[i] = (WORD)(0x5555 << (i & 1));\n\t\tHBITMAP grayBitmap = CreateBitmap(8, 8, 1, 1, &grayPattern);\n\t\tif(grayBitmap != NULL)\n\t\t{\n\t\t\thalftoneBrush = ::CreatePatternBrush(grayBitmap);\n\t\t\tDeleteObject(grayBitmap);\n\t\t}\n\t\treturn CBrushHandle(halftoneBrush);\n\t}\n\n\tvoid DrawDragRect(LPCRECT lpRect, SIZE size, LPCRECT lpRectLast, SIZE sizeLast, HBRUSH hBrush = NULL, HBRUSH hBrushLast = NULL)\n\t{\n\t\t// first, determine the update region and select it\n\t\tCRgn rgnOutside;\n\t\trgnOutside.CreateRectRgnIndirect(lpRect);\n\t\tRECT rect = *lpRect;\n\t\t::InflateRect(&rect, -size.cx, -size.cy);\n\t\t::IntersectRect(&rect, &rect, lpRect);\n\t\tCRgn rgnInside;\n\t\trgnInside.CreateRectRgnIndirect(&rect);\n\t\tCRgn rgnNew;\n\t\trgnNew.CreateRectRgn(0, 0, 0, 0);\n\t\trgnNew.CombineRgn(rgnOutside, rgnInside, RGN_XOR);\n\n\t\tHBRUSH hBrushOld = NULL;\n\t\tCBrush brushHalftone;\n\t\tif(hBrush == NULL)\n\t\t\tbrushHalftone = hBrush = CDCHandle::GetHalftoneBrush();\n\t\tif(hBrushLast == NULL)\n\t\t\thBrushLast = hBrush;\n\n\t\tCRgn rgnLast;\n\t\tCRgn rgnUpdate;\n\t\tif(lpRectLast != NULL)\n\t\t{\n\t\t\t// find difference between new region and old region\n\t\t\trgnLast.CreateRectRgn(0, 0, 0, 0);\n\t\t\trgnOutside.SetRectRgn(lpRectLast->left, lpRectLast->top, lpRectLast->right, lpRectLast->bottom);\n\t\t\trect = *lpRectLast;\n\t\t\t::InflateRect(&rect, -sizeLast.cx, -sizeLast.cy);\n\t\t\t::IntersectRect(&rect, &rect, lpRectLast);\n\t\t\trgnInside.SetRectRgn(rect.left, rect.top, rect.right, rect.bottom);\n\t\t\trgnLast.CombineRgn(rgnOutside, rgnInside, RGN_XOR);\n\n\t\t\t// only diff them if brushes are the same\n\t\t\tif(hBrush == hBrushLast)\n\t\t\t{\n\t\t\t\trgnUpdate.CreateRectRgn(0, 0, 0, 0);\n\t\t\t\trgnUpdate.CombineRgn(rgnLast, rgnNew, RGN_XOR);\n\t\t\t}\n\t\t}\n\t\tif((hBrush != hBrushLast) && (lpRectLast != NULL))\n\t\t{\n\t\t\t// brushes are different -- erase old region first\n\t\t\tSelectClipRgn(rgnLast);\n\t\t\tGetClipBox(&rect);\n\t\t\thBrushOld = SelectBrush(hBrushLast);\n\t\t\tPatBlt(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, PATINVERT);\n\t\t\tSelectBrush(hBrushOld);\n\t\t\thBrushOld = NULL;\n\t\t}\n\n\t\t// draw into the update/new region\n\t\tSelectClipRgn(rgnUpdate.IsNull() ? rgnNew : rgnUpdate);\n\t\tGetClipBox(&rect);\n\t\thBrushOld = SelectBrush(hBrush);\n\t\tPatBlt(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, PATINVERT);\n\n\t\t// cleanup DC\n\t\tif(hBrushOld != NULL)\n\t\t\tSelectBrush(hBrushOld);\n\t\tSelectClipRgn(NULL);\n\t}\n\n\tvoid FillSolidRect(LPCRECT lpRect, COLORREF clr)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\n\t\tCOLORREF clrOld = ::SetBkColor(m_hDC, clr);\n\t\tATLASSERT(clrOld != CLR_INVALID);\n\t\tif(clrOld != CLR_INVALID)\n\t\t{\n\t\t\t::ExtTextOut(m_hDC, 0, 0, ETO_OPAQUE, lpRect, NULL, 0, NULL);\n\t\t\t::SetBkColor(m_hDC, clrOld);\n\t\t}\n\t}\n\n\tvoid FillSolidRect(int x, int y, int cx, int cy, COLORREF clr)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\n\t\tRECT rect = { x, y, x + cx, y + cy };\n\t\tFillSolidRect(&rect, clr);\n\t}\n\n\tvoid Draw3dRect(LPCRECT lpRect, COLORREF clrTopLeft, COLORREF clrBottomRight)\n\t{\n\t\tDraw3dRect(lpRect->left, lpRect->top, lpRect->right - lpRect->left,\n\t\t\tlpRect->bottom - lpRect->top, clrTopLeft, clrBottomRight);\n\t}\n\n\tvoid Draw3dRect(int x, int y, int cx, int cy, COLORREF clrTopLeft, COLORREF clrBottomRight)\n\t{\n\t\tFillSolidRect(x, y, cx - 1, 1, clrTopLeft);\n\t\tFillSolidRect(x, y, 1, cy - 1, clrTopLeft);\n\t\tFillSolidRect(x + cx, y, -1, cy, clrBottomRight);\n\t\tFillSolidRect(x, y + cy, cx, -1, clrBottomRight);\n\t}\n\n// DIB support\n\tint SetDIBitsToDevice(int x, int y, DWORD dwWidth, DWORD dwHeight, int xSrc, int ySrc, UINT uStartScan, UINT cScanLines, CONST VOID* lpvBits, CONST BITMAPINFO* lpbmi, UINT uColorUse)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetDIBitsToDevice(m_hDC, x, y, dwWidth, dwHeight, xSrc, ySrc, uStartScan, cScanLines, lpvBits, lpbmi, uColorUse);\n\t}\n\n\tint StretchDIBits(int x, int y, int nWidth, int nHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, CONST VOID* lpvBits, CONST BITMAPINFO* lpbmi, UINT uColorUse, DWORD dwRop)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::StretchDIBits(m_hDC, x, y, nWidth, nHeight, xSrc, ySrc, nSrcWidth, nSrcHeight, lpvBits, lpbmi, uColorUse, dwRop);\n\t}\n\n\tUINT GetDIBColorTable(UINT uStartIndex, UINT cEntries, RGBQUAD* pColors) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetDIBColorTable(m_hDC, uStartIndex, cEntries, pColors);\n\t}\n\n\tUINT SetDIBColorTable(UINT uStartIndex, UINT cEntries, CONST RGBQUAD* pColors)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetDIBColorTable(m_hDC, uStartIndex, cEntries, pColors);\n\t}\n\n// OpenGL support\n#if !defined(_ATL_NO_OPENGL)\n\tint ChoosePixelFormat(CONST PIXELFORMATDESCRIPTOR* ppfd)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::ChoosePixelFormat(m_hDC, ppfd);\n\t}\n\n\tint DescribePixelFormat(int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::DescribePixelFormat(m_hDC, iPixelFormat, nBytes, ppfd);\n\t}\n\n\tint GetPixelFormat() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetPixelFormat(m_hDC);\n\t}\n\n\tBOOL SetPixelFormat(int iPixelFormat, CONST PIXELFORMATDESCRIPTOR* ppfd)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetPixelFormat(m_hDC, iPixelFormat, ppfd);\n\t}\n\n\tBOOL SwapBuffers()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SwapBuffers(m_hDC);\n\t}\n\n\tHGLRC wglCreateContext()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::wglCreateContext(m_hDC);\n\t}\n\n\tHGLRC wglCreateLayerContext(int iLayerPlane)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::wglCreateLayerContext(m_hDC, iLayerPlane);\n\t}\n\n\tBOOL wglMakeCurrent(HGLRC hglrc)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::wglMakeCurrent(m_hDC, hglrc);\n\t}\n\n\tBOOL wglUseFontBitmaps(DWORD dwFirst, DWORD dwCount, DWORD listBase)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::wglUseFontBitmaps(m_hDC, dwFirst, dwCount, listBase);\n\t}\n\n\tBOOL wglUseFontOutlines(DWORD dwFirst, DWORD dwCount, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::wglUseFontOutlines(m_hDC, dwFirst, dwCount, listBase, deviation, extrusion, format, lpgmf);\n\t}\n\n\tBOOL wglDescribeLayerPlane(int iPixelFormat, int iLayerPlane, UINT nBytes, LPLAYERPLANEDESCRIPTOR plpd)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::wglDescribeLayerPlane(m_hDC, iPixelFormat, iLayerPlane, nBytes, plpd);\n\t}\n\n\tint wglSetLayerPaletteEntries(int iLayerPlane, int iStart, int cEntries, CONST COLORREF* pclr)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::wglSetLayerPaletteEntries(m_hDC, iLayerPlane, iStart, cEntries, pclr);\n\t}\n\n\tint wglGetLayerPaletteEntries(int iLayerPlane, int iStart, int cEntries, COLORREF* pclr)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::wglGetLayerPaletteEntries(m_hDC, iLayerPlane, iStart, cEntries, pclr);\n\t}\n\n\tBOOL wglRealizeLayerPalette(int iLayerPlane, BOOL bRealize)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::wglRealizeLayerPalette(m_hDC, iLayerPlane, bRealize);\n\t}\n\n\tBOOL wglSwapLayerBuffers(UINT uPlanes)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::wglSwapLayerBuffers(m_hDC, uPlanes);\n\t}\n#endif // !defined(_ATL_NO_OPENGL)\n\n\tCOLORREF GetDCPenColor() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetDCPenColor(m_hDC);\n\t}\n\n\tCOLORREF SetDCPenColor(COLORREF clr)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetDCPenColor(m_hDC, clr);\n\t}\n\n\tCOLORREF GetDCBrushColor() const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetDCBrushColor(m_hDC);\n\t}\n\n\tCOLORREF SetDCBrushColor(COLORREF clr)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::SetDCBrushColor(m_hDC, clr);\n\t}\n\n\tDWORD GetFontUnicodeRanges(LPGLYPHSET lpgs) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetFontUnicodeRanges(m_hDC, lpgs);\n\t}\n\n\tDWORD GetGlyphIndices(LPCTSTR lpstr, int cch, LPWORD pgi, DWORD dwFlags) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetGlyphIndices(m_hDC, lpstr, cch, pgi, dwFlags);\n\t}\n\n\tBOOL GetTextExtentPointI(LPWORD pgiIn, int cgi, LPSIZE lpSize) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetTextExtentPointI(m_hDC, pgiIn, cgi, lpSize);\n\t}\n\n\tBOOL GetTextExtentExPointI(LPWORD pgiIn, int cgi, int nMaxExtent, LPINT lpnFit, LPINT alpDx, LPSIZE lpSize) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetTextExtentExPointI(m_hDC, pgiIn, cgi, nMaxExtent, lpnFit, alpDx, lpSize);\n\t}\n\n\tBOOL GetCharWidthI(UINT giFirst, UINT cgi, LPWORD pgi, LPINT lpBuffer) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetCharWidthI(m_hDC, giFirst, cgi, pgi, lpBuffer);\n\t}\n\n\tBOOL GetCharABCWidthsI(UINT giFirst, UINT cgi, LPWORD pgi, LPABC lpabc) const\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::GetCharABCWidthsI(m_hDC, giFirst, cgi, pgi, lpabc);\n\t}\n\n\tBOOL ColorCorrectPalette(HPALETTE hPalette, DWORD dwFirstEntry, DWORD dwNumOfEntries)\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\treturn ::ColorCorrectPalette(m_hDC, hPalette, dwFirstEntry, dwNumOfEntries);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CDC Helpers\n\nclass CPaintDC : public CDC\n{\npublic:\n// Data members\n\tHWND m_hWnd;\n\tPAINTSTRUCT m_ps;\n\n// Constructor/destructor\n\tCPaintDC(HWND hWnd)\n\t{\n\t\tATLASSERT(::IsWindow(hWnd));\n\t\tm_hWnd = hWnd;\n\t\tm_hDC = ::BeginPaint(hWnd, &m_ps);\n\t}\n\n\t~CPaintDC()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\t::EndPaint(m_hWnd, &m_ps);\n\t\tDetach();\n\t}\n};\n\nclass CClientDC : public CDC\n{\npublic:\n// Data members\n\tHWND m_hWnd;\n\n// Constructor/destructor\n\tCClientDC(HWND hWnd)\n\t{\n\t\tATLASSERT((hWnd == NULL) || ::IsWindow(hWnd));\n\t\tm_hWnd = hWnd;\n\t\tm_hDC = ::GetDC(hWnd);\n\t}\n\n\t~CClientDC()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\t::ReleaseDC(m_hWnd, Detach());\n\t}\n};\n\nclass CWindowDC : public CDC\n{\npublic:\n// Data members\n\tHWND m_hWnd;\n\n// Constructor/destructor\n\tCWindowDC(HWND hWnd)\n\t{\n\t\tATLASSERT((hWnd == NULL) || ::IsWindow(hWnd));\n\t\tm_hWnd = hWnd;\n\t\tm_hDC = ::GetWindowDC(hWnd);\n\t}\n\n\t~CWindowDC()\n\t{\n\t\tATLASSERT(m_hDC != NULL);\n\t\t::ReleaseDC(m_hWnd, Detach());\n\t}\n};\n\nclass CMemoryDC : public CDC\n{\npublic:\n// Data members\n\tHDC m_hDCOriginal;\n\tRECT m_rcPaint;\n\tCBitmap m_bmp;\n\tHBITMAP m_hBmpOld;\n\n// Constructor/destructor\n\tCMemoryDC(HDC hDC, const RECT& rcPaint) : m_hDCOriginal(hDC), m_hBmpOld(NULL)\n\t{\n\t\tm_rcPaint = rcPaint;\n\t\tCreateCompatibleDC(m_hDCOriginal);\n\t\tATLASSERT(m_hDC != NULL);\n\t\tm_bmp.CreateCompatibleBitmap(m_hDCOriginal, m_rcPaint.right - m_rcPaint.left, m_rcPaint.bottom - m_rcPaint.top);\n\t\tATLASSERT(m_bmp.m_hBitmap != NULL);\n\t\tm_hBmpOld = SelectBitmap(m_bmp);\n\t\tSetViewportOrg(-m_rcPaint.left, -m_rcPaint.top);\n\t}\n\n\t~CMemoryDC()\n\t{\n\t\t::BitBlt(m_hDCOriginal, m_rcPaint.left, m_rcPaint.top, m_rcPaint.right - m_rcPaint.left, m_rcPaint.bottom - m_rcPaint.top, m_hDC, m_rcPaint.left, m_rcPaint.top, SRCCOPY);\n\t\tSelectBitmap(m_hBmpOld);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Enhanced metafile support\n\nclass CEnhMetaFileInfo\n{\npublic:\n// Data members\n\tHENHMETAFILE m_hEMF;\n\tBYTE* m_pBits;\n\tTCHAR* m_pDesc;\n\tENHMETAHEADER m_header;\n\tPIXELFORMATDESCRIPTOR m_pfd;\n\n// Constructor/destructor\n\tCEnhMetaFileInfo(HENHMETAFILE hEMF) : m_hEMF(hEMF), m_pBits(NULL), m_pDesc(NULL)\n\t{\n\t\tmemset(&m_header, 0, sizeof(m_header));\n\t\tmemset(&m_pfd, 0, sizeof(m_pfd));\n\t}\n\n\t~CEnhMetaFileInfo()\n\t{\n\t\tdelete [] m_pBits;\n\t\tdelete [] m_pDesc;\n\t}\n\n// Operations\n\tBYTE* GetEnhMetaFileBits()\n\t{\n\t\tATLASSERT(m_hEMF != NULL);\n\t\tUINT nBytes = ::GetEnhMetaFileBits(m_hEMF, 0, NULL);\n\t\tdelete [] m_pBits;\n\t\tm_pBits = NULL;\n\t\tATLTRY(m_pBits = new BYTE[nBytes]);\n\t\tif (m_pBits != NULL)\n\t\t\t::GetEnhMetaFileBits(m_hEMF, nBytes, m_pBits);\n\t\treturn m_pBits;\n\t}\n\n\tLPTSTR GetEnhMetaFileDescription()\n\t{\n\t\tATLASSERT(m_hEMF != NULL);\n\t\tUINT nLen = ::GetEnhMetaFileDescription(m_hEMF, 0, NULL);\n\t\tdelete [] m_pDesc;\n\t\tm_pDesc = NULL;\n\t\tATLTRY(m_pDesc = new TCHAR[nLen]);\n\t\tif (m_pDesc != NULL)\n\t\t\tnLen = ::GetEnhMetaFileDescription(m_hEMF, nLen, m_pDesc);\n\t\treturn m_pDesc;\n\t}\n\n\tENHMETAHEADER* GetEnhMetaFileHeader()\n\t{\n\t\tATLASSERT(m_hEMF != NULL);\n\t\tmemset(&m_header, 0, sizeof(m_header));\n\t\tm_header.iType = EMR_HEADER;\n\t\tm_header.nSize = sizeof(ENHMETAHEADER);\n\t\tUINT n = ::GetEnhMetaFileHeader(m_hEMF, sizeof(ENHMETAHEADER), &m_header);\n\t\treturn (n != 0) ? &m_header : NULL;\n\t}\n\n\tPIXELFORMATDESCRIPTOR* GetEnhMetaFilePixelFormat()\n\t{\n\t\tATLASSERT(m_hEMF != NULL);\n\t\tmemset(&m_pfd, 0, sizeof(m_pfd));\n\t\tUINT n = ::GetEnhMetaFilePixelFormat(m_hEMF, sizeof(m_pfd), &m_pfd);\n\t\treturn (n != 0) ? &m_pfd : NULL;\n\t}\n};\n\n\ntemplate <bool t_bManaged>\nclass CEnhMetaFileT\n{\npublic:\n// Data members\n\tHENHMETAFILE m_hEMF;\n\n// Constructor/destructor\n\tCEnhMetaFileT(HENHMETAFILE hEMF = NULL) : m_hEMF(hEMF)\n\t{\n\t}\n\n\t~CEnhMetaFileT()\n\t{\n\t\tif(t_bManaged && (m_hEMF != NULL))\n\t\t\tDeleteObject();\n\t}\n\n// Operations\n\tCEnhMetaFileT<t_bManaged>& operator =(HENHMETAFILE hEMF)\n\t{\n\t\tAttach(hEMF);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HENHMETAFILE hEMF)\n\t{\n\t\tif(t_bManaged && (m_hEMF != NULL) && (m_hEMF != hEMF))\n\t\t\tDeleteObject();\n\t\tm_hEMF = hEMF;\n\t}\n\n\tHENHMETAFILE Detach()\n\t{\n\t\tHENHMETAFILE hEMF = m_hEMF;\n\t\tm_hEMF = NULL;\n\t\treturn hEMF;\n\t}\n\n\toperator HENHMETAFILE() const { return m_hEMF; }\n\n\tbool IsNull() const { return (m_hEMF == NULL); }\n\n\tBOOL DeleteObject()\n\t{\n\t\tATLASSERT(m_hEMF != NULL);\n\t\tBOOL bRet = ::DeleteEnhMetaFile(m_hEMF);\n\t\tm_hEMF = NULL;\n\t\treturn bRet;\n\t}\n\n\tUINT GetEnhMetaFileBits(UINT cbBuffer, LPBYTE lpbBuffer) const\n\t{\n\t\tATLASSERT(m_hEMF != NULL);\n\t\treturn ::GetEnhMetaFileBits(m_hEMF, cbBuffer, lpbBuffer);\n\t}\n\n\tUINT GetEnhMetaFileDescription(UINT cchBuffer, LPTSTR lpszDescription) const\n\t{\n\t\tATLASSERT(m_hEMF != NULL);\n\t\treturn ::GetEnhMetaFileDescription(m_hEMF, cchBuffer, lpszDescription);\n\t}\n\n\tUINT GetEnhMetaFileHeader(LPENHMETAHEADER lpemh) const\n\t{\n\t\tATLASSERT(m_hEMF != NULL);\n\t\tlpemh->iType = EMR_HEADER;\n\t\tlpemh->nSize = sizeof(ENHMETAHEADER);\n\t\treturn ::GetEnhMetaFileHeader(m_hEMF, sizeof(ENHMETAHEADER), lpemh);\n\t}\n\n\tUINT GetEnhMetaFilePaletteEntries(UINT cEntries, LPPALETTEENTRY lppe) const\n\t{\n\t\tATLASSERT(m_hEMF != NULL);\n\t\treturn ::GetEnhMetaFilePaletteEntries(m_hEMF, cEntries, lppe);\n\t}\n\n\tUINT GetEnhMetaFilePixelFormat(DWORD cbBuffer, PIXELFORMATDESCRIPTOR* ppfd) const\n\t{\n\t\tATLASSERT(m_hEMF != NULL);\n\t\treturn ::GetEnhMetaFilePixelFormat(m_hEMF, cbBuffer, ppfd);\n\t}\n};\n\ntypedef CEnhMetaFileT<false>   CEnhMetaFileHandle;\ntypedef CEnhMetaFileT<true>    CEnhMetaFile;\n\n\nclass CEnhMetaFileDC : public CDC\n{\npublic:\n// Constructor/destructor\n\tCEnhMetaFileDC()\n\t{\n\t}\n\n\tCEnhMetaFileDC(HDC hdc, LPCRECT lpRect)\n\t{\n\t\tCreate(hdc, NULL, lpRect, NULL);\n\t\tATLASSERT(m_hDC != NULL);\n\t}\n\n\tCEnhMetaFileDC(HDC hdcRef, LPCTSTR lpFilename, LPCRECT lpRect, LPCTSTR lpDescription)\n\t{\n\t\tCreate(hdcRef, lpFilename, lpRect, lpDescription);\n\t\tATLASSERT(m_hDC != NULL);\n\t}\n\n\t~CEnhMetaFileDC()\n\t{\n\t\tHENHMETAFILE hEMF = Close();\n\t\tif (hEMF != NULL)\n\t\t\t::DeleteEnhMetaFile(hEMF);\n\t}\n\n// Operations\n\tvoid Create(HDC hdcRef, LPCTSTR lpFilename, LPCRECT lpRect, LPCTSTR lpDescription)\n\t{\n\t\tATLASSERT(m_hDC == NULL);\n\t\tm_hDC = ::CreateEnhMetaFile(hdcRef, lpFilename, lpRect, lpDescription);\n\t}\n\n\tHENHMETAFILE Close()\n\t{\n\t\tHENHMETAFILE hEMF = NULL;\n\t\tif (m_hDC != NULL)\n\t\t{\n\t\t\thEMF = ::CloseEnhMetaFile(m_hDC);\n\t\t\tm_hDC = NULL;\n\t\t}\n\t\treturn hEMF;\n\t}\n};\n\n} // namespace WTL\n\n#endif // __ATLGDI_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlmisc.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLMISC_H__\n#define __ATLMISC_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atlmisc.h requires atlapp.h to be included first\n#endif\n\n#ifndef _WTL_NO_COMPATIBILITY_INCLUDES\n  #include <atlstr.h>\n  #include <atltypes.h>\n#endif // _WTL_NO_COMPATIBILITY_INCLUDES\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CRecentDocumentListBase<T, t_cchItemLen, t_nFirstID, t_nLastID>\n// CRecentDocumentList\n// CFindFile\n// CRegProperty\n// CRegPropertyImpl<T>\n//\n// Global functions:\n//   AtlGetStockPen()\n//   AtlGetStockBrush()\n//   AtlGetStockFont()\n//   AtlGetStockPalette()\n//\n//   AtlCompactPath()\n\n\nnamespace WTL\n{\n\n///////////////////////////////////////////////////////////////////////////////\n// CSize scalar operators \n\n#if !defined(_WTL_NO_SIZE_SCALAR) && defined(__ATLTYPES_H__)\n\ntemplate <class Num>\ninline CSize operator *(SIZE s, Num n) \n{\n\treturn CSize((int)(s.cx * n), (int)(s.cy * n));\n};\n\ntemplate <class Num>\ninline void operator *=(SIZE & s, Num n)\n{\n\ts = s * n;\n};\t\n\ntemplate <class Num>\ninline CSize operator /(SIZE s, Num n) \n{\n\treturn CSize((int)(s.cx / n), (int)(s.cy / n));\n};\n\ntemplate <class Num>\ninline void operator /=(SIZE & s, Num n)\n{\n\ts = s / n;\n};\t\n\n#endif // !defined(_WTL_NO_SIZE_SCALAR) && defined(__ATLTYPES_H__)\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CRecentDocumentList - MRU List Support\n\n#ifndef _WTL_MRUEMPTY_TEXT\n  #define _WTL_MRUEMPTY_TEXT\t_T(\"(empty)\")\n#endif\n\n// forward declaration\ninline bool AtlCompactPath(LPTSTR lpstrOut, LPCTSTR lpstrIn, int cchLen);\n\ntemplate <class T, int t_cchItemLen = MAX_PATH, int t_nFirstID = ID_FILE_MRU_FIRST, int t_nLastID = ID_FILE_MRU_LAST>\nclass CRecentDocumentListBase\n{\npublic:\n// Declarations\n\tstruct _DocEntry\n\t{\n\t\tTCHAR szDocName[t_cchItemLen];\n\t\tbool operator ==(const _DocEntry& de) const\n\t\t{ return (lstrcmpi(szDocName, de.szDocName) == 0); }\n\t};\n\n\tenum\n\t{\n\t\tm_nMaxEntries_Min = 2,\n\t\tm_nMaxEntries_Max = t_nLastID - t_nFirstID + 1,\n\t\tm_cchMaxItemLen_Min = 6,\n\t\tm_cchMaxItemLen_Max = t_cchItemLen,\n\t\tm_cchItemNameLen = 11\n\t};\n\n// Data members\n\tATL::CSimpleArray<_DocEntry> m_arrDocs;\n\tint m_nMaxEntries;   // default is 4\n\tHMENU m_hMenu;\n\n\tTCHAR m_szNoEntries[t_cchItemLen];\n\n\tint m_cchMaxItemLen;\n\n// Constructor\n\tCRecentDocumentListBase() : m_nMaxEntries(4), m_hMenu(NULL), m_cchMaxItemLen(-1)\n\t{\n\t\tm_szNoEntries[0] = 0;\n\n\t\t// These ASSERTs verify values of the template arguments\n\t\tATLASSERT(t_cchItemLen > m_cchMaxItemLen_Min);\n\t\tATLASSERT(m_nMaxEntries_Max > m_nMaxEntries_Min);\n\t}\n\n// Attributes\n\tHMENU GetMenuHandle() const\n\t{\n\t\treturn m_hMenu;\n\t}\n\n\tvoid SetMenuHandle(HMENU hMenu)\n\t{\n\t\tATLASSERT((hMenu == NULL) || ::IsMenu(hMenu));\n\t\tm_hMenu = hMenu;\n\t\tif((m_hMenu == NULL) || (::GetMenuString(m_hMenu, t_nFirstID, m_szNoEntries, t_cchItemLen, MF_BYCOMMAND) == 0))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t(void)pT;   // avoid level 4 warning\n\t\t\tATL::Checked::tcsncpy_s(m_szNoEntries, _countof(m_szNoEntries), pT->GetMRUEmptyText(), _TRUNCATE);\n\t\t}\n\t}\n\n\tint GetMaxEntries() const\n\t{\n\t\treturn m_nMaxEntries;\n\t}\n\n\tvoid SetMaxEntries(int nMaxEntries)\n\t{\n\t\tATLASSERT((nMaxEntries >= m_nMaxEntries_Min) && (nMaxEntries <= m_nMaxEntries_Max));\n\t\tif(nMaxEntries < m_nMaxEntries_Min)\n\t\t\tnMaxEntries = m_nMaxEntries_Min;\n\t\telse if(nMaxEntries > m_nMaxEntries_Max)\n\t\t\tnMaxEntries = m_nMaxEntries_Max;\n\t\tm_nMaxEntries = nMaxEntries;\n\t}\n\n\tint GetMaxItemLength() const\n\t{\n\t\treturn m_cchMaxItemLen;\n\t}\n\n\tvoid SetMaxItemLength(int cchMaxLen)\n\t{\n\t\tATLASSERT(((cchMaxLen >= m_cchMaxItemLen_Min) && (cchMaxLen <= m_cchMaxItemLen_Max)) || (cchMaxLen == -1));\n\t\tif(cchMaxLen != -1)\n\t\t{\n\t\t\tif(cchMaxLen < m_cchMaxItemLen_Min)\n\t\t\t\tcchMaxLen = m_cchMaxItemLen_Min;\n\t\t\telse if(cchMaxLen > m_cchMaxItemLen_Max)\n\t\t\t\tcchMaxLen = m_cchMaxItemLen_Max;\n\t\t}\n\t\tm_cchMaxItemLen = cchMaxLen;\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->UpdateMenu();\n\t}\n\n// Operations\n\tBOOL AddToList(LPCTSTR lpstrDocName)\n\t{\n\t\t_DocEntry de;\n\t\terrno_t nRet = ATL::Checked::tcsncpy_s(de.szDocName, _countof(de.szDocName), lpstrDocName, _TRUNCATE);\n\t\tif((nRet != 0) && (nRet != STRUNCATE))\n\t\t\treturn FALSE;\n\n\t\tfor(int i = 0; i < m_arrDocs.GetSize(); i++)\n\t\t{\n\t\t\tif(lstrcmpi(m_arrDocs[i].szDocName, lpstrDocName) == 0)\n\t\t\t{\n\t\t\t\tm_arrDocs.RemoveAt(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(m_arrDocs.GetSize() == m_nMaxEntries)\n\t\t\tm_arrDocs.RemoveAt(0);\n\n\t\tBOOL bRet = m_arrDocs.Add(de);\n\t\tif(bRet)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tbRet = pT->UpdateMenu();\n\t\t}\n\t\treturn bRet;\n\t}\n\n\t// This function is deprecated because it is not safe. \n\t// Use the version below that accepts the buffer length.\n\t__declspec(deprecated)\n\tBOOL GetFromList(int /*nItemID*/, LPTSTR /*lpstrDocName*/)\n\t{\n\t\tATLASSERT(FALSE);\n\t\treturn FALSE;\n\t}\n\n\tBOOL GetFromList(int nItemID, LPTSTR lpstrDocName, int cchLength)\n\t{\n\t\tint nIndex = m_arrDocs.GetSize() - (nItemID - t_nFirstID) - 1;\n\t\tif((nIndex < 0) || (nIndex >= m_arrDocs.GetSize()))\n\t\t\treturn FALSE;\n\t\tif(lstrlen(m_arrDocs[nIndex].szDocName) >= cchLength)\n\t\t\treturn FALSE;\n\t\tATL::Checked::tcscpy_s(lpstrDocName, cchLength, m_arrDocs[nIndex].szDocName);\n\n\t\treturn TRUE;\n\t}\n\n#ifdef __ATLSTR_H__\n\tBOOL GetFromList(int nItemID, ATL::CString& strDocName)\n\t{\n\t\tint nIndex = m_arrDocs.GetSize() - (nItemID - t_nFirstID) - 1;\n\t\tif((nIndex < 0) || (nIndex >= m_arrDocs.GetSize()))\n\t\t\treturn FALSE;\n\t\tstrDocName = m_arrDocs[nIndex].szDocName;\n\t\treturn TRUE;\n\t}\n#endif // __ATLSTR_H__\n\n\tBOOL RemoveFromList(int nItemID)\n\t{\n\t\tint nIndex = m_arrDocs.GetSize() - (nItemID - t_nFirstID) - 1;\n\t\tBOOL bRet = m_arrDocs.RemoveAt(nIndex);\n\t\tif(bRet)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tbRet = pT->UpdateMenu();\n\t\t}\n\t\treturn bRet;\n\t}\n\n\tBOOL MoveToTop(int nItemID)\n\t{\n\t\tint nIndex = m_arrDocs.GetSize() - (nItemID - t_nFirstID) - 1;\n\t\tif((nIndex < 0) || (nIndex >= m_arrDocs.GetSize()))\n\t\t\treturn FALSE;\n\t\t_DocEntry de;\n\t\tde = m_arrDocs[nIndex];\n\t\tm_arrDocs.RemoveAt(nIndex);\n\t\tBOOL bRet = m_arrDocs.Add(de);\n\t\tif(bRet)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tbRet = pT->UpdateMenu();\n\t\t}\n\t\treturn bRet;\n\t}\n\n\tBOOL ReadFromRegistry(LPCTSTR lpstrRegKey)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATL::CRegKey rkParent;\n\t\tATL::CRegKey rk;\n\n\t\tLONG lRet = rkParent.Open(HKEY_CURRENT_USER, lpstrRegKey);\n\t\tif(lRet != ERROR_SUCCESS)\n\t\t\treturn FALSE;\n\t\tlRet = rk.Open(rkParent, pT->GetRegKeyName());\n\t\tif(lRet != ERROR_SUCCESS)\n\t\t\treturn FALSE;\n\n\t\tDWORD dwRet = 0;\n\t\tlRet = rk.QueryDWORDValue(pT->GetRegCountName(), dwRet);\n\t\tif(lRet != ERROR_SUCCESS)\n\t\t\treturn FALSE;\n\t\tSetMaxEntries(dwRet);\n\n\t\tm_arrDocs.RemoveAll();\n\n\t\tTCHAR szRetString[t_cchItemLen] = {};\n\t\t_DocEntry de;\n\n\t\tfor(int nItem = m_nMaxEntries; nItem > 0; nItem--)\n\t\t{\n\t\t\tTCHAR szBuff[m_cchItemNameLen] = {};\n\t\t\t_stprintf_s(szBuff, m_cchItemNameLen, pT->GetRegItemName(), nItem);\n\t\t\tULONG ulCount = t_cchItemLen;\n\t\t\tlRet = rk.QueryStringValue(szBuff, szRetString, &ulCount);\n\t\t\tif(lRet == ERROR_SUCCESS)\n\t\t\t{\n\t\t\t\tATL::Checked::tcscpy_s(de.szDocName, _countof(de.szDocName), szRetString);\n\t\t\t\tm_arrDocs.Add(de);\n\t\t\t}\n\t\t}\n\n\t\trk.Close();\n\t\trkParent.Close();\n\n\t\treturn pT->UpdateMenu();\n\t}\n\n\tBOOL WriteToRegistry(LPCTSTR lpstrRegKey)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\t(void)pT;   // avoid level 4 warning\n\t\tATL::CRegKey rkParent;\n\t\tATL::CRegKey rk;\n\n\t\tLONG lRet = rkParent.Create(HKEY_CURRENT_USER, lpstrRegKey);\n\t\tif(lRet != ERROR_SUCCESS)\n\t\t\treturn FALSE;\n\t\tlRet = rk.Create(rkParent, pT->GetRegKeyName());\n\t\tif(lRet != ERROR_SUCCESS)\n\t\t\treturn FALSE;\n\n\t\tlRet = rk.SetDWORDValue(pT->GetRegCountName(), m_nMaxEntries);\n\t\tATLASSERT(lRet == ERROR_SUCCESS);\n\n\t\t// set new values\n\t\tint nItem;\n\t\tfor(nItem = m_arrDocs.GetSize(); nItem > 0; nItem--)\n\t\t{\n\t\t\tTCHAR szBuff[m_cchItemNameLen] = {};\n\t\t\t_stprintf_s(szBuff, m_cchItemNameLen, pT->GetRegItemName(), nItem);\n\t\t\tTCHAR szDocName[t_cchItemLen] = {};\n\t\t\tGetFromList(t_nFirstID + nItem - 1, szDocName, t_cchItemLen);\n\t\t\tlRet = rk.SetStringValue(szBuff, szDocName);\n\t\t\tATLASSERT(lRet == ERROR_SUCCESS);\n\t\t}\n\n\t\t// delete unused keys\n\t\tfor(nItem = m_arrDocs.GetSize() + 1; nItem <= m_nMaxEntries_Max; nItem++)\n\t\t{\n\t\t\tTCHAR szBuff[m_cchItemNameLen] = {};\n\t\t\t_stprintf_s(szBuff, m_cchItemNameLen, pT->GetRegItemName(), nItem);\n\t\t\trk.DeleteValue(szBuff);\n\t\t}\n\n\t\trk.Close();\n\t\trkParent.Close();\n\n\t\treturn TRUE;\n\t}\n\n// Implementation\n\tBOOL UpdateMenu()\n\t{\n\t\tif(m_hMenu == NULL)\n\t\t\treturn FALSE;\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\n\t\tint nItems = ::GetMenuItemCount(m_hMenu);\n\t\tint nInsertPoint = 0;\n\t\tfor(int i = 0; i < nItems; i++)\n\t\t{\n\t\t\tCMenuItemInfo mi;\n\t\t\tmi.fMask = MIIM_ID;\n\t\t\t::GetMenuItemInfo(m_hMenu, i, TRUE, &mi);\n\t\t\tif (mi.wID == t_nFirstID)\n\t\t\t{\n\t\t\t\tnInsertPoint = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tATLASSERT((nInsertPoint < nItems) && \"You need a menu item with an ID = t_nFirstID\");\n\n\t\tfor(int j = t_nFirstID; j < (t_nFirstID + m_nMaxEntries); j++)\n\t\t{\n\t\t\t// keep the first one as an insertion point\n\t\t\tif (j != t_nFirstID)\n\t\t\t\t::DeleteMenu(m_hMenu, j, MF_BYCOMMAND);\n\t\t}\n\n\t\tTCHAR szItemText[t_cchItemLen + 6] = {};   // add space for &, 2 digits, and a space\n\t\tint nSize = m_arrDocs.GetSize();\n\t\tint nItem = 0;\n\t\tif(nSize > 0)\n\t\t{\n\t\t\tfor(nItem = 0; nItem < nSize; nItem++)\n\t\t\t{\n\t\t\t\tif(m_cchMaxItemLen == -1)\n\t\t\t\t{\n\t\t\t\t\t_stprintf_s(szItemText, t_cchItemLen + 6, _T(\"&%i %s\"), nItem + 1, m_arrDocs[nSize - 1 - nItem].szDocName);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tTCHAR szBuff[t_cchItemLen] = {};\n\t\t\t\t\tT* pT = static_cast<T*>(this);\n\t\t\t\t\t(void)pT;   // avoid level 4 warning\n\t\t\t\t\tbool bRet = pT->CompactDocumentName(szBuff, m_arrDocs[nSize - 1 - nItem].szDocName, m_cchMaxItemLen);\n\t\t\t\t\t(void)bRet;   // avoid level 4 warning\n\t\t\t\t\tATLASSERT(bRet);\n\t\t\t\t\t_stprintf_s(szItemText, t_cchItemLen + 6, _T(\"&%i %s\"), nItem + 1, szBuff);\n\t\t\t\t}\n\n\t\t\t\t::InsertMenu(m_hMenu, nInsertPoint + nItem, MF_BYPOSITION | MF_STRING, t_nFirstID + nItem, szItemText);\n\t\t\t}\n\t\t}\n\t\telse\t// empty\n\t\t{\n\t\t\t::InsertMenu(m_hMenu, nInsertPoint, MF_BYPOSITION | MF_STRING, t_nFirstID, m_szNoEntries);\n\t\t\t::EnableMenuItem(m_hMenu, t_nFirstID, MF_GRAYED);\n\t\t\tnItem++;\n\t\t}\n\t\t::DeleteMenu(m_hMenu, nInsertPoint + nItem, MF_BYPOSITION);\n\n\t\treturn TRUE;\n\t}\n\n// Overrideables\n\t// override to provide a different method of compacting document names\n\tstatic bool CompactDocumentName(LPTSTR lpstrOut, LPCTSTR lpstrIn, int cchLen)\n\t{\n\t\treturn AtlCompactPath(lpstrOut, lpstrIn, cchLen);\n\t}\n\n\tstatic LPCTSTR GetRegKeyName()\n\t{\n\t\treturn _T(\"Recent Document List\");\n\t}\n\n\tstatic LPCTSTR GetRegCountName()\n\t{\n\t\treturn _T(\"DocumentCount\");\n\t}\n\n\tstatic LPCTSTR GetRegItemName()\n\t{\n\t\t// Note: This string is a format string used with wsprintf().\n\t\t// Resulting formatted string must be m_cchItemNameLen or less \n\t\t// characters long, including the terminating null character.\n\t\treturn _T(\"Document%i\");\n\t}\n\n\tstatic LPCTSTR GetMRUEmptyText()\n\t{\n\t\treturn _WTL_MRUEMPTY_TEXT;\n\t}\n};\n\nclass CRecentDocumentList : public CRecentDocumentListBase<CRecentDocumentList>\n{\npublic:\n// nothing here\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CFindFile - file search helper class\n\nclass CFindFile\n{\npublic:\n// Data members\n\tHANDLE m_hFind;\n\tWIN32_FIND_DATA m_fd;\n\tLPTSTR m_lpszRoot;\n\tconst TCHAR m_chDirSeparator;\n\tBOOL m_bFound;\n\n// Constructor/destructor\n\tCFindFile() : m_hFind(NULL), m_lpszRoot(NULL), m_chDirSeparator(_T('\\\\')), m_bFound(FALSE)\n\t{\n\t\tmemset(&m_fd, 0, sizeof(m_fd));\n\t}\n\n\t~CFindFile()\n\t{\n\t\tClose();\n\t}\n\n// Attributes\n\tULONGLONG GetFileSize() const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\n\t\tULARGE_INTEGER nFileSize = {};\n\t\tif(m_bFound)\n\t\t{\n\t\t\tnFileSize.LowPart = m_fd.nFileSizeLow;\n\t\t\tnFileSize.HighPart = m_fd.nFileSizeHigh;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnFileSize.QuadPart = 0;\n\t\t}\n\n\t\treturn nFileSize.QuadPart;\n\t}\n\n\tBOOL GetFileName(LPTSTR lpstrFileName, int cchLength) const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\t\tif(lstrlen(m_fd.cFileName) >= cchLength)\n\t\t\treturn FALSE;\n\n\t\tif(m_bFound)\n\t\t\tATL::Checked::tcscpy_s(lpstrFileName, cchLength, m_fd.cFileName);\n\n\t\treturn m_bFound;\n\t}\n\n\tBOOL GetFilePath(LPTSTR lpstrFilePath, int cchLength) const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\n\t\tint nLen = lstrlen(m_lpszRoot);\n\t\tATLASSERT(nLen > 0);\n\t\tif(nLen == 0)\n\t\t\treturn FALSE;\n\n\t\tbool bAddSep = (m_lpszRoot[nLen - 1] != m_chDirSeparator);\n\n\t\tif((lstrlen(m_lpszRoot) + (bAddSep ?  1 : 0)) >= cchLength)\n\t\t\treturn FALSE;\n\n\t\tATL::Checked::tcscpy_s(lpstrFilePath, cchLength, m_lpszRoot);\n\n\t\tif(bAddSep)\n\t\t{\n\t\t\tTCHAR szSeparator[2] = { m_chDirSeparator, 0 };\n\t\t\tATL::Checked::tcscat_s(lpstrFilePath, cchLength, szSeparator);\n\t\t}\n\n\t\tATL::Checked::tcscat_s(lpstrFilePath, cchLength, m_fd.cFileName);\n\n\t\treturn TRUE;\n\t}\n\n\tBOOL GetFileTitle(LPTSTR lpstrFileTitle, int cchLength) const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\n\t\tTCHAR szBuff[MAX_PATH] = {};\n\t\tif(!GetFileName(szBuff, MAX_PATH))\n\t\t\treturn FALSE;\n\n\t\tif(lstrlen(szBuff) >= cchLength)\n\t\t\treturn FALSE;\n\n\t\t// find the last dot\n\t\tLPTSTR pstrDot  = _tcsrchr(szBuff, _T('.'));\n\t\tif(pstrDot != NULL)\n\t\t\t*pstrDot = 0;\n\n\t\tATL::Checked::tcscpy_s(lpstrFileTitle, cchLength, szBuff);\n\n\t\treturn TRUE;\n\t}\n\n\tBOOL GetFileURL(LPTSTR lpstrFileURL, int cchLength) const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\n\t\tLPCTSTR lpstrFileURLPrefix = _T(\"file://\");\n\t\tconst int cchPrefix = lstrlen(lpstrFileURLPrefix);\n\t\tif(cchPrefix >= cchLength)\n\t\t\treturn FALSE;\n\n\t\tATL::Checked::tcscpy_s(lpstrFileURL, cchLength, lpstrFileURLPrefix);\n\n\t\treturn GetFilePath(&lpstrFileURL[cchPrefix], cchLength - cchPrefix);\n\t}\n\n\tBOOL GetRoot(LPTSTR lpstrRoot, int cchLength) const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\t\tif(lstrlen(m_lpszRoot) >= cchLength)\n\t\t\treturn FALSE;\n\n\t\tATL::Checked::tcscpy_s(lpstrRoot, cchLength, m_lpszRoot);\n\n\t\treturn TRUE;\n\t}\n\n#ifdef __ATLSTR_H__\n\tATL::CString GetFileName() const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\n\t\tATL::CString ret;\n\n\t\tif(m_bFound)\n\t\t\tret = m_fd.cFileName;\n\t\treturn ret;\n\t}\n\n\tATL::CString GetFilePath() const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\n\t\tATL::CString strResult = m_lpszRoot;\n\t\tint nLen = strResult.GetLength();\n\t\tATLASSERT(nLen > 0);\n\t\tif(nLen == 0)\n\t\t\treturn strResult;\n\n\t\tif(strResult[nLen - 1] != m_chDirSeparator)\n\t\t\tstrResult += m_chDirSeparator;\n\t\tstrResult += GetFileName();\n\t\treturn strResult;\n\t}\n\n\tATL::CString GetFileTitle() const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\n\t\tATL::CString strResult;\n\t\tGetFileTitle(strResult.GetBuffer(MAX_PATH), MAX_PATH);\n\t\tstrResult.ReleaseBuffer();\n\n\t\treturn strResult;\n\t}\n\n\tATL::CString GetFileURL() const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\n\t\tATL::CString strResult(\"file://\");\n\t\tstrResult += GetFilePath();\n\t\treturn strResult;\n\t}\n\n\tATL::CString GetRoot() const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\n\t\tATL::CString str = m_lpszRoot;\n\t\treturn str;\n\t}\n#endif // __ATLSTR_H__\n\n\tBOOL GetLastWriteTime(FILETIME* pTimeStamp) const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\t\tATLASSERT(pTimeStamp != NULL);\n\n\t\tif(m_bFound && (pTimeStamp != NULL))\n\t\t{\n\t\t\t*pTimeStamp = m_fd.ftLastWriteTime;\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}\n\n\tBOOL GetLastAccessTime(FILETIME* pTimeStamp) const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\t\tATLASSERT(pTimeStamp != NULL);\n\n\t\tif(m_bFound && (pTimeStamp != NULL))\n\t\t{\n\t\t\t*pTimeStamp = m_fd.ftLastAccessTime;\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}\n\n\tBOOL GetCreationTime(FILETIME* pTimeStamp) const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\n\t\tif(m_bFound && (pTimeStamp != NULL))\n\t\t{\n\t\t\t*pTimeStamp = m_fd.ftCreationTime;\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}\n\n\tBOOL MatchesMask(DWORD dwMask) const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\n\t\tif(m_bFound)\n\t\t\treturn ((m_fd.dwFileAttributes & dwMask) != 0);\n\n\t\treturn FALSE;\n\t}\n\n\tBOOL IsDots() const\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\n\t\t// return TRUE if the file name is \".\" or \"..\" and\n\t\t// the file is a directory\n\n\t\tBOOL bResult = FALSE;\n\t\tif(m_bFound && IsDirectory())\n\t\t{\n\t\t\tif((m_fd.cFileName[0] == _T('.')) && ((m_fd.cFileName[1] == _T('\\0')) || ((m_fd.cFileName[1] == _T('.')) && (m_fd.cFileName[2] == _T('\\0')))))\n\t\t\t\tbResult = TRUE;\n\t\t}\n\n\t\treturn bResult;\n\t}\n\n\tBOOL IsReadOnly() const\n\t{\n\t\treturn MatchesMask(FILE_ATTRIBUTE_READONLY);\n\t}\n\n\tBOOL IsDirectory() const\n\t{\n\t\treturn MatchesMask(FILE_ATTRIBUTE_DIRECTORY);\n\t}\n\n\tBOOL IsCompressed() const\n\t{\n\t\treturn MatchesMask(FILE_ATTRIBUTE_COMPRESSED);\n\t}\n\n\tBOOL IsSystem() const\n\t{\n\t\treturn MatchesMask(FILE_ATTRIBUTE_SYSTEM);\n\t}\n\n\tBOOL IsHidden() const\n\t{\n\t\treturn MatchesMask(FILE_ATTRIBUTE_HIDDEN);\n\t}\n\n\tBOOL IsTemporary() const\n\t{\n\t\treturn MatchesMask(FILE_ATTRIBUTE_TEMPORARY);\n\t}\n\n\tBOOL IsNormal() const\n\t{\n\t\treturn MatchesMask(FILE_ATTRIBUTE_NORMAL);\n\t}\n\n\tBOOL IsArchived() const\n\t{\n\t\treturn MatchesMask(FILE_ATTRIBUTE_ARCHIVE);\n\t}\n\n// Operations\n\tBOOL FindFile(LPCTSTR pstrName = NULL, bool bAutoLongPath = false)\n\t{\n\t\tClose();\n\n\t\tif(pstrName == NULL)\n\t\t\tpstrName = _T(\"*.*\");\n\n\t\tif(bAutoLongPath && (lstrlen(pstrName) >= MAX_PATH))\n\t\t{\n\t\t\tLPCTSTR lpstrPrefix = _T(\"\\\\\\\\?\\\\\");\n\t\t\tint cchLongPath = lstrlen(lpstrPrefix) + lstrlen(pstrName) + 1;\n\t\t\tATL::CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\t\tLPTSTR lpstrLongPath = buff.Allocate(cchLongPath);\n\t\t\tif(lpstrLongPath != NULL)\n\t\t\t{\n\t\t\t\tATL::Checked::tcscpy_s(lpstrLongPath, cchLongPath, lpstrPrefix);\n\t\t\t\tATL::Checked::tcscat_s(lpstrLongPath, cchLongPath, pstrName);\n\t\t\t\tm_hFind = ::FindFirstFile(lpstrLongPath, &m_fd);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_hFind = ::FindFirstFile(pstrName, &m_fd);\n\t\t}\n\n\t\tif(m_hFind == INVALID_HANDLE_VALUE)\n\t\t\treturn FALSE;\n\n\t\tint cchRoot = ::GetFullPathName(pstrName, 0, NULL, NULL);\n\t\tif(cchRoot > 0)\n\t\t\tATLTRY(m_lpszRoot = new TCHAR[cchRoot]);\n\t\tif(m_lpszRoot == NULL)\n\t\t\treturn FALSE;\n\n\t\tbool bFullPath = (::GetFullPathName(pstrName, cchRoot, m_lpszRoot, NULL) != 0);\n\n\t\t// passed name isn't a valid path but was found by the API\n\t\tATLASSERT(bFullPath);\n\t\tif(!bFullPath)\n\t\t{\n\t\t\tClose();\n\t\t\t::SetLastError(ERROR_INVALID_NAME);\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// find the last separator\n\t\t\tLPTSTR pstrSep  = _tcsrchr(m_lpszRoot, m_chDirSeparator);\n\t\t\tif(pstrSep != NULL)\n\t\t\t\t*pstrSep = _T('\\0');\n\t\t}\n\n\t\tm_bFound = TRUE;\n\n\t\treturn TRUE;\n\t}\n\n\tBOOL FindNextFile()\n\t{\n\t\tATLASSERT(m_hFind != NULL);\n\n\t\tif(m_hFind == NULL)\n\t\t\treturn FALSE;\n\n\t\tif(!m_bFound)\n\t\t\treturn FALSE;\n\n\t\tm_bFound = ::FindNextFile(m_hFind, &m_fd);\n\n\t\treturn m_bFound;\n\t}\n\n\tvoid Close()\n\t{\n\t\tm_bFound = FALSE;\n\n\t\tdelete [] m_lpszRoot;\n\t\tm_lpszRoot = NULL;\n\n\t\tif((m_hFind != NULL) && (m_hFind != INVALID_HANDLE_VALUE))\n\t\t{\n\t\t\t::FindClose(m_hFind);\n\t\t\tm_hFind = NULL;\n\t\t}\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CRegProperty and CRegPropertyImpl<> - properties stored in registry\n\n// How to use: Derive a class from CRegPropertyImpl, add data members \n// for properties, and add REGPROP map to map properties to registry value names.\n// You can then call Read() and Write() methods to read and write properties to/from registry.\n// You can also use CRegProperty class directly, for one time read/write, or for custom stuff.\n\n#define REGPROP_CURRENTUSER   0x0000\n#define REGPROP_LOCALMACHINE  0x0001\n#define REGPROP_READONLY      0x0002\n#define REGPROP_WRITEONLY     0x0004\n\nclass CRegProperty\n{\npublic:\n// Type declarations\n\tstruct BinaryProp\n\t{\n\t\tvoid* pBinary;\n\t\tULONG uSize;   // buffer size in bytes, used size after read\n\n\t\tBinaryProp() : pBinary(NULL), uSize(0U)\n\t\t{ }\n\t};\n\n\tstruct CharArrayProp\n\t{\n\t\tLPTSTR lpstrText;\n\t\tULONG uSize;   // buffer size in chars\n\n\t\tCharArrayProp() : lpstrText(NULL), uSize(0U)\n\t\t{ }\n\t};\n\n// Data members\n\tATL::CRegKey m_regkey;\n\tWORD m_wFlags;\n\n// Constructor\n\tCRegProperty() : m_wFlags(REGPROP_CURRENTUSER)\n\t{ }\n\n// Registry key methods\n\tLSTATUS OpenRegKey(LPCTSTR lpstrRegKey, bool bWrite)\n\t{\n\t\tATLASSERT(m_regkey.m_hKey == NULL);\n\n\t\tHKEY hKey = ((m_wFlags & REGPROP_LOCALMACHINE) != 0) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;\n\t\tREGSAM sam = KEY_READ | KEY_WRITE;\n\t\tLSTATUS lRet = -1;\n\t\tif(bWrite)\n\t\t\tlRet = m_regkey.Create(hKey, lpstrRegKey, NULL, 0, ((m_wFlags & REGPROP_WRITEONLY) != 0) ? KEY_WRITE : sam);\n\t\telse\n\t\t\tlRet = m_regkey.Open(hKey, lpstrRegKey, ((m_wFlags & REGPROP_READONLY) != 0) ? KEY_READ : sam);\n\n\t\treturn lRet;\n\t}\n\n\tvoid CloseRegKey()\n\t{\n\t\tLSTATUS lRet = m_regkey.Close();\n\t\t(void)lRet;   // avoid level 4 warning\n\t\tATLASSERT(lRet == ERROR_SUCCESS);\n\t}\n\n// Flag methods\n\tWORD GetFlags() const\n\t{\n\t\treturn m_wFlags;\n\t}\n\n\tWORD SetFlags(WORD wFlags, WORD wMask = 0)\n\t{\n\t\tWORD wPrevFlags = m_wFlags;\n\t\tif(wMask == 0)\n\t\t\tm_wFlags = wFlags;\n\t\telse\n\t\t\tm_wFlags = (m_wFlags & ~wMask) | (wFlags & wMask);\n\n\t\treturn wPrevFlags;\n\t}\n\n// Generic read/write methods\n\ttemplate <class TProp>\n\tLSTATUS ReadProp(LPCTSTR lpstrRegValue, TProp& prop)\n\t{\n\t\tATLASSERT(m_regkey.m_hKey != NULL);\n\n\t\tDWORD dwRet = 0;\n\t\tLSTATUS lRet = m_regkey.QueryDWORDValue(lpstrRegValue, dwRet);\n\t\tif(lRet == ERROR_SUCCESS)\n\t\t\tprop = static_cast<TProp>(dwRet);\n\n\t\treturn lRet;\n\t}\n\n\ttemplate <class TProp>\n\tLSTATUS WriteProp(LPCTSTR lpstrRegValue, TProp& prop)\n\t{\n\t\tATLASSERT(m_regkey.m_hKey != NULL);\n\n\t\treturn m_regkey.SetDWORDValue(lpstrRegValue, (DWORD)prop);\n\t}\n\n// Specialization for bool\n\ttemplate <>\n\tLSTATUS ReadProp(LPCTSTR lpstrRegValue, bool& bProp)\n\t{\n\t\tATLASSERT(m_regkey.m_hKey != NULL);\n\n\t\tDWORD dwRet = 0;\n\t\tLSTATUS lRet = m_regkey.QueryDWORDValue(lpstrRegValue, dwRet);\n\t\tif(lRet == ERROR_SUCCESS)\n\t\t\tbProp = (dwRet != 0);\n\n\t\treturn lRet;\n\t}\n\n\ttemplate <>\n\tLSTATUS WriteProp(LPCTSTR lpstrRegValue, bool& bProp)\n\t{\n\t\tATLASSERT(m_regkey.m_hKey != NULL);\n\n\t\treturn m_regkey.SetDWORDValue(lpstrRegValue, bProp ? 1 : 0);\n\t}\n\n// Specialization for HFONT\n\ttemplate <>\n\tLSTATUS ReadProp(LPCTSTR lpstrRegValue, HFONT& hFont)\n\t{\n\t\tATLASSERT(m_regkey.m_hKey != NULL);\n\n\t\tLOGFONT lf = {};\n\t\tULONG uSize = sizeof(lf);\n\t\tLSTATUS lRet = m_regkey.QueryBinaryValue(lpstrRegValue, &lf, &uSize);\n\t\tif(lRet == ERROR_SUCCESS)\n\t\t{\n\t\t\tif(hFont != NULL)\n\t\t\t\t::DeleteObject(hFont);\n\n\t\t\thFont = ::CreateFontIndirect(&lf);\n\t\t\tif(hFont == NULL)\n\t\t\t\tlRet = ERROR_INVALID_DATA;\n\t\t}\n\n\t\treturn lRet;\n\t}\n\n\ttemplate <>\n\tLSTATUS WriteProp(LPCTSTR lpstrRegValue, HFONT& hFont)\n\t{\n\t\tATLASSERT(m_regkey.m_hKey != NULL);\n\n\t\tCLogFont lf(hFont);\n\t\treturn m_regkey.SetBinaryValue(lpstrRegValue, &lf, sizeof(lf));\n\t}\n\n// Specialization for BinaryProp\n\ttemplate <>\n\tLSTATUS ReadProp(LPCTSTR lpstrRegValue, BinaryProp& binProp)\n\t{\n\t\tATLASSERT(m_regkey.m_hKey != NULL);\n\n\t\tULONG uSize = 0U;\n\t\tLSTATUS lRet = m_regkey.QueryBinaryValue(lpstrRegValue, NULL, &uSize);\n\t\tif(lRet == ERROR_SUCCESS)\n\t\t{\n\t\t\tif(uSize <= binProp.uSize)\n\t\t\t\tlRet = m_regkey.QueryBinaryValue(lpstrRegValue, binProp.pBinary, &binProp.uSize);\n\t\t\telse\n\t\t\t\tlRet = ERROR_OUTOFMEMORY;\n\t\t}\n\n\t\treturn lRet;\n\t}\n\n\ttemplate <>\n\tLSTATUS WriteProp(LPCTSTR lpstrRegValue, BinaryProp& binProp)\n\t{\n\t\tATLASSERT(m_regkey.m_hKey != NULL);\n\n\t\treturn m_regkey.SetBinaryValue(lpstrRegValue, binProp.pBinary, binProp.uSize);\n\t}\n\n// Specialization for CharArrayProp\n\ttemplate <>\n\tLSTATUS ReadProp(LPCTSTR lpstrRegValue, CharArrayProp& caProp)\n\t{\n\t\tATLASSERT(m_regkey.m_hKey != NULL);\n\n\t\tULONG uSize = 0U;\n\t\tLSTATUS lRet = m_regkey.QueryStringValue(lpstrRegValue, NULL, &uSize);\n\t\tif(lRet == ERROR_SUCCESS)\n\t\t{\n\t\t\tif(uSize <= caProp.uSize)\n\t\t\t\tlRet = m_regkey.QueryStringValue(lpstrRegValue, caProp.lpstrText, &caProp.uSize);\n\t\t\telse\n\t\t\t\tlRet = ERROR_OUTOFMEMORY;\n\t\t}\n\n\t\treturn lRet;\n\t}\n\n\ttemplate <>\n\tLSTATUS WriteProp(LPCTSTR lpstrRegValue, CharArrayProp& caProp)\n\t{\n\t\tATLASSERT(m_regkey.m_hKey != NULL);\n\n\t\treturn m_regkey.SetStringValue(lpstrRegValue, caProp.lpstrText);\n\t}\n\n// Specialization for CString\n#ifdef __ATLSTR_H__\n\ttemplate <>\n\tLSTATUS ReadProp(LPCTSTR lpstrRegValue, ATL::CString& strProp)\n\t{\n\t\tATLASSERT(m_regkey.m_hKey != NULL);\n\n\t\tULONG uSize = 0U;\n\t\tLSTATUS lRet = m_regkey.QueryStringValue(lpstrRegValue, NULL, &uSize);\n\t\tif(lRet == ERROR_SUCCESS)\n\t\t{\n\t\t\tlRet = m_regkey.QueryStringValue(lpstrRegValue, strProp.GetBufferSetLength(uSize), &uSize);\n\t\t\tstrProp.ReleaseBuffer();\n\t\t}\n\n\t\treturn lRet;\n\t}\n\n\ttemplate <>\n\tLSTATUS WriteProp(LPCTSTR lpstrRegValue, ATL::CString& strProp)\n\t{\n\t\tATLASSERT(m_regkey.m_hKey != NULL);\n\n\t\treturn m_regkey.SetStringValue(lpstrRegValue, (LPCTSTR)strProp);\n\t}\n#endif // __ATLSTR_H__\n\n// Static methods for one time read/write\n\ttemplate <class TProp>\n\tstatic bool ReadOne(LPCTSTR lpstrRegKey, LPCTSTR lpstrRegValue, TProp& prop, WORD wFlags = REGPROP_CURRENTUSER)\n\t{\n\t\tCRegProperty rp;\n\t\trp.SetFlags(wFlags);\n\t\tLSTATUS lRet = rp.OpenRegKey(lpstrRegKey, false);\n\t\tif(lRet == ERROR_SUCCESS)\n\t\t{\n\t\t\tlRet = rp.ReadProp(lpstrRegValue, prop);\n\t\t\trp.CloseRegKey();\n\t\t}\n\n\t\treturn (lRet == ERROR_SUCCESS) || (lRet == ERROR_FILE_NOT_FOUND);\n\t}\n\n\ttemplate <class TProp>\n\tstatic bool WriteOne(LPCTSTR lpstrRegKey, LPCTSTR lpstrRegValue, TProp& prop, WORD wFlags = REGPROP_CURRENTUSER)\n\t{\n\t\tCRegProperty rp;\n\t\trp.SetFlags(wFlags);\n\t\tLSTATUS lRet = rp.OpenRegKey(lpstrRegKey, true);\n\t\tif(lRet == ERROR_SUCCESS)\n\t\t{\n\t\t\tlRet = rp.WriteProp(lpstrRegValue, prop);\n\t\t\trp.CloseRegKey();\n\t\t}\n\n\t\treturn (lRet == ERROR_SUCCESS);\n\t}\n};\n\n\n#define BEGIN_REGPROP_MAP(class) \\\n\tvoid ReadWriteAll(bool bWrite) \\\n\t{\n\n#define REG_PROPERTY(name, prop) \\\n\t\tthis->ReadWriteProp(name, prop, bWrite);\n\n#define END_REGPROP_MAP() \\\n\t}\n\ntemplate <class T>\nclass CRegPropertyImpl : public CRegProperty\n{\npublic:\n// Methods\n\tvoid Read(LPCTSTR lpstrRegKey)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tLSTATUS lRet = pT->OpenRegKey(lpstrRegKey, false);\n\t\tif(lRet == ERROR_SUCCESS)\n\t\t{\n\t\t\tpT->ReadWriteAll(false);\n\t\t\tpT->OnRead(lpstrRegKey);\n\n\t\t\tpT->CloseRegKey();\n\t\t}\n\t\telse if(lRet != ERROR_FILE_NOT_FOUND)\n\t\t{\n\t\t\tpT->OnReadError(NULL, lRet);\n\t\t}\n\t}\n\n\tvoid Write(LPCTSTR lpstrRegKey)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tLSTATUS lRet = pT->OpenRegKey(lpstrRegKey, true);\n\t\tif(lRet == ERROR_SUCCESS)\n\t\t{\n\t\t\tpT->ReadWriteAll(true);\n\t\t\tpT->OnWrite(lpstrRegKey);\n\n\t\t\tpT->CloseRegKey();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpT->OnWriteError(NULL, lRet);\n\t\t}\n\t}\n\n// Implementation\n\ttemplate <class TProp>\n\tvoid ReadWriteProp(LPCTSTR lpstrRegValue, TProp& prop, bool bWrite)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(bWrite)\n\t\t{\n\t\t\tLSTATUS lRet = pT->WriteProp(lpstrRegValue, prop);\n\t\t\tif(lRet != ERROR_SUCCESS)\n\t\t\t\tpT->OnWriteError(lpstrRegValue, lRet);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tLSTATUS lRet = pT->ReadProp(lpstrRegValue, prop);\n\t\t\tif((lRet != ERROR_SUCCESS) && (lRet != ERROR_FILE_NOT_FOUND))\n\t\t\t\tpT->OnReadError(lpstrRegValue, lRet);\n\t\t}\n\t}\n\n// Overrideable handlers\n\tvoid OnRead(LPCTSTR /*lpstrRegKey*/)\n\t{ }\n\n\tvoid OnWrite(LPCTSTR /*lpstrRegKey*/)\n\t{ }\n\n\tvoid OnReadError(LPCTSTR /*lpstrRegValue*/, LSTATUS /*lError*/)\n\t{\n\t\tATLASSERT(FALSE);\n\t}\n\n\tvoid OnWriteError(LPCTSTR /*lpstrRegValue*/, LSTATUS /*lError*/)\n\t{\n\t\tATLASSERT(FALSE);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Global functions for stock GDI objects\n\ninline HPEN AtlGetStockPen(int nPen)\n{\n\tATLASSERT((nPen == WHITE_PEN) || (nPen == BLACK_PEN) || (nPen == NULL_PEN) || (nPen == DC_PEN));\n\treturn (HPEN)::GetStockObject(nPen);\n}\n\ninline HBRUSH AtlGetStockBrush(int nBrush)\n{\n\tATLASSERT(((nBrush >= WHITE_BRUSH) && (nBrush <= HOLLOW_BRUSH)) || (nBrush == DC_BRUSH));\n\treturn (HBRUSH)::GetStockObject(nBrush);\n}\n\ninline HFONT AtlGetStockFont(int nFont)\n{\n\tATLASSERT(((nFont >= OEM_FIXED_FONT) && (nFont <= SYSTEM_FIXED_FONT)) || (nFont == DEFAULT_GUI_FONT));\n\treturn (HFONT)::GetStockObject(nFont);\n}\n\ninline HPALETTE AtlGetStockPalette(int nPalette)\n{\n\tATLASSERT(nPalette == DEFAULT_PALETTE); // the only one supported\n\treturn (HPALETTE)::GetStockObject(nPalette);\n}\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Global function for compacting a path by replacing parts with ellipsis\n\n// helper for multi-byte character sets\ninline bool _IsDBCSTrailByte(LPCTSTR lpstr, int nChar)\n{\n#ifndef _UNICODE\n\tint i = nChar;\n\tfor( ; i > 0; i--)\n\t{\n\t\tif(!::IsDBCSLeadByte(lpstr[i - 1]))\n\t\t\tbreak;\n\t}\n\treturn ((nChar > 0) && (((nChar - i) & 1) != 0));\n#else // _UNICODE\n\t(void)lpstr;   // avoid level 4 warning\n\t(void)nChar;   // avoid level 4 warning\n\treturn false;\n#endif // _UNICODE\n}\n\ninline bool AtlCompactPath(LPTSTR lpstrOut, LPCTSTR lpstrIn, int cchLen)\n{\n\tATLASSERT(lpstrOut != NULL);\n\tATLASSERT(lpstrIn != NULL);\n\tATLASSERT(cchLen > 0);\n\n\tLPCTSTR szEllipsis = _T(\"...\");\n\tconst int cchEndEllipsis = 3;\n\tconst int cchMidEllipsis = 4;\n\n\tif(lstrlen(lpstrIn) < cchLen)\n\t{\n\t\tATL::Checked::tcscpy_s(lpstrOut, cchLen, lpstrIn);\n\t\treturn true;\n\t}\n\n\tlpstrOut[0] = 0;\n\n\t// check if the separator is a slash or a backslash\n\tTCHAR chSlash = _T('\\\\');\n\tfor(LPTSTR lpstr = (LPTSTR)lpstrIn; *lpstr != 0; lpstr = ::CharNext(lpstr))\n\t{\n\t\tif((*lpstr == _T('/')) || (*lpstr == _T('\\\\')))\n\t\t\tchSlash = *lpstr;\n\t}\n\n\t// find the filename portion of the path\n\tLPCTSTR lpstrFileName = lpstrIn;\n\tfor(LPCTSTR pPath = lpstrIn; *pPath; pPath = ::CharNext(pPath))\n\t{\n\t\tif(((pPath[0] == _T('\\\\')) || (pPath[0] == _T(':')) || (pPath[0] == _T('/')))\n\t\t\t\t&& pPath[1] && (pPath[1] != _T('\\\\')) && (pPath[1] != _T('/')))\n\t\t\tlpstrFileName = pPath + 1;\n\t}\n\tint cchFileName = lstrlen(lpstrFileName);\n\n\t// handle just the filename without a path\n\tif((lpstrFileName == lpstrIn) && (cchLen > cchEndEllipsis))\n\t{\n\t\tbool bRet = (ATL::Checked::tcsncpy_s(lpstrOut, cchLen, lpstrIn, cchLen - cchEndEllipsis - 1) == 0);\n\t\tif(bRet)\n\t\t{\n#ifndef _UNICODE\n\t\t\tif(_IsDBCSTrailByte(lpstrIn, cchLen - cchEndEllipsis))\n\t\t\t\tlpstrOut[cchLen - cchEndEllipsis - 1] = 0;\n#endif // _UNICODE\n\t\t\tATL::Checked::tcscat_s(lpstrOut, cchLen, szEllipsis);\n\t\t}\n\t\treturn bRet;\n\t}\n\n\t// handle just ellipsis\n\tif((cchLen < (cchMidEllipsis + cchEndEllipsis)))\n\t{\n\t\tfor(int i = 0; i < cchLen - 1; i++)\n\t\t\tlpstrOut[i] = ((i + 1) == cchMidEllipsis) ? chSlash : _T('.');\n\t\tlpstrOut[cchLen - 1] = 0;\n\t\treturn true;\n\t}\n\n\t// calc how much we have to copy\n\tint cchToCopy = cchLen - (cchMidEllipsis + cchFileName) - 1;\n\n\tif(cchToCopy < 0)\n\t\tcchToCopy = 0;\n\n#ifndef _UNICODE\n\tif((cchToCopy > 0) && _IsDBCSTrailByte(lpstrIn, cchToCopy))\n\t\tcchToCopy--;\n#endif // _UNICODE\n\n\tbool bRet = (ATL::Checked::tcsncpy_s(lpstrOut, cchLen, lpstrIn, cchToCopy) == 0);\n\tif(!bRet)\n\t\treturn false;\n\n\t// add ellipsis\n\tATL::Checked::tcscat_s(lpstrOut, cchLen, szEllipsis);\n\tTCHAR szSlash[2] = { chSlash, 0 };\n\tATL::Checked::tcscat_s(lpstrOut, cchLen, szSlash);\n\n\t// add filename (and ellipsis, if needed)\n\tif(cchLen > (cchMidEllipsis + cchFileName))\n\t{\n\t\tATL::Checked::tcscat_s(lpstrOut, cchLen, lpstrFileName);\n\t}\n\telse\n\t{\n\t\tcchToCopy = cchLen - cchMidEllipsis - cchEndEllipsis - 1;\n#ifndef _UNICODE\n\t\tif((cchToCopy > 0) && _IsDBCSTrailByte(lpstrFileName, cchToCopy))\n\t\t\tcchToCopy--;\n#endif // _UNICODE\n\t\tbRet = (ATL::Checked::tcsncpy_s(&lpstrOut[cchMidEllipsis], cchLen - cchMidEllipsis, lpstrFileName, cchToCopy) == 0);\n\t\tif(bRet)\n\t\t\tATL::Checked::tcscat_s(lpstrOut, cchLen, szEllipsis);\n\t}\n\n\treturn bRet;\n}\n\n} // namespace WTL\n\n#endif // __ATLMISC_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlprint.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLPRINT_H__\n#define __ATLPRINT_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atlprint.h requires atlapp.h to be included first\n#endif\n\n#ifndef __ATLWIN_H__\n\t#error atlprint.h requires atlwin.h to be included first\n#endif\n\n#include <winspool.h>\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CPrinterInfo<t_nInfo>\n// CPrinterT<t_bManaged>\n// CDevModeT<t_bManaged>\n// CPrinterDC\n// CPrintJobInfo\n// CPrintJob\n// CPrintPreview\n// CPrintPreviewWindowImpl<T, TBase, TWinTraits>\n// CPrintPreviewWindow\n// CZoomPrintPreviewWindowImpl<T, TBase, TWinTraits>\n// CZoomPrintPreviewWindow\n\nnamespace WTL\n{\n\n///////////////////////////////////////////////////////////////////////////////\n// CPrinterInfo - This class wraps all of the PRINTER_INFO_* structures\n//                and provided by ::GetPrinter.\n\ntemplate <unsigned int t_nInfo>\nclass _printer_info\n{\npublic:\n\ttypedef void infotype;\n};\n\ntemplate <> class _printer_info<1> { public: typedef PRINTER_INFO_1 infotype; };\ntemplate <> class _printer_info<2> { public: typedef PRINTER_INFO_2 infotype; };\ntemplate <> class _printer_info<3> { public: typedef PRINTER_INFO_3 infotype; };\ntemplate <> class _printer_info<4> { public: typedef PRINTER_INFO_4 infotype; };\ntemplate <> class _printer_info<5> { public: typedef PRINTER_INFO_5 infotype; };\ntemplate <> class _printer_info<6> { public: typedef PRINTER_INFO_6 infotype; };\ntemplate <> class _printer_info<7> { public: typedef PRINTER_INFO_7 infotype; };\ntemplate <> class _printer_info<8> { public: typedef PRINTER_INFO_8 infotype; };\ntemplate <> class _printer_info<9> { public: typedef PRINTER_INFO_9 infotype; };\n\n\ntemplate <unsigned int t_nInfo>\nclass CPrinterInfo\n{\npublic:\n// Data members\n\ttypename _printer_info<t_nInfo>::infotype* m_pi;\n\n// Constructor/destructor\n\tCPrinterInfo() : m_pi(NULL)\n\t{ }\n\n\tCPrinterInfo(HANDLE hPrinter) : m_pi(NULL)\n\t{\n\t\tGetPrinterInfo(hPrinter);\n\t}\n\n\t~CPrinterInfo()\n\t{\n\t\tCleanup();\n\t}\n\n// Operations\n\tbool GetPrinterInfo(HANDLE hPrinter)\n\t{\n\t\tCleanup();\n\t\treturn GetPrinterInfoHelper(hPrinter, (BYTE**)&m_pi, t_nInfo);\n\t}\n\n// Implementation\n\tvoid Cleanup()\n\t{\n\t\tdelete [] (BYTE*)m_pi;\n\t\tm_pi = NULL;\n\t}\n\n\tstatic bool GetPrinterInfoHelper(HANDLE hPrinter, BYTE** pi, int nIndex)\n\t{\n\t\tATLASSERT(pi != NULL);\n\t\tDWORD dw = 0;\n\t\tBYTE* pb = NULL;\n\t\t::GetPrinter(hPrinter, nIndex, NULL, 0, &dw);\n\t\tif (dw > 0)\n\t\t{\n\t\t\tATLTRY(pb = new BYTE[dw]);\n\t\t\tif (pb != NULL)\n\t\t\t{\n\t\t\t\tmemset(pb, 0, dw);\n\t\t\t\tDWORD dwNew;\n\t\t\t\tif (!::GetPrinter(hPrinter, nIndex, pb, dw, &dwNew))\n\t\t\t\t{\n\t\t\t\t\tdelete [] pb;\n\t\t\t\t\tpb = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t*pi = pb;\n\t\treturn (pb != NULL);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CPrinter - Wrapper class for a HANDLE to a printer\n\ntemplate <bool t_bManaged>\nclass CPrinterT\n{\npublic:\n// Data members\n\tHANDLE m_hPrinter;\n\n// Constructor/destructor\n\tCPrinterT(HANDLE hPrinter = NULL) : m_hPrinter(hPrinter)\n\t{ }\n\n\t~CPrinterT()\n\t{\n\t\tClosePrinter();\n\t}\n\n// Operations\n\tCPrinterT& operator =(HANDLE hPrinter)\n\t{\n\t\tif (hPrinter != m_hPrinter)\n\t\t{\n\t\t\tClosePrinter();\n\t\t\tm_hPrinter = hPrinter;\n\t\t}\n\t\treturn *this;\n\t}\n\n\tbool IsNull() const { return (m_hPrinter == NULL); }\n\n\tbool OpenPrinter(HANDLE hDevNames, const DEVMODE* pDevMode = NULL)\n\t{\n\t\tbool b = false;\n\t\tDEVNAMES* pdn = (DEVNAMES*)::GlobalLock(hDevNames);\n\t\tif (pdn != NULL)\n\t\t{\n\t\t\tLPTSTR lpszPrinterName = (LPTSTR)pdn + pdn->wDeviceOffset;\n\t\t\tb = OpenPrinter(lpszPrinterName, pDevMode);\n\t\t\t::GlobalUnlock(hDevNames);\n\t\t}\n\t\treturn b;\n\t}\n\n\tbool OpenPrinter(LPCTSTR lpszPrinterName, const DEVMODE* pDevMode = NULL)\n\t{\n\t\tClosePrinter();\n\t\tPRINTER_DEFAULTS pdefs = { NULL, (DEVMODE*)pDevMode, PRINTER_ACCESS_USE };\n\t\t::OpenPrinter((LPTSTR) lpszPrinterName, &m_hPrinter, (pDevMode == NULL) ? NULL : &pdefs);\n\n\t\treturn (m_hPrinter != NULL);\n\t}\n\n\tbool OpenPrinter(LPCTSTR lpszPrinterName, PRINTER_DEFAULTS* pprintdefs)\n\t{\n\t\tClosePrinter();\n\t\t::OpenPrinter((LPTSTR) lpszPrinterName, &m_hPrinter, pprintdefs);\n\t\treturn (m_hPrinter != NULL);\n\t}\n\n\tbool OpenDefaultPrinter(const DEVMODE* pDevMode = NULL)\n\t{\n\t\tClosePrinter();\n\n\t\tDWORD cchBuff = 0;\n\t\t::GetDefaultPrinter(NULL, &cchBuff);\n\t\tTCHAR* pszBuff = new TCHAR[cchBuff];\n\t\tBOOL bRet = ::GetDefaultPrinter(pszBuff, &cchBuff);\n\t\tif(bRet != FALSE)\n\t\t{\n\t\t\tPRINTER_DEFAULTS pdefs = { NULL, (DEVMODE*)pDevMode, PRINTER_ACCESS_USE };\n\t\t\t::OpenPrinter(pszBuff, &m_hPrinter, (pDevMode == NULL) ? NULL : &pdefs);\n\t\t}\n\t\tdelete [] pszBuff;\n\n\t\treturn m_hPrinter != NULL;\n\t}\n\n\tvoid ClosePrinter()\n\t{\n\t\tif (m_hPrinter != NULL)\n\t\t{\n\t\t\tif (t_bManaged)\n\t\t\t\t::ClosePrinter(m_hPrinter);\n\t\t\tm_hPrinter = NULL;\n\t\t}\n\t}\n\n\tbool PrinterProperties(HWND hWnd = NULL)\n\t{\n\t\tif (hWnd == NULL)\n\t\t\thWnd = ::GetActiveWindow();\n\t\treturn !!::PrinterProperties(hWnd, m_hPrinter);\n\t}\n\n\tHANDLE CopyToHDEVNAMES() const\n\t{\n\t\tHANDLE hDevNames = NULL;\n\t\tCPrinterInfo<5> pinfon5;\n\t\tCPrinterInfo<2> pinfon2;\n\t\tLPTSTR lpszPrinterName = NULL;\n\t\tLPTSTR lpszPortName = NULL;\n\t\t// Some printers fail for PRINTER_INFO_5 in some situations\n\t\tif(pinfon5.GetPrinterInfo(m_hPrinter))\n\t\t{\n\t\t\tlpszPrinterName = pinfon5.m_pi->pPrinterName;\n\t\t\tlpszPortName = pinfon5.m_pi->pPortName;\n\t\t}\n\t\telse if(pinfon2.GetPrinterInfo(m_hPrinter))\n\t\t{\n\t\t\tlpszPrinterName = pinfon2.m_pi->pPrinterName;\n\t\t\tlpszPortName = pinfon2.m_pi->pPortName;\n\t\t}\n\n\t\tif(lpszPrinterName != NULL)\n\t\t{\n\t\t\tint nLen = sizeof(DEVNAMES) + (lstrlen(lpszPrinterName) + 1 + lstrlen(lpszPortName) + 1) * sizeof(TCHAR);\n\t\t\thDevNames = ::GlobalAlloc(GMEM_MOVEABLE, nLen);\n\t\t\tBYTE* pv = (BYTE*)::GlobalLock(hDevNames);\n\t\t\tDEVNAMES* pdev = (DEVNAMES*)pv;\n\t\t\tif(pv != NULL)\n\t\t\t{\n\t\t\t\tmemset(pv, 0, nLen);\n\t\t\t\tpdev->wDeviceOffset = sizeof(DEVNAMES) / sizeof(TCHAR);\n\t\t\t\tpv = pv + sizeof(DEVNAMES); // now points to end\n\t\t\t\tATL::Checked::tcscpy_s((LPTSTR)pv, lstrlen(lpszPrinterName) + 1, lpszPrinterName);\n\t\t\t\tpdev->wOutputOffset = (WORD)(sizeof(DEVNAMES) / sizeof(TCHAR) + lstrlen(lpszPrinterName) + 1);\n\t\t\t\tpv = pv + (lstrlen(lpszPrinterName) + 1) * sizeof(TCHAR);\n\t\t\t\tATL::Checked::tcscpy_s((LPTSTR)pv, lstrlen(lpszPortName) + 1, lpszPortName);\n\t\t\t\t::GlobalUnlock(hDevNames);\n\t\t\t}\n\t\t}\n\n\t\treturn hDevNames;\n\t}\n\n\tHDC CreatePrinterDC(const DEVMODE* pdm = NULL) const\n\t{\n\t\tCPrinterInfo<5> pinfo5;\n\t\tCPrinterInfo<2> pinfo2;\n\t\tHDC hDC = NULL;\n\t\tLPTSTR lpszPrinterName = NULL;\n\t\t// Some printers fail for PRINTER_INFO_5 in some situations\n\t\tif (pinfo5.GetPrinterInfo(m_hPrinter))\n\t\t\tlpszPrinterName = pinfo5.m_pi->pPrinterName;\n\t\telse if (pinfo2.GetPrinterInfo(m_hPrinter))\n\t\t\tlpszPrinterName = pinfo2.m_pi->pPrinterName;\n\t\tif (lpszPrinterName != NULL)\n\t\t\thDC = ::CreateDC(NULL, lpszPrinterName, NULL, pdm);\n\t\treturn hDC;\n\t}\n\n\tHDC CreatePrinterIC(const DEVMODE* pdm = NULL) const\n\t{\n\t\tCPrinterInfo<5> pinfo5;\n\t\tCPrinterInfo<2> pinfo2;\n\t\tHDC hDC = NULL;\n\t\tLPTSTR lpszPrinterName = NULL;\n\t\t// Some printers fail for PRINTER_INFO_5 in some situations\n\t\tif (pinfo5.GetPrinterInfo(m_hPrinter))\n\t\t\tlpszPrinterName = pinfo5.m_pi->pPrinterName;\n\t\telse if (pinfo2.GetPrinterInfo(m_hPrinter))\n\t\t\tlpszPrinterName = pinfo2.m_pi->pPrinterName;\n\t\tif (lpszPrinterName != NULL)\n\t\t\thDC = ::CreateIC(NULL, lpszPrinterName, NULL, pdm);\n\t\treturn hDC;\n\t}\n\n\tvoid Attach(HANDLE hPrinter)\n\t{\n\t\tClosePrinter();\n\t\tm_hPrinter = hPrinter;\n\t}\n\n\tHANDLE Detach()\n\t{\n\t\tHANDLE hPrinter = m_hPrinter;\n\t\tm_hPrinter = NULL;\n\t\treturn hPrinter;\n\t}\n\n\toperator HANDLE() const { return m_hPrinter; }\n};\n\ntypedef CPrinterT<false>   CPrinterHandle;\ntypedef CPrinterT<true>    CPrinter;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CDevMode - Wrapper class for DEVMODE\n\ntemplate <bool t_bManaged>\nclass CDevModeT\n{\npublic:\n// Data members\n\tHANDLE m_hDevMode;\n\tDEVMODE* m_pDevMode;\n\n// Constructor/destructor\n\tCDevModeT(HANDLE hDevMode = NULL) : m_hDevMode(hDevMode)\n\t{\n\t\tm_pDevMode = (m_hDevMode != NULL) ? (DEVMODE*)::GlobalLock(m_hDevMode) : NULL;\n\t}\n\n\t~CDevModeT()\n\t{\n\t\tCleanup();\n\t}\n\n// Operations\n\tCDevModeT<t_bManaged>& operator =(HANDLE hDevMode)\n\t{\n\t\tAttach(hDevMode);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HANDLE hDevModeNew)\n\t{\n\t\tCleanup();\n\t\tm_hDevMode = hDevModeNew;\n\t\tm_pDevMode = (m_hDevMode != NULL) ? (DEVMODE*)::GlobalLock(m_hDevMode) : NULL;\n\t}\n\n\tHANDLE Detach()\n\t{\n\t\tif (m_hDevMode != NULL)\n\t\t\t::GlobalUnlock(m_hDevMode);\n\t\tHANDLE hDevMode = m_hDevMode;\n\t\tm_hDevMode = NULL;\n\t\treturn hDevMode;\n\t}\n\n\tbool IsNull() const { return (m_hDevMode == NULL); }\n\n\tbool CopyFromPrinter(HANDLE hPrinter)\n\t{\n\t\tCPrinterInfo<2> pinfo;\n\t\tbool b = pinfo.GetPrinterInfo(hPrinter);\n\t\tif (b)\n\t\t b = CopyFromDEVMODE(pinfo.m_pi->pDevMode);\n\t\treturn b;\n\t}\n\n\tbool CopyFromDEVMODE(const DEVMODE* pdm)\n\t{\n\t\tif (pdm == NULL)\n\t\t\treturn false;\n\t\tint nSize = pdm->dmSize + pdm->dmDriverExtra;\n\t\tHANDLE h = ::GlobalAlloc(GMEM_MOVEABLE, nSize);\n\t\tif (h != NULL)\n\t\t{\n\t\t\tvoid* p = ::GlobalLock(h);\n\t\t\tATL::Checked::memcpy_s(p, nSize, pdm, nSize);\n\t\t\t::GlobalUnlock(h);\n\t\t}\n\t\tAttach(h);\n\t\treturn (h != NULL);\n\t}\n\n\tbool CopyFromHDEVMODE(HANDLE hdm)\n\t{\n\t\tbool b = false;\n\t\tif (hdm != NULL)\n\t\t{\n\t\t\tDEVMODE* pdm = (DEVMODE*)::GlobalLock(hdm);\n\t\t\tb = CopyFromDEVMODE(pdm);\n\t\t\t::GlobalUnlock(hdm);\n\t\t}\n\t\treturn b;\n\t}\n\n\tHANDLE CopyToHDEVMODE()\n\t{\n\t\tif ((m_hDevMode == NULL) || (m_pDevMode == NULL))\n\t\t\treturn NULL;\n\t\tint nSize = m_pDevMode->dmSize + m_pDevMode->dmDriverExtra;\n\t\tHANDLE h = ::GlobalAlloc(GMEM_MOVEABLE, nSize);\n\t\tif (h != NULL)\n\t\t{\n\t\t\tvoid* p = ::GlobalLock(h);\n\t\t\tATL::Checked::memcpy_s(p, nSize, m_pDevMode, nSize);\n\t\t\t::GlobalUnlock(h);\n\t\t}\n\t\treturn h;\n\t}\n\n\t// If this devmode was for another printer, this will create a new devmode\n\t// based on the existing devmode, but retargeted at the new printer\n\tbool UpdateForNewPrinter(HANDLE hPrinter)\n\t{\n\t\tbool bRet = false;\n\t\tLONG nLen = ::DocumentProperties(NULL, hPrinter, NULL, NULL, NULL, 0);\n\t\tATL::CTempBuffer<DEVMODE, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tDEVMODE* pdm = buff.AllocateBytes(nLen);\n\t\tif(pdm != NULL)\n\t\t{\n\t\t\tmemset(pdm, 0, nLen);\n\t\t\tLONG l = ::DocumentProperties(NULL, hPrinter, NULL, pdm, m_pDevMode, DM_IN_BUFFER | DM_OUT_BUFFER);\n\t\t\tif (l == IDOK)\n\t\t\t\tbRet = CopyFromDEVMODE(pdm);\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\tbool DocumentProperties(HANDLE hPrinter, HWND hWnd = NULL)\n\t{\n\t\tCPrinterInfo<1> pi;\n\t\tpi.GetPrinterInfo(hPrinter);\n\t\tif (hWnd == NULL)\n\t\t\thWnd = ::GetActiveWindow();\n\n\t\tbool bRet = false;\n\t\tLONG nLen = ::DocumentProperties(hWnd, hPrinter, pi.m_pi->pName, NULL, NULL, 0);\n\t\tATL::CTempBuffer<DEVMODE, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tDEVMODE* pdm = buff.AllocateBytes(nLen);\n\t\tif(pdm != NULL)\n\t\t{\n\t\t\tmemset(pdm, 0, nLen);\n\t\t\tLONG l = ::DocumentProperties(hWnd, hPrinter, pi.m_pi->pName, pdm, m_pDevMode, DM_IN_BUFFER | DM_OUT_BUFFER | DM_PROMPT);\n\t\t\tif (l == IDOK)\n\t\t\t\tbRet = CopyFromDEVMODE(pdm);\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\toperator HANDLE() const { return m_hDevMode; }\n\n\toperator DEVMODE*() const { return m_pDevMode; }\n\n// Implementation\n\tvoid Cleanup()\n\t{\n\t\tif (m_hDevMode != NULL)\n\t\t{\n\t\t\t::GlobalUnlock(m_hDevMode);\n\t\t\tif(t_bManaged)\n\t\t\t\t::GlobalFree(m_hDevMode);\n\t\t\tm_hDevMode = NULL;\n\t\t}\n\t}\n};\n\ntypedef CDevModeT<false>   CDevModeHandle;\ntypedef CDevModeT<true>    CDevMode;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CPrinterDC\n\nclass CPrinterDC : public CDC\n{\npublic:\n// Constructors/destructor\n\tCPrinterDC()\n\t{\n\t\tCPrinter printer;\n\t\tprinter.OpenDefaultPrinter();\n\t\tAttach(printer.CreatePrinterDC());\n\t\tATLASSERT(m_hDC != NULL);\n\t}\n\n\tCPrinterDC(HANDLE hPrinter, const DEVMODE* pdm = NULL)\n\t{\n\t\tCPrinterHandle p;\n\t\tp.Attach(hPrinter);\n\t\tAttach(p.CreatePrinterDC(pdm));\n\t\tATLASSERT(m_hDC != NULL);\n\t}\n\n\t~CPrinterDC()\n\t{\n\t\tDeleteDC();\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CPrintJob - Wraps a set of tasks for a specific printer (StartDoc/EndDoc)\n//             Handles aborting, background printing\n\n// Defines callbacks used by CPrintJob (not a COM interface)\nclass ATL_NO_VTABLE IPrintJobInfo\n{\npublic:\n\tvirtual void BeginPrintJob(HDC hDC) = 0;                // allocate handles needed, etc.\n\tvirtual void EndPrintJob(HDC hDC, bool bAborted) = 0;   // free handles, etc.\n\tvirtual void PrePrintPage(UINT nPage, HDC hDC) = 0;\n\tvirtual bool PrintPage(UINT nPage, HDC hDC) = 0;\n\tvirtual void PostPrintPage(UINT nPage, HDC hDC) = 0;\n\t// If you want per page devmodes, return the DEVMODE* to use for nPage.\n\t// You can optimize by only returning a new DEVMODE* when it is different\n\t// from the one for nLastPage, otherwise return NULL.\n\t// When nLastPage==0, the current DEVMODE* will be the default passed to\n\t// StartPrintJob.\n\t// Note: During print preview, nLastPage will always be \"0\".\n\tvirtual DEVMODE* GetNewDevModeForPage(UINT nLastPage, UINT nPage) = 0;\n\tvirtual bool IsValidPage(UINT nPage) = 0;\n};\n\n// Provides a default implementatin for IPrintJobInfo\n// Typically, MI'd into a document or view class\nclass ATL_NO_VTABLE CPrintJobInfo : public IPrintJobInfo\n{\npublic:\n\tCPrintJobInfo() : m_nPJState(0)\n\t{ }\n\n\tvirtual void BeginPrintJob(HDC /*hDC*/)   // allocate handles needed, etc\n\t{\n\t}\n\n\tvirtual void EndPrintJob(HDC /*hDC*/, bool /*bAborted*/)   // free handles, etc\n\t{\n\t}\n\n\tvirtual void PrePrintPage(UINT /*nPage*/, HDC hDC)\n\t{\n\t\tm_nPJState = ::SaveDC(hDC);\n\t}\n\n\tvirtual bool PrintPage(UINT /*nPage*/, HDC /*hDC*/) = 0;\n\n\tvirtual void PostPrintPage(UINT /*nPage*/, HDC hDC)\n\t{\n\t\tRestoreDC(hDC, m_nPJState);\n\t}\n\n\tvirtual DEVMODE* GetNewDevModeForPage(UINT /*nLastPage*/, UINT /*nPage*/)\n\t{\n\t\treturn NULL;\n\t}\n\n\tvirtual bool IsValidPage(UINT /*nPage*/)\n\t{\n\t\treturn true;\n\t}\n\n// Implementation - data\n\tint m_nPJState;\n};\n\n\nclass CPrintJob\n{\npublic:\n// Data members\n\tCPrinterHandle m_printer;\n\tIPrintJobInfo* m_pInfo;\n\tDEVMODE* m_pDefDevMode;\n\tDOCINFO m_docinfo;\n\tint m_nJobID;\n\tbool m_bCancel;\n\tbool m_bComplete;\n\tunsigned long m_nStartPage;\n\tunsigned long m_nEndPage;\n\n// Constructor/destructor\n\tCPrintJob() : m_pInfo(NULL), m_pDefDevMode(NULL), m_nJobID(0), m_bCancel(false), m_bComplete(true), m_nStartPage(0), m_nEndPage(0)\n\t{\n\t\tmemset(&m_docinfo, 0, sizeof(m_docinfo));\n\t}\n\n\t~CPrintJob()\n\t{\n\t\tATLASSERT(IsJobComplete()); // premature destruction?\n\t}\n\n// Operations\n\tbool IsJobComplete() const\n\t{\n\t\treturn m_bComplete;\n\t}\n\n\tbool StartPrintJob(bool bBackground, HANDLE hPrinter, DEVMODE* pDefaultDevMode,\n\t\t\tIPrintJobInfo* pInfo, LPCTSTR lpszDocName, \n\t\t\tunsigned long nStartPage, unsigned long nEndPage,\n\t\t\tbool bPrintToFile = false, LPCTSTR lpstrOutputFile = NULL)\n\t{\n\t\tATLASSERT(m_bComplete); // previous job not done yet?\n\t\tif (pInfo == NULL)\n\t\t\treturn false;\n\n\t\tmemset(&m_docinfo, 0, sizeof(m_docinfo));\n\t\tm_docinfo.cbSize = sizeof(m_docinfo);\n\t\tm_docinfo.lpszDocName = lpszDocName;\n\t\tm_pInfo = pInfo;\n\t\tm_nStartPage = nStartPage;\n\t\tm_nEndPage = nEndPage;\n\t\tm_printer.Attach(hPrinter);\n\t\tm_pDefDevMode = pDefaultDevMode;\n\t\tm_bComplete = false;\n\n\t\tif(bPrintToFile)\n\t\t\tm_docinfo.lpszOutput = (lpstrOutputFile != NULL) ? lpstrOutputFile : _T(\"FILE:\");\n\n\t\tif (!bBackground)\n\t\t{\n\t\t\tm_bComplete = true;\n\t\t\treturn StartHelper();\n\t\t}\n\n\t\t// Create a thread and return\n\t\tDWORD dwThreadID = 0;\n#ifdef _MT\n\t\tHANDLE hThread = (HANDLE)_beginthreadex(NULL, 0, (UINT (WINAPI*)(void*))StartProc, this, 0, (UINT*)&dwThreadID);\n#else\n\t\tHANDLE hThread = ::CreateThread(NULL, 0, StartProc, (void*)this, 0, &dwThreadID);\n#endif\n\t\tif (hThread == NULL)\n\t\t\treturn false;\n\n\t\t::CloseHandle(hThread);\n\n\t\treturn true;\n\t}\n\n// Implementation\n\tstatic DWORD WINAPI StartProc(void* p)\n\t{\n\t\tCPrintJob* pThis = (CPrintJob*)p;\n\t\tpThis->StartHelper();\n\t\tpThis->m_bComplete = true;\n\t\treturn 0;\n\t}\n\n\tbool StartHelper()\n\t{\n\t\tCDC dcPrinter;\n\t\tdcPrinter.Attach(m_printer.CreatePrinterDC(m_pDefDevMode));\n\t\tif (dcPrinter.IsNull())\n\t\t\treturn false;\n\t\t\t\n\t\tm_nJobID = ::StartDoc(dcPrinter, &m_docinfo);\n\t\tif (m_nJobID <= 0)\n\t\t\treturn false;\n\n\t\tm_pInfo->BeginPrintJob(dcPrinter);\n\n\t\t// print all the pages now\n\t\tunsigned long nLastPage = 0;\n\t\tfor (unsigned long nPage = m_nStartPage; nPage <= m_nEndPage; nPage++)\n\t\t{\n\t\t\tif (!m_pInfo->IsValidPage(nPage))\n\t\t\t\tbreak;\n\t\t\tDEVMODE* pdm = m_pInfo->GetNewDevModeForPage(nLastPage, nPage);\n\t\t\tif (pdm != NULL)\n\t\t\t\tdcPrinter.ResetDC(pdm);\n\t\t\tdcPrinter.StartPage();\n\t\t\tm_pInfo->PrePrintPage(nPage, dcPrinter);\n\t\t\tif (!m_pInfo->PrintPage(nPage, dcPrinter))\n\t\t\t\tm_bCancel = true;\n\t\t\tm_pInfo->PostPrintPage(nPage, dcPrinter);\n\t\t\tdcPrinter.EndPage();\n\t\t\tif (m_bCancel)\n\t\t\t\tbreak;\n\t\t\tnLastPage = nPage;\n\t\t}\n\n\t\tm_pInfo->EndPrintJob(dcPrinter, m_bCancel);\n\t\tif (m_bCancel)\n\t\t\t::AbortDoc(dcPrinter);\n\t\telse\n\t\t\t::EndDoc(dcPrinter);\n\t\tm_nJobID = 0;\n\t\treturn true;\n\t}\n\n\t// Cancels a print job. Can be called asynchronously.\n\tvoid CancelPrintJob()\n\t{\n\t\tm_bCancel = true;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CPrintPreview - Adds print preview support to an existing window\n\nclass CPrintPreview\n{\npublic:\n// Data members\n\tIPrintJobInfo* m_pInfo;\n\tCPrinterHandle m_printer;\n\tCEnhMetaFile m_meta;\n\tDEVMODE* m_pDefDevMode;\n\tDEVMODE* m_pCurDevMode;\n\tSIZE m_sizeCurPhysOffset;\n\n// Implementation - data\n\tint m_nCurPage;\n\n// Constructor\n\tCPrintPreview() : m_pInfo(NULL), m_pDefDevMode(NULL), m_pCurDevMode(NULL), m_nCurPage(0)\n\t{\n\t\tm_sizeCurPhysOffset.cx = 0;\n\t\tm_sizeCurPhysOffset.cy = 0;\n\t}\n\n// Operations\n\tvoid SetPrintPreviewInfo(HANDLE hPrinter, DEVMODE* pDefaultDevMode, IPrintJobInfo* pji)\n\t{\n\t\tm_printer.Attach(hPrinter);\n\t\tm_pDefDevMode = pDefaultDevMode;\n\t\tm_pInfo = pji;\n\t\tm_nCurPage = 0;\n\t\tm_pCurDevMode = NULL;\n\t}\n\n\tvoid SetEnhMetaFile(HENHMETAFILE hEMF)\n\t{\n\t\tm_meta = hEMF;\n\t}\n\n\tvoid SetPage(int nPage)\n\t{\n\t\tif (!m_pInfo->IsValidPage(nPage))\n\t\t\treturn;\n\t\tm_nCurPage = nPage;\n\t\tm_pCurDevMode = m_pInfo->GetNewDevModeForPage(0, nPage);\n\t\tif (m_pCurDevMode == NULL)\n\t\t\tm_pCurDevMode = m_pDefDevMode;\n\t\tCDC dcPrinter = m_printer.CreatePrinterDC(m_pCurDevMode);\n\n\t\tint iWidth = dcPrinter.GetDeviceCaps(PHYSICALWIDTH); \n\t\tint iHeight = dcPrinter.GetDeviceCaps(PHYSICALHEIGHT); \n\t\tint nLogx = dcPrinter.GetDeviceCaps(LOGPIXELSX);\n\t\tint nLogy = dcPrinter.GetDeviceCaps(LOGPIXELSY);\n\n\t\tRECT rcMM = { 0, 0, ::MulDiv(iWidth, 2540, nLogx), ::MulDiv(iHeight, 2540, nLogy) };\n\n\t\tm_sizeCurPhysOffset.cx = dcPrinter.GetDeviceCaps(PHYSICALOFFSETX);\n\t\tm_sizeCurPhysOffset.cy = dcPrinter.GetDeviceCaps(PHYSICALOFFSETY);\n\t\t\n\t\tCEnhMetaFileDC dcMeta(dcPrinter, &rcMM);\n\t\tm_pInfo->PrePrintPage(nPage, dcMeta);\n\t\tm_pInfo->PrintPage(nPage, dcMeta);\n\t\tm_pInfo->PostPrintPage(nPage, dcMeta);\n\t\tm_meta.Attach(dcMeta.Close());\n\t}\n\n\tvoid GetPageRect(RECT& rc, LPRECT prc)\n\t{\n\t\tint x1 = rc.right-rc.left;\n\t\tint y1 = rc.bottom - rc.top;\n\t\tif ((x1 < 0) || (y1 < 0))\n\t\t\treturn;\n\n\t\tCEnhMetaFileInfo emfinfo(m_meta);\n\t\tENHMETAHEADER* pmh = emfinfo.GetEnhMetaFileHeader();\n\t\tif(pmh == NULL)\n\t\t{\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn;\n\t\t}\n\n\t\t// Compute whether we are OK vertically or horizontally\n\t\tint x2 = pmh->szlDevice.cx;\n\t\tint y2 = pmh->szlDevice.cy;\n\t\tint y1p = MulDiv(x1, y2, x2);\n\t\tint x1p = MulDiv(y1, x2, y2);\n\t\tATLASSERT((x1p <= x1) || (y1p <= y1));\n\t\tif (x1p <= x1)\n\t\t{\n\t\t\tprc->left = rc.left + (x1 - x1p) / 2;\n\t\t\tprc->right = prc->left + x1p;\n\t\t\tprc->top = rc.top;\n\t\t\tprc->bottom = rc.bottom;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprc->left = rc.left;\n\t\t\tprc->right = rc.right;\n\t\t\tprc->top = rc.top + (y1 - y1p) / 2;\n\t\t\tprc->bottom = prc->top + y1p;\n\t\t}\n\t}\n\n// Painting helpers\n\tvoid DoPaint(CDCHandle dc)\n\t{\n\t\t// this one is not used\n\t}\n\n\tvoid DoPaint(CDCHandle dc, RECT& rc)\n\t{\n\t\tCEnhMetaFileInfo emfinfo(m_meta);\n\t\tENHMETAHEADER* pmh = emfinfo.GetEnhMetaFileHeader();\n\t\tif(pmh == NULL)\n\t\t{\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn;\n\t\t}\n\n\t\tint nOffsetX = MulDiv(m_sizeCurPhysOffset.cx, rc.right-rc.left, pmh->szlDevice.cx);\n\t\tint nOffsetY = MulDiv(m_sizeCurPhysOffset.cy, rc.bottom-rc.top, pmh->szlDevice.cy);\n\n\t\tdc.OffsetWindowOrg(-nOffsetX, -nOffsetY);\n\t\tdc.PlayMetaFile(m_meta, &rc);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CPrintPreviewWindow - Implements a print preview window\n\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CPrintPreviewWindowImpl : public ATL::CWindowImpl<T, TBase, TWinTraits>, public CPrintPreview\n{\npublic:\n\tDECLARE_WND_CLASS_EX2(NULL, T, CS_VREDRAW | CS_HREDRAW, -1)\n\n\tenum { m_cxOffset = 10, m_cyOffset = 10 };\n\n// Constructor\n\tCPrintPreviewWindowImpl() : m_nMinPage(0), m_nMaxPage(0)\n\t{ }\n\n// Operations\n\tvoid SetPrintPreviewInfo(HANDLE hPrinter, DEVMODE* pDefaultDevMode, \n\t\tIPrintJobInfo* pji, int nMinPage, int nMaxPage)\n\t{\n\t\tCPrintPreview::SetPrintPreviewInfo(hPrinter, pDefaultDevMode, pji);\n\t\tm_nMinPage = nMinPage;\n\t\tm_nMaxPage = nMaxPage;\n\t}\n\n\tbool NextPage()\n\t{\n\t\tif (m_nCurPage == m_nMaxPage)\n\t\t\treturn false;\n\t\tSetPage(m_nCurPage + 1);\n\t\tthis->Invalidate();\n\t\treturn true;\n\t}\n\n\tbool PrevPage()\n\t{\n\t\tif (m_nCurPage == m_nMinPage)\n\t\t\treturn false;\n\t\tif (m_nCurPage == 0)\n\t\t\treturn false;\n\t\tSetPage(m_nCurPage - 1);\n\t\tthis->Invalidate();\n\t\treturn true;\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CPrintPreviewWindowImpl)\n\t\tMESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd)\n\t\tMESSAGE_HANDLER(WM_PAINT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\n\tEND_MSG_MAP()\n\n\tLRESULT OnEraseBkgnd(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn 1;   // no need for the background\n\t}\n\n\tLRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tRECT rc = {};\n\n\t\tif(wParam != NULL)\n\t\t{\n\t\t\tpT->DoPrePaint((HDC)wParam, rc);\n\t\t\tpT->DoPaint((HDC)wParam, rc);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCPaintDC dc(this->m_hWnd);\n\t\t\tpT->DoPrePaint(dc.m_hDC, rc);\n\t\t\tpT->DoPaint(dc.m_hDC, rc);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n// Painting helper\n\tvoid DoPrePaint(CDCHandle dc, RECT& rc)\n\t{\n\t\tRECT rcClient = {};\n\t\tthis->GetClientRect(&rcClient);\n\t\tRECT rcArea = rcClient;\n\t\tT* pT = static_cast<T*>(this);\n\t\t(void)pT;   // avoid level 4 warning\n\t\t::InflateRect(&rcArea, -pT->m_cxOffset, -pT->m_cyOffset);\n\t\tif (rcArea.left > rcArea.right)\n\t\t\trcArea.right = rcArea.left;\n\t\tif (rcArea.top > rcArea.bottom)\n\t\t\trcArea.bottom = rcArea.top;\n\t\tGetPageRect(rcArea, &rc);\n\t\tCRgn rgn1, rgn2;\n\t\trgn1.CreateRectRgnIndirect(&rc);\n\t\trgn2.CreateRectRgnIndirect(&rcClient);\n\t\trgn2.CombineRgn(rgn1, RGN_DIFF);\n\t\tdc.SelectClipRgn(rgn2);\n\t\tdc.FillRect(&rcClient, COLOR_BTNSHADOW);\n\t\tdc.SelectClipRgn(NULL);\n\t\tdc.FillRect(&rc, (HBRUSH)::GetStockObject(WHITE_BRUSH));\n\t}\n\n// Implementation - data\n\tint m_nMinPage;\n\tint m_nMaxPage;\n};\n\n\nclass CPrintPreviewWindow : public CPrintPreviewWindowImpl<CPrintPreviewWindow>\n{\npublic:\n\tDECLARE_WND_CLASS_EX(_T(\"WTL_PrintPreview\"), CS_VREDRAW | CS_HREDRAW, -1)\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CZoomPrintPreviewWindowImpl - Implements print preview window with zooming\n\n#ifdef __ATLSCRL_H__\n\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CZoomPrintPreviewWindowImpl : public CPrintPreviewWindowImpl< T, TBase, TWinTraits >, public CZoomScrollImpl< T >\n{\npublic:\n\tbool m_bSized;\n\n\tCZoomPrintPreviewWindowImpl()  \n\t{\n\t\tthis->SetScrollExtendedStyle(SCRL_DISABLENOSCROLL);\n\t\tInitZoom();\n\t}\n\n\t// should be called to reset data members before recreating window \n\tvoid InitZoom()\n\t{\n\t\tm_bSized = false;\t\n\t\tthis->m_nZoomMode = ZOOMMODE_OFF;\n\t\tthis->m_fZoomScaleMin = 1.0;\n\t\tthis->m_fZoomScale = 1.0;\n\t}\n\n\tBEGIN_MSG_MAP(CZoomPrintPreviewWindowImpl)\n\t\tMESSAGE_HANDLER(WM_SETCURSOR, CZoomScrollImpl< T >::OnSetCursor)\n\t\tMESSAGE_HANDLER(WM_VSCROLL, CScrollImpl< T >::OnVScroll)\n\t\tMESSAGE_HANDLER(WM_HSCROLL, CScrollImpl< T >::OnHScroll)\n\t\tMESSAGE_HANDLER(WM_MOUSEWHEEL, CScrollImpl< T >::OnMouseWheel)\n\t\tMESSAGE_HANDLER(WM_MOUSEHWHEEL, CScrollImpl< T >::OnMouseHWheel)\n\t\tMESSAGE_HANDLER(WM_SETTINGCHANGE, CScrollImpl< T >::OnSettingChange)\n\t\tMESSAGE_HANDLER(WM_LBUTTONDOWN, CZoomScrollImpl< T >::OnLButtonDown)\n\t\tMESSAGE_HANDLER(WM_MOUSEMOVE, CZoomScrollImpl< T >::OnMouseMove)\n\t\tMESSAGE_HANDLER(WM_LBUTTONUP, CZoomScrollImpl< T >::OnLButtonUp)\n\t\tMESSAGE_HANDLER(WM_CAPTURECHANGED, CZoomScrollImpl< T >::OnCaptureChanged)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\t\tMESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd)\n\t\tMESSAGE_HANDLER(WM_PAINT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\n\tALT_MSG_MAP(1)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_UP, CScrollImpl< T >::OnScrollUp)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_DOWN, CScrollImpl< T >::OnScrollDown)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_UP, CScrollImpl< T >::OnScrollPageUp)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_DOWN, CScrollImpl< T >::OnScrollPageDown)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_TOP, CScrollImpl< T >::OnScrollTop)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_BOTTOM, CScrollImpl< T >::OnScrollBottom)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_LEFT, CScrollImpl< T >::OnScrollLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_RIGHT, CScrollImpl< T >::OnScrollRight)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_LEFT, CScrollImpl< T >::OnScrollPageLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_RIGHT, CScrollImpl< T >::OnScrollPageRight)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_ALL_LEFT, CScrollImpl< T >::OnScrollAllLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_ALL_RIGHT, CScrollImpl< T >::OnScrollAllRight)\n\tEND_MSG_MAP()\n\t\n\tLRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tSIZE sizeClient = {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};\n\t\tPOINT ptOffset = this->m_ptOffset;\n\t\tSIZE sizeAll = this->m_sizeAll;\n\t\tthis->SetScrollSize(sizeClient);\n\t\tif(sizeAll.cx > 0)\n\t\t\tptOffset.x = ::MulDiv(ptOffset.x, this->m_sizeAll.cx, sizeAll.cx);\n\t\tif(sizeAll.cy > 0)\n\t\t\tptOffset.y = ::MulDiv(ptOffset.y, this->m_sizeAll.cy, sizeAll.cy);\n\t\tthis->SetScrollOffset(ptOffset);\n\t\tCScrollImpl< T >::OnSize(uMsg, wParam, lParam, bHandled);\n\t\tif(!m_bSized)\n\t\t{\n\t\t\tm_bSized = true;\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->ShowScrollBar(SB_HORZ, TRUE);\n\t\t\tpT->ShowScrollBar(SB_VERT, TRUE);\n\t\t}\n\t\treturn 0;\n\t}\n\n\tLRESULT OnEraseBkgnd(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn 1;\n\t}\n\n\tLRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tRECT rc = {};\n\n\t\tif(wParam != NULL)\n\t\t{\n\t\t\tCDCHandle dc = (HDC)wParam;\n\t\t\tint nMapModeSav = dc.GetMapMode();\n\t\t\tdc.SetMapMode(MM_ANISOTROPIC);\n\t\t\tSIZE szWindowExt = { 0, 0 };\n\t\t\tdc.SetWindowExt(this->m_sizeLogAll, &szWindowExt);\n\t\t\tSIZE szViewportExt = { 0, 0 };\n\t\t\tdc.SetViewportExt(this->m_sizeAll, &szViewportExt);\n\t\t\tPOINT ptViewportOrg = { 0, 0 };\n\t\t\tdc.SetViewportOrg(-this->m_ptOffset.x, -this->m_ptOffset.y, &ptViewportOrg);\n\n\t\t\tpT->DoPrePaint(dc, rc);\n\t\t\tpT->DoPaint(dc, rc);\n\n\t\t\tdc.SetMapMode(nMapModeSav);\n\t\t\tdc.SetWindowExt(szWindowExt);\n\t\t\tdc.SetViewportExt(szViewportExt);\n\t\t\tdc.SetViewportOrg(ptViewportOrg);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCPaintDC dc(pT->m_hWnd);\n\t\t\tpT->PrepareDC(dc.m_hDC);\n\t\t\tpT->DoPrePaint(dc.m_hDC, rc);\n\t\t\tpT->DoPaint(dc.m_hDC, rc);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\t// Painting helpers\n\tvoid DoPaint(CDCHandle dc)\n\t{\n\t\t// this one is not used\n\t}\n\n\tvoid DoPrePaint(CDCHandle dc, RECT& rc)\n\t{\n\t\tRECT rcClient = {};\n\t\tthis->GetClientRect(&rcClient);\n\t\tRECT rcArea = rcClient;\n\t\tT* pT = static_cast<T*>(this);\n\t\t(void)pT;   // avoid level 4 warning\n\t\t::InflateRect(&rcArea, -pT->m_cxOffset, -pT->m_cyOffset);\n\t\tif (rcArea.left > rcArea.right)\n\t\t\trcArea.right = rcArea.left;\n\t\tif (rcArea.top > rcArea.bottom)\n\t\t\trcArea.bottom = rcArea.top;\n\t\tthis->GetPageRect(rcArea, &rc);\n\t\tHBRUSH hbrOld = dc.SelectBrush(::GetSysColorBrush(COLOR_BTNSHADOW));\n\t\tdc.PatBlt(rcClient.left, rcClient.top, rc.left - rcClient.left, rcClient.bottom - rcClient.top, PATCOPY);\n\t\tdc.PatBlt(rc.left, rcClient.top, rc.right - rc.left, rc.top - rcClient.top, PATCOPY);\n\t\tdc.PatBlt(rc.right, rcClient.top, rcClient.right - rc.right, rcClient.bottom - rcClient.top, PATCOPY);\n\t\tdc.PatBlt(rc.left, rc.bottom, rc.right - rc.left, rcClient.bottom - rc.bottom, PATCOPY);\n\t\tdc.SelectBrush((HBRUSH)::GetStockObject(WHITE_BRUSH));\n\t\tdc.PatBlt(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY);\n\t\tdc.SelectBrush(::GetSysColorBrush(COLOR_3DDKSHADOW));\n\t\tdc.PatBlt(rc.right, rc.top + 4, 4, rc.bottom - rc.top, PATCOPY);\n\t\tdc.PatBlt(rc.left + 4, rc.bottom, rc.right - rc.left, 4, PATCOPY);\n\t\tdc.SelectBrush(hbrOld);\n\t}\n\n\tvoid DoPaint(CDCHandle dc, RECT& rc)\n\t{\n\t\tCEnhMetaFileInfo emfinfo(this->m_meta);\n\t\tENHMETAHEADER* pmh = emfinfo.GetEnhMetaFileHeader();\n\t\tif(pmh == NULL)\n\t\t{\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn;\n\t\t}\n\n\t\tint nOffsetX = MulDiv(this->m_sizeCurPhysOffset.cx, rc.right-rc.left, pmh->szlDevice.cx);\n\t\tint nOffsetY = MulDiv(this->m_sizeCurPhysOffset.cy, rc.bottom-rc.top, pmh->szlDevice.cy);\n\n\t\tdc.OffsetWindowOrg(-nOffsetX, -nOffsetY);\n\t\tdc.PlayMetaFile(this->m_meta, &rc);\n\t}\n};\n\nclass CZoomPrintPreviewWindow : public CZoomPrintPreviewWindowImpl<CZoomPrintPreviewWindow>\n{\npublic:\n\tDECLARE_WND_CLASS_EX(_T(\"WTL_ZoomPrintPreview\"), CS_VREDRAW | CS_HREDRAW, -1)\n};\n\n#endif // __ATLSCRL_H__\n\n} // namespace WTL\n\n#endif // __ATLPRINT_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlres.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLRES_H__\n#define __ATLRES_H__\n\n#pragma once\n\n\n#ifdef RC_INVOKED\n#ifndef _INC_WINDOWS\n\n  #define _INC_WINDOWS\n\n  #define VS_VERSION_INFO     1\n\n  #ifdef APSTUDIO_INVOKED\n    #define APSTUDIO_HIDDEN_SYMBOLS // Ignore following symbols\n  #endif // APSTUDIO_INVOKED\n\n  #ifndef WINVER\n    #define WINVER 0x0500\n  #endif // !WINVER\n\n  #include <winresrc.h>\n\n    // operation messages sent to DLGINIT\n  #define LB_ADDSTRING    (WM_USER+1)\n  #define CB_ADDSTRING    (WM_USER+3)\n\n  #ifdef APSTUDIO_INVOKED\n    #undef APSTUDIO_HIDDEN_SYMBOLS\n  #endif // APSTUDIO_INVOKED\n\n  #ifdef IDC_STATIC\n    #undef IDC_STATIC\n  #endif // IDC_STATIC\n  #define IDC_STATIC      (-1)\n\n#endif // !_INC_WINDOWS\n#endif // RC_INVOKED\n\n#ifdef APSTUDIO_INVOKED\n  #define APSTUDIO_HIDDEN_SYMBOLS\n#endif // APSTUDIO_INVOKED\n\n///////////////////////////////////////////////////////////////////////////////\n// ATL resource types\n\n#ifndef RC_INVOKED\n  #define RT_DLGINIT  MAKEINTRESOURCE(240)\n  #define RT_TOOLBAR  MAKEINTRESOURCE(241)\n#endif // RC_INVOKED\n\n///////////////////////////////////////////////////////////////////////////////\n\n#ifdef APSTUDIO_INVOKED\n  #undef APSTUDIO_HIDDEN_SYMBOLS\n#endif // APSTUDIO_INVOKED\n\n///////////////////////////////////////////////////////////////////////////////\n// Standard window components\n\n#define ID_SEPARATOR                    0       // special separator value\n#define ID_DEFAULT_PANE                 0       // default status bar pane\n\n#ifndef RC_INVOKED  // code only\n// standard control bars (IDW = window ID)\n  #define ATL_IDW_TOOLBAR               0xE800  // main Toolbar for window\n  #define ATL_IDW_STATUS_BAR            0xE801  // Status bar window\n  #define ATL_IDW_COMMAND_BAR           0xE802  // Command bar window\n\n// parts of a frame window\n  #define ATL_IDW_CLIENT                0xE900\n  #define ATL_IDW_PANE_FIRST            0xE900  // first pane (256 max)\n  #define ATL_IDW_PANE_LAST             0xE9FF\n  #define ATL_IDW_HSCROLL_FIRST         0xEA00  // first Horz scrollbar (16 max)\n  #define ATL_IDW_VSCROLL_FIRST         0xEA10  // first Vert scrollbar (16 max)\n\n  #define ATL_IDW_SIZE_BOX              0xEA20  // size box for splitters\n  #define ATL_IDW_PANE_SAVE             0xEA21  // to shift ATL_IDW_PANE_FIRST\n\n// bands for a rebar\n  #define ATL_IDW_BAND_FIRST            0xEB00\n  #define ATL_IDW_BAND_LAST             0xEBFF\n#endif // !RC_INVOKED\n\n///////////////////////////////////////////////////////////////////////////////\n// Standard Commands\n\n// File commands\n#define ID_FILE_NEW                     0xE100\n#define ID_FILE_OPEN                    0xE101\n#define ID_FILE_CLOSE                   0xE102\n#define ID_FILE_SAVE                    0xE103\n#define ID_FILE_SAVE_AS                 0xE104\n#define ID_FILE_PAGE_SETUP              0xE105\n#define ID_FILE_PRINT_SETUP             0xE106\n#define ID_FILE_PRINT                   0xE107\n#define ID_FILE_PRINT_DIRECT            0xE108\n#define ID_FILE_PRINT_PREVIEW           0xE109\n#define ID_FILE_UPDATE                  0xE10A\n#define ID_FILE_SAVE_COPY_AS            0xE10B\n#define ID_FILE_SEND_MAIL               0xE10C\n\n#define ID_FILE_MRU_FIRST               0xE110\n#define ID_FILE_MRU_FILE1               0xE110          // range - 16 max\n#define ID_FILE_MRU_FILE2               0xE111\n#define ID_FILE_MRU_FILE3               0xE112\n#define ID_FILE_MRU_FILE4               0xE113\n#define ID_FILE_MRU_FILE5               0xE114\n#define ID_FILE_MRU_FILE6               0xE115\n#define ID_FILE_MRU_FILE7               0xE116\n#define ID_FILE_MRU_FILE8               0xE117\n#define ID_FILE_MRU_FILE9               0xE118\n#define ID_FILE_MRU_FILE10              0xE119\n#define ID_FILE_MRU_FILE11              0xE11A\n#define ID_FILE_MRU_FILE12              0xE11B\n#define ID_FILE_MRU_FILE13              0xE11C\n#define ID_FILE_MRU_FILE14              0xE11D\n#define ID_FILE_MRU_FILE15              0xE11E\n#define ID_FILE_MRU_FILE16              0xE11F\n#define ID_FILE_MRU_LAST                0xE11F\n\n// Edit commands\n#define ID_EDIT_CLEAR                   0xE120\n#define ID_EDIT_CLEAR_ALL               0xE121\n#define ID_EDIT_COPY                    0xE122\n#define ID_EDIT_CUT                     0xE123\n#define ID_EDIT_FIND                    0xE124\n#define ID_EDIT_PASTE                   0xE125\n#define ID_EDIT_PASTE_LINK              0xE126\n#define ID_EDIT_PASTE_SPECIAL           0xE127\n#define ID_EDIT_REPEAT                  0xE128\n#define ID_EDIT_REPLACE                 0xE129\n#define ID_EDIT_SELECT_ALL              0xE12A\n#define ID_EDIT_UNDO                    0xE12B\n#define ID_EDIT_REDO                    0xE12C\n#define ID_EDIT_DELETE                  ID_EDIT_CLEAR\n#define ID_EDIT_FIND_NEXT               ID_EDIT_REPEAT\n#define ID_EDIT_FIND_PREVIOUS           0xE12D\n\n// Window commands\n#define ID_WINDOW_NEW                   0xE130\n#define ID_WINDOW_ARRANGE               0xE131\n#define ID_WINDOW_CASCADE               0xE132\n#define ID_WINDOW_TILE_HORZ             0xE133\n#define ID_WINDOW_TILE_VERT             0xE134\n#define ID_WINDOW_SPLIT                 0xE135\n#ifndef RC_INVOKED      // code only\n  #define ATL_IDM_WINDOW_FIRST          0xE130\n  #define ATL_IDM_WINDOW_LAST           0xE13F\n  #define ATL_IDM_FIRST_MDICHILD        0xFF00  // window list starts here\n  #define ATL_IDM_LAST_MDICHILD         0xFFFD\n#endif // !RC_INVOKED\n// TabView\n#define ID_WINDOW_TABFIRST              0xFF00\t// = ATL_IDM_FIRST_MDICHILD\n#define ID_WINDOW_TABLAST               0xFFFD\n#define ID_WINDOW_SHOWTABLIST           0xFFFE\n\n// Help and App commands\n#define ID_APP_ABOUT                    0xE140\n#define ID_APP_EXIT                     0xE141\n#define ID_HELP_INDEX                   0xE142\n#define ID_HELP_FINDER                  0xE143\n#define ID_HELP_USING                   0xE144\n#define ID_CONTEXT_HELP                 0xE145      // shift-F1\n// special commands for processing help\n#define ID_HELP                         0xE146      // first attempt for F1\n#define ID_DEFAULT_HELP                 0xE147      // last attempt\n\n// Misc\n#define ID_NEXT_PANE                    0xE150\n#define ID_PREV_PANE                    0xE151\n#define ID_PANE_CLOSE                   0xE152\n#define ID_PANE_NEXT                    ID_NEXT_PANE\n#define ID_PANE_PREVIOUS                ID_PREV_PANE\n\n// Format\n#define ID_FORMAT_FONT                  0xE160\n\n// Scroll\n#define ID_SCROLL_UP                    0xE170\n#define ID_SCROLL_DOWN                  0xE171\n#define ID_SCROLL_PAGE_UP               0xE172\n#define ID_SCROLL_PAGE_DOWN             0xE173\n#define ID_SCROLL_TOP                   0xE174\n#define ID_SCROLL_BOTTOM                0xE175\n#define ID_SCROLL_LEFT                  0xE176\n#define ID_SCROLL_RIGHT                 0xE177\n#define ID_SCROLL_PAGE_LEFT             0xE178\n#define ID_SCROLL_PAGE_RIGHT            0xE179\n#define ID_SCROLL_ALL_LEFT              0xE17A\n#define ID_SCROLL_ALL_RIGHT             0xE17B\n\n// OLE commands\n#define ID_OLE_INSERT_NEW               0xE200\n#define ID_OLE_EDIT_LINKS               0xE201\n#define ID_OLE_EDIT_CONVERT             0xE202\n#define ID_OLE_EDIT_CHANGE_ICON         0xE203\n#define ID_OLE_EDIT_PROPERTIES          0xE204\n#define ID_OLE_VERB_FIRST               0xE210     // range - 16 max\n#ifndef RC_INVOKED      // code only\n  #define ID_OLE_VERB_LAST              0xE21F\n#endif // !RC_INVOKED\n\n// View commands (same number used as IDW used for toolbar and status bar)\n#define ID_VIEW_TOOLBAR                 0xE800\n#define ID_VIEW_STATUS_BAR              0xE801\n#define ID_VIEW_REFRESH                 0xE803\n#define ID_VIEW_RIBBON                  0xE804\n\n///////////////////////////////////////////////////////////////////////////////\n// Standard control IDs\n\n#ifdef IDC_STATIC\n  #undef IDC_STATIC\n#endif // IDC_STATIC\n#define IDC_STATIC              (-1)     // all static controls\n\n///////////////////////////////////////////////////////////////////////////////\n// Standard string error/warnings\n\n// idle status bar message\n#define ATL_IDS_IDLEMESSAGE             0xE001\n\n#ifndef RC_INVOKED      // code only\n  #define ATL_IDS_SCFIRST               0xEF00\n#endif // !RC_INVOKED\n\n#define ATL_IDS_SCSIZE                  0xEF00\n#define ATL_IDS_SCMOVE                  0xEF01\n#define ATL_IDS_SCMINIMIZE              0xEF02\n#define ATL_IDS_SCMAXIMIZE              0xEF03\n#define ATL_IDS_SCNEXTWINDOW            0xEF04\n#define ATL_IDS_SCPREVWINDOW            0xEF05\n#define ATL_IDS_SCCLOSE                 0xEF06\n#define ATL_IDS_SCRESTORE               0xEF12\n#define ATL_IDS_SCTASKLIST              0xEF13\n\n#define ATL_IDS_MDICHILD                0xEF1F\n#define ATL_IDS_MRU_FILE                0xEFDA\n\n///////////////////////////////////////////////////////////////////////////////\n// Misc. control IDs\n\n// Property Sheet control id's (determined with Spy++)\n#define ID_APPLY_NOW                    0x3021\n#define ID_WIZBACK                      0x3023\n#define ID_WIZNEXT                      0x3024\n#define ID_WIZFINISH                    0x3025\n#define ATL_IDC_TAB_CONTROL             0x3020\n\n#endif // __ATLRES_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlribbon.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLRIBBON_H__\n#define __ATLRIBBON_H__\n\n#pragma once\n\n#if (_MSC_VER < 1500)\n\t#error atlribbon.h requires Visual C++ 2008 compiler or higher\n#endif\n\n#ifndef _UNICODE\n\t#error atlribbon.h requires the Unicode character set\n#endif\n\n#if !defined(NTDDI_WIN7) || (NTDDI_VERSION < NTDDI_WIN7)\n\t#error atlribbon.h requires the Windows 7 SDK or higher\n#endif\n\n#ifndef __ATLAPP_H__\n\t#error atlribbon.h requires atlapp.h to be included first\n#endif\n\n#include <atlmisc.h>    // for RecentDocumentList classes\n#include <atlframe.h>   // for Frame and UpdateUI classes\n#include <atlctrls.h>   // required for atlctrlw.h\n#include <atlctrlw.h>   // for CCommandBarCtrl\n\n#ifndef __ATLSTR_H__\n  #pragma warning(push)\n  #pragma warning(disable: 4530)   // unwind semantics not enabled\n  #include <string>\n  #pragma warning(pop)\n#endif\n\n#include <dwmapi.h>\n#pragma comment(lib, \"dwmapi.lib\")\n\n#include \"UIRibbon.h\"\n#include \"UIRibbonPropertyHelpers.h\"\n#pragma comment(lib, \"propsys.lib\")\n\n#include <Richedit.h>   // for CHARFORMAT2\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CRibbonUpdateUI : Automatic mapping of ribbon UI elements\n//\n// RibbonUI::Text\n// RibbonUI::CharFormat\n// RibbonUI::ICtrl\n// RibbonUI::CtrlImpl\n// RibbonUI::CommandCtrlImpl\n// RibbonUI::ItemProperty\n// RibbonUI::CollectionImplBase\n// RibbonUI::CollectionImpl\n// RibbonUI::TextCollectionImpl\n// RibbonUI::ItemCollectionImpl\n// RibbonUI::ComboCollectionImpl\n// RibbonUI::CommandCollectionImpl\n// RibbonUI::ToolbarCollectionImpl\n// RibbonUI::SimpleCollectionImpl\n// RibbonUI::CollectionCtrlImpl\n// RibbonUI::ToolbarGalleryCtrlImpl\n// RibbonUI::SimpleCollectionCtrlImpl\n// RibbonUI::RecentItemsCtrlImpl\n// RibbonUI::FontCtrlImpl\n// RibbonUI::ColorCtrlImpl\n// RibbonUI::SpinnerCtrlImpl\n//\n// RibbonUI::CRibbonImpl\n//\t CRibbonImpl::CRibbonComboCtrl\n//\t CRibbonImpl::CRibbonItemGalleryCtrl\n//\t CRibbonImpl::CRibbonCommandGalleryCtrl\n//\t CRibbonImpl::CRibbonToolbarGalleryCtrl\n//\t CRibbonImpl::CRibbonSimpleComboCtrl\n//\t CRibbonImpl::CRibbonSimpleGalleryCtrl\n//\t CRibbonImpl::CRibbonRecentItemsCtrl\n//\t CRibbonImpl::CRibbonColorCtrl\n//\t CRibbonImpl::CRibbonFontCtrl\n//\t CRibbonImpl::CRibbonSpinnerCtrl\n//\t CRibbonImpl::CRibbonFloatSpinnerCtrl\n//\t CRibbonImpl::CRibbonCommandCtrl\n//\n// CRibbonFrameWindowImplBase\n// CRibbonFrameWindowImpl\n// CRibbonMDIFrameWindowImpl\n// CRibbonPersist\n//\n// Global functions:\n//   RibbonUI::SetPropertyVal()\n//   RibbonUI::GetImage()\n\n\n// Constants\n\n#ifndef RIBBONUI_MAX_TEXT\n  #define RIBBONUI_MAX_TEXT 128\n#endif\n\n#define TWIPS_PER_POINT 20   // For font size\n\n\nnamespace WTL\n{\n\n///////////////////////////////////////////////////////////////////////////////\n// CRibbonUpdateUI : Automatic mapping of ribbon UI elements\n\ntemplate <class T>\nclass CRibbonUpdateUI : public CAutoUpdateUI<T>\n{\npublic:\n\tenum\n\t{\n\t\tUPDUI_RIBBON = 0x0080, \n\t\tUPDUI_PERSIST = 0x0020\n\t};\n\n\tbool IsRibbonElement(const CUpdateUIBase::_AtlUpdateUIMap& UIMap)\n\t{\n\t\treturn (UIMap.m_wType & UPDUI_RIBBON) != 0;\n\t}\n\n\tbool IsRibbonID(UINT nID)\n\t{\n\t\tfor(int i = 0; i < this->m_arrUIMap.GetSize(); i++)\n\t\t{\n\t\t\tif(this->m_arrUIMap[i].m_nID == nID)\n\t\t\t\treturn IsRibbonElement(this->m_arrUIMap[i]);\n\t\t}\n\n\t\treturn false;\n\t}\n\n// Element\n\tbool UIAddRibbonElement(UINT nID)\n\t{\n\t\treturn this->UIAddElement<UPDUI_RIBBON>(nID);\n\t}\n\n\tbool UIRemoveRibbonElement(UINT nID)\n\t{\n\t\treturn this->UIRemoveElement<UPDUI_RIBBON>(nID);\n\t}\n\n\tbool UIPersistElement(UINT nID, bool bPersist = true)\n\t{\n\t\treturn bPersist ?\n\t\t\tthis->UIAddElement<UPDUI_PERSIST>(nID) :\n\t\t\tthis->UIRemoveElement<UPDUI_PERSIST>(nID);\n\t}\n\n// methods for Ribbon elements\n\tBOOL UISetText(int nID, LPCWSTR sText, BOOL bForceUpdate = FALSE)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tBOOL bRes = CUpdateUIBase::UISetText(nID, sText, bForceUpdate);\n\t\tif (pT->IsRibbonUI() && IsRibbonID(nID))\n\t\t\tbRes = SUCCEEDED(pT->InvalidateProperty(nID, UI_PKEY_Label));\n\t\treturn bRes;\n\t}\n\n\tBOOL UISetText(int nID, UINT uIdResource, BOOL bForceUpdate = FALSE)\n\t{\n\t\tATL::CTempBuffer<WCHAR> sText(RIBBONUI_MAX_TEXT);\n\t\tint nRet = ATL::AtlLoadString(uIdResource, sText, RIBBONUI_MAX_TEXT);\n\t\tif(nRet > 0)\n\t\t\tUISetText(nID, sText, bForceUpdate);\n\t\treturn (nRet > 0) ? TRUE : FALSE;\n\t}\n\n\tLPCTSTR UIGetText(int nID)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tLPCTSTR sUI = CAutoUpdateUI<T>::UIGetText(nID);\n\t\t\n\t\t// replace 'tab' by 'space' for RibbonUI elements\n\t\tif (sUI && pT->IsRibbonUI() && IsRibbonID(nID) && wcschr(sUI, L'\\t'))\n\t\t{\n\t\t\tstatic WCHAR sText[RIBBONUI_MAX_TEXT] = {};\n\t\t\twcscpy_s(sText, sUI);\n\t\t\tWCHAR* pch = wcschr(sText, L'\\t');\n\t\t\tif (pch != NULL)\n\t\t\t\t*pch = L' ';\n\t\t\treturn sText;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn sUI;\n\t\t}\n\t}\n\n\tBOOL UIEnable(int nID, BOOL bEnable, BOOL bForceUpdate = FALSE)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tBOOL bRes = CUpdateUIBase::UIEnable(nID, bEnable, bForceUpdate);\n\t\tif (pT->IsRibbonUI() && IsRibbonID(nID))\n\t\t\tbRes = SUCCEEDED(pT->SetProperty((WORD)nID, UI_PKEY_Enabled, bEnable));\n\t\treturn bRes;\n\t}\n\n\tBOOL UISetCheck(int nID, INT nCheck, BOOL bForceUpdate = FALSE)\n\t{\n\t\tif ((nCheck == 0) || (nCheck == 1))\n\t\t\treturn UISetCheck(nID, nCheck != 0, bForceUpdate);\n\t\telse\n\t\t\treturn CUpdateUIBase::UISetCheck(nID, nCheck, bForceUpdate);\n\t}\n\n\tBOOL UISetCheck(int nID, bool bCheck, BOOL bForceUpdate = FALSE)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tBOOL bRes = CUpdateUIBase::UISetCheck(nID, bCheck, bForceUpdate);\n\t\tif (bRes && pT->IsRibbonUI() && IsRibbonID(nID))\n\t\t\tbRes = SUCCEEDED(pT->SetProperty((WORD)nID, UI_PKEY_BooleanValue, bCheck));\n\t\treturn bRes;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// RibbonUI namespace\n//\n\nnamespace RibbonUI\n{\n\n// Minimal string allocation support for various PROPERTYKEY values\n#ifdef __ATLSTR_H__\n  typedef ATL::CString Text;\n#else\n  class Text : public std::wstring\n  {\n  public:\n\tText(std::wstring& s) : std::wstring(s)\n\t{ }\n\tText(LPCWSTR s) : std::wstring(s)\n\t{ }\n\tText()\n\t{ }\n\tbool IsEmpty()\n\t{\n\t\treturn empty();\n\t}\n\toperator LPCWSTR()\n\t{\n\t\treturn c_str();\n\t}\n\tText& operator =(LPCWSTR s)\n\t{\n\t\treturn static_cast<Text&>(std::wstring::operator =(s));\n\t}\n  };\n#endif // __ATLSTR_H__\n\n// PROPERTYKEY enum and helpers\nenum k_KEY\n{\n\t// state\n\tk_Enabled = 1, k_BooleanValue = 200, \n\t// text properties\n\tk_LabelDescription = 2, k_Keytip = 3, k_Label = 4, k_TooltipDescription = 5, k_TooltipTitle = 6, \n\t// image properties\n\tk_LargeImage = 7, k_LargeHighContrastImage = 8, k_SmallImage = 9, k_SmallHighContrastImage = 10,\n\t// collection properties\n\tk_ItemsSource = 101, k_Categories = 102, k_SelectedItem = 104,\n\t// collection item properties\n\tk_CommandId = 100, k_CategoryId = 103, k_CommandType = 105, k_ItemImage = 106,\n\t// combo control property\n\tk_StringValue = 202,\n\t// spinner control properties\n\tk_DecimalValue = 201, k_MaxValue = 203, k_MinValue, k_Increment, k_DecimalPlaces, k_FormatString, k_RepresentativeString = 208,\n\t// font control properties\n\tk_FontProperties = 300, k_FontProperties_Family, k_FontProperties_Size, k_FontProperties_Bold, k_FontProperties_Italic = 304, \n\tk_FontProperties_Underline = 305, k_FontProperties_Strikethrough, k_FontProperties_VerticalPositioning, k_FontProperties_ForegroundColor = 308, \n\tk_FontProperties_BackgroundColor = 309, k_FontProperties_ForegroundColorType, k_FontProperties_BackgroundColorType, k_FontProperties_ChangedProperties = 312, \n\tk_FontProperties_DeltaSize = 313, \n\t// recent items properties\n\tk_RecentItems = 350, k_Pinned = 351,\n\t// color control properties\n\tk_Color = 400, k_ColorType = 401, k_ColorMode, \n\tk_ThemeColorsCategoryLabel = 403, k_StandardColorsCategoryLabel, k_RecentColorsCategoryLabel = 405, k_AutomaticColorLabel = 406, \n\tk_NoColorLabel = 407, k_MoreColorsLabel = 408, \n\tk_ThemeColors = 409, k_StandardColors = 410, k_ThemeColorsTooltips = 411, k_StandardColorsTooltips = 412,\n\t// Ribbon state\n\tk_Viewable = 1000, k_Minimized = 1001, k_QuickAccessToolbarDock = 1002, k_ContextAvailable = 1100,\n\t// Ribbon UI colors\n\tk_GlobalBackgroundColor = 2000, k_GlobalHighlightColor, k_GlobalTextColor = 2002\n};\n\ninline k_KEY k_(REFPROPERTYKEY key)\n{\n\treturn (k_KEY)key.fmtid.Data1;\n}\n\n// PROPERTYKEY value assignment and specializations\n//\ntemplate <typename V>\nHRESULT SetPropertyVal(REFPROPERTYKEY key, V val, PROPVARIANT* ppv)\n{\n\tswitch (k_(key))\n\t{\n\tcase k_Enabled:\n\tcase k_BooleanValue:\n\t\treturn InitPropVariantFromBoolean(val, ppv);\n\tdefault:\n\t\treturn UIInitPropertyFromUInt32(key, val, ppv);\n\t}\n}\n\ninline HRESULT SetPropertyVal(REFPROPERTYKEY key, DOUBLE val, PROPVARIANT* ppv)\n{\n\treturn SetPropertyVal(key, (LONG)val, ppv);\n}\n\ninline HRESULT SetPropertyVal(REFPROPERTYKEY key, IUIImage* val, PROPVARIANT* ppv)\n{\n\tHRESULT hr = UIInitPropertyFromImage(key, val, ppv);\n\tATLVERIFY(val->Release() == 1);\n\treturn hr;\n}\n\ninline HRESULT SetPropertyVal(REFPROPERTYKEY key, IUnknown* val, PROPVARIANT* ppv)\n{\n\treturn UIInitPropertyFromInterface(key, val, ppv);\n}\n\ninline HRESULT SetPropertyVal(REFPROPERTYKEY key, IPropertyStore* val, PROPVARIANT* ppv)\n{\n\treturn UIInitPropertyFromInterface(key, val, ppv);\n}\n\ninline HRESULT SetPropertyVal(REFPROPERTYKEY key, SAFEARRAY* val, PROPVARIANT* ppv)\n{\n\treturn UIInitPropertyFromIUnknownArray(key, val, ppv);\n}\n\ninline HRESULT SetPropertyVal(REFPROPERTYKEY key, DECIMAL* val, PROPVARIANT* ppv)\n{\n\treturn UIInitPropertyFromDecimal(key, *val, ppv);\n}\n\ninline HRESULT SetPropertyVal(REFPROPERTYKEY key, bool val, PROPVARIANT* ppv)\n{\n\treturn UIInitPropertyFromBoolean(key, val, ppv);\n}\n\ninline HRESULT SetPropertyVal(REFPROPERTYKEY key, LPCWSTR val, PROPVARIANT* ppv)\n{\n\treturn UIInitPropertyFromString(key, val, ppv);\n}\n\n// CharFormat helper struct for RibbonUI font control\n//\nstruct CharFormat : CHARFORMAT2\n{\n\t// Default constructor\n\tCharFormat()\n\t{\n\t\tcbSize = sizeof(CHARFORMAT2);\n\t\tReset();\n\t}\n\n\t// Copy constructor\n\tCharFormat(const CharFormat& cf)\n\t{\n\t\tthis->CharFormat::CharFormat();\n\t\t::CopyMemory(this, &cf, sizeof(CharFormat));\n\t}\n\n\t// Assign operator\n\tCharFormat& operator =(const CharFormat& cf)\n\t{\n\t\t::CopyMemory(this, &cf, sizeof(CharFormat));\n\t\treturn (*this);\n\t}\n\n\tvoid Reset()\n\t{\n\t\tuValue = dwMask = dwEffects = 0;\n\t\tPropVariantInit(&propvar);\n\t}\n\n\tvoid operator <<(IPropertyStore* pStore)\n\t{\n\t\tif (pStore == NULL)\n\t\t{\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn;\n\t\t}\n\n\t\tstatic void (CharFormat::*Getk_[])(IPropertyStore*) = \n\t\t{\n\t\t\t&CharFormat::Getk_Family, \n\t\t\t&CharFormat::Getk_FontProperties_Size, \n\t\t\t&CharFormat::Getk_MaskEffectBold,\n\t\t\t&CharFormat::Getk_MaskEffectItalic,\n\t\t\t&CharFormat::Getk_MaskEffectUnderline,\n\t\t\t&CharFormat::Getk_MaskEffectStrikeout,\n\t\t\t&CharFormat::Getk_VerticalPositioning,\n\t\t\t&CharFormat::Getk_Color, \n\t\t\t&CharFormat::Getk_ColorBack, \n\t\t\t&CharFormat::Getk_ColorType,\n\t\t\t&CharFormat::Getk_ColorTypeBack,\n\t\t};\n\n\t\tDWORD nProps = 0;\n\t\tReset();\n\n\t\tATLVERIFY(SUCCEEDED(pStore->GetCount(&nProps)));\n\t\tfor (DWORD iProp = 0; iProp < nProps; iProp++)\n\t\t{\n\t\t\tPROPERTYKEY key;\t\n\t\t\tATLVERIFY(SUCCEEDED(pStore->GetAt(iProp, &key)));\n\t\t\tATLASSERT(k_(key) >= k_FontProperties_Family);\n\n\t\t\tif (k_(key) <= k_FontProperties_BackgroundColorType)\n\t\t\t\t(this->*Getk_[k_(key) - k_FontProperties_Family])(pStore);\n\t\t}\n\t}\n\n\tvoid operator >>(IPropertyStore* pStore)\n\t{\n\t\tif (pStore == NULL)\n\t\t{\n\t\t\tATLASSERT(FALSE);\n\t\t\treturn;\n\t\t}\n\n\t\tPutFace(pStore);\n\t\tPutSize(pStore);\n\t\tPutMaskEffect(CFM_BOLD, CFE_BOLD, UI_PKEY_FontProperties_Bold, pStore);\n\t\tPutMaskEffect(CFM_ITALIC, CFE_ITALIC, UI_PKEY_FontProperties_Italic, pStore);\n\t\tPutMaskEffect(CFM_UNDERLINE, CFE_UNDERLINE, UI_PKEY_FontProperties_Underline, pStore);\n\t\tPutMaskEffect(CFM_STRIKEOUT, CFE_STRIKEOUT, UI_PKEY_FontProperties_Strikethrough, pStore);\n\t\tPutVerticalPos(pStore);\n\t\tPutColor(pStore);\n\t\tPutBackColor(pStore);\n\t}\n\nprivate:\n\tPROPVARIANT propvar;\n\tUINT uValue;\n\n\t// Getk_ functions\n\tvoid Getk_Family(IPropertyStore* pStore)\n\t{\n\t\tif (SUCCEEDED(pStore->GetValue(UI_PKEY_FontProperties_Family, &propvar)))\n\t\t{\n\t\t\tPropVariantToString(propvar, szFaceName, LF_FACESIZE);\n\t\t\tif (*szFaceName)\n\t\t\t\tdwMask |= CFM_FACE;\n\t\t}\n\t}\n\n\tvoid Getk_FontProperties_Size(IPropertyStore* pStore)\n\t{\n\t\tif (SUCCEEDED(pStore->GetValue(UI_PKEY_FontProperties_Size, &propvar)))\n\t\t{\n\t\t\tDECIMAL decSize = {};\n\t\t\tUIPropertyToDecimal(UI_PKEY_FontProperties_Size, propvar, &decSize);\n\t\t\tDOUBLE dSize = 0;\n\t\t\tVarR8FromDec(&decSize, &dSize);\n\t\t\tif (dSize > 0)\n\t\t\t{\n\t\t\t\tdwMask |= CFM_SIZE;\n\t\t\t\tyHeight = (LONG)(dSize * TWIPS_PER_POINT);\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid Getk_MaskEffectBold(IPropertyStore* pStore)\n\t{\n\t\tGetk_MaskEffectAll(pStore, CFM_BOLD, CFE_BOLD, UI_PKEY_FontProperties_Bold);\n\t}\n\n\tvoid Getk_MaskEffectItalic(IPropertyStore* pStore)\n\t{\n\t\tGetk_MaskEffectAll(pStore, CFM_ITALIC, CFE_ITALIC, UI_PKEY_FontProperties_Italic);\n\t}\n\n\tvoid Getk_MaskEffectUnderline(IPropertyStore* pStore)\n\t{\n\t\tGetk_MaskEffectAll(pStore, CFM_UNDERLINE, CFE_UNDERLINE, UI_PKEY_FontProperties_Underline);\n\t}\n\n\tvoid Getk_MaskEffectStrikeout(IPropertyStore* pStore)\n\t{\n\t\tGetk_MaskEffectAll(pStore, CFM_STRIKEOUT, CFE_STRIKEOUT, UI_PKEY_FontProperties_Strikethrough);\n\t}\n\n\tvoid Getk_MaskEffectAll(IPropertyStore* pStore, DWORD _dwMask, DWORD _dwEffects, REFPROPERTYKEY key)\n\t{\n\t\tif (SUCCEEDED(pStore->GetValue(key, &propvar)))\n\t\t{\n\t\t\tUIPropertyToUInt32(key, propvar, &uValue);\n\t\t\tif ((UI_FONTPROPERTIES)uValue != UI_FONTPROPERTIES_NOTAVAILABLE)\n\t\t\t{\n\t\t\t\tdwMask |= _dwMask;\n\t\t\t\tdwEffects |= ((UI_FONTPROPERTIES)uValue == UI_FONTPROPERTIES_SET) ? _dwEffects : 0;\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid Getk_VerticalPositioning(IPropertyStore* pStore)\n\t{\n\t\tif (SUCCEEDED(pStore->GetValue(UI_PKEY_FontProperties_VerticalPositioning, &propvar)))\n\t\t{\n\t\t\tUIPropertyToUInt32(UI_PKEY_FontProperties_VerticalPositioning, propvar, &uValue);\n\t\t\tUI_FONTVERTICALPOSITION uVerticalPosition = (UI_FONTVERTICALPOSITION) uValue;\n\t\t\tif ((uVerticalPosition != UI_FONTVERTICALPOSITION_NOTAVAILABLE))\n\t\t\t{\n\t\t\t\tdwMask |= (CFM_SUPERSCRIPT | CFM_SUBSCRIPT);\n\t\t\t\tif (uVerticalPosition != UI_FONTVERTICALPOSITION_NOTSET)\n\t\t\t\t{\n\t\t\t\t\tdwEffects |= (uVerticalPosition == UI_FONTVERTICALPOSITION_SUPERSCRIPT) ? CFE_SUPERSCRIPT : CFE_SUBSCRIPT;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid Getk_Color(IPropertyStore* pStore)\n\t{\n\t\tGetk_ColorAll(pStore, CFM_COLOR, UI_PKEY_FontProperties_ForegroundColor);\n\t}\n\n\tvoid Getk_ColorBack(IPropertyStore* pStore)\n\t{\n\t\tGetk_ColorAll(pStore, CFM_BACKCOLOR, UI_PKEY_FontProperties_BackgroundColor);\n\t}\n\t\t\n\tvoid Getk_ColorAll(IPropertyStore* pStore, DWORD _dwMask, REFPROPERTYKEY key)\n\t{\n\t\tUINT32 color = 0;\n\t\tif (SUCCEEDED(pStore->GetValue(key, &propvar)))\n\t\t{\n\t\t\tUIPropertyToUInt32(key, propvar, &color);\n\t\t\tdwMask |= _dwMask;\n\n\t\t\tif (_dwMask == CFM_COLOR)\n\t\t\t\tcrTextColor = color;\n\t\t\telse\n\t\t\t\tcrBackColor = color;\n\t\t}\n\t}\n\n\tvoid Getk_ColorType(IPropertyStore* pStore)\n\t{\n\t\tGetk_ColorTypeAll(pStore, CFM_COLOR, CFE_AUTOCOLOR, UI_SWATCHCOLORTYPE_AUTOMATIC, UI_PKEY_FontProperties_ForegroundColor);\n\n\t}\n\n\tvoid Getk_ColorTypeBack(IPropertyStore* pStore)\n\t{\n\t\tGetk_ColorTypeAll(pStore, CFM_BACKCOLOR, CFE_AUTOBACKCOLOR, UI_SWATCHCOLORTYPE_NOCOLOR, UI_PKEY_FontProperties_BackgroundColor);\n\t}\n\n\tvoid Getk_ColorTypeAll(IPropertyStore* pStore, DWORD _dwMask, DWORD _dwEffects, UI_SWATCHCOLORTYPE _type, REFPROPERTYKEY key)\n\t{\n\t\tif (SUCCEEDED(pStore->GetValue(key, &propvar)))\n\t\t{\n\t\t\tUIPropertyToUInt32(key, propvar, &uValue);\n\t\t\tif (_type == (UI_SWATCHCOLORTYPE)uValue)\n\t\t\t{\n\t\t\t\tdwMask |= _dwMask;\n\t\t\t\tdwEffects |= _dwEffects;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Put functions\n\tvoid PutMaskEffect(WORD dwMaskVal, WORD dwEffectVal, REFPROPERTYKEY key, IPropertyStore* pStore)\n\t{\n\t\tPROPVARIANT var;\n\t\tUI_FONTPROPERTIES uProp = UI_FONTPROPERTIES_NOTAVAILABLE;\n\t\tif ((dwMask & dwMaskVal) != 0)\n\t\t\tuProp = dwEffects & dwEffectVal ? UI_FONTPROPERTIES_SET : UI_FONTPROPERTIES_NOTSET;\n\t\tSetPropertyVal(key, uProp, &var);\n\t\tpStore->SetValue(key, var);\n\t}\n\n\tvoid PutVerticalPos(IPropertyStore* pStore)\n\t{\n\t\tPROPVARIANT var;\n\t\tUI_FONTVERTICALPOSITION uProp = UI_FONTVERTICALPOSITION_NOTAVAILABLE;\n\n\t\tif ((dwMask & CFE_SUBSCRIPT) != 0)\n\t\t{\n\t\t\tif ((dwMask & CFM_SUBSCRIPT) && (dwEffects & CFE_SUBSCRIPT))\n\t\t\t\tuProp = UI_FONTVERTICALPOSITION_SUBSCRIPT;\n\t\t\telse\n\t\t\t\tuProp = UI_FONTVERTICALPOSITION_SUPERSCRIPT;\n\t\t}\n\t\telse if ((dwMask & CFM_OFFSET) != 0)\n\t\t{\n\t\t\tif (yOffset > 0)\n\t\t\t\tuProp = UI_FONTVERTICALPOSITION_SUPERSCRIPT;\n\t\t\telse if (yOffset < 0)\n\t\t\t\tuProp = UI_FONTVERTICALPOSITION_SUBSCRIPT;\n\t\t}\n\n\t\tSetPropertyVal(UI_PKEY_FontProperties_VerticalPositioning, uProp, &var);\n\t\tpStore->SetValue(UI_PKEY_FontProperties_VerticalPositioning, var);\n\t}\n\n\tvoid PutFace(IPropertyStore* pStore)\n\t{\n\t\tPROPVARIANT var;\n\t\tSetPropertyVal(UI_PKEY_FontProperties_Family, \n\t\t\tdwMask & CFM_FACE ? szFaceName : L\"\", &var);\n\t\tpStore->SetValue(UI_PKEY_FontProperties_Family, var);\n\t}\n\n\tvoid PutSize(IPropertyStore* pStore)\n\t{\n\t\tPROPVARIANT var;\n\t\tDECIMAL decVal;\n\n\t\tif ((dwMask & CFM_SIZE) != 0)\n\t\t\tVarDecFromR8((DOUBLE)yHeight / TWIPS_PER_POINT, &decVal);\n\t\telse\n\t\t\tVarDecFromI4(0, &decVal);\n\n\t\tSetPropertyVal(UI_PKEY_FontProperties_Size, &decVal, &var);\n\t\tpStore->SetValue(UI_PKEY_FontProperties_Size, var);\n\t}\n\n\tvoid PutColor(IPropertyStore* pStore)\n\t{\n\t\tif ((dwMask & CFM_COLOR) != 0)\n\t\t{\n\t\t\tif ((dwEffects & CFE_AUTOCOLOR) == 0)\n\t\t\t{\n\t\t\t\tSetPropertyVal(UI_PKEY_FontProperties_ForegroundColorType, UI_SWATCHCOLORTYPE_RGB, &propvar);\n\t\t\t\tpStore->SetValue(UI_PKEY_FontProperties_ForegroundColorType, propvar);\n\t\t\t\t\n\t\t\t\tSetPropertyVal(UI_PKEY_FontProperties_ForegroundColor, crTextColor, &propvar);\n\t\t\t\tpStore->SetValue(UI_PKEY_FontProperties_ForegroundColor, propvar);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSetPropertyVal(UI_PKEY_FontProperties_ForegroundColorType, UI_SWATCHCOLORTYPE_AUTOMATIC, &propvar);\n\t\t\t\tpStore->SetValue(UI_PKEY_FontProperties_ForegroundColorType, propvar);\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid PutBackColor(IPropertyStore* pStore)\n\t{\n\t\tif (((dwMask & CFM_BACKCOLOR) != 0) && ((dwEffects & CFE_AUTOBACKCOLOR) == 0))\n\t\t{\n\t\t\tSetPropertyVal(UI_PKEY_FontProperties_BackgroundColorType, UI_SWATCHCOLORTYPE_RGB, &propvar);\n\t\t\tpStore->SetValue(UI_PKEY_FontProperties_BackgroundColorType, propvar);\n\t\t\t\t\n\t\t\tSetPropertyVal(UI_PKEY_FontProperties_BackgroundColor, crBackColor, &propvar);\n\t\t\tpStore->SetValue(UI_PKEY_FontProperties_BackgroundColor, propvar);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSetPropertyVal(UI_PKEY_FontProperties_BackgroundColorType, UI_SWATCHCOLORTYPE_NOCOLOR, &propvar);\n\t\t\tpStore->SetValue(UI_PKEY_FontProperties_BackgroundColorType, propvar);\n\t\t}\n\t}\n};\n\n// IUIImage helper\n//\ninline IUIImage* GetImage(HBITMAP hbm, UI_OWNERSHIP owner)\n{\n\tATLASSERT(hbm);\n\tIUIImage* pIUII = NULL;\n\tATL::CComPtr<IUIImageFromBitmap> pIFB;\n\n\tif SUCCEEDED(pIFB.CoCreateInstance(CLSID_UIRibbonImageFromBitmapFactory))\n\t\tATLVERIFY(SUCCEEDED(pIFB->CreateImage(hbm, owner, &pIUII)));\n\n\treturn pIUII;\n}\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Ribbon control classes\n\n// RibbonUI::ICtrl abstract interface of RibbonUI::CRibbonImpl and all RibbonUI control classes\n//\nstruct ICtrl\n{\n\tvirtual HRESULT DoExecute(UINT nCmdID, UI_EXECUTIONVERB verb, \n\t                          const PROPERTYKEY* key, const PROPVARIANT* ppropvarValue,\n\t                          IUISimplePropertySet* pCommandExecutionProperties) = 0;\n\n\tvirtual HRESULT DoUpdateProperty(UINT nCmdID, REFPROPERTYKEY key, \n\t                                 const PROPVARIANT* ppropvarCurrentValue, PROPVARIANT* ppropvarNewValue) = 0;\n};\n\n// RibbonUI::CtrlImpl base class for all ribbon controls\n//\ntemplate <class T, UINT t_ID>\nclass ATL_NO_VTABLE CtrlImpl : public ICtrl\n{\nprotected:\n\tT* m_pWndRibbon;\n\npublic:\n\ttypedef T WndRibbon;\n\n\tCtrlImpl() : m_pWndRibbon(T::pWndRibbon)\n\t{ }\n\n\tvirtual ~CtrlImpl()\n\t{ }\n\n\tWndRibbon& GetWndRibbon()\n\t{\n\t\treturn *m_pWndRibbon;\n\t}\n\n\tstatic WORD GetID()\n\t{\n\t\treturn t_ID;\n\t}\n\n\tText m_sTxt[5];\n\n\t// Operations\n\tHRESULT Invalidate()\n\t{\n\t\treturn GetWndRibbon().InvalidateCtrl(GetID());\n\t}\n\n\tHRESULT Invalidate(REFPROPERTYKEY key, UI_INVALIDATIONS flags = UI_INVALIDATIONS_PROPERTY)\n\t{\n\t\treturn GetWndRibbon().InvalidateProperty(GetID(), key, flags);\n\t}\n\n\tHRESULT SetText(REFPROPERTYKEY key, LPCWSTR sTxt, bool bUpdate = false)\n\t{\n\t\tATLASSERT((k_(key) <= k_TooltipTitle) && (k_(key) >= k_LabelDescription));\n\n\t\tm_sTxt[k_(key) - k_LabelDescription] = sTxt;\n\n\t\treturn bUpdate ?\n\t\t\tGetWndRibbon().InvalidateProperty(GetID(), key) :\n\t\t\tS_OK;\n\t}\n\n\t// Implementation\n\ttemplate <typename V>\n\tHRESULT SetProperty(REFPROPERTYKEY key, V val)\n\t{\n\t\treturn GetWndRibbon().SetProperty(GetID(), key, val);\n\t}\n\n\tHRESULT OnGetText(REFPROPERTYKEY key, PROPVARIANT* ppv)\n\t{\n\t\tATLASSERT((k_(key) <= k_TooltipTitle) && (k_(key) >= k_LabelDescription));\n\n\t\tconst INT iText = k_(key) - k_LabelDescription;\n\t\tif (m_sTxt[iText].IsEmpty())\n\t\t\tif (LPCWSTR sText = GetWndRibbon().OnRibbonQueryText(GetID(), key))\n\t\t\t\tm_sTxt[iText] = sText;\n\n\t\treturn !m_sTxt[iText].IsEmpty() ?\n\t\t\tSetPropertyVal(key, (LPCWSTR)m_sTxt[iText], ppv) :\n\t\t\tS_OK;\n\t}\n\n\tvirtual HRESULT DoExecute(UINT nCmdID, UI_EXECUTIONVERB verb, \n\t                          const PROPERTYKEY* key, const PROPVARIANT* ppropvarValue,\n\t                          IUISimplePropertySet* pCommandExecutionProperties)\n\t{\n\t\tATLASSERT(nCmdID == t_ID);\n\t\treturn GetWndRibbon().DoExecute(nCmdID, verb, key, ppropvarValue, pCommandExecutionProperties);\n\t}\n\n\tvirtual HRESULT DoUpdateProperty(UINT nCmdID, REFPROPERTYKEY key, \n\t                                 const PROPVARIANT* ppropvarCurrentValue, PROPVARIANT* ppropvarNewValue)\n\t{\n\t\tATLASSERT(nCmdID == t_ID);\n\n\t\tconst INT iMax = k_TooltipTitle - k_LabelDescription;\n\t\tconst INT iVal = k_(key) - k_LabelDescription;\n\n\t\treturn (iVal <= iMax) && (iVal >= 0) ?\n\t\t\tOnGetText(key, ppropvarNewValue) :\n\t\t\tGetWndRibbon().DoUpdateProperty(nCmdID, key, ppropvarCurrentValue, ppropvarNewValue);\n\t}\n};\n\n// CommandCtrlImpl base class for most ribbon controls\n//\ntemplate <class T, UINT t_ID>\nclass CommandCtrlImpl : public CtrlImpl<T, t_ID>\n{\npublic:\n\tCBitmap m_hbm[4];\n\n\tHRESULT SetImage(REFPROPERTYKEY key, HBITMAP hbm, bool bUpdate = false)\n\t{\n\t\tATLASSERT((k_(key) <= k_SmallHighContrastImage) && (k_(key) >= k_LargeImage));\n\t\t\t\n\t\tm_hbm[k_(key) - k_LargeImage].Attach(hbm);\n\n\t\treturn bUpdate ?\n\t\t\tthis->GetWndRibbon().InvalidateProperty(this->GetID(), key) :\n\t\t\tS_OK;\n\t}\n\n\tHRESULT OnGetImage(REFPROPERTYKEY key, PROPVARIANT* ppv)\n\t{\n\t\tATLASSERT((k_(key) <= k_SmallHighContrastImage) && (k_(key) >= k_LargeImage));\n\n\t\tconst INT iImage = k_(key) - k_LargeImage;\n\n\t\tif (m_hbm[iImage].IsNull())\n\t\t\tm_hbm[iImage] = this->GetWndRibbon().OnRibbonQueryImage(this->GetID(), key);\n\n\t\treturn m_hbm[iImage].IsNull() ?\n\t\t\tE_NOTIMPL :\n\t\t\tSetPropertyVal(key, GetImage(m_hbm[iImage], UI_OWNERSHIP_COPY), ppv);\n\t}\n\n\tvirtual HRESULT DoUpdateProperty(UINT nCmdID, REFPROPERTYKEY key, \n\t                                 const PROPVARIANT* ppropvarCurrentValue, PROPVARIANT* ppropvarNewValue)\n\t{\n\t\tATLASSERT (nCmdID == this->GetID());\n\n\t\treturn (k_(key) <= k_SmallHighContrastImage) && (k_(key) >= k_LargeImage) ?\n\t\t\tOnGetImage(key, ppropvarNewValue) :\n\t\t\tCtrlImpl<T, t_ID>::DoUpdateProperty(nCmdID, key, ppropvarCurrentValue, ppropvarNewValue);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Ribbon collection base classes\n\n// ItemProperty class: ribbon callback for each item in a collection\n//\n\n#pragma warning(push)\n#pragma warning(disable: 4512)   // assignment operator could not be generated\n\ntemplate <class TCollection>\nclass ItemProperty : public IUISimplePropertySet\n{\npublic:\n\tItemProperty(UINT i, TCollection* pCollection) : m_Index(i), m_pCollection(pCollection)\n\t{ }\n\n\tconst UINT m_Index;\n\tTCollection* m_pCollection;\n\n\t// IUISimplePropertySet method.\n\tSTDMETHODIMP GetValue(REFPROPERTYKEY key, PROPVARIANT *value)\n\t{\n\t\treturn m_pCollection->OnGetItem(m_Index, key, value);\n\t}\n\n\t// IUnknown methods.\n\tSTDMETHODIMP_(ULONG) AddRef()\n\t{\n\t\treturn 1;\n\t}\n\n\tSTDMETHODIMP_(ULONG) Release()\n\t{\n\t\treturn 1;\n\t}\n\n\tSTDMETHODIMP QueryInterface(REFIID iid, void** ppv)\n\t{\n\t\tif ((iid == __uuidof(IUnknown)) || (iid == __uuidof(IUISimplePropertySet)))\n\t\t{\n\t\t\t*ppv = this;\n\t\t\treturn S_OK;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn E_NOINTERFACE;\n\t\t}\n\t}\n};\n\n#pragma warning(pop)\n\n\n// CollectionImplBase: base class for all RibbonUI collections\n//\ntemplate <class TCollection, size_t t_size>\nclass CollectionImplBase\n{\n\ttypedef CollectionImplBase<TCollection, t_size> thisClass;\n\npublic:\n\tCollectionImplBase()\n\t{\n\t\tmemset(&m_apItems, 0, sizeof(m_apItems));\n\t\tfor (int i = 0; i < t_size; i++)\n\t\t\tm_apItems[i] = new ItemProperty<TCollection>(i, static_cast<TCollection*>(this));\n\t}\n\n\t~CollectionImplBase()\n\t{\n\t\tfor (int i = 0; i < t_size; i++)\n\t\t\tdelete m_apItems[i];\n\t}\n\n// Data members\n\tItemProperty<TCollection>* m_apItems[t_size];\n};\n\n// CollectionImpl: handles categories and collecton resizing\n//\ntemplate <class TCtrl, size_t t_items, size_t t_categories>\nclass CollectionImpl : public CollectionImplBase<CollectionImpl<TCtrl, t_items, t_categories>, t_items + t_categories>\n{\n\ttypedef CollectionImpl<TCtrl, t_items, t_categories> thisClass;\npublic:\n\ttypedef thisClass Collection;\n\n\tCollectionImpl() : m_size(t_items)\n\t{\n\t\t::FillMemory(m_auItemCat, sizeof(m_auItemCat), 0xff); // UI_COLLECTION_INVALIDINDEX\n\t}\n\n\tUINT32 m_auItemCat[t_items];\n\tText m_asCatName[__max(t_categories, 1)];\n\tsize_t m_size;\n\n// Operations\n\tHRESULT SetItemCategory(UINT uItem, UINT uCat, bool bUpdate = false)\n\t{\n\t\tATLASSERT((uItem < t_items) && (uCat < t_categories));\n\n\t\tm_auItemCat[uItem] = uCat;\n\n\t\treturn bUpdate ? InvalidateItems() : S_OK;\n\t}\n\n\tHRESULT SetCategoryText(UINT uCat, LPCWSTR sText, bool bUpdate = false)\n\t{\n\t\tATLASSERT(uCat < t_categories);\n\n\t\tm_asCatName[uCat] = sText;\n\n\t\treturn bUpdate ? InvalidateCategories() : S_OK;\n\t}\n\n\tHRESULT Resize(size_t size, bool bUpdate = false)\n\t{\n\t\tATLASSERT(size <= t_items);\n\n\t\tm_size = size;\n\n\t\treturn bUpdate ? InvalidateItems() : S_OK;\n\t}\n\n// Implementation\n\tHRESULT OnGetItem(UINT uIndex, REFPROPERTYKEY key, PROPVARIANT *value)\n\t{\n\t\tATLASSERT(uIndex < t_items + t_categories);\n\t\tTCtrl* pCtrl = static_cast<TCtrl*>(this);\n\n\t\treturn uIndex < t_items ?\n\t\t\tpCtrl->DoGetItem(uIndex, key, value) :\n\t\t\tpCtrl->DoGetCategory(uIndex - t_items, key, value);\n\t}\n\n\tHRESULT DoGetItem(UINT uItem, REFPROPERTYKEY key, PROPVARIANT *value)\n\t{\n\t\tATLASSERT(k_(key) == k_CategoryId);\n\t\tUINT32 uCat = UI_COLLECTION_INVALIDINDEX;\n\n\t\tif (t_categories != 0)\n\t\t{\n\t\t\tif (m_auItemCat[uItem] == UI_COLLECTION_INVALIDINDEX)\n\t\t\t{\n\t\t\t\ttypename TCtrl::WndRibbon& ribbon = static_cast<TCtrl*>(this)->GetWndRibbon();\n\t\t\t\tm_auItemCat[uItem] = ribbon.OnRibbonQueryItemCategory(TCtrl::GetID(), uItem);\n\t\t\t}\n\t\t\tuCat = m_auItemCat[uItem];\n\t\t}\n\n\t\treturn SetPropertyVal(key, uCat, value);\n\t}\n\n\tHRESULT DoGetCategory(UINT uCat, REFPROPERTYKEY key, PROPVARIANT *value)\n\t{\n\t\tHRESULT hr = S_OK;\n\n\t\tswitch (k_(key))\n\t\t{\n\t\tcase k_Label:\n\t\t\tif (m_asCatName[uCat].IsEmpty())\n\t\t\t{\n\t\t\t\ttypename TCtrl::WndRibbon& ribbon = static_cast<TCtrl*>(this)->GetWndRibbon();\n\t\t\t\tm_asCatName[uCat] = ribbon.OnRibbonQueryCategoryText(TCtrl::GetID(), uCat);\n\t\t\t}\n\t\t\thr = SetPropertyVal(key, (LPCWSTR)m_asCatName[uCat], value);\n\t\t\tbreak;\n\t\tcase k_CategoryId:\n\t\t\thr = SetPropertyVal(key, uCat, value);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tATLASSERT(FALSE);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn hr;\n\t}\n\n\tHRESULT InvalidateItems()\n\t{\n\t\treturn static_cast<TCtrl*>(this)->Invalidate(UI_PKEY_ItemsSource);\n\t}\n\n\tHRESULT InvalidateCategories()\n\t{\n\t\treturn static_cast<TCtrl*>(this)->Invalidate(UI_PKEY_Categories);\n\t}\n\n\tHRESULT DoUpdateProperty(UINT nCmdID, REFPROPERTYKEY key, \n\t                         const PROPVARIANT* ppropvarCurrentValue, PROPVARIANT* /*ppropvarNewValue*/)\n\t{\n\t\tATLASSERT(nCmdID == TCtrl::GetID());\n\t\t(void)nCmdID;   // avoid level 4 warning\n\n\t\tHRESULT hr = E_NOTIMPL;\n\t\tswitch (k_(key))\n\t\t{\n\t\tcase k_ItemsSource:\n\t\t\t{\n\t\t\t\tATL::CComQIPtr<IUICollection> pIUICollection(ppropvarCurrentValue->punkVal);\n\t\t\t\tATLASSERT(pIUICollection);\n\t\t\t\thr = pIUICollection->Clear();\n\t\t\t\tfor (UINT i = 0; i < m_size; i++)\n\t\t\t\t{\n\t\t\t\t\tif FAILED(hr = pIUICollection->Add(this->m_apItems[i]))\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tATLASSERT(SUCCEEDED(hr));\n\t\t\t}\n\t\t\tbreak;\n\t\tcase k_Categories:\n\t\t\tif (t_categories != 0)\n\t\t\t{\n\t\t\t\tATL::CComQIPtr<IUICollection> pIUICategory(ppropvarCurrentValue->punkVal);\n\t\t\t\tATLASSERT(pIUICategory.p);\n\t\t\t\thr = pIUICategory->Clear();\n\t\t\t\tfor (UINT i = t_items; i < (t_items + t_categories); i++)\n\t\t\t\t{\n\t\t\t\t\tif FAILED(hr = pIUICategory->Add(this->m_apItems[i]))\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tATLASSERT(SUCCEEDED(hr));\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\treturn hr;\n\t}\n};\n\n// TextCollectionImpl: handles item labels and selection\n//\ntemplate <class TCtrl, size_t t_items, size_t t_categories = 0>\nclass TextCollectionImpl : public CollectionImpl<TCtrl, t_items, t_categories>\n{\n\ttypedef TextCollectionImpl<TCtrl, t_items, t_categories> thisClass;\npublic:\n\ttypedef thisClass TextCollection;\n\n\tTextCollectionImpl() : m_uSelected(UI_COLLECTION_INVALIDINDEX)\n\t{ }\n\n\tText m_asText[t_items];\n\tUINT m_uSelected;\n\n\t// Operations\n\tHRESULT SetItemText(UINT uItem, LPCWSTR sText, bool bUpdate = false)\n\t{\n\t\tATLASSERT(uItem < t_items);\n\n\t\tm_asText[uItem] = sText;\n\n\t\treturn bUpdate ? this->InvalidateItems() : S_OK;\n\t}\n\n\tUINT GetSelected()\n\t{\n\t\treturn m_uSelected;\n\t}\n\n\tHRESULT Select(UINT uItem, bool bUpdate = false)\n\t{\n\t\tATLASSERT((uItem < t_items) || (uItem == UI_COLLECTION_INVALIDINDEX));\n\n\t\tm_uSelected = uItem;\n\n\t\ttypename TCtrl::WndRibbon& ribbon = static_cast<TCtrl*>(this)->GetWndRibbon();\n\t\treturn bUpdate ?\n\t\t\tribbon.SetProperty(TCtrl::GetID(), UI_PKEY_SelectedItem, uItem) : \n\t\t\tS_OK;\n\t}\n\n// Implementation\n \tHRESULT DoGetItem(UINT uItem, REFPROPERTYKEY key, PROPVARIANT *value)\n\t{\n\t\tATLASSERT(uItem < t_items);\n\n\t\tif (k_(key) == k_Label)\n\t\t{\n\t\t\tif (m_asText[uItem].IsEmpty())\n\t\t\t{\n\t\t\t\ttypename TCtrl::WndRibbon& ribbon = static_cast<TCtrl*>(this)->GetWndRibbon();\n\t\t\t\tm_asText[uItem] = ribbon.OnRibbonQueryItemText(TCtrl::GetID(), uItem);\n\t\t\t}\n\t\t\treturn SetPropertyVal(key, (LPCWSTR)m_asText[uItem], value);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn CollectionImpl<TCtrl, t_items, t_categories>::Collection::DoGetItem(uItem, key, value);\n\t\t}\n\t}\n\n\tHRESULT DoUpdateProperty(UINT nCmdID, REFPROPERTYKEY key, \n\t                         const PROPVARIANT* ppropvarCurrentValue, PROPVARIANT* ppropvarNewValue)\n\t{\n\t\tATLASSERT(nCmdID == TCtrl::GetID());\n\n\t\tif (k_(key) == k_SelectedItem)\n\t\t{\n\t\t\ttypename TCtrl::WndRibbon& ribbon = static_cast<TCtrl*>(this)->GetWndRibbon();\n\t\t\tUINT uSel = UI_COLLECTION_INVALIDINDEX;\n\t\t\tif ((m_uSelected == UI_COLLECTION_INVALIDINDEX) &&\n\t\t\t    ribbon.OnRibbonQuerySelectedItem(TCtrl::GetID(), uSel))\n\t\t\t\tm_uSelected = uSel;\n\n\t\t\treturn SetPropertyVal(key, m_uSelected, ppropvarNewValue);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn CollectionImpl<TCtrl, t_items, t_categories>::Collection::DoUpdateProperty(nCmdID, key, ppropvarCurrentValue, ppropvarNewValue);\n\t\t}\n\t}\n};\n\n// ItemCollectionImpl: handles item image\n//\ntemplate <class TCtrl, size_t t_items, size_t t_categories = 0>\nclass ItemCollectionImpl : public TextCollectionImpl<TCtrl, t_items, t_categories>\n{\n\ttypedef ItemCollectionImpl<TCtrl, t_items, t_categories> thisClass;\npublic:\n\ttypedef thisClass ItemCollection;\n\t\n\tCBitmap m_aBitmap[t_items];\n\n\t// Operations\n\tHRESULT SetItemImage(UINT uIndex, HBITMAP hbm, bool bUpdate = false)\n\t{\n\t\tATLASSERT(uIndex < t_items);\n\n\t\tm_aBitmap[uIndex] = hbm;\n\n\t\treturn bUpdate ? this->InvalidateItems() : S_OK;\n\t}\n\n// Implementation\n\tHRESULT DoGetItem(UINT uItem, REFPROPERTYKEY key, PROPVARIANT *value)\n\t{\n\t\tATLASSERT(uItem < t_items);\n\n\t\tif (k_(key) == k_ItemImage)\n\t\t{\n\t\t\tif (m_aBitmap[uItem].IsNull())\n\t\t\t{\n\t\t\t\ttypename TCtrl::WndRibbon& ribbon = static_cast<TCtrl*>(this)->GetWndRibbon();\n\t\t\t\tm_aBitmap[uItem] = ribbon.OnRibbonQueryItemImage(TCtrl::GetID(), uItem);\n\t\t\t}\n\t\t\treturn m_aBitmap[uItem].IsNull() ?\n\t\t\t\tE_NOTIMPL :\n\t\t\t\tSetPropertyVal(key, GetImage(m_aBitmap[uItem], UI_OWNERSHIP_COPY), value);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn TextCollectionImpl<TCtrl, t_items, t_categories>::TextCollection::DoGetItem(uItem, key, value);\n\t\t}\n\t}\n};\n\n// ComboCollectionImpl: handles combo text\n//\ntemplate <class TCtrl, size_t t_items, size_t t_categories = 0>\nclass ComboCollectionImpl : public ItemCollectionImpl<TCtrl, t_items, t_categories>\n{\n\ttypedef ComboCollectionImpl<TCtrl, t_items, t_categories> thisClass;\npublic:\n\ttypedef thisClass ComboCollection;\n\n\t// Operations\n\tHRESULT SetComboText(LPCWSTR sText)\n\t{\n\t\ttypename TCtrl::WndRibbon& ribbon = static_cast<TCtrl*>(this)->GetWndRibbon();\n\t\treturn ribbon.IsRibbonUI() ? \n\t\t\tribbon.SetProperty(TCtrl::GetID(), UI_PKEY_StringValue, sText) : \n\t\t\tS_OK;\n\t}\n\n\tLPCWSTR GetComboText()\n\t{\n\t\tstatic WCHAR sCombo[RIBBONUI_MAX_TEXT] = {};\n\t\ttypename TCtrl::WndRibbon& ribbon = static_cast<TCtrl*>(this)->GetWndRibbon();\n\t\tPROPVARIANT var;\n\t\tif (ribbon.IsRibbonUI())\n\t\t{\n\t\t\tHRESULT hr = ribbon.GetIUIFrameworkPtr()->GetUICommandProperty(TCtrl::GetID(), UI_PKEY_StringValue, &var);\n\t\t\tATLASSERT(SUCCEEDED(hr));\n\t\t\thr = PropVariantToString(var, sCombo, RIBBONUI_MAX_TEXT);\n\t\t\tATLASSERT(SUCCEEDED(hr));\n\t\t\treturn sCombo;\n\t\t}\n\t\treturn NULL;\n\t}\n};\n\n// CommandCollectionImpl: handles RibbonUI command collection controls\n//\ntemplate <class TCtrl, size_t t_items, size_t t_categories = 0>\nclass CommandCollectionImpl : public CollectionImpl<TCtrl, t_items, t_categories>\n{\n\ttypedef CommandCollectionImpl<TCtrl, t_items, t_categories> thisClass;\npublic:\n\ttypedef thisClass CommandCollection;\n\n\tCommandCollectionImpl()\n\t{\n\t\t::ZeroMemory(m_auCmd, sizeof(m_auCmd));\n\t\t::ZeroMemory(m_aCmdType, sizeof(m_aCmdType));\n\t}\n\n\tUINT32 m_auCmd[t_items];\n\tBYTE m_aCmdType[t_items];\n\n\t// Operations\n\tHRESULT SetItemCommand(UINT uItem, UINT32 uCommandID, bool bUpdate = false)\n\t{\n\t\tATLASSERT(uItem < t_items);\n\n\t\tif (uCommandID == m_auCmd[uItem])\n\t\t\treturn S_OK;\n\n\t\ttypename TCtrl::WndRibbon& ribbon = static_cast<TCtrl*>(this)->GetWndRibbon();\n\n\t\tm_auCmd[uItem] = uCommandID;\n\t\tif (uCommandID != 0)\n\t\t\tribbon.UIAddRibbonElement(uCommandID);\n\n\t\treturn bUpdate ? this->InvalidateItems() : S_OK;\n\t}\n\n\tHRESULT SetItemCommandType(UINT uItem, UI_COMMANDTYPE type, bool bUpdate = false)\n\t{\n\t\tATLASSERT(uItem < t_items);\n\n\t\tm_aCmdType[uItem] = (BYTE)type;\n\n\t\treturn bUpdate ? this->InvalidateItems() : S_OK;\n\t}\n\n// Implementation\n \tHRESULT DoGetItem(UINT uItem, REFPROPERTYKEY key, PROPVARIANT *value)\n\t{\n\t\tATLASSERT(uItem < t_items);\n\t\ttypename TCtrl::WndRibbon& ribbon = static_cast<TCtrl*>(this)->GetWndRibbon();\n\n\t\tHRESULT hr = E_FAIL;\n\t\tswitch (k_(key))\n\t\t{\n\t\tcase k_CommandId:\n\t\t\tif (m_auCmd[uItem] == 0)\n\t\t\t\tSetItemCommand(uItem, ribbon.OnRibbonQueryItemCommand(TCtrl::GetID(), uItem));\n\t\t\thr = SetPropertyVal(key, m_auCmd[uItem], value);\n\t\t\tbreak;\n\t\tcase k_CommandType:\n\t\t\tif (m_aCmdType[uItem] == UI_COMMANDTYPE_UNKNOWN)\n\t\t\t\tSetItemCommandType(uItem, ribbon.OnRibbonQueryItemCommandType(TCtrl::GetID(), uItem));\n\t\t\thr = SetPropertyVal(key, UINT32(m_aCmdType[uItem]), value);\n\t\t\tbreak;\n\t\tcase k_CategoryId:\n\t\tdefault:\n\t\t\thr = CollectionImpl<TCtrl, t_items, t_categories>::Collection::DoGetItem(uItem, key, value);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn hr;\n\t}\n\n\tHRESULT Select(UINT /*uItem*/, bool /*bUpdate*/ = false)\n\t{\n\t\tATLASSERT(FALSE);\n\t\treturn S_OK;\n\t}\n};\n\n// SimpleCollectionImpl: collection class for ribbon simple collection controls\n//\ntemplate <class TCtrl, size_t t_size, UI_COMMANDTYPE t_CommandType = UI_COMMANDTYPE_ACTION>\nclass SimpleCollectionImpl : public CollectionImplBase<SimpleCollectionImpl<TCtrl, t_size>, t_size>\n{\n\ttypedef SimpleCollectionImpl<TCtrl, t_size, t_CommandType> thisClass;\npublic:\n\ttypedef CollectionImplBase<thisClass, t_size> CollectionBase;\n\ttypedef thisClass SimpleCollection;\n\n// Implementation\n\tHRESULT OnGetItem(UINT uItem, REFPROPERTYKEY key, PROPVARIANT *value)\n\t{\n\t\tATLASSERT(uItem < t_size);\n\t\ttypename TCtrl::WndRibbon& ribbon = static_cast<TCtrl*>(this)->GetWndRibbon();\n\n\t\tHRESULT hr = E_NOTIMPL;\n\t\tswitch (k_(key))\n\t\t{\n\t\tcase k_ItemImage:\n\t\t\tif (HBITMAP hbm = ribbon.DefRibbonQueryItemImage(TCtrl::GetID(), uItem))\n\t\t\t\thr = SetPropertyVal(key, GetImage(hbm, UI_OWNERSHIP_TRANSFER), value);\n\t\t\tbreak;\n\t\tcase k_Label:\n\t\t\tif (LPCWSTR sText = ribbon.DefRibbonQueryItemText(TCtrl::GetID(), uItem))\n\t\t\t\thr = SetPropertyVal(key, (LPCWSTR)sText, value);\n\t\t\tbreak;\n\t\tcase k_CommandType:\n\t\t\thr = SetPropertyVal(key, t_CommandType, value);\n\t\t\tbreak;\n\t\tcase k_CommandId:\n\t\t\thr = SetPropertyVal(key, ribbon.DefRibbonQueryItemCommand(TCtrl::GetID(), uItem), value);\n\t\t\tbreak;\n\t\tcase k_CategoryId:\n\t\t\thr = SetPropertyVal(key, UI_COLLECTION_INVALIDINDEX, value);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tATLASSERT(FALSE);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn hr;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Ribbon collection control classes\n\n// CollectionCtrlImpl: specializable class for ribbon collection controls\n//\ntemplate <class T, UINT t_ID, class TCollection>\nclass CollectionCtrlImpl : public CommandCtrlImpl<T, t_ID>, public TCollection\n{\n\ttypedef CollectionCtrlImpl<T, t_ID, TCollection> thisClass;\npublic:\n\ttypedef CommandCtrlImpl<T, t_ID> CommandCtrl;\n\ttypedef TCollection Collection;\n\n\t// Implementation\n\tvirtual HRESULT DoUpdateProperty(UINT nCmdID, REFPROPERTYKEY key, \n\t                                 const PROPVARIANT* ppropvarCurrentValue, PROPVARIANT* ppropvarNewValue)\n\t{\n\t\tATLASSERT(nCmdID == this->GetID());\n\t\tATLASSERT(ppropvarNewValue);\n\n\t\tHRESULT hr = Collection::DoUpdateProperty(nCmdID, key, ppropvarCurrentValue, ppropvarNewValue);\n\t\tif FAILED(hr)\n\t\t\thr = CommandCtrl::DoUpdateProperty(nCmdID, key, ppropvarCurrentValue, ppropvarNewValue);\n\n\t\treturn hr;\n\t}\n\n\tvirtual HRESULT DoExecute(UINT nCmdID, UI_EXECUTIONVERB verb, \n\t                          const PROPERTYKEY* key, const PROPVARIANT* ppropvarValue,\n\t                          IUISimplePropertySet* /*pCommandExecutionProperties*/)\n\t{\n\t\tATLASSERT (nCmdID == this->GetID());\n\t\t(void)nCmdID; // avoid level4 warning\n\n\t\tif (key == NULL) // gallery button pressed\n\t\t{\n\t\t\tthis->GetWndRibbon().OnRibbonItemSelected(this->GetID(), UI_EXECUTIONVERB_EXECUTE, UI_COLLECTION_INVALIDINDEX);\n\t\t\treturn S_OK;\n\t\t}\n\n\t\tATLASSERT(k_(*key) == k_SelectedItem);\n\t\tATLASSERT(ppropvarValue);\n\n\t\tHRESULT hr = S_OK;\n\t\tUINT32 uSel = 0xffff;\n\t\thr = UIPropertyToUInt32(*key, *ppropvarValue, &uSel);\n\n\t\tif (SUCCEEDED(hr))\n\t\t{\n\t\t\tif (this->GetWndRibbon().OnRibbonItemSelected(this->GetID(), verb, uSel))\n\t\t\t\tTCollection::Select(uSel);\n\t\t}\n\n\t\treturn hr;\n\t}\n};\n\n// ToolbarGalleryCtrlImpl: base class for ribbon toolbar gallery controls\n//\ntemplate <class T, UINT t_ID, UINT t_idTB, size_t t_size>\nclass ToolbarGalleryCtrlImpl : public CollectionCtrlImpl<T, t_ID, CommandCollectionImpl<ToolbarGalleryCtrlImpl<T, t_ID, t_idTB, t_size>, t_size>>\n{\npublic:\n\tToolbarGalleryCtrlImpl()\n\t{\n\t\tCResource tbres;\n\t\tATLVERIFY(tbres.Load(RT_TOOLBAR, t_idTB));\n\t\t_AtlToolBarData* pData = (_AtlToolBarData*)tbres.Lock();\n\t\tATLASSERT(pData);\n\t\tATLASSERT(pData->wVersion == 1);\n\n\t\tWORD* pItems = pData->items();\n\t\tINT j = 0;\n\t\tfor (int i = 0; (i < pData->wItemCount) && (j < t_size); i++)\n\t\t{\n\t\t\tif (pItems[i] != 0)\n\t\t\t{\n\t\t\t\tthis->m_aCmdType[j] = UI_COMMANDTYPE_ACTION;\n\t\t\t\tthis->m_auCmd[j++] = pItems[i];\n\t\t\t}\n\t\t}\n\n\t\tif (j < t_size)\n\t\t\tthis->Resize(j);\n\t}\n\n \tHRESULT DoGetItem(UINT uItem, REFPROPERTYKEY key, PROPVARIANT *value)\n\t{\n\t\tATLASSERT(uItem < this->m_size);\n\t\tATLASSERT(this->m_auCmd[uItem]);\n\n\t\tHRESULT hr = E_FAIL;\n\t\tswitch (k_(key))\n\t\t{\n\t\tcase k_CommandId:\n\t\t\thr = SetPropertyVal(key, this->m_auCmd[uItem], value);\n\t\t\tbreak;\n\t\tcase k_CommandType:\n\t\t\thr = SetPropertyVal(key, UINT32(this->m_aCmdType[uItem]), value);\n\t\t\tbreak;\n\t\tcase k_CategoryId:\n\t\t\thr = SetPropertyVal(key, UI_COLLECTION_INVALIDINDEX, value);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tATLASSERT(FALSE);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn hr;\n\t}\n};\n\n\n// SimpleCollectionCtrlImpl: base class for simple gallery and listbox controls\n//\ntemplate <class T, UINT t_ID, size_t t_size, UI_COMMANDTYPE t_CommandType = UI_COMMANDTYPE_ACTION>\nclass SimpleCollectionCtrlImpl : \n\t\tpublic CommandCtrlImpl<T, t_ID>,\n\t\tpublic SimpleCollectionImpl<SimpleCollectionCtrlImpl<T, t_ID, t_size, t_CommandType>, t_size, t_CommandType>\n{\n\ttypedef SimpleCollectionCtrlImpl<T, t_ID, t_size, t_CommandType> thisClass;\npublic:\n\ttypedef thisClass SimpleCollection;\n\n\tSimpleCollectionCtrlImpl() : m_uSelected(0)\n\t{ }\n\n\tUINT m_uSelected;\n\n\tHRESULT Select(UINT uItem, bool bUpdate = false)\n\t{\n\t\tATLASSERT((uItem < t_size) || (uItem == UI_COLLECTION_INVALIDINDEX));\n\n\t\tm_uSelected = uItem;\n\n\t\treturn bUpdate ? \n\t\t\tthis->GetWndRibbon().SetProperty(this->GetID(), UI_PKEY_SelectedItem, uItem) :\n\t\t\tS_OK;\n\t}\n\n\t// Implementation\n\tvirtual HRESULT DoUpdateProperty(UINT nCmdID, REFPROPERTYKEY key, \n\t                                 const PROPVARIANT* ppropvarCurrentValue, PROPVARIANT* ppropvarNewValue)\n\t{\n\t\tATLASSERT(nCmdID == this->GetID());\n\t\tATLASSERT(ppropvarNewValue != NULL);\n\n\t\tHRESULT hr = S_OK;\n\t\tswitch (k_(key))\n\t\t{\n\t\tcase k_ItemsSource:\n\t\t\t{\n\t\t\t\tATL::CComQIPtr<IUICollection> pIUICollection(ppropvarCurrentValue->punkVal);\n\t\t\t\tATLASSERT(pIUICollection.p);\n\t\t\t\thr = pIUICollection->Clear();\n\t\t\t\tfor (UINT i = 0; i < t_size; i++)\n\t\t\t\t{\n\t\t\t\t\tif FAILED(hr = pIUICollection->Add(this->m_apItems[i]))\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tATLASSERT(SUCCEEDED(hr));\n\t\t\t}\n\t\t\tbreak;\n\t\tcase k_SelectedItem:\n\t\t\thr = SetPropertyVal(UI_PKEY_SelectedItem, m_uSelected, ppropvarNewValue);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\thr = CommandCtrlImpl<T, t_ID>::DoUpdateProperty(nCmdID, key, ppropvarCurrentValue, ppropvarNewValue);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn hr;\n\t}\n\n\tvirtual HRESULT DoExecute(UINT nCmdID, UI_EXECUTIONVERB verb, \n\t                          const PROPERTYKEY* key, const PROPVARIANT* ppropvarValue,\n\t                          IUISimplePropertySet* /*pCommandExecutionProperties*/)\n\t{\n\t\tATLASSERT (nCmdID == this->GetID());\n\t\t(void)nCmdID;   // avoid level 4 warning\n\t\t\n\t\tHRESULT hr = S_OK;\n\t\tif (key == NULL) // gallery button pressed\n\t\t{\n\t\t\tthis->GetWndRibbon().OnRibbonItemSelected(this->GetID(), UI_EXECUTIONVERB_EXECUTE, UI_COLLECTION_INVALIDINDEX);\n\t\t\treturn hr;\n\t\t}\n\t\tATLASSERT(k_(*key) == k_SelectedItem);\n\t\tATLASSERT(ppropvarValue);\n\n\t\tif SUCCEEDED(hr = UIPropertyToUInt32(*key, *ppropvarValue, &m_uSelected))\n\t\t\tthis->GetWndRibbon().OnRibbonItemSelected(this->GetID(), verb, m_uSelected);\n\n\t\treturn hr;\n\t}\n};\n\n// RecentItemsCtrlImpl\n//\ntemplate <class T, UINT t_ID, class TDocList = CRecentDocumentList>\nclass RecentItemsCtrlImpl : \n\t\tpublic CtrlImpl<T, t_ID>,\n\t\tpublic CollectionImplBase<RecentItemsCtrlImpl<T, t_ID, TDocList>, TDocList::m_nMaxEntries_Max>,\n\t\tpublic TDocList\n{\n\ttypedef RecentItemsCtrlImpl<T, t_ID, TDocList> thisClass;\npublic:\n\ttypedef thisClass RecentItems;\n\n\t// Implementation\n\tHRESULT OnGetItem(UINT uItem, REFPROPERTYKEY key, PROPVARIANT *value)\n\t{\n\t\tATLASSERT((INT)uItem < this->GetMaxEntries());\n\n\t\tLPCWSTR sPath = this->m_arrDocs[uItem].szDocName;\n\t\tHRESULT hr = E_NOTIMPL;\n\t\tswitch (k_(key))\n\t\t{\n\t\tcase k_Label:\n\t\t\thr = SetPropertyVal(key, this->GetWndRibbon().OnRibbonQueryRecentItemName(sPath), value);\n\t\t\tbreak;\n\t\tcase k_LabelDescription:\n\t\t\thr = SetPropertyVal(key, sPath, value);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tATLASSERT(FALSE);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn hr;\n\t}\n\n\tvirtual HRESULT DoUpdateProperty(UINT nCmdID, REFPROPERTYKEY key, \n\t                                 const PROPVARIANT* ppropvarCurrentValue, PROPVARIANT* ppropvarNewValue)\n\t{\n\t\tATLASSERT(nCmdID == this->GetID());\n\t\tATLASSERT(ppropvarNewValue);\n\n\t\tHRESULT hr = S_OK;\n\t\tswitch (k_(key))\n\t\t{\n\t\tcase k_RecentItems:\n\t\t\tif (SAFEARRAY* psa = SafeArrayCreateVector(VT_UNKNOWN, 0, this->m_arrDocs.GetSize()))\n\t\t\t{\n\t\t\t\tconst int iLastIndex = this->m_arrDocs.GetSize() - 1;\n\t\t\t\tfor (LONG i = 0; i <= iLastIndex; i++)\n\t\t\t\t\tSafeArrayPutElement(psa, &i, this->m_apItems[iLastIndex - i]); // reverse order\n\n\t\t\t\thr = SetPropertyVal(key, psa, ppropvarNewValue);\n\t\t\t\tSafeArrayDestroy(psa);\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\thr = CtrlImpl<T, t_ID>::DoUpdateProperty(nCmdID, key, ppropvarCurrentValue, ppropvarNewValue);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn hr;\n\t}\n\n\tvirtual HRESULT DoExecute(UINT nCmdID, UI_EXECUTIONVERB verb, \n\t                          const PROPERTYKEY* key, const PROPVARIANT* ppropvarValue,\n\t                          IUISimplePropertySet* /*pCommandExecutionProperties*/)\n\t{\n\t\tATLASSERT(nCmdID == this->GetID());\n\t\t(void)nCmdID;   // avoid level 4 warning\n\t\tATLASSERT(verb == UI_EXECUTIONVERB_EXECUTE);\n\t\t(void)verb;   // avoid level 4 warning\n\t\tATLASSERT((key) && (k_(*key) == k_SelectedItem));\n\t\tATLASSERT(ppropvarValue);\n\n\t\tUINT32 uSel = 0xffff;\n\t\tHRESULT hr = UIPropertyToUInt32(*key, *ppropvarValue, &uSel);\n\t\tif SUCCEEDED(hr)\n\t\t{\n\t\t\tATLASSERT(uSel < (UINT)this->GetMaxEntries());\n\t\t\tthis->GetWndRibbon().DefCommandExecute(ID_FILE_MRU_FIRST + uSel);\n\t\t}\n\n\t\treturn hr;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Ribbon stand-alone control classes\n\n// FontCtrlImpl\n//\ntemplate <class T, UINT t_ID>\nclass FontCtrlImpl : public CtrlImpl<T, t_ID>\n{\npublic:\n\n\tCharFormat m_cf;\n\n// Implementation\n\tvirtual HRESULT DoExecute(UINT nCmdID, UI_EXECUTIONVERB verb, \n\t                          const PROPERTYKEY* key, const PROPVARIANT* ppropvarValue,\n\t                          IUISimplePropertySet* pCommandExecutionProperties)\n\t{\n\t\tATLASSERT (nCmdID == this->GetID());\n\t\t(void)nCmdID;   // avoid level 4 warning\n\t\tATLASSERT ((key) && (k_(*key) == k_FontProperties));\n\t\t(void)key;   // avoid level 4 warning\n\n\t\tHRESULT hr = E_INVALIDARG;\n\t\tswitch (verb)\n\t\t{\n\t\t\tcase UI_EXECUTIONVERB_PREVIEW:\n\t\t\tcase UI_EXECUTIONVERB_EXECUTE:\n\t\t\t\tATLASSERT(pCommandExecutionProperties);\n\t\t\t\tPROPVARIANT propvar;\n\n\t\t\t\tif (SUCCEEDED(hr = pCommandExecutionProperties->GetValue(UI_PKEY_FontProperties_ChangedProperties, &propvar)))\n\t\t\t\t\tm_cf << ATL::CComQIPtr<IPropertyStore>(propvar.punkVal);\n\t\t\t\tbreak;\n\n\t\t\tcase UI_EXECUTIONVERB_CANCELPREVIEW:\n\t\t\t\tATLASSERT(ppropvarValue);\n\t\t\t\tATL::CComPtr<IPropertyStore> pStore;\n\n\t\t\t\tif (SUCCEEDED(hr = UIPropertyToInterface(UI_PKEY_FontProperties, *ppropvarValue, &pStore)))\n\t\t\t\t\tm_cf << pStore;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (SUCCEEDED(hr))\n\t\t\tthis->GetWndRibbon().OnRibbonFontCtrlExecute(this->GetID(), verb, &m_cf);\n\t\telse\n\t\t\tATLASSERT(FALSE);\n\n\t\treturn hr;\n\t}\n\n\tvirtual HRESULT DoUpdateProperty(UINT nCmdID, REFPROPERTYKEY key, \n\t                                 const PROPVARIANT* ppropvarCurrentValue, PROPVARIANT* ppropvarNewValue)\n\t{\n\t\tif ((k_(key) == k_FontProperties) && (this->GetWndRibbon().OnRibbonQueryFont(t_ID, m_cf)))\n\t\t{\n\t\t\tATL::CComQIPtr<IPropertyStore> pStore(ppropvarCurrentValue->punkVal);\n\t\t\tm_cf >> pStore;\n\t\t\treturn SetPropertyVal(key, pStore.p, ppropvarNewValue);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn CtrlImpl<T, t_ID>::DoUpdateProperty(nCmdID, key, ppropvarCurrentValue, ppropvarNewValue);\n\t\t}\n\t}\n};\n\n// ColorCtrlImpl\n//\ntemplate <class T, UINT t_ID>\nclass ColorCtrlImpl : public CommandCtrlImpl<T, t_ID>\n{\npublic:\n\tColorCtrlImpl() : m_colorType(UI_SWATCHCOLORTYPE_NOCOLOR), m_color(0x800080) /*MAGENTA*/\n\t{ }\n\n\tUINT32 m_colorType; // value in UI_SWATCHCOLORTYPE\n\tCOLORREF m_color;\n\tText m_sLabels[6]; // k_MoreColorsLabel to k_ThemeColorsCategoryLabel\n\tATL::CSimpleArray<COLORREF> m_aColors[2];\n\tATL::CSimpleArray<LPCWSTR> m_aTooltips[2];\n\n\t// Operations\n\tHRESULT SetColor(COLORREF color, bool bUpdate = false)\n\t{\n\t\tif (m_colorType != UI_SWATCHCOLORTYPE_RGB)\n\t\t\tSetColorType(UI_SWATCHCOLORTYPE_RGB, bUpdate);\n\t\tm_color = color;\n\t\treturn bUpdate ? this->SetProperty(UI_PKEY_Color, color) : S_OK;\n\t}\n\n\tHRESULT SetColorType(UI_SWATCHCOLORTYPE type, bool bUpdate = false)\n\t{\n\t\tm_colorType = type;\n\t\treturn bUpdate ? this->SetProperty(UI_PKEY_ColorType, type) : S_OK;\n\t}\n\n\tHRESULT SetColorLabel(REFPROPERTYKEY key, LPCWSTR sLabel, bool bUpdate = false)\n\t{\n\t\tATLASSERT((k_(key) >= k_ThemeColorsCategoryLabel) && (k_(key) <= k_MoreColorsLabel));\n\t\tm_sLabels[k_(key) - k_ThemeColorsCategoryLabel] = sLabel;\n\t\treturn bUpdate ? this->SetProperty(key, sLabel) : S_OK;\n\t}\n\n\tHRESULT SetColorArray(REFPROPERTYKEY key, COLORREF* pColor, bool bUpdate = false)\n\t{\n\t\tATLASSERT((k_(key) == k_ThemeColors) || (k_(key) == k_StandardColors));\n\n\t\tconst INT ic = k_(key) - k_ThemeColors;\n\t\tm_aColors[ic].RemoveAll();\n\t\twhile (*pColor != 0x800080) /*MAGENTA*/\n\t\t\tm_aColors[ic].Add(*pColor++);\n\n\t\tif (bUpdate)\n\t\t{\n\t\t\tPROPVARIANT var;\n\t\t\tif SUCCEEDED(InitPropVariantFromUInt32Vector(m_aColors[ic].GetData(), m_aColors[ic].GetSize(), &var))\n\t\t\t\treturn this->SetProperty(key, var);\n\t\t\telse\n\t\t\t\treturn E_INVALIDARG;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn S_OK;\n\t\t}\n\t}\n\n\tHRESULT SetColorTooltips(REFPROPERTYKEY key, LPCWSTR* ppsTT, bool bUpdate = false)\n\t{\n\t\tATLASSERT((k_(key) == k_ThemeColorsTooltips) || (k_(key) == k_StandardColorsTooltips));\n\n\t\tconst INT ic = k_(key) - k_ThemeColorsTooltips;\n\t\tm_aTooltips[ic].RemoveAll();\n\t\twhile (*ppsTT)\n\t\t\tm_aTooltips[ic].Add(*ppsTT++);\n\n\t\tif (bUpdate)\n\t\t{\n\t\t\tPROPVARIANT var;\n\t\t\tif SUCCEEDED(InitPropVariantFromStringVector(m_aTooltips[ic].GetData(), m_aTooltips[ic].GetSize(), &var))\n\t\t\t\treturn this->SetProperty(key, var);\n\t\t\telse\n\t\t\t\treturn E_INVALIDARG;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn S_OK;\n\t\t}\n\t}\n\n\t// Implementation\n\tvirtual HRESULT DoExecute(UINT nCmdID, UI_EXECUTIONVERB verb, \n\t                          const PROPERTYKEY* key, const PROPVARIANT* ppropvarValue,\n\t                          IUISimplePropertySet* pCommandExecutionProperties)\n\t{\n\t\tATLASSERT (nCmdID == this->GetID());\n\t\t(void)nCmdID;   // avoid level 4 warning\n\t\tATLASSERT (key && (k_(*key) == k_ColorType));\n\t\t(void)key;   // avoid level 4 warning\n\t\tATLASSERT (ppropvarValue);\n\n\t\tHRESULT hr = PropVariantToUInt32(*ppropvarValue, &m_colorType);\n\t\tATLASSERT(SUCCEEDED(hr));\n\n\t\tif (SUCCEEDED(hr) && (m_colorType == UI_SWATCHCOLORTYPE_RGB))\n\t\t{\n\t\t\tATLASSERT(pCommandExecutionProperties);\n\t\t\tPROPVARIANT var;\n\t\t\tif SUCCEEDED(hr = pCommandExecutionProperties->GetValue(UI_PKEY_Color, &var))\n\t\t\t\thr = PropVariantToUInt32(var, &m_color);\n\t\t}\n\n\t\tif SUCCEEDED(hr)\n\t\t\tthis->GetWndRibbon().OnRibbonColorCtrlExecute(this->GetID(), verb, (UI_SWATCHCOLORTYPE)m_colorType/*uType*/, m_color);\n\t\telse\n\t\t\tATLASSERT(FALSE); // something was wrong\n\n\t\treturn hr;\n\t}\n\n\tvirtual HRESULT DoUpdateProperty(UINT nCmdID, REFPROPERTYKEY key, \n\t                                 const PROPVARIANT* ppropvarCurrentValue, PROPVARIANT* ppropvarNewValue)\n\t{\n\t\tATLASSERT (nCmdID == this->GetID());\n\n\t\tHRESULT hr = E_NOTIMPL;\n\n\t\tswitch (k_(key))\n\t\t{\n\t\tcase k_ColorType:\n\t\t\thr = SetPropertyVal(key, m_colorType, ppropvarNewValue);\n\t\t\tbreak;\n\t\tcase k_Color:\n\t\t\tif (m_color == 0x800080) /*MAGENTA*/\n\t\t\t\tm_color = this->GetWndRibbon().OnRibbonQueryColor(this->GetID());\n\t\t\thr = SetPropertyVal(key, m_color, ppropvarNewValue);\n\t\t\tbreak;\n\t\tcase k_ColorMode:\n\t\t\tbreak;\n\t\tcase k_ThemeColorsCategoryLabel:\n\t\tcase k_StandardColorsCategoryLabel:\n\t\tcase k_RecentColorsCategoryLabel:\n\t\tcase k_AutomaticColorLabel:\n\t\tcase k_NoColorLabel:\n\t\tcase k_MoreColorsLabel:\n\t\t\t{\n\t\t\t\tconst UINT iLabel = k_(key) - k_ThemeColorsCategoryLabel;\n\t\t\t\tif (m_sLabels[iLabel].IsEmpty())\n\t\t\t\t\tif (LPCWSTR psLabel = this->GetWndRibbon().OnRibbonQueryColorLabel(this->GetID(), key))\n\t\t\t\t\t\tm_sLabels[iLabel] = psLabel;\n\t\t\t\tif (!m_sLabels[iLabel].IsEmpty())\n\t\t\t\t\thr = SetPropertyVal(key, (LPCWSTR)m_sLabels[iLabel], ppropvarNewValue);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase k_ThemeColors:\n\t\tcase k_StandardColors:\n\t\t\t{\n\t\t\t\tconst INT ic = k_(key) - k_ThemeColors;\n\t\t\t\tif (!m_aColors[ic].GetSize())\n\t\t\t\t\tif (COLORREF* pColor = this->GetWndRibbon().OnRibbonQueryColorArray(this->GetID(), key))\n\t\t\t\t\t\tSetColorArray(key, pColor);\n\t\t\t\tif (INT iMax = m_aColors[ic].GetSize())\n\t\t\t\t\thr = InitPropVariantFromUInt32Vector(m_aColors[ic].GetData(), iMax, ppropvarNewValue);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase k_ThemeColorsTooltips:\n\t\tcase k_StandardColorsTooltips:\n\t\t\t{\n\t\t\t\tconst INT ic = k_(key) - k_ThemeColorsTooltips;\n\t\t\t\tif (m_aTooltips[ic].GetSize() == 0)\n\t\t\t\t\tif (LPCWSTR* ppsTT = this->GetWndRibbon().OnRibbonQueryColorTooltips(this->GetID(), key))\n\t\t\t\t\t\tSetColorTooltips(key, ppsTT);\n\t\t\t\tif (INT iMax = m_aTooltips[ic].GetSize())\n\t\t\t\t\thr = InitPropVariantFromStringVector(m_aTooltips[ic].GetData(), iMax, ppropvarNewValue);\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\thr = CommandCtrlImpl<T, t_ID>::DoUpdateProperty(nCmdID, key, ppropvarCurrentValue, ppropvarNewValue);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn hr;\n\t}\n};\n\n// SpinnerCtrlImpl\n//\ntemplate <class T, UINT t_ID, typename V = LONG>\nclass SpinnerCtrlImpl : public CtrlImpl<T, t_ID>\n{\npublic:\n\tSpinnerCtrlImpl()\n\t{\n\t\tm_Values[0] = m_Values[2] = m_Values[4] = 0;\n\t\tm_Values[1] = 100;\n\t\tm_Values[3] = 1;\n\t}\n\n\tV m_Values[5];\n\t\t// k_DecimalValue = 201, k_MaxValue = 203, k_MinValue, k_Increment, k_DecimalPlaces\n\t\t\n\tText m_FormatString;\n\tText m_RepresentativeString;\n\n\t// Operations\n\tHRESULT SetDecimalPlaces(V vPlaces, bool bUpdate = false)\n\t{\n\t\treturn SetValue(UI_PKEY_DecimalPlaces, vPlaces, bUpdate);\n\t}\n\n\tHRESULT SetMin(V vMin, bool bUpdate = false)\n\t{\n\t\treturn SetValue(UI_PKEY_MinValue, vMin, bUpdate);\n\t}\n\n\tHRESULT SetMax(V vMax, bool bUpdate = false)\n\t{\n\t\treturn SetValue(UI_PKEY_MaxValue, vMax, bUpdate);\n\t}\n\n\tHRESULT SetVal(V vVal, bool bUpdate = false)\n\t{\n\t\treturn SetValue(UI_PKEY_DecimalValue, vVal, bUpdate);\n\t}\n\n\tHRESULT SetIncrement(V vIncrement, bool bUpdate = false)\n\t{\n\t\treturn SetValue(UI_PKEY_Increment, vIncrement, bUpdate);\n\t}\n\n\tHRESULT SetFormatString(LPCWSTR sFormat, bool bUpdate = false)\n\t{\n\t\treturn SetText(UI_PKEY_FormatString, sFormat, bUpdate);\n\t}\n\n\tHRESULT SetRepresentativeString(LPCWSTR sRepresentative, bool bUpdate = false)\n\t{\n\t\treturn SetText(UI_PKEY_RepresentativeString, sRepresentative, bUpdate);\n\t}\n\n\t// Implementation\n\tHRESULT SetText(REFPROPERTYKEY key, LPCWSTR sText, bool bUpdate = false)\n\t{\n\t\tswitch (k_(key))\n\t\t{\n\t\tcase k_FormatString:\n\t\t\tm_FormatString = sText;\n\t\t\tbreak;\n\t\tcase k_RepresentativeString:\n\t\t\tm_RepresentativeString = sText;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn CtrlImpl::SetText(key, sText, bUpdate);\n\t\t}\n\n\t\treturn bUpdate ?\n\t\t\tthis->GetWndRibbon().InvalidateProperty(this->GetID(), key) :\n\t\t\tS_OK;\n\t}\n\n\tHRESULT SetValue(REFPROPERTYKEY key, V val, bool bUpdate = false)\n\t{\n\t\tATLASSERT((k_(key) <= k_DecimalPlaces) && (k_(key) >= k_DecimalValue));\n\n\t\tconst INT iVal = k_(key) == k_DecimalValue ? 0 : k_(key) - k_StringValue;\n\t\tm_Values[iVal] = val;\n\n\t\tif (bUpdate)\n\t\t{\n\t\t\tif(k_(key) == k_DecimalValue)\n\t\t\t{\n\t\t\t\tDECIMAL decVal;\n\t\t\t\tInitDecimal(val, &decVal);\n\t\t\t\treturn this->SetProperty(key, &decVal);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn this->GetWndRibbon().InvalidateProperty(this->GetID(), key);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn S_OK;\n\t\t}\n\t}\n\n\tHRESULT QueryValue(REFPROPERTYKEY key, LONG* plVal)\n\t{\n\t\treturn this->GetWndRibbon().OnRibbonQuerySpinnerValue(this->GetID(), key, plVal) ? S_OK : S_FALSE;\n\t}\n\n\tHRESULT QueryValue(REFPROPERTYKEY key, DOUBLE* pdVal)\n\t{\n\t\treturn this->GetWndRibbon().OnRibbonQueryFloatSpinnerValue(this->GetID(), key, pdVal) ? S_OK : S_FALSE;\n\t}\n\n\tHRESULT OnGetValue(REFPROPERTYKEY key, PROPVARIANT* ppv)\n\t{\n\t\tATLASSERT((k_(key) <= k_DecimalPlaces) && (k_(key) >= k_DecimalValue));\n\n\t\tconst INT iVal = k_(key) == k_DecimalValue ? 0 : k_(key) - k_StringValue;\n\n\t\tQueryValue(key, m_Values + iVal);\n\n\t\tif (k_(key) == k_DecimalPlaces)\n\t\t{\n\t\t\treturn SetPropertyVal(key, m_Values[iVal], ppv);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDECIMAL decVal;\n\t\t\tInitDecimal(m_Values[iVal], &decVal);\n\t\t\treturn SetPropertyVal(key, &decVal, ppv);\n\t\t}\n\t}\n\n\tHRESULT OnGetText(REFPROPERTYKEY key, Text& sVal, PROPVARIANT* ppv)\n\t{\n\t\tif (LPCWSTR sNew = this->GetWndRibbon().OnRibbonQueryText(this->GetID(), key))\n\t\t\tsVal = sNew;\n\t\treturn SetPropertyVal(key, (LPCWSTR)sVal, ppv);\n\t}\n\n\tvirtual HRESULT DoExecute(UINT nCmdID, UI_EXECUTIONVERB verb, \n\t                          const PROPERTYKEY* key, const PROPVARIANT* ppropvarValue,\n\t                          IUISimplePropertySet* /*pCommandExecutionProperties*/)\n\t{\n\t\tATLASSERT (nCmdID == this->GetID());\n\t\t(void)nCmdID;   // avoid level 4 warning\n\t\tATLASSERT (key && (k_(*key) == k_DecimalValue));\n\t\t(void)key;   // avoid level 4 warning\n\t\tATLASSERT (verb == UI_EXECUTIONVERB_EXECUTE);\n\t\t(void)verb;   // avoid level 4 warning\n\n\t\tDECIMAL decVal;\n\n\t\tHRESULT hr = UIPropertyToDecimal(UI_PKEY_DecimalValue, *ppropvarValue, &decVal);\n\t\tATLASSERT(SUCCEEDED(hr));\n\t\thr = InitVal(m_Values[0], &decVal);\n\t\tATLASSERT(SUCCEEDED(hr));\n\n\t\tthis->GetWndRibbon().OnRibbonSpinnerCtrlExecute(this->GetID(), &m_Values[0]);\n\n\t\treturn hr;\n\t}\n\n\tvirtual HRESULT DoUpdateProperty(UINT nCmdID, REFPROPERTYKEY key, \n\t                                 const PROPVARIANT* ppropvarCurrentValue, PROPVARIANT* ppropvarNewValue)\n\t{\n\t\tATLASSERT (nCmdID == this->GetID());\n\n\t\tHRESULT hr = E_NOTIMPL;\n\t\tswitch (k_(key))\n\t\t{\n\t\tcase k_DecimalPlaces:\n\t\tcase k_DecimalValue:\n\t\tcase k_Increment:\n\t\tcase k_MaxValue:\n\t\tcase k_MinValue:\n\t\t\thr = OnGetValue(key, ppropvarNewValue);\n\t\t\tbreak;\n\t\tcase k_FormatString:\n\t\t\thr = OnGetText(key, m_FormatString, ppropvarNewValue);\n\t\t\tbreak;\n\t\tcase k_RepresentativeString:\n\t\t\thr = OnGetText(key, m_RepresentativeString, ppropvarNewValue);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\thr = CtrlImpl<T, t_ID>::DoUpdateProperty(nCmdID, key, ppropvarCurrentValue, ppropvarNewValue);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn hr;\n\t}\n\n\t// decimal conversion helpers\n\tstatic HRESULT InitDecimal(LONG& val, DECIMAL* pDecimal)\n\t{\n\t\treturn ::VarDecFromI4(val, pDecimal);\n\t}\n\n\tstatic HRESULT InitDecimal(DOUBLE& val, DECIMAL* pDecimal)\n\t{\n\t\treturn ::VarDecFromR8(val, pDecimal);\n\t}\n\n\tstatic HRESULT InitVal(LONG& val, const DECIMAL* pDecimal)\n\t{\n\t\treturn ::VarI4FromDec(pDecimal, &val);\n\t}\n\n\tstatic HRESULT InitVal(DOUBLE& val, const DECIMAL* pDecimal)\n\t{\n\t\treturn ::VarR8FromDec(pDecimal, &val);\n\t}\n};\n\n// CRibbonImpl Ribbon implementation class\n//\ntemplate <class T>\nclass CRibbonImpl : \n\t\tpublic CRibbonUpdateUI<T>,\n\t\tpublic ICtrl,\n\t\tpublic IUIApplication,\n\t\tpublic IUICommandHandler\n{\n\ttypedef CRibbonImpl<T> thisClass;\npublic:\n\ttypedef thisClass Ribbon;\n\ttypedef T WndRibbon;\n\n\tCRibbonImpl() : m_bRibbonUI(false), m_hgRibbonSettings(NULL)\n\t{\n#ifdef _DEBUG\n\t\tm_cRef = 1;\n#endif\n\t\tpWndRibbon = static_cast<T*>(this);\n\t\tHRESULT hr = ::CoInitialize(NULL);\n\t\tif(SUCCEEDED(hr))\n\t\t\tif (RunTimeHelper::IsRibbonUIAvailable())\n\t\t\t\thr = m_pIUIFramework.CoCreateInstance(CLSID_UIRibbonFramework);\n\t\t\telse\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"Ribbon UI not available\\n\"));\n\n\t\tif FAILED(hr)\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"Ribbon construction failed\\n\"));\n\n\t\tATLASSERT(SUCCEEDED(hr));\n\t}\n\n\tvirtual ~CRibbonImpl()\n\t{\n\t\t::GlobalFree(m_hgRibbonSettings);\n\t\tm_pIUIFramework.Release();\n\t\t::CoUninitialize();\n\t}\n\n\tICtrl& GetRibbonCtrl(UINT)\n\t{\n\t\treturn static_cast<ICtrl&>(*this);\n\t}\n\n\tATL::CComPtr<IUIFramework> m_pIUIFramework;\n\tbool m_bRibbonUI;\n\tHGLOBAL m_hgRibbonSettings;\n\n\tbool IsRibbonUI()\n\t{\n\t\treturn m_bRibbonUI;\n\t}\n\n\tIUIFramework* GetIUIFrameworkPtr()\n\t{\n\t\treturn m_pIUIFramework;\n\t}\n\n\ttemplate <typename I>\n\tI* GetRibbonViewPtr(UINT32 uID)\n\t{\n\t\tATLASSERT(m_pIUIFramework);\n\t\tATL::CComPtr<I> pI;\n\t\treturn m_pIUIFramework->GetView(uID, __uuidof(I), (void**) &pI) == S_OK ?\n\t\t\tpI : \n\t\t\tNULL;\n\t}\n\n\tIUIRibbon* GetRibbonPtr()\n\t{\n\t\treturn GetRibbonViewPtr<IUIRibbon>(0);\n\t}\n\n\tIUIContextualUI* GetMenuPtr(UINT32 uID)\n\t{\n\t\tATLASSERT(uID);\n\t\treturn GetRibbonViewPtr<IUIContextualUI>(uID);\n\t}\n\n\tUINT GetRibbonHeight()\n\t{\n\t\tATLASSERT(IsRibbonUI());\n\n\t\tUINT32 cy = 0;\n\t\tif (ATL::CComPtr<IUIRibbon> pIUIRibbon = GetRibbonPtr())\n\t\t\tpIUIRibbon->GetHeight(&cy);\n\t\treturn cy;\n\t}\n\n\tHRESULT CreateRibbon(LPCWSTR sResName = L\"APPLICATION_RIBBON\")\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(GetIUIFrameworkPtr() && !IsRibbonUI());\n\t\tATLASSERT(pT->IsWindow());\n\n\t\tHRESULT hr = m_pIUIFramework->Initialize(pT->m_hWnd, this);\n\n\t\tif (hr == S_OK)\n\t\t\thr = m_pIUIFramework->LoadUI(ModuleHelper::GetResourceInstance(), sResName);\n\t\t\t\n\t\treturn hr;\n\t}\n\n\tHRESULT DestroyRibbon()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(GetIUIFrameworkPtr() && IsRibbonUI());\n\t\tATLASSERT(pT->IsWindow());\n\n\t\tHRESULT hRes = m_pIUIFramework->Destroy();\n\t\tif (!RunTimeHelper::IsWin7())\n\t\t\tpT->SetWindowRgn(NULL, TRUE); // Vista Basic bug workaround\n\t\treturn hRes;\n\t}\n\n// Ribbon persistency\n\tHRESULT operator >>(IStream* pIStream)\n\t{\n\t\tATLASSERT(GetIUIFrameworkPtr());\n\t\tATLASSERT(pIStream);\n\n\t\tHRESULT hr = E_FAIL;\n\t\tif (ATL::CComPtr<IUIRibbon> pIUIRibbon = GetRibbonPtr())\n\t\t{\n\t\t\tconst LARGE_INTEGER li0 = {};\n\t\t\tpIStream->Seek(li0, STREAM_SEEK_SET, NULL);\n\t\t\thr = pIUIRibbon->SaveSettingsToStream(pIStream);\n\t\t\tpIStream->Commit(STGC_DEFAULT);\n\t\t}\n\n\t\treturn hr;\n\t}\n\n\tHRESULT operator <<(IStream* pIStream)\n\t{\n\t\tATLASSERT(GetIUIFrameworkPtr());\n\t\tATLASSERT(pIStream);\n\n\t\tHRESULT hr = E_FAIL;\n\t\tif (ATL::CComPtr<IUIRibbon> pIUIRibbon = GetRibbonPtr())\n\t\t{\n\t\t\tconst LARGE_INTEGER li0 = {};\n\t\t\tpIStream->Seek(li0, STREAM_SEEK_SET, NULL);\n\t\t\thr = pIUIRibbon->LoadSettingsFromStream(pIStream);\n\t\t}\n\n\t\treturn hr;\n\t}\n\n\tvoid ResetRibbonSettings()\n\t{\n\t\tif (m_hgRibbonSettings != NULL)\n\t\t{\n\t\t\t::GlobalFree(m_hgRibbonSettings);\n\t\t\tm_hgRibbonSettings = NULL;\n\t\t}\n\t}\n\n\tHRESULT SaveRibbonSettings()\n\t{\n\t\tATLASSERT(GetIUIFrameworkPtr());\n\t\tATLASSERT(static_cast<T*>(this)->IsWindow());\n\n\t\tHRESULT hr = E_FAIL;\n\t\tATL::CComPtr<IStream> pIStream;\n\n\t\tif SUCCEEDED(hr = ::CreateStreamOnHGlobal(m_hgRibbonSettings, FALSE, &pIStream))\n\t\t\thr = *this >> pIStream;\n\n\t\tif (SUCCEEDED(hr) && (m_hgRibbonSettings == NULL))\n\t\t\thr = ::GetHGlobalFromStream(pIStream, &m_hgRibbonSettings);\n\n\t\tif FAILED(hr)\n\t\t\tResetRibbonSettings();\n\n\t\treturn hr;\n\t}\n\n\tHRESULT RestoreRibbonSettings()\n\t{\n\t\tATLASSERT(GetIUIFrameworkPtr());\n\t\tATLASSERT(m_hgRibbonSettings);\n\t\tATLASSERT(static_cast<T*>(this)->IsWindow());\n\n\t\tHRESULT hr = E_FAIL;\n\t\tATL::CComPtr<IStream> pIStream;\n\n\t\tif SUCCEEDED(hr = ::CreateStreamOnHGlobal(m_hgRibbonSettings, FALSE, &pIStream))\n\t\t\thr = *this << pIStream;\n\n\t\tif FAILED(hr)\n\t\t\tResetRibbonSettings();\n\n\t\treturn hr;\n\t}\n\n// QAT dock states\n\tUI_CONTROLDOCK GetQATDock()\n\t{\n\t\tATLASSERT(GetIUIFrameworkPtr());\n\t\tATLASSERT(IsRibbonUI());\n\n\t\tUINT32 uDock = 0;\n\t\tPROPVARIANT propvar;\n\t\tATL::CComQIPtr<IPropertyStore>pIPS(GetRibbonPtr());\n\n\t\tif ((pIPS != NULL) && SUCCEEDED(pIPS->GetValue(UI_PKEY_QuickAccessToolbarDock, &propvar)) &&\n\t\t\tSUCCEEDED(UIPropertyToUInt32(UI_PKEY_QuickAccessToolbarDock, propvar, &uDock)))\n\t\t\t\treturn (UI_CONTROLDOCK)uDock;\n\n\t\tATLASSERT(FALSE); // something was wrong\n\t\treturn (UI_CONTROLDOCK)0;\n\t}\n\n\tbool SetQATDock(UI_CONTROLDOCK dockState)\n\t{\n\t\tATLASSERT(GetIUIFrameworkPtr());\n\t\tATLASSERT(IsRibbonUI());\n\n\t\tPROPVARIANT propvar;\n\t\tATLVERIFY(SUCCEEDED(SetPropertyVal(UI_PKEY_QuickAccessToolbarDock, dockState, &propvar)));\n\n\t\tATL::CComQIPtr<IPropertyStore>pIPS(GetRibbonPtr());\n\t\tif ((pIPS != NULL) && SUCCEEDED(pIPS->SetValue(UI_PKEY_QuickAccessToolbarDock, propvar)))\n\t\t{\n\t\t\tpIPS->Commit();\n\t\t\treturn true;\n\t\t}\n\n\t\tATLASSERT(FALSE); // something was wrong\n\t\treturn false;\n\t}\n\n// Ribbon display states\n\tbool GetRibbonDisplayState(REFPROPERTYKEY key)\n\t{\n\t\tATLASSERT(GetIUIFrameworkPtr());\n\t\tATLASSERT(IsRibbonUI());\n\t\tATLASSERT((k_(key) == k_Viewable) || (k_(key) == k_Minimized));\n\n\t\tPROPVARIANT propvar;\n\t\tATL::CComQIPtr<IPropertyStore>pIPS(GetRibbonPtr());\n\n\t\tif ((pIPS != NULL) && SUCCEEDED(pIPS->GetValue(key, &propvar)))\n\t\t{\n\t\t\tBOOL bState = FALSE;\n\t\t\tif SUCCEEDED(UIPropertyToBoolean(key, propvar, &bState))\n\t\t\t\treturn (bState != FALSE);\n\t\t}\n\n\t\tATLASSERT(FALSE); // something was wrong\n\t\treturn false;\n\t}\n\n\tbool SetRibbonDisplayState(REFPROPERTYKEY key, bool bState = true)\n\t{\n\t\tATLASSERT(GetIUIFrameworkPtr());\n\t\tATLASSERT(IsRibbonUI());\n\t\tATLASSERT((k_(key) == k_Viewable) || (k_(key) == k_Minimized));\n\n\t\tPROPVARIANT propvar;\n\t\tATLVERIFY(SUCCEEDED(SetPropertyVal(key, bState, &propvar)));\n\n\t\tATL::CComQIPtr<IPropertyStore>pIPS(GetRibbonPtr());\n\n\t\tif ((pIPS != NULL) && SUCCEEDED(pIPS->SetValue(key, propvar)))\n\t\t{\n\t\t\tpIPS->Commit();\n\t\t\treturn true;\n\t\t}\n\n\t\tATLASSERT(FALSE); // something was wrong\n\t\treturn false;\n\t}\n\n\tbool IsRibbonMinimized()\n\t{\n\t\treturn GetRibbonDisplayState(UI_PKEY_Minimized);\n\t}\n\n\tbool MinimizeRibbon(bool bMinimize = true)\n\t{\n\t\treturn SetRibbonDisplayState(UI_PKEY_Minimized, bMinimize);\n\t}\n\n\tbool IsRibbonHidden()\n\t{\n\t\treturn !GetRibbonDisplayState(UI_PKEY_Viewable);\n\t}\n\n\tbool HideRibbon(bool bHide = true)\n\t{\n\t\treturn SetRibbonDisplayState(UI_PKEY_Viewable, !bHide);\n\t}\n\n// Ribbon colors\n\tUI_HSBCOLOR GetRibbonColor(REFPROPERTYKEY key)\n\t{\n\t\tATLASSERT(GetIUIFrameworkPtr());\n\t\tATLASSERT(IsRibbonUI());\n\t\tATLASSERT((k_(key) >= k_GlobalBackgroundColor) && (k_(key) <= k_GlobalTextColor));\n\n\t\tPROPVARIANT propvar;\n\t\tATL::CComQIPtr<IPropertyStore>pIPS(GetIUIFrameworkPtr());\n\n\t\tif ((pIPS != NULL) && SUCCEEDED(pIPS->GetValue(key, &propvar)))\n\t\t{\n\t\t\tUINT32 color = 0;\n\t\t\tif SUCCEEDED(UIPropertyToUInt32(key, propvar, &color))\n\t\t\t\treturn color;\n\t\t}\n\n\t\tATLASSERT(FALSE); // something was wrong\n\t\treturn 0;\n\t}\n\n\tbool SetRibbonColor(REFPROPERTYKEY key, UI_HSBCOLOR color)\n\t{\n\t\tATLASSERT(GetIUIFrameworkPtr());\n\t\tATLASSERT(IsRibbonUI());\n\t\tATLASSERT((k_(key) >= k_GlobalBackgroundColor) && (k_(key) <= k_GlobalTextColor));\n\n\t\tPROPVARIANT propvar;\n\t\tATLVERIFY(SUCCEEDED(SetPropertyVal(key, color, &propvar)));\n\n\t\tATL::CComQIPtr<IPropertyStore>pIPS(GetIUIFrameworkPtr());\n\n\t\tif ((pIPS != NULL) && SUCCEEDED(pIPS->SetValue(key, propvar)))\n\t\t{\n\t\t\tpIPS->Commit();\n\t\t\treturn true;\n\t\t}\n\n\t\tATLASSERT(FALSE); // something was wrong\n\t\treturn false;\n\t}\n\n// Ribbon modes\n\tHRESULT SetRibbonModes(INT32 iModes)\n\t{\n\t\tATLASSERT(IsRibbonUI());\n\t\treturn GetIUIFrameworkPtr()->SetModes(iModes);\n\t}\n\n// Ribbon contextual tab\n\tUI_CONTEXTAVAILABILITY GetRibbonContextAvail(UINT32 uID)\n\t{\n\t\tATLASSERT(GetIUIFrameworkPtr());\n\n\t\tPROPVARIANT propvar;\n\t\tif (IsRibbonUI() && \n\t\t    SUCCEEDED(GetIUIFrameworkPtr()->GetUICommandProperty(uID, UI_PKEY_ContextAvailable, &propvar)))\n\t\t{\n\t\t\tUINT uav;\n\t\t\tif (SUCCEEDED(PropVariantToUInt32(propvar, &uav)))\n\t\t\t{\n\t\t\t\tCUpdateUIBase::UIEnable(uID, uav != UI_CONTEXTAVAILABILITY_NOTAVAILABLE);\n\t\t\t\tCUpdateUIBase::UISetCheck(uID, uav == UI_CONTEXTAVAILABILITY_ACTIVE);\n\t\t\t\treturn (UI_CONTEXTAVAILABILITY)uav;\n\t\t\t}\n\t\t}\n\n\t\treturn UI_CONTEXTAVAILABILITY_NOTAVAILABLE;\n\t}\n\n\tHRESULT SetRibbonContextAvail(UINT32 uID, UI_CONTEXTAVAILABILITY cav)\n\t{\n\t\tCUpdateUIBase::UIEnable(uID, cav != UI_CONTEXTAVAILABILITY_NOTAVAILABLE);\n\t\tCUpdateUIBase::UISetCheck(uID, cav == UI_CONTEXTAVAILABILITY_ACTIVE);\n\t\t\n\t\treturn SetProperty((WORD)uID, UI_PKEY_ContextAvailable, UINT32(cav));\n\t}\n\n// Ribbon context menu\n\tbool HasRibbonMenu(UINT32 uID)\n\t{\n\t\tATL::CComPtr<IUIContextualUI> pI = GetMenuPtr(uID);\n\t\treturn pI != NULL;\n\t}\n\n\tHRESULT TrackRibbonMenu(UINT32 uID, INT32 x, INT32 y)\n\t{\n\t\tATLASSERT(HasRibbonMenu(uID));\n\n\t\treturn IsRibbonUI() ?\n\t\t\tATL::CComPtr<IUIContextualUI>(GetMenuPtr(uID))->ShowAtLocation(x, y) :\n\t\t\tE_FAIL;\n\t}\n\n\tHRESULT TrackRibbonMenu(UINT32 uID, LPARAM lParam)\n\t{\n\t\treturn TrackRibbonMenu(uID, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));\n\t}\n\n// Overrideables\n\tHBITMAP OnRibbonQueryImage(UINT nCmdID, REFPROPERTYKEY /*key*/)\n\t{\n\t\treturn DefRibbonQueryImage(nCmdID);\n\t}\n\n\tLPCWSTR OnRibbonQueryText(UINT nCmdID, REFPROPERTYKEY key)\n\t{\n\t\treturn DefRibbonQueryText(nCmdID, key);\n\t}\n\n\tbool OnRibbonQueryState(UINT nCmdID, REFPROPERTYKEY key)\n\t{\n\t\treturn DefRibbonQueryState(nCmdID, key);\n\t}\n\n\tUI_CONTEXTAVAILABILITY OnRibbonQueryTabAvail(UINT nCmdID)\n\t{\n\t\tDWORD dwState = this->UIGetState(nCmdID);\n\t\treturn ((dwState & CUpdateUIBase::UPDUI_DISABLED) == CUpdateUIBase::UPDUI_DISABLED) ?\n\t\t\tUI_CONTEXTAVAILABILITY_NOTAVAILABLE :\n\t\t\t(((dwState & CUpdateUIBase::UPDUI_CHECKED) == CUpdateUIBase::UPDUI_CHECKED) ?\n\t\t\t\tUI_CONTEXTAVAILABILITY_ACTIVE : \n\t\t\t\tUI_CONTEXTAVAILABILITY_AVAILABLE);\n\t}\n\n\tLPCWSTR OnRibbonQueryComboText(UINT32 /*uCtrlID*/)\n\t{\n\t\treturn NULL;\n\t}\n\n\tLPCWSTR OnRibbonQueryCategoryText(UINT32 /*uCtrlID*/, UINT32 /*uCat*/)\n\t{\n\t\treturn L\"Category\";\n\t}\n\n\tUINT32 OnRibbonQueryItemCategory(UINT32 /*uCtrlID*/, UINT32 /*uItem*/)\n\t{\n\t\treturn 0;\n\t}\n\n\tLPCWSTR OnRibbonQueryItemText(UINT32 uCtrlID, UINT32 uItem)\n\t{\n\t\treturn DefRibbonQueryItemText(uCtrlID, uItem);\n\t}\n\n\tbool OnRibbonQuerySelectedItem(UINT32 /*uCtrlID*/, UINT32& /*uSel*/)\n\t{\n\t\treturn false;\n\t}\n\n\tHBITMAP OnRibbonQueryItemImage(UINT32 uCtrlID, UINT32 uItem)\n\t{\n\t\treturn DefRibbonQueryItemImage(uCtrlID, uItem);\n\t}\n\n\tUINT32 OnRibbonQueryItemCommand(UINT32 uCtrlID, UINT32 uItem)\n\t{\n\t\treturn DefRibbonQueryItemCommand(uCtrlID, uItem);\n\t}\n\n\tUI_COMMANDTYPE OnRibbonQueryItemCommandType(UINT32 /*uCtrlID*/, UINT32 /*uItem*/)\n\t{\n\t\treturn UI_COMMANDTYPE_ACTION;\n\t}\n\n\tLPCWSTR OnRibbonQueryRecentItemName(LPCWSTR sPath)\n\t{\n\t\treturn ::PathFindFileName(sPath);\n\t}\n\n\tbool OnRibbonQueryFont(UINT /*nId*/, CHARFORMAT2& /*cf*/)\n\t{\n\t\treturn false;\n\t}\n\n\tbool OnRibbonQuerySpinnerValue(UINT /*nCmdID*/, REFPROPERTYKEY /*key*/, LONG* /*pVal*/)\n\t{\n\t\treturn false;\n\t}\n\n\tbool OnRibbonQueryFloatSpinnerValue(UINT /*nCmdID*/, REFPROPERTYKEY /*key*/, DOUBLE* /*pVal*/)\n\t{\n\t\treturn false;\n\t}\n\n\tCOLORREF OnRibbonQueryColor(UINT /*nCmdID*/)\n\t{\n\t\treturn 0x800080; /*MAGENTA*/\n\t}\n\n\tLPCWSTR OnRibbonQueryColorLabel(UINT /*nCmdID*/, REFPROPERTYKEY /*key*/)\n\t{\n\t\treturn NULL;\n\t}\n\n\tCOLORREF* OnRibbonQueryColorArray(UINT /*nCmdID*/, REFPROPERTYKEY /*key*/)\n\t{\n\t\treturn NULL;\n\t}\n\n\tLPCWSTR* OnRibbonQueryColorTooltips(UINT /*nCmdID*/, REFPROPERTYKEY /*key*/)\n\t{\n\t\treturn NULL;\n\t}\n\n\tbool OnRibbonItemSelected(UINT32 uCtrlID, UI_EXECUTIONVERB verb, UINT32 uItem)\n\t{\n\t\tDefCommandExecute(MAKELONG(uCtrlID, verb), uItem);\n\t\treturn true;\n\t}\n\n\tvoid OnRibbonColorCtrlExecute(UINT32 uCtrlID, UI_EXECUTIONVERB verb, UI_SWATCHCOLORTYPE uType, COLORREF color)\n\t{\n\t\tDefRibbonColorCtrlExecute(uCtrlID, verb, uType, color);\n\t}\n\n\tvoid OnRibbonFontCtrlExecute(UINT32 uCtrlID, UI_EXECUTIONVERB verb, CHARFORMAT2* pcf)\n\t{\n\t\tDefCommandExecute(MAKELONG(uCtrlID, verb), (LPARAM)pcf);\n\t}\n\n\tvoid OnRibbonSpinnerCtrlExecute(UINT32 uCtrlID, LONG* pVal)\n\t{\n\t\tDefCommandExecute(uCtrlID, *pVal);\n\t}\n\n\tvoid OnRibbonSpinnerCtrlExecute(UINT32 uCtrlID, DOUBLE* pVal)\n\t{\n\t\tDefCommandExecute(uCtrlID, (LPARAM)pVal);\n\t}\n\n\tvoid OnRibbonCommandExecute(UINT32 uCmdID)\n\t{\n\t\tDefCommandExecute(uCmdID);\n\t}\n\n// Default implementations\n\tHBITMAP DefRibbonQueryImage(UINT nCmdID)\n\t{\n\t\treturn AtlLoadBitmapImage(nCmdID, LR_CREATEDIBSECTION);\n\t}\n\n\tbool DefRibbonQueryState(UINT nCmdID, REFPROPERTYKEY key)\n\t{\n\t\tDWORD dwState = this->UIGetState(nCmdID);\n\t\tbool bRet = false;\n\t\tswitch (k_(key))\n\t\t{\n\t\tcase k_BooleanValue:\n\t\t\tbRet = (dwState & CUpdateUIBase::UPDUI_CHECKED) == CUpdateUIBase::UPDUI_CHECKED;\n\t\t\tbreak;\n\t\tcase k_Enabled:\n\t\t\tbRet = (dwState & CUpdateUIBase::UPDUI_DISABLED) != CUpdateUIBase::UPDUI_DISABLED;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tATLASSERT(FALSE);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\tLPCTSTR DefRibbonQueryText(UINT nCmdID, REFPROPERTYKEY key)\n\t{\n\t\tstatic WCHAR sText[RIBBONUI_MAX_TEXT] = {};\n\n\t\tif (k_(key) == k_Label)\n\t\t\t return this->UIGetText(nCmdID);\n\n\t\tif (ATL::AtlLoadString(nCmdID, sText, RIBBONUI_MAX_TEXT))\n\t\t{\n\t\t\tPWCHAR pTitle = wcschr(sText, L'\\n');\n\t\t\tswitch (k_(key))\n\t\t\t{\n\t\t\tcase k_Keytip:\n\t\t\t\tif (PWCHAR pAmp = wcschr(sText, L'&'))\n\t\t\t\t\tpTitle = pAmp;\n\t\t\t\tif (pTitle != NULL)\n\t\t\t\t\t*(pTitle + 2) = NULL; // fall through\n\t\t\tcase k_TooltipTitle:\n\t\t\t\treturn pTitle ? ++pTitle : NULL;\n\t\t\tcase k_TooltipDescription:\n\t\t\tcase k_LabelDescription:\n\t\t\t\tif (pTitle != NULL)\n\t\t\t\t\t*pTitle = NULL;\n\t\t\t\treturn sText;\n\t\t\t}\n\t\t}\n\n\t\treturn NULL;\n\t}\n\n\tLPCWSTR DefRibbonQueryItemText(UINT32 uCtrlID, UINT32 uItem)\n\t{\n\t\treturn DefRibbonQueryText(uCtrlID + 1 + uItem, UI_PKEY_LabelDescription);\n\t}\n\n\tHBITMAP DefRibbonQueryItemImage(UINT32 uCtrlID, UINT32 uItem)\n\t{\n\t\treturn DefRibbonQueryImage(uCtrlID + 1 + uItem);\n\t}\n\n\tUINT32 DefRibbonQueryItemCommand(UINT32 uCtrlID, UINT32 uItem)\n\t{\n\t\treturn uCtrlID + 1 + uItem;\n\t}\n\n\tvoid DefRibbonColorCtrlExecute(UINT32 uCtrlID, UI_EXECUTIONVERB verb, UI_SWATCHCOLORTYPE uType, COLORREF color)\n\t{\n\t\tswitch(uType)\n\t\t{\n\t\tcase UI_SWATCHCOLORTYPE_RGB:\n\t\t\tbreak;\n\t\tcase UI_SWATCHCOLORTYPE_AUTOMATIC:\n\t\t\tcolor = ::GetSysColor(COLOR_WINDOWTEXT);\n\t\t\tbreak;\n\t\tcase UI_SWATCHCOLORTYPE_NOCOLOR:\n\t\t\tcolor = ::GetSysColor(COLOR_WINDOW);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tATLASSERT(FALSE);\n\t\t\tbreak;\n\t\t}\n\n\t\tDefCommandExecute(MAKELONG(uCtrlID, verb), color);\n\t}\n\n\tvoid DefCommandExecute(UINT32 uCmd, LPARAM lParam = 0)\n\t{\n\t\tstatic_cast<T*>(this)->PostMessage(WM_COMMAND, uCmd, lParam);\n\t}\n\n// Elements setting helpers\n\tHRESULT InvalidateCtrl(UINT32 nID)\n\t{\n\t\treturn IsRibbonUI() ?\n\t\t\tGetIUIFrameworkPtr()->InvalidateUICommand(nID, UI_INVALIDATIONS_ALLPROPERTIES, NULL) :\n\t\t\tE_FAIL;\n\t}\n\n\tHRESULT InvalidateProperty(UINT32 nID, REFPROPERTYKEY key, UI_INVALIDATIONS flags = UI_INVALIDATIONS_PROPERTY)\n\t{\n\t\treturn IsRibbonUI() ?\n\t\t\tGetIUIFrameworkPtr()->InvalidateUICommand(nID, flags, &key) :\n\t\t\tE_FAIL;\n\t}\n\n\ttemplate <typename V>\n\tHRESULT SetProperty(WORD wID, REFPROPERTYKEY key, V val)\n\t{\n\t\tif (IsRibbonUI())\n\t\t{\n\t\t\tPROPVARIANT var;\n\t\t\tif (SUCCEEDED(RibbonUI::SetPropertyVal(key, val, &var)))\n\t\t\t{\n\t\t\t\treturn SetProperty(wID, key, var);\n\t\t\t}\n\t\t\treturn E_INVALIDARG;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn E_FAIL;\n\t\t}\n\t}\n\n\ttemplate <>\n\tHRESULT SetProperty(WORD nID, REFPROPERTYKEY key, PROPVARIANT var)\n\t{\n\t\treturn IsRibbonUI() ?\n\t\t\tGetIUIFrameworkPtr()->SetUICommandProperty(nID, key, var) :\n\t\t\tE_FAIL;\n\t}\n\n// Interfaces\n\t// IUIApplication\n\tSTDMETHODIMP OnViewChanged(UINT32, UI_VIEWTYPE, IUnknown*, UI_VIEWVERB verb, INT32)\n\t{\n\t\tswitch (verb)\n\t\t{\t\t\t\n\t\tcase UI_VIEWVERB_CREATE:\n\t\t\tm_bRibbonUI = true;\n\t\t\tif (m_hgRibbonSettings != NULL)\n\t\t\t\tRestoreRibbonSettings();\n\t\t\tbreak;\n\t\tcase UI_VIEWVERB_SIZE:\n\t\t\tstatic_cast<T*>(this)->UpdateLayout(FALSE);\n\t\t\tbreak;\n\t\tcase UI_VIEWVERB_DESTROY:\n\t\t\tSaveRibbonSettings();\n\t\t\tm_bRibbonUI = false;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t\treturn S_OK;\n\t}\n\n\tSTDMETHODIMP OnCreateUICommand(UINT32 nCmdID, UI_COMMANDTYPE typeID, IUICommandHandler** ppCommandHandler)\n\t{\n\t\tthis->UIAddRibbonElement(nCmdID);\n\t\tif (typeID == UI_COMMANDTYPE_CONTEXT)\n\t\t\tCUpdateUIBase::UIEnable(nCmdID, false);\n\t\t*ppCommandHandler = this;\n\t\treturn S_OK;\n\t}\n\n\tSTDMETHODIMP OnDestroyUICommand(UINT32 nCmdID, UI_COMMANDTYPE, IUICommandHandler*)\n\t{\n\t\tthis->UIRemoveRibbonElement(nCmdID);\n\t\treturn S_OK;\n\t}\n\n\t// IUICommandHandler\n\tSTDMETHODIMP Execute(UINT nCmdID,\n\t\tUI_EXECUTIONVERB verb, \n\t\tconst PROPERTYKEY* key,\n\t\tconst PROPVARIANT* ppropvarValue,\n\t\tIUISimplePropertySet* pCommandExecutionProperties)\n\t{\n\t\tT* pT =static_cast<T*>(this);\n\t\treturn pT->GetRibbonCtrl(nCmdID).DoExecute(nCmdID, verb, key, ppropvarValue, pCommandExecutionProperties);\t\n\t}\n\n\tSTDMETHODIMP UpdateProperty(UINT nCmdID, REFPROPERTYKEY key, \n\t                            const PROPVARIANT* ppropvarCurrentValue, PROPVARIANT* ppropvarNewValue)\n\t{\n\t\tT* pT =static_cast<T*>(this);\n\t\treturn pT->GetRibbonCtrl(nCmdID).DoUpdateProperty(nCmdID, key, ppropvarCurrentValue, ppropvarNewValue);\t\n\t}\n\n#ifdef _DEBUG\n\t// IUnknown methods (heavyweight)\n\tSTDMETHODIMP_(ULONG) AddRef()\n\t{\n\t\treturn InterlockedIncrement(&m_cRef);\n\t}\n\n\tSTDMETHODIMP_(ULONG) Release()\n\t{\n\t\tLONG cRef = InterlockedDecrement(&m_cRef);\n\t\tif (cRef == 0) // NoOp for breakpoint\n\t\t{\n\t\t\tcRef = 0;\n\t\t}\n\n\t\treturn cRef;\n\t}\n\n\tSTDMETHODIMP QueryInterface(REFIID iid, void** ppv)\n\t{\n\t\tif (ppv == NULL)\n\t\t{\n\t\t\treturn E_POINTER;\n\t\t}\n\t\telse if ((iid == __uuidof(IUnknown)) ||\n\t\t         (iid == __uuidof(IUICommandHandler)) ||\n\t\t         (iid == __uuidof(IUIApplication)))\n\t\t{\n\t\t\t*ppv = this;\n\t\t\tAddRef();\n\t\t\treturn S_OK;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn E_NOINTERFACE;\n\t\t}\n\t}\n\n\tLONG m_cRef;\n#else\n\t// IUnknown methods (lightweight)\n\tSTDMETHODIMP QueryInterface(REFIID iid, void** ppv)\n\t{\n\t\tif ((iid == __uuidof(IUnknown)) ||\n\t\t    (iid == __uuidof(IUICommandHandler)) ||\n\t\t    (iid == __uuidof(IUIApplication)))\n\t\t{\n\t\t\t*ppv = this;\n\t\t\treturn S_OK;\n\t\t}\n\t\treturn E_NOINTERFACE;\n\t}\n\tULONG STDMETHODCALLTYPE AddRef()\n\t{\n\t\treturn 1;\n\t}\n\tULONG STDMETHODCALLTYPE Release()\n\t{\n\t\treturn 1;\n\t}\n#endif\n\n// CRibbonImpl ICtrl implementation\n\tvirtual HRESULT DoExecute(UINT nCmdID, UI_EXECUTIONVERB verb, \n\t                          const PROPERTYKEY* key, const PROPVARIANT* ppropvarValue,\n\t                          IUISimplePropertySet* /*pCommandExecutionProperties*/)\n\t{\n\t\tif (key != NULL)\n\t\t{\n\t\t\tif(k_(*key) != k_BooleanValue)\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"Control ID %d is not handled\\n\"), nCmdID);\n\t\t\t\treturn E_NOTIMPL;\n\t\t\t}\n\t\t\tBOOL bChecked = FALSE;\n\t\t\tATLVERIFY(SUCCEEDED(PropVariantToBoolean(*ppropvarValue, &bChecked)));\n\t\t\tCUpdateUIBase::UISetCheck(nCmdID, bChecked);\n\t\t}\n\n\t\tATLASSERT(verb == UI_EXECUTIONVERB_EXECUTE);\n\t\t(void)verb;   // avoid level 4 warning\n\n\t\tstatic_cast<T*>(this)->OnRibbonCommandExecute(nCmdID);\n\t\t\n\t\treturn S_OK;\n\t}\n\n\tvirtual HRESULT DoUpdateProperty(UINT nCmdID, REFPROPERTYKEY key, \n\t\tconst PROPVARIANT* /*ppropvarCurrentValue*/, PROPVARIANT* ppropvarNewValue)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tHRESULT hr = E_NOTIMPL;\n\t\tswitch (k_(key))\n\t\t{\n\t\tcase k_LargeImage:\n\t\tcase k_LargeHighContrastImage:\n\t\tcase k_SmallImage:\n\t\tcase k_SmallHighContrastImage:\n\t\t\tif (HBITMAP hbm = pT->OnRibbonQueryImage(nCmdID, key))\n\t\t\t\thr = SetPropertyVal(key, GetImage(hbm, UI_OWNERSHIP_TRANSFER), ppropvarNewValue);\n\t\t\tbreak;\n\t\tcase k_Label:\n\t\tcase k_Keytip:\n\t\tcase k_TooltipTitle:\n\t\tcase k_TooltipDescription:\n\t\tcase k_LabelDescription:\n\t\t\tif (LPCWSTR sText = pT->OnRibbonQueryText(nCmdID, key))\n\t\t\t\thr = SetPropertyVal(key, sText, ppropvarNewValue);\n\t\t\tbreak;\n\t\tcase k_BooleanValue:\n\t\tcase k_Enabled:\n\t\t\thr = SetPropertyVal(key, pT->OnRibbonQueryState(nCmdID, key), ppropvarNewValue);\n\t\t\tbreak;\n\t\tcase k_ContextAvailable:\n\t\t\thr = SetPropertyVal(key, pT->OnRibbonQueryTabAvail(nCmdID), ppropvarNewValue);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn hr;\n\t}\n\n// CRibbonImpl::CRibbonXXXCtrl specialized classes\n\t //CRibbonComboCtrl\n\ttemplate <UINT t_ID, size_t t_items, size_t t_categories = 0>\n\tclass CRibbonComboCtrl : public CollectionCtrlImpl<T, t_ID, ComboCollectionImpl<CRibbonComboCtrl<t_ID, t_items, t_categories>, t_items, t_categories>>\n\t{\n\tpublic:\n\t\tCRibbonComboCtrl()\n\t\t{ }\n\t};\n\n\t// CRibbonItemGalleryCtrl\n\ttemplate <UINT t_ID, size_t t_items, size_t t_categories = 0>\n\tclass CRibbonItemGalleryCtrl : public CollectionCtrlImpl<T, t_ID, ItemCollectionImpl<CRibbonItemGalleryCtrl<t_ID, t_items, t_categories>, t_items, t_categories>>\n\t{\n\tpublic:\n\t\tCRibbonItemGalleryCtrl()\n\t\t{ }\n\t};\n\n\t// CRibbonCommandGalleryCtrl\n\ttemplate <UINT t_ID, size_t t_items, size_t t_categories = 0>\n\tclass CRibbonCommandGalleryCtrl : public CollectionCtrlImpl<T, t_ID, CommandCollectionImpl<CRibbonCommandGalleryCtrl<t_ID, t_items, t_categories>, t_items, t_categories>>\n\t{\n\tpublic:\n\t\tCRibbonCommandGalleryCtrl()\n\t\t{ }\n\t};\n\n\t// CRibbonToolbarGalleryCtrl\n\ttemplate <UINT t_ID, UINT t_idTB, size_t t_size>\n\tclass CRibbonToolbarGalleryCtrl : public ToolbarGalleryCtrlImpl<T, t_ID, t_idTB, t_size>\n\t{ };\n\n\t// CRibbonSimpleComboCtrl\n\ttemplate <UINT t_ID, size_t t_size>\n\tclass CRibbonSimpleComboCtrl : public SimpleCollectionCtrlImpl<T, t_ID, t_size>\n\t{ };\n\n\t// CRibbonSimpleGalleryCtrl\n\ttemplate <UINT t_ID, size_t t_size, UI_COMMANDTYPE t_CommandType = UI_COMMANDTYPE_ACTION>\n\tclass CRibbonSimpleGalleryCtrl : public SimpleCollectionCtrlImpl<T, t_ID, t_size, t_CommandType>\n\t{ };\n\n\t//CRibbonRecentItemsCtrl\n\ttemplate <UINT t_ID, class TDocList = CRecentDocumentList>\n\tclass CRibbonRecentItemsCtrl : public RecentItemsCtrlImpl<T, t_ID, TDocList>\n\t{\n\tpublic:\n\t\tCRibbonRecentItemsCtrl()\n\t\t{ }\n\t};\n\n\t// CRibbonColorCtrl\n\ttemplate <UINT t_ID>\n\tclass CRibbonColorCtrl : public ColorCtrlImpl<T, t_ID>\n\t{\n\tpublic:\n\t\tCRibbonColorCtrl()\n\t\t{ }\n\t};\n\n\t //CRibbonFontCtrl\n\ttemplate <UINT t_ID>\n\tclass CRibbonFontCtrl : public FontCtrlImpl<T, t_ID>\n\t{\n\tpublic:\n\t\tCRibbonFontCtrl()\n\t\t{ }\n\t};\n\n\t// CRibbonSpinnerCtrl\n\ttemplate <UINT t_ID>\n\tclass CRibbonSpinnerCtrl : public SpinnerCtrlImpl<T, t_ID, LONG>\n\t{\n\tpublic:\n\t\tCRibbonSpinnerCtrl()\n\t\t{ }\n\t};\n\n\t// CRibbonFloatSpinnerCtrl\n\ttemplate <UINT t_ID>\n\tclass CRibbonFloatSpinnerCtrl : public SpinnerCtrlImpl<T, t_ID, DOUBLE>\n\t{\n\tpublic:\n\t\tCRibbonFloatSpinnerCtrl()\n\t\t{\n\t\t\tthis->m_Values[4] = 1; // 1 decimal\n\t\t}\n\t};\n\n\t// CRibbonCommandCtrl\n\ttemplate <UINT t_ID>\n\tclass CRibbonCommandCtrl : public CommandCtrlImpl<T, t_ID>\n\t{\n\tpublic:\n\t\tCRibbonCommandCtrl()\n\t\t{ }\n\t};\n\n// Control classes access to T instance (re-initialized in constructor)\n\tstatic T* pWndRibbon;\n};\n\ntemplate <class T>\n__declspec(selectany) T* CRibbonImpl<T>::pWndRibbon;\n\n// Control map element\n#pragma warning(push)\n#pragma warning(disable: 4510 610 4512)   // missing default constructor, can't be instatiated, assignment operator could not be generated\ntypedef struct\n{\n\tUINT uID;\n\tICtrl& ctrl;\n} _ribbonCtrl;\n#pragma warning(pop)\n\n} // namespace RibbonUI\n\n\n///////////////////////////////////////////////////////////////////////////////\n// RibbonUI Control map\n\n// Control map macros\n#define BEGIN_RIBBON_CONTROL_MAP(theClass) \\\n\tWTL::RibbonUI::ICtrl& GetRibbonCtrl(UINT id) \\\n\t{ \\\n\t\tWTL::RibbonUI::_ribbonCtrl _ctrls[] = \\\n\t\t{\n\n#define RIBBON_CONTROL(member) {member.GetID(), static_cast<WTL::RibbonUI::ICtrl&>(member)},\n\n#define END_RIBBON_CONTROL_MAP() \\\n\t\t{0, *this} \\\n\t}; \\\n\tint i = 0; \\\n\tfor(; i < _countof(_ctrls) - 1; i++) \\\n\t\tif (_ctrls[i].uID == id) \\\n\t\t\tbreak; \\\n\treturn _ctrls[i].ctrl; \\\n}\n\n// Control message map macros\n#define RIBBON_GALLERY_CONTROL_HANDLER(id, func) \\\n\tif((uMsg == WM_COMMAND) && (id == LOWORD(wParam))) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = func((UI_EXECUTIONVERB)HIWORD(wParam), LOWORD(wParam), (UINT)lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define RIBBON_COMBO_CONTROL_HANDLER(id, func) \\\n\tRIBBON_GALLERY_CONTROL_HANDLER(id, func)\t\n\n#define RIBBON_FONT_CONTROL_HANDLER(id, func) \\\n\tif((uMsg == WM_COMMAND) && (id == LOWORD(wParam))) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = func((UI_EXECUTIONVERB)HIWORD(wParam), LOWORD(wParam), (CHARFORMAT2*)lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define RIBBON_COLOR_CONTROL_HANDLER(id, func) \\\n\tif((uMsg == WM_COMMAND) && (id == LOWORD(wParam))) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = func((UI_EXECUTIONVERB)HIWORD(wParam), LOWORD(wParam), (COLORREF)lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define RIBBON_SPINNER_CONTROL_HANDLER(id, func) \\\n\tif((uMsg == WM_COMMAND) && (id == wParam)) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = func((WORD)wParam, (LONG)lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define RIBBON_FLOATSPINNER_CONTROL_HANDLER(id, func) \\\n\tif((uMsg == WM_COMMAND) && (id == wParam)) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = func((WORD)wParam, (DOUBLE*)lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n// Handler prototypes\n/*\n\tLRESULT OnRibbonGalleryCtrl(UI_EXECUTIONVERB verb, WORD wID, UINT uSel, BOOL& bHandled);\n\tLRESULT OnRibbonComboCtrl(UI_EXECUTIONVERB verb, WORD wID, UINT uSel, BOOL& bHandled);\n\tLRESULT OnRibbonFontCtrl(UI_EXECUTIONVERB verb, WORD wID, CHARFORMAT2* pcf, BOOL& bHandled);\n\tLRESULT OnRibbonColorCtrl(UI_EXECUTIONVERB verb, WORD wID, COLORREF color, BOOL& bHandled);\n\tLRESULT OnRibbonSpinnerCtrl(WORD wID, LONG lVal, BOOL& bHandled);\n\tLRESULT OnRibbonFloatSpinnerCtrl(WORD wID, DOUBLE* pdVal, BOOL& bHandled);\n*/\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Ribbon frame classes\n\n// CRibbonFrameWindowImplBase\n//\ntemplate <class T, class TFrameImpl>\nclass ATL_NO_VTABLE CRibbonFrameWindowImplBase : public TFrameImpl, public RibbonUI::CRibbonImpl<T>\n{\n\ttypedef TFrameImpl baseFrame;\n\tbool m_bUseCommandBarBitmaps;\n\tbool m_bWin7Fix;\n\npublic:\n// Construction\n\tCRibbonFrameWindowImplBase(bool bUseCommandBarBitmaps = true) : \n\t\t\tm_bUseCommandBarBitmaps(bUseCommandBarBitmaps), m_bWin7Fix(false)\n\t{\n\t\t__if_not_exists(T::m_CmdBar)\n\t\t{\n\t\t\tm_bUseCommandBarBitmaps = false;\n\t\t}\n\t}\n\n// Win7 Aero fix helpers\n\tvoid ResetFrame()\n\t{\n\t\tconst MARGINS margins = { 0, 0, 0, 0 };\n\t\t::DwmExtendFrameIntoClientArea(this->m_hWnd, &margins);\n\t}\n\n\tINT CalcWin7Fix()\n\t{\n\t\tResetFrame();\n\t\tRECT rc = {};\n\t\t::AdjustWindowRectEx(&rc, T::GetWndStyle(0), this->GetMenu() != NULL, T::GetWndExStyle(0));\n\t\treturn -rc.top;\n\t}\n\n\tbool NeedWin7Fix()\n\t{\n\t\tBOOL bComp = FALSE;\n\t\treturn m_bWin7Fix && RunTimeHelper::IsWin7() && SUCCEEDED(DwmIsCompositionEnabled(&bComp)) && bComp;\n\t}\n\n// Operations\n\tbool UseCommandBarBitmaps(bool bUse)\n\t{\n\t\t__if_exists(T::m_CmdBar)\n\t\t{\n\t\t\treturn m_bUseCommandBarBitmaps = bUse;\n\t\t}\n\t\t__if_not_exists(T::m_CmdBar)\n\t\t{\n\t\t\t(void)bUse;   // avoid level 4 warning\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tbool ShowRibbonUI(bool bShow, INT32 imodes = UI_MAKEAPPMODE(0), LPCWSTR sResName = L\"APPLICATION_RIBBON\")\n\t{\n\t\tif (!RunTimeHelper::IsRibbonUIAvailable())\n\t\t\treturn false;\n\n\t\tATLASSERT(this->GetIUIFrameworkPtr());\n\n\t\tif (this->IsRibbonUI() == bShow)\n\t\t\treturn bShow;\n\n\t\tbool bVisible = (this->IsWindowVisible() != FALSE);\n\t\tif(bVisible && !bShow)\n\t\t\tthis->SetRedraw(FALSE);\n\n\t\tif (bShow && ::IsWindow(this->m_hWndToolBar))\n\t\t{\n\t\t\t::ShowWindow(this->m_hWndToolBar, SW_HIDE);\n\t\t\tUpdateLayout();\n\t\t}\n\n\t\tm_bWin7Fix = !bShow;\n\n\t\tHRESULT hr = bShow ? this->CreateRibbon(sResName) : this->DestroyRibbon();\n\n\t\tm_bWin7Fix = SUCCEEDED(hr) && !bShow;\n\n\t\tif (SUCCEEDED(hr))\n\t\t{\n\t\t\tif(::IsWindow(this->m_hWndToolBar) && !bShow)\n\t\t\t{\n\t\t\t\t::ShowWindow(this->m_hWndToolBar, SW_SHOWNA);\n\t\t\t\tUpdateLayout(); \n\t\t\t}\n\t\t\telse if (bShow)\n\t\t\t{\n\t\t\t\tthis->PostMessage(WM_SIZE);\n\t\t\t\tthis->SetRibbonModes(imodes);\n\t\t\t}\n\t\t}\n\n\t\tif(bVisible && !bShow)\n\t\t{\n\t\t\tthis->SetRedraw(TRUE);\n\t\t\tthis->RedrawWindow(NULL, NULL, RDW_FRAME | RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);\n\t\t}\n\n\t\treturn SUCCEEDED(hr) ? bShow : !bShow;\n\t}\n\n// Overrideables\n\tHBITMAP OnRibbonQueryImage(UINT nCmdID, REFPROPERTYKEY key)\n\t{\n\t\tif ((key == UI_PKEY_SmallImage) && m_bUseCommandBarBitmaps)\n\t\t{\n\t\t\tif (HBITMAP hbm = GetCommandBarBitmap(nCmdID))\n\t\t\t\treturn (HBITMAP)::CopyImage(hbm, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);\n\t\t}\n\n\t\treturn this->DefRibbonQueryImage(nCmdID);\n\t}\n\n\tBEGIN_MSG_MAP(CRibbonFrameWindowImplBase)\n\t\tif (!this->IsRibbonUI() && NeedWin7Fix())\n\t\t{\n\t\t\tMESSAGE_HANDLER(WM_SIZING, OnSizing)\n\t\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\t\t\tMESSAGE_HANDLER(WM_ACTIVATE, OnActivate)\n\t\t\tMESSAGE_HANDLER(WM_NCCALCSIZE, OnNCCalcSize)\n\t\t}\n\t\tCHAIN_MSG_MAP(CRibbonUpdateUI<T>)\n\t\tCHAIN_MSG_MAP(baseFrame)\n\tEND_MSG_MAP()\n\n// Message handlers for Win7 Aero\n\tLRESULT OnSizing(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tswitch (wParam)\n\t\t{\t\t\n\t\tcase WMSZ_TOP:\n\t\tcase WMSZ_TOPLEFT:\n\t\tcase WMSZ_TOPRIGHT:\n\t\t\tthis->SetWindowPos(NULL, (LPRECT)lParam, SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthis->DefWindowProc();\n\t\t\tbreak;\n\t\t}\n\n\t\treturn 1; // handled\n\t}\n\n\tLRESULT OnSize(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif (wParam != SIZE_MINIMIZED)\n\t\t\tthis->SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(wParam != WA_INACTIVE)\n\t\t\tthis->SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnNCCalcSize(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tATLASSERT(!this->IsRibbonUI() && NeedWin7Fix());\n\n\t\tLRESULT lRet = this->DefWindowProc();\n\n\t\tif(wParam)\n\t\t{\n\t\t\tLPNCCALCSIZE_PARAMS pParams = (LPNCCALCSIZE_PARAMS)lParam;\n\t\t\tpParams->rgrc[0].top = pParams->rgrc[1].top + CalcWin7Fix();\n\t\t}\n\n\t\treturn lRet;\n\t}\n\n// Overrides\n\tvoid UpdateLayout(BOOL bResizeBars = TRUE)\n\t{\n\t\tRECT rect = {};\n\t\tthis->GetClientRect(&rect);\n\n\t\tif (this->IsRibbonUI() && !this->IsRibbonHidden())\n\t\t{\n\t\t\trect.top += this->GetRibbonHeight();\n\t\t}\n\t\telse if (!this->IsRibbonUI() && NeedWin7Fix())\n\t\t{\n\t\t\tResetFrame();\n\t\t}\n\n\t\t// position bars and offset their dimensions\n\t\tthis->UpdateBarsPosition(rect, bResizeBars);\n\n\t\t// resize client window\n\t\tif(this->m_hWndClient != NULL)\n\t\t\t::SetWindowPos(this->m_hWndClient, NULL, rect.left, rect.top,\n\t\t\t\trect.right - rect.left, rect.bottom - rect.top,\n\t\t\t\tSWP_NOZORDER | SWP_NOACTIVATE);\n\t}\n\n\t// Implementation\n\tHBITMAP GetCommandBarBitmap(UINT nCmdID)\n\t{\n\t\t__if_exists (T::m_CmdBar)\n\t\t{\n\t\t\tATLASSERT(RunTimeHelper::IsVista());\n\t\t\tT* pT =static_cast<T*>(this);\n\t\t\tint nIndex = pT->m_CmdBar.m_arrCommand.Find((WORD&)nCmdID);\n\t\t\treturn (nIndex == -1) ? NULL : pT->m_CmdBar.m_arrVistaBitmap[nIndex];\n\t\t}\n\t\t__if_not_exists (T::m_CmdBar)\n\t\t{\n\t\t\t(void)nCmdID;   // avoid level 4 warning\n\t\t\treturn NULL;\n\t\t}\n\t}\n};\n\n// CRibbonFrameWindowImpl\n//\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CFrameWinTraits>\nclass ATL_NO_VTABLE CRibbonFrameWindowImpl : public CRibbonFrameWindowImplBase<T, CFrameWindowImpl<T, TBase, TWinTraits>>\n{ };\n\n// CRibbonMDIFrameWindowImpl\n//\ntemplate <class T, class TBase = CMDIWindow, class TWinTraits = ATL::CFrameWinTraits>\nclass ATL_NO_VTABLE CRibbonMDIFrameWindowImpl : public CRibbonFrameWindowImplBase<T, CMDIFrameWindowImpl<T, TBase, TWinTraits>>\n{ };\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CRibbonPersist helper for RibbonUI persistency\n\nclass CRibbonPersist\n{\npublic:\n\tCRibbonPersist(LPCWSTR sAppKey)\n\t{\n\t\tATLASSERT(sAppKey && *sAppKey);\n\t\tm_Key.Create(HKEY_CURRENT_USER, sAppKey);\n\t\tATLASSERT(m_Key.m_hKey);\n\t}\n\n\tATL::CRegKey m_Key;\n\n\tLONG Save(bool bRibbonUI, HGLOBAL hgSettings = NULL)\n\t{\n\t\tATL::CRegKey key;\n\t\tconst DWORD dwUI = bRibbonUI;\n\n\t\tLONG lRet = key.Create(m_Key, L\"Ribbon\");\n\t\tif(lRet != ERROR_SUCCESS)\n\t\t\treturn lRet;\n\t\t\n\t\tlRet = key.SetDWORDValue(L\"UI\", dwUI);\n\t\tif(lRet != ERROR_SUCCESS)\n\t\t\treturn lRet;\n\n\t\tif (hgSettings != NULL)\n\t\t{\n\t\t\tLPBYTE pVal = (LPBYTE)::GlobalLock(hgSettings);\n\t\t\tif (pVal != NULL)\n\t\t\t{\n\t\t\t\tlRet = key.SetBinaryValue(L\"Settings\", pVal, (ULONG)::GlobalSize(hgSettings));\n\t\t\t\t::GlobalUnlock(hgSettings);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlRet = GetLastError();\n\t\t\t}\n\t\t}\n\n\t\treturn lRet;\n\t}\n\n\tLONG Restore(bool& bRibbonUI, HGLOBAL& hgSettings)\n\t{\n\t\tATLASSERT(hgSettings == NULL);\n\n\t\tATL::CRegKey key;\n\n\t\tLONG lRet = key.Open(m_Key, L\"Ribbon\");\n\t\tif(lRet != ERROR_SUCCESS)\n\t\t\treturn lRet;\n\t\t\n\t\tDWORD dwUI = 0xffff;\n\t\tlRet = key.QueryDWORDValue(L\"UI\", dwUI);\n\t\tif(lRet == ERROR_SUCCESS)\n\t\t\tbRibbonUI = dwUI == 1;\n\t\telse\n\t\t\treturn lRet;\n\n\t\tULONG ulSize = 0;\n\t\tlRet = key.QueryBinaryValue(L\"Settings\", NULL, &ulSize);\n\t\tif (lRet == ERROR_SUCCESS)\n\t\t{\n\t\t\tATLASSERT(ulSize != 0);\n\t\t\t\n\t\t\thgSettings = ::GlobalAlloc(GHND, ulSize);\n\t\t\tif (hgSettings != NULL)\n\t\t\t{\n\t\t\t\tLPBYTE pData = (LPBYTE)::GlobalLock(hgSettings);\n\t\t\t\tif (pData != NULL)\n\t\t\t\t{\n\t\t\t\t\tlRet = key.QueryBinaryValue(L\"Settings\", pData, &ulSize);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlRet = GetLastError();\n\t\t\t\t\t::GlobalFree(hgSettings);\n\t\t\t\t\thgSettings = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlRet = GetLastError();\n\t\t\t}\n\t\t}\n\t\treturn lRet;\n\t}\n\n\tLONG Delete()\n\t{\n\t\treturn m_Key.DeleteSubKey(L\"Ribbon\");\n\t}\n};\n\n} // namespace WTL\n\n#endif // __ATLRIBBON_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlscrl.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLSCRL_H__\n#define __ATLSCRL_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atlscrl.h requires atlapp.h to be included first\n#endif\n\n#ifndef __ATLWIN_H__\n\t#error atlscrl.h requires atlwin.h to be included first\n#endif\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CScrollImpl<T>\n// CScrollWindowImpl<T, TBase, TWinTraits>\n// CMapScrollImpl<T>\n// CMapScrollWindowImpl<T, TBase, TWinTraits>\n// CFSBWindowT<TBase>\n// CZoomScrollImpl<T>\n// CZoomScrollWindowImpl<T, TBase, TWinTraits>\n// CScrollContainerImpl<T, TBase, TWinTraits>\n// CScrollContainer\n\nnamespace WTL\n{\n\n///////////////////////////////////////////////////////////////////////////////\n// CScrollImpl - Provides scrolling support to any window\n\n// Scroll extended styles\n#define SCRL_SCROLLCHILDREN\t0x00000001\n#define SCRL_ERASEBACKGROUND\t0x00000002\n#define SCRL_NOTHUMBTRACKING\t0x00000004\n#define SCRL_SMOOTHSCROLL\t0x00000008\n#define SCRL_DISABLENOSCROLLV\t0x00000010\n#define SCRL_DISABLENOSCROLLH\t0x00000020\n#define SCRL_DISABLENOSCROLL\t(SCRL_DISABLENOSCROLLV | SCRL_DISABLENOSCROLLH)\n\n\ntemplate <class T>\nclass CScrollImpl\n{\npublic:\n\tenum { uSCROLL_FLAGS = SW_INVALIDATE };\n\n\tPOINT m_ptOffset;\n\tSIZE m_sizeAll;\n\tSIZE m_sizeLine;\n\tSIZE m_sizePage;\n\tSIZE m_sizeClient;\n\tint m_zDelta;              // current wheel value\n\tint m_nWheelLines;         // number of lines to scroll on wheel\n\tint m_zHDelta;              // current horizontal wheel value\n\tint m_nHWheelChars;         // number of chars to scroll on horizontal wheel\n\tUINT m_uScrollFlags;\n\tDWORD m_dwExtendedStyle;   // scroll specific extended styles\n\n// Constructor\n\tCScrollImpl() : m_zDelta(0), m_nWheelLines(3), \n\t\t\tm_zHDelta(0), m_nHWheelChars(3), \n\t\t\tm_uScrollFlags(0U), m_dwExtendedStyle(0)\n\t{\n\t\tm_ptOffset.x = 0;\n\t\tm_ptOffset.y = 0;\n\t\tm_sizeAll.cx = 0;\n\t\tm_sizeAll.cy = 0;\n\t\tm_sizePage.cx = 0;\n\t\tm_sizePage.cy = 0;\n\t\tm_sizeLine.cx = 0;\n\t\tm_sizeLine.cy = 0;\n\t\tm_sizeClient.cx = 0;\n\t\tm_sizeClient.cy = 0;\n\n\t\tSetScrollExtendedStyle(SCRL_SCROLLCHILDREN | SCRL_ERASEBACKGROUND);\n\t}\n\n// Attributes & Operations\n\tDWORD GetScrollExtendedStyle() const\n\t{\n\t\treturn m_dwExtendedStyle;\n\t}\n\n\tDWORD SetScrollExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\n\t{\n\t\tDWORD dwPrevStyle = m_dwExtendedStyle;\n\t\tif(dwMask == 0)\n\t\t\tm_dwExtendedStyle = dwExtendedStyle;\n\t\telse\n\t\t\tm_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\n\t\t// cache scroll flags\n\t\tT* pT = static_cast<T*>(this);\n\t\t(void)pT;   // avoid level 4 warning\n\t\tm_uScrollFlags = pT->uSCROLL_FLAGS | (IsScrollingChildren() ? SW_SCROLLCHILDREN : 0) | (IsErasingBackground() ? SW_ERASE : 0);\n\t\tm_uScrollFlags |= (IsSmoothScroll() ? SW_SMOOTHSCROLL : 0);\n\t\treturn dwPrevStyle;\n\t}\n\n\t// offset operations\n\tvoid SetScrollOffset(int x, int y, BOOL bRedraw = TRUE)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\n\t\tpT->AdjustScrollOffset(x, y);\n\n\t\tint dx = m_ptOffset.x - x;\n\t\tint dy = m_ptOffset.y - y;\n\t\tm_ptOffset.x = x;\n\t\tm_ptOffset.y = y;\n\n\t\t// block: set horizontal scroll bar\n\t\t{\n\t\t\tSCROLLINFO si = { sizeof(SCROLLINFO) };\n\t\t\tsi.fMask = SIF_POS;\n\t\t\tif((m_dwExtendedStyle & SCRL_DISABLENOSCROLLH) != 0)\n\t\t\t\tsi.fMask |= SIF_DISABLENOSCROLL;\n\t\t\tsi.nPos = m_ptOffset.x;\n\t\t\tpT->SetScrollInfo(SB_HORZ, &si, bRedraw);\n\t\t}\n\n\t\t// block: set vertical scroll bar\n\t\t{\n\t\t\tSCROLLINFO si = { sizeof(SCROLLINFO) };\n\t\t\tsi.fMask = SIF_POS;\n\t\t\tif((m_dwExtendedStyle & SCRL_DISABLENOSCROLLV) != 0)\n\t\t\t\tsi.fMask |= SIF_DISABLENOSCROLL;\n\t\t\tsi.nPos = m_ptOffset.y;\n\t\t\tpT->SetScrollInfo(SB_VERT, &si, bRedraw);\n\t\t}\n\n\t\t// Move all children if needed\n\t\tif(IsScrollingChildren() && ((dx != 0) || (dy != 0)))\n\t\t{\n\t\t\tfor(HWND hWndChild = ::GetWindow(pT->m_hWnd, GW_CHILD); hWndChild != NULL; hWndChild = ::GetWindow(hWndChild, GW_HWNDNEXT))\n\t\t\t{\n\t\t\t\tRECT rect = {};\n\t\t\t\t::GetWindowRect(hWndChild, &rect);\n\t\t\t\t::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rect, 1);\n\t\t\t\t::SetWindowPos(hWndChild, NULL, rect.left + dx, rect.top + dy, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);\n\t\t\t}\n\t\t}\n\n\t\tif(bRedraw)\n\t\t\tpT->Invalidate();\n\t}\n\n\tvoid SetScrollOffset(POINT ptOffset, BOOL bRedraw = TRUE)\n\t{\n\t\tSetScrollOffset(ptOffset.x, ptOffset.y, bRedraw);\n\t}\n\n\tvoid GetScrollOffset(POINT& ptOffset) const\n\t{\n\t\tptOffset = m_ptOffset;\n\t}\n\n\t// size operations\n\tvoid SetScrollSize(int cx, int cy, BOOL bRedraw = TRUE, bool bResetOffset = true)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\n\t\tm_sizeAll.cx = cx;\n\t\tm_sizeAll.cy = cy;\n\n\t\tint x = 0;\n\t\tint y = 0;\n\t\tif(!bResetOffset)\n\t\t{\n\t\t\tx = m_ptOffset.x;\n\t\t\ty = m_ptOffset.y;\n\t\t\tpT->AdjustScrollOffset(x, y);\n\t\t}\n\n\t\tint dx = m_ptOffset.x - x;\n\t\tint dy = m_ptOffset.y - y;\n\t\tm_ptOffset.x = x;\n\t\tm_ptOffset.y = y;\n\n\t\t// block: set horizontal scroll bar\n\t\t{\n\t\t\tSCROLLINFO si = { sizeof(SCROLLINFO) };\n\t\t\tsi.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;\n\t\t\tif((m_dwExtendedStyle & SCRL_DISABLENOSCROLLH) != 0)\n\t\t\t\tsi.fMask |= SIF_DISABLENOSCROLL;\n\t\t\tsi.nMin = 0;\n\t\t\tsi.nMax = m_sizeAll.cx - 1;\n\t\t\tsi.nPage = m_sizeClient.cx;\n\t\t\tsi.nPos = m_ptOffset.x;\n\t\t\tpT->SetScrollInfo(SB_HORZ, &si, bRedraw);\n\t\t}\n\n\t\t// block: set vertical scroll bar\n\t\t{\n\t\t\tSCROLLINFO si = { sizeof(SCROLLINFO) };\n\t\t\tsi.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;\n\t\t\tif((m_dwExtendedStyle & SCRL_DISABLENOSCROLLV) != 0)\n\t\t\t\tsi.fMask |= SIF_DISABLENOSCROLL;\n\t\t\tsi.nMin = 0;\n\t\t\tsi.nMax = m_sizeAll.cy - 1;\n\t\t\tsi.nPage = m_sizeClient.cy;\n\t\t\tsi.nPos = m_ptOffset.y;\n\t\t\tpT->SetScrollInfo(SB_VERT, &si, bRedraw);\n\t\t}\n\n\t\t// Move all children if needed\n\t\tif(IsScrollingChildren() && ((dx != 0) || (dy != 0)))\n\t\t{\n\t\t\tfor(HWND hWndChild = ::GetWindow(pT->m_hWnd, GW_CHILD); hWndChild != NULL; hWndChild = ::GetWindow(hWndChild, GW_HWNDNEXT))\n\t\t\t{\n\t\t\t\tRECT rect = {};\n\t\t\t\t::GetWindowRect(hWndChild, &rect);\n\t\t\t\t::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rect, 1);\n\t\t\t\t::SetWindowPos(hWndChild, NULL, rect.left + dx, rect.top + dy, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);\n\t\t\t}\n\t\t}\n\n\t\tSetScrollLine(0, 0);\n\t\tSetScrollPage(0, 0);\n\n\t\tif(bRedraw)\n\t\t\tpT->Invalidate();\n\t}\n\n\tvoid SetScrollSize(SIZE size, BOOL bRedraw = TRUE, bool bResetOffset = true)\n\t{\n\t\tSetScrollSize(size.cx, size.cy, bRedraw, bResetOffset);\n\t}\n\n\tvoid GetScrollSize(SIZE& sizeWnd) const\n\t{\n\t\tsizeWnd = m_sizeAll;\n\t}\n\n\t// line operations\n\tvoid SetScrollLine(int cxLine, int cyLine)\n\t{\n\t\tATLASSERT((cxLine >= 0) && (cyLine >= 0));\n\t\tATLASSERT((m_sizeAll.cx != 0) && (m_sizeAll.cy != 0));\n\n\t\tm_sizeLine.cx = T::CalcLineOrPage(cxLine, m_sizeAll.cx, 100);\n\t\tm_sizeLine.cy = T::CalcLineOrPage(cyLine, m_sizeAll.cy, 100);\n\t}\n\n\tvoid SetScrollLine(SIZE sizeLine)\n\t{\n\t\tSetScrollLine(sizeLine.cx, sizeLine.cy);\n\t}\n\n\tvoid GetScrollLine(SIZE& sizeLine) const\n\t{\n\t\tsizeLine = m_sizeLine;\n\t}\n\n\t// page operations\n\tvoid SetScrollPage(int cxPage, int cyPage)\n\t{\n\t\tATLASSERT((cxPage >= 0) && (cyPage >= 0));\n\t\tATLASSERT((m_sizeAll.cx != 0) && (m_sizeAll.cy != 0));\n\n\t\tm_sizePage.cx = T::CalcLineOrPage(cxPage, m_sizeAll.cx, 10);\n\t\tm_sizePage.cy = T::CalcLineOrPage(cyPage, m_sizeAll.cy, 10);\n\t}\n\n\tvoid SetScrollPage(SIZE sizePage)\n\t{\n\t\tSetScrollPage(sizePage.cx, sizePage.cy);\n\t}\n\n\tvoid GetScrollPage(SIZE& sizePage) const\n\t{\n\t\tsizePage = m_sizePage;\n\t}\n\n\t// commands\n\tvoid ScrollLineDown()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tpT->DoScroll(SB_VERT, SB_LINEDOWN, (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\n\t}\n\n\tvoid ScrollLineUp()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tpT->DoScroll(SB_VERT, SB_LINEUP, (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\n\t}\n\n\tvoid ScrollPageDown()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tpT->DoScroll(SB_VERT, SB_PAGEDOWN, (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\n\t}\n\n\tvoid ScrollPageUp()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tpT->DoScroll(SB_VERT, SB_PAGEUP, (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\n\t}\n\n\tvoid ScrollTop()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tpT->DoScroll(SB_VERT, SB_TOP, (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\n\t}\n\n\tvoid ScrollBottom()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tpT->DoScroll(SB_VERT, SB_BOTTOM, (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\n\t}\n\n\tvoid ScrollLineRight()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tpT->DoScroll(SB_HORZ, SB_LINEDOWN, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\n\t}\n\n\tvoid ScrollLineLeft()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tpT->DoScroll(SB_HORZ, SB_LINEUP, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\n\t}\n\n\tvoid ScrollPageRight()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tpT->DoScroll(SB_HORZ, SB_PAGEDOWN, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\n\t}\n\n\tvoid ScrollPageLeft()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tpT->DoScroll(SB_HORZ, SB_PAGEUP, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\n\t}\n\n\tvoid ScrollAllLeft()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tpT->DoScroll(SB_HORZ, SB_TOP, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\n\t}\n\n\tvoid ScrollAllRight()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tpT->DoScroll(SB_HORZ, SB_BOTTOM, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\n\t}\n\n\t// scroll to make point/view/window visible\n\tvoid ScrollToView(POINT pt)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tRECT rect = { pt.x, pt.y, pt.x, pt.y };\n\t\tpT->ScrollToView(rect);\n\t}\n\n\tvoid ScrollToView(RECT& rect)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\n\t\tRECT rcClient = {};\n\t\tpT->GetClientRect(&rcClient);\n\n\t\tint x = m_ptOffset.x;\n\t\tif(rect.left < m_ptOffset.x)\n\t\t\tx = rect.left;\n\t\telse if(rect.right > (m_ptOffset.x + rcClient.right))\n\t\t\tx = rect.right - rcClient.right;\n\n\t\tint y = m_ptOffset.y;\n\t\tif(rect.top < m_ptOffset.y)\n\t\t\ty = rect.top;\n\t\telse if(rect.bottom > (m_ptOffset.y + rcClient.bottom))\n\t\t\ty = rect.bottom - rcClient.bottom;\n\n\t\tSetScrollOffset(x, y);\n\t}\n\n\tvoid ScrollToView(HWND hWnd)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\n\t\tRECT rect = {};\n\t\t::GetWindowRect(hWnd, &rect);\n\t\t::OffsetRect(&rect, m_ptOffset.x, m_ptOffset.y);\n\t\t::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rect, 2);\n\t\tScrollToView(rect);\n\t}\n\n\tBEGIN_MSG_MAP(CScrollImpl)\n\t\tMESSAGE_HANDLER(WM_CREATE, OnCreate)\n\t\tMESSAGE_HANDLER(WM_VSCROLL, OnVScroll)\n\t\tMESSAGE_HANDLER(WM_HSCROLL, OnHScroll)\n\t\tMESSAGE_HANDLER(WM_MOUSEWHEEL, OnMouseWheel)\n\t\tMESSAGE_HANDLER(WM_MOUSEHWHEEL, OnMouseHWheel)\n\t\tMESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\t\tMESSAGE_HANDLER(WM_PAINT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\n\t// standard scroll commands\n\tALT_MSG_MAP(1)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_UP, OnScrollUp)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_DOWN, OnScrollDown)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_UP, OnScrollPageUp)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_DOWN, OnScrollPageDown)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_TOP, OnScrollTop)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_BOTTOM, OnScrollBottom)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_LEFT, OnScrollLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_RIGHT, OnScrollRight)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_LEFT, OnScrollPageLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_RIGHT, OnScrollPageRight)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_ALL_LEFT, OnScrollAllLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_ALL_RIGHT, OnScrollAllRight)\n\tEND_MSG_MAP()\n\n\tLRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->GetSystemSettings();\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnVScroll(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tpT->DoScroll(SB_VERT, (int)(short)LOWORD(wParam), (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\n\t\treturn 0;\n\t}\n\n\tLRESULT OnHScroll(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tpT->DoScroll(SB_HORZ, (int)(short)LOWORD(wParam), (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\n\t\treturn 0;\n\t}\n\n\tLRESULT OnMouseWheel(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\n\t\tint zDelta = (int)GET_WHEEL_DELTA_WPARAM(wParam);\n\t\tint nScrollCode = (m_nWheelLines == WHEEL_PAGESCROLL) ? ((zDelta > 0) ? SB_PAGEUP : SB_PAGEDOWN) : ((zDelta > 0) ? SB_LINEUP : SB_LINEDOWN);\n\t\tm_zDelta += zDelta;   // cumulative\n\t\tint zTotal = (m_nWheelLines == WHEEL_PAGESCROLL) ? abs(m_zDelta) : abs(m_zDelta) * m_nWheelLines;\n\t\tif(m_sizeAll.cy > m_sizeClient.cy)\n\t\t{\n\t\t\tfor(int i = 0; i < zTotal; i += WHEEL_DELTA)\n\t\t\t{\n\t\t\t\tpT->DoScroll(SB_VERT, nScrollCode, (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\n\t\t\t\tpT->UpdateWindow();\n\t\t\t}\n\t\t}\n\t\telse if(m_sizeAll.cx > m_sizeClient.cx)   // can't scroll vertically, scroll horizontally\n\t\t{\n\t\t\tfor(int i = 0; i < zTotal; i += WHEEL_DELTA)\n\t\t\t{\n\t\t\t\tpT->DoScroll(SB_HORZ, nScrollCode, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\n\t\t\t\tpT->UpdateWindow();\n\t\t\t}\n\t\t}\n\t\tm_zDelta %= WHEEL_DELTA;\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnMouseHWheel(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\n\t\tint zDelta = (int)GET_WHEEL_DELTA_WPARAM(wParam);\n\t\tint nScrollCode = (m_nHWheelChars == WHEEL_PAGESCROLL) ? ((zDelta > 0) ? SB_PAGERIGHT : SB_PAGELEFT) : ((zDelta > 0) ? SB_LINERIGHT : SB_LINELEFT);\n\t\tm_zHDelta += zDelta;   // cumulative\n\t\tint zTotal = (m_nHWheelChars == WHEEL_PAGESCROLL) ? abs(m_zHDelta) : abs(m_zHDelta) * m_nHWheelChars;\n\t\tif(m_sizeAll.cx > m_sizeClient.cx)\n\t\t{\n\t\t\tfor(int i = 0; i < zTotal; i += WHEEL_DELTA)\n\t\t\t{\n\t\t\t\tpT->DoScroll(SB_HORZ, nScrollCode, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\n\t\t\t\tpT->UpdateWindow();\n\t\t\t}\n\t\t}\n\t\tm_zHDelta %= WHEEL_DELTA;\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSettingChange(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tGetSystemSettings();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\n\t\tpT->DoSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tif(wParam != NULL)\n\t\t{\n\t\t\tCDCHandle dc = (HDC)wParam;\n\t\t\tPOINT ptViewportOrg = { 0, 0 };\n\t\t\tdc.SetViewportOrg(-m_ptOffset.x, -m_ptOffset.y, &ptViewportOrg);\n\t\t\tpT->DoPaint(dc);\n\t\t\tdc.SetViewportOrg(ptViewportOrg);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCPaintDC dc(pT->m_hWnd);\n\t\t\tdc.SetViewportOrg(-m_ptOffset.x, -m_ptOffset.y);\n\t\t\tpT->DoPaint(dc.m_hDC);\n\t\t}\n\t\treturn 0;\n\t}\n\n\t// scrolling handlers\n\tLRESULT OnScrollUp(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tScrollLineUp();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnScrollDown(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tScrollLineDown();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnScrollPageUp(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tScrollPageUp();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnScrollPageDown(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tScrollPageDown();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnScrollTop(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tScrollTop();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnScrollBottom(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tScrollBottom();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnScrollLeft(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tScrollLineLeft();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnScrollRight(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tScrollLineRight();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnScrollPageLeft(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tScrollPageLeft();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnScrollPageRight(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tScrollPageRight();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnScrollAllLeft(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tScrollAllLeft();\n\t\treturn 0;\n\t}\n\n\tLRESULT OnScrollAllRight(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\n\t{\n\t\tScrollAllRight();\n\t\treturn 0;\n\t}\n\n// Overrideables\n\tvoid DoPaint(CDCHandle /*dc*/)\n\t{\n\t\t// must be implemented in a derived class\n\t\tATLASSERT(FALSE);\n\t}\n\n// Implementation\n\tvoid DoSize(int cx, int cy)\n\t{\n\t\tm_sizeClient.cx = cx;\n\t\tm_sizeClient.cy = cy;\n\n\t\tT* pT = static_cast<T*>(this);\n\n\t\t// block: set horizontal scroll bar\n\t\t{\n\t\t\tSCROLLINFO si = { sizeof(SCROLLINFO) };\n\t\t\tsi.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;\n\t\t\tsi.nMin = 0;\n\t\t\tsi.nMax = m_sizeAll.cx - 1;\n\t\t\tif((m_dwExtendedStyle & SCRL_DISABLENOSCROLLH) != 0)\n\t\t\t\tsi.fMask |= SIF_DISABLENOSCROLL;\n\t\t\tsi.nPage = m_sizeClient.cx;\n\t\t\tsi.nPos = m_ptOffset.x;\n\t\t\tpT->SetScrollInfo(SB_HORZ, &si, TRUE);\n\t\t}\n\n\t\t// block: set vertical scroll bar\n\t\t{\n\t\t\tSCROLLINFO si = { sizeof(SCROLLINFO) };\n\t\t\tsi.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;\n\t\t\tsi.nMin = 0;\n\t\t\tsi.nMax = m_sizeAll.cy - 1;\n\t\t\tif((m_dwExtendedStyle & SCRL_DISABLENOSCROLLV) != 0)\n\t\t\t\tsi.fMask |= SIF_DISABLENOSCROLL;\n\t\t\tsi.nPage = m_sizeClient.cy;\n\t\t\tsi.nPos = m_ptOffset.y;\n\t\t\tpT->SetScrollInfo(SB_VERT, &si, TRUE);\n\t\t}\n\n\t\tint x = m_ptOffset.x;\n\t\tint y = m_ptOffset.y;\n\t\tif(pT->AdjustScrollOffset(x, y))\n\t\t{\n\t\t\t// Children will be moved in SetScrollOffset, if needed\n\t\t\tpT->ScrollWindowEx(m_ptOffset.x - x, m_ptOffset.y - y, (m_uScrollFlags & ~SCRL_SCROLLCHILDREN));\n\t\t\tSetScrollOffset(x, y, FALSE);\n\t\t}\n\t}\n\n\tvoid DoScroll(int nType, int nScrollCode, int& cxyOffset, int cxySizeAll, int cxySizePage, int cxySizeLine)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tRECT rect = {};\n\t\tpT->GetClientRect(&rect);\n\t\tint cxyClient = (nType == SB_VERT) ? rect.bottom : rect.right;\n\t\tint cxyMax = cxySizeAll - cxyClient;\n\n\t\tif(cxyMax < 0)   // can't scroll, client area is bigger\n\t\t\treturn;\n\n\t\tbool bUpdate = true;\n\t\tint cxyScroll = 0;\n\n\t\tswitch(nScrollCode)\n\t\t{\n\t\tcase SB_TOP:\t\t// top or all left\n\t\t\tcxyScroll = cxyOffset;\n\t\t\tcxyOffset = 0;\n\t\t\tbreak;\n\t\tcase SB_BOTTOM:\t\t// bottom or all right\n\t\t\tcxyScroll = cxyOffset - cxyMax;\n\t\t\tcxyOffset = cxyMax;\n\t\t\tbreak;\n\t\tcase SB_LINEUP:\t\t// line up or line left\n\t\t\tif(cxyOffset >= cxySizeLine)\n\t\t\t{\n\t\t\t\tcxyScroll = cxySizeLine;\n\t\t\t\tcxyOffset -= cxySizeLine;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcxyScroll = cxyOffset;\n\t\t\t\tcxyOffset = 0;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase SB_LINEDOWN:\t// line down or line right\n\t\t\tif(cxyOffset < cxyMax - cxySizeLine)\n\t\t\t{\n\t\t\t\tcxyScroll = -cxySizeLine;\n\t\t\t\tcxyOffset += cxySizeLine;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcxyScroll = cxyOffset - cxyMax;\n\t\t\t\tcxyOffset = cxyMax;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase SB_PAGEUP:\t\t// page up or page left\n\t\t\tif(cxyOffset >= cxySizePage)\n\t\t\t{\n\t\t\t\tcxyScroll = cxySizePage;\n\t\t\t\tcxyOffset -= cxySizePage;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcxyScroll = cxyOffset;\n\t\t\t\tcxyOffset = 0;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase SB_PAGEDOWN:\t// page down or page right\n\t\t\tif(cxyOffset < cxyMax - cxySizePage)\n\t\t\t{\n\t\t\t\tcxyScroll = -cxySizePage;\n\t\t\t\tcxyOffset += cxySizePage;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcxyScroll = cxyOffset - cxyMax;\n\t\t\t\tcxyOffset = cxyMax;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase SB_THUMBTRACK:\n\t\t\tif(IsNoThumbTracking())\n\t\t\t\tbreak;\n\t\t\t// else fall through\n\t\tcase SB_THUMBPOSITION:\n\t\t\t{\n\t\t\t\tSCROLLINFO si = { sizeof(SCROLLINFO), SIF_TRACKPOS };\n\t\t\t\tif(pT->GetScrollInfo(nType, &si))\n\t\t\t\t{\n\t\t\t\t\tcxyScroll = cxyOffset - si.nTrackPos;\n\t\t\t\t\tcxyOffset = si.nTrackPos;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase SB_ENDSCROLL:\n\t\tdefault:\n\t\t\tbUpdate = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tif(bUpdate && (cxyScroll != 0))\n\t\t{\n\t\t\tpT->SetScrollPos(nType, cxyOffset, TRUE);\n\t\t\tif(nType == SB_VERT)\n\t\t\t\tpT->ScrollWindowEx(0, cxyScroll, m_uScrollFlags);\n\t\t\telse\n\t\t\t\tpT->ScrollWindowEx(cxyScroll, 0, m_uScrollFlags);\n\t\t}\n\t}\n\n\tstatic int CalcLineOrPage(int nVal, int nMax, int nDiv)\n\t{\n\t\tif(nVal == 0)\n\t\t{\n\t\t\tnVal = nMax / nDiv;\n\t\t\tif(nVal < 1)\n\t\t\t\tnVal = 1;\n\t\t}\n\t\telse if(nVal > nMax)\n\t\t{\n\t\t\tnVal = nMax;\n\t\t}\n\n\t\treturn nVal;\n\t}\n\n\tbool AdjustScrollOffset(int& x, int& y)\n\t{\n\t\tint xOld = x;\n\t\tint yOld = y;\n\n\t\tint cxMax = m_sizeAll.cx - m_sizeClient.cx;\n\t\tif(x > cxMax)\n\t\t\tx = (cxMax >= 0) ? cxMax : 0;\n\t\telse if(x < 0)\n\t\t\tx = 0;\n\n\t\tint cyMax = m_sizeAll.cy - m_sizeClient.cy;\n\t\tif(y > cyMax)\n\t\t\ty = (cyMax >= 0) ? cyMax : 0;\n\t\telse if(y < 0)\n\t\t\ty = 0;\n\n\t\treturn ((x != xOld) || (y != yOld));\n\t}\n\n\tvoid GetSystemSettings()\n\t{\n\t\t::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &m_nWheelLines, 0);\n\n#ifndef SPI_GETWHEELSCROLLCHARS\n\t\tconst UINT SPI_GETWHEELSCROLLCHARS = 0x006C;\n#endif\n\t\t::SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &m_nHWheelChars, 0);\n\t}\n\n\tbool IsScrollingChildren() const\n\t{\n\t\treturn (m_dwExtendedStyle & SCRL_SCROLLCHILDREN) != 0;\n\t}\n\n\tbool IsErasingBackground() const\n\t{\n\t\treturn (m_dwExtendedStyle & SCRL_ERASEBACKGROUND) != 0;\n\t}\n\n\tbool IsNoThumbTracking() const\n\t{\n\t\treturn (m_dwExtendedStyle & SCRL_NOTHUMBTRACKING) != 0;\n\t}\n\n\tbool IsSmoothScroll() const\n\t{\n\t\treturn (m_dwExtendedStyle & SCRL_SMOOTHSCROLL) != 0;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CScrollWindowImpl - Implements a scrollable window\n\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CScrollWindowImpl : public ATL::CWindowImpl<T, TBase, TWinTraits>, public CScrollImpl< T >\n{\npublic:\n\tBOOL SubclassWindow(HWND hWnd)\n\t{\n\t\tBOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits >::SubclassWindow(hWnd);\n\t\tif(bRet != FALSE)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->GetSystemSettings();\n\n\t\t\tRECT rect = {};\n\t\t\tthis->GetClientRect(&rect);\n\t\t\tpT->DoSize(rect.right, rect.bottom);\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\tBEGIN_MSG_MAP(CScrollWindowImpl)\n\t\tMESSAGE_HANDLER(WM_VSCROLL, CScrollImpl< T >::OnVScroll)\n\t\tMESSAGE_HANDLER(WM_HSCROLL, CScrollImpl< T >::OnHScroll)\n\t\tMESSAGE_HANDLER(WM_MOUSEWHEEL, CScrollImpl< T >::OnMouseWheel)\n\t\tMESSAGE_HANDLER(WM_MOUSEHWHEEL, CScrollImpl< T >::OnMouseHWheel)\n\t\tMESSAGE_HANDLER(WM_SETTINGCHANGE, CScrollImpl< T >::OnSettingChange)\n\t\tMESSAGE_HANDLER(WM_SIZE, CScrollImpl< T >::OnSize)\n\t\tMESSAGE_HANDLER(WM_PAINT, CScrollImpl< T >::OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, CScrollImpl< T >::OnPaint)\n\tALT_MSG_MAP(1)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_UP, CScrollImpl< T >::OnScrollUp)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_DOWN, CScrollImpl< T >::OnScrollDown)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_UP, CScrollImpl< T >::OnScrollPageUp)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_DOWN, CScrollImpl< T >::OnScrollPageDown)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_TOP, CScrollImpl< T >::OnScrollTop)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_BOTTOM, CScrollImpl< T >::OnScrollBottom)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_LEFT, CScrollImpl< T >::OnScrollLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_RIGHT, CScrollImpl< T >::OnScrollRight)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_LEFT, CScrollImpl< T >::OnScrollPageLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_RIGHT, CScrollImpl< T >::OnScrollPageRight)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_ALL_LEFT, CScrollImpl< T >::OnScrollAllLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_ALL_RIGHT, CScrollImpl< T >::OnScrollAllRight)\n\tEND_MSG_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CMapScrollImpl - Provides mapping and scrolling support to any window\n\ntemplate <class T>\nclass CMapScrollImpl : public CScrollImpl< T >\n{\npublic:\n\tint m_nMapMode;\n\tRECT m_rectLogAll;\n\tSIZE m_sizeLogLine;\n\tSIZE m_sizeLogPage;\n\n// Constructor\n\tCMapScrollImpl() : m_nMapMode(MM_TEXT)\n\t{\n\t\t::SetRectEmpty(&m_rectLogAll);\n\t\tm_sizeLogPage.cx = 0;\n\t\tm_sizeLogPage.cy = 0;\n\t\tm_sizeLogLine.cx = 0;\n\t\tm_sizeLogLine.cy = 0;\n\t}\n\n// Attributes & Operations\n\t// mapping mode operations\n\tvoid SetScrollMapMode(int nMapMode)\n\t{\n\t\tATLASSERT((nMapMode >= MM_MIN) && (nMapMode <= MM_MAX_FIXEDSCALE));\n\t\tm_nMapMode = nMapMode;\n\t}\n\n\tint GetScrollMapMode() const\n\t{\n\t\tATLASSERT((m_nMapMode >= MM_MIN) && (m_nMapMode <= MM_MAX_FIXEDSCALE));\n\t\treturn m_nMapMode;\n\t}\n\n\t// offset operations\n\tvoid SetScrollOffset(int x, int y, BOOL bRedraw = TRUE)\n\t{\n\t\tATLASSERT((m_nMapMode >= MM_MIN) && (m_nMapMode <= MM_MAX_FIXEDSCALE));\n\t\tPOINT ptOff = { x, y };\n\t\t// block: convert logical to device units\n\t\t{\n\t\t\tCWindowDC dc(NULL);\n\t\t\tdc.SetMapMode(m_nMapMode);\n\t\t\tdc.LPtoDP(&ptOff);\n\t\t}\n\t\tCScrollImpl< T >::SetScrollOffset(ptOff, bRedraw);\n\t}\n\n\tvoid SetScrollOffset(POINT ptOffset, BOOL bRedraw = TRUE)\n\t{\n\t\tSetScrollOffset(ptOffset.x, ptOffset.y, bRedraw);\n\t}\n\n\tvoid GetScrollOffset(POINT& ptOffset) const\n\t{\n\t\tATLASSERT((m_nMapMode >= MM_MIN) && (m_nMapMode <= MM_MAX_FIXEDSCALE));\n\t\tptOffset = this->m_ptOffset;\n\t\t// block: convert device to logical units\n\t\t{\n\t\t\tCWindowDC dc(NULL);\n\t\t\tdc.SetMapMode(m_nMapMode);\n\t\t\tdc.DPtoLP(&ptOffset);\n\t\t}\n\t}\n\n\t// size operations\n\tvoid SetScrollSize(int xMin, int yMin, int xMax, int yMax, BOOL bRedraw = TRUE, bool bResetOffset = true)\n\t{\n\t\tATLASSERT((xMax > xMin) && (yMax > yMin));\n\t\tATLASSERT((m_nMapMode >= MM_MIN) && (m_nMapMode <= MM_MAX_FIXEDSCALE));\n\n\t\t::SetRect(&m_rectLogAll, xMin, yMin, xMax, yMax);\n\n\t\tSIZE sizeAll = {};\n\t\tsizeAll.cx = xMax - xMin + 1;\n\t\tsizeAll.cy = yMax - yMin + 1;\n\t\t// block: convert logical to device units\n\t\t{\n\t\t\tCWindowDC dc(NULL);\n\t\t\tdc.SetMapMode(m_nMapMode);\n\t\t\tdc.LPtoDP(&sizeAll);\n\t\t}\n\t\tCScrollImpl< T >::SetScrollSize(sizeAll, bRedraw, bResetOffset);\n\t\tSetScrollLine(0, 0);\n\t\tSetScrollPage(0, 0);\n\t}\n\n\tvoid SetScrollSize(RECT& rcScroll, BOOL bRedraw = TRUE, bool bResetOffset = true)\n\t{\n\t\tSetScrollSize(rcScroll.left, rcScroll.top, rcScroll.right, rcScroll.bottom, bRedraw, bResetOffset);\n\t}\n\n\tvoid SetScrollSize(int cx, int cy, BOOL bRedraw = TRUE, bool bResetOffset = true)\n\t{\n\t\tSetScrollSize(0, 0, cx, cy, bRedraw, bResetOffset);\n\t}\n\n\tvoid SetScrollSize(SIZE size, BOOL bRedraw = TRUE, bool bResetOffset = true)\n\t{\n\t\tSetScrollSize(0, 0, size.cx, size.cy, bRedraw, bResetOffset);\n\t}\n\n\tvoid GetScrollSize(RECT& rcScroll) const\n\t{\n\t\tATLASSERT((m_nMapMode >= MM_MIN) && (m_nMapMode <= MM_MAX_FIXEDSCALE));\n\t\trcScroll = m_rectLogAll;\n\t}\n\n\t// line operations\n\tvoid SetScrollLine(int cxLine, int cyLine)\n\t{\n\t\tATLASSERT((cxLine >= 0) && (cyLine >= 0));\n\t\tATLASSERT((m_nMapMode >= MM_MIN) && (m_nMapMode <= MM_MAX_FIXEDSCALE));\n\n\t\tm_sizeLogLine.cx = cxLine;\n\t\tm_sizeLogLine.cy = cyLine;\n\t\tSIZE sizeLine = m_sizeLogLine;\n\t\t// block: convert logical to device units\n\t\t{\n\t\t\tCWindowDC dc(NULL);\n\t\t\tdc.SetMapMode(m_nMapMode);\n\t\t\tdc.LPtoDP(&sizeLine);\n\t\t}\n\t\tCScrollImpl< T >::SetScrollLine(sizeLine);\n\t}\n\n\tvoid SetScrollLine(SIZE sizeLine)\n\t{\n\t\tSetScrollLine(sizeLine.cx, sizeLine.cy);\n\t}\n\n\tvoid GetScrollLine(SIZE& sizeLine) const\n\t{\n\t\tATLASSERT((m_nMapMode >= MM_MIN) && (m_nMapMode <= MM_MAX_FIXEDSCALE));\n\t\tsizeLine = m_sizeLogLine;\n\t}\n\n\t// page operations\n\tvoid SetScrollPage(int cxPage, int cyPage)\n\t{\n\t\tATLASSERT((cxPage >= 0) && (cyPage >= 0));\n\t\tATLASSERT((m_nMapMode >= MM_MIN) && (m_nMapMode <= MM_MAX_FIXEDSCALE));\n\n\t\tm_sizeLogPage.cx = cxPage;\n\t\tm_sizeLogPage.cy = cyPage;\n\t\tSIZE sizePage = m_sizeLogPage;\n\t\t// block: convert logical to device units\n\t\t{\n\t\t\tCWindowDC dc(NULL);\n\t\t\tdc.SetMapMode(m_nMapMode);\n\t\t\tdc.LPtoDP(&sizePage);\n\t\t}\n\t\tCScrollImpl< T >::SetScrollPage(sizePage);\n\t}\n\n\tvoid SetScrollPage(SIZE sizePage)\n\t{\n\t\tSetScrollPage(sizePage.cx, sizePage.cy);\n\t}\n\n\tvoid GetScrollPage(SIZE& sizePage) const\n\t{\n\t\tATLASSERT((m_nMapMode >= MM_MIN) && (m_nMapMode <= MM_MAX_FIXEDSCALE));\n\t\tsizePage = m_sizeLogPage;\n\t}\n\n\tBEGIN_MSG_MAP(CMapScrollImpl)\n\t\tMESSAGE_HANDLER(WM_VSCROLL, CScrollImpl< T >::OnVScroll)\n\t\tMESSAGE_HANDLER(WM_HSCROLL, CScrollImpl< T >::OnHScroll)\n\t\tMESSAGE_HANDLER(WM_MOUSEWHEEL, CScrollImpl< T >::OnMouseWheel)\n\t\tMESSAGE_HANDLER(WM_MOUSEHWHEEL, CScrollImpl< T >::OnMouseHWheel)\n\t\tMESSAGE_HANDLER(WM_SETTINGCHANGE, CScrollImpl< T >::OnSettingChange)\n\t\tMESSAGE_HANDLER(WM_SIZE, CScrollImpl< T >::OnSize)\n\t\tMESSAGE_HANDLER(WM_PAINT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\n\tALT_MSG_MAP(1)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_UP, CScrollImpl< T >::OnScrollUp)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_DOWN, CScrollImpl< T >::OnScrollDown)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_UP, CScrollImpl< T >::OnScrollPageUp)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_DOWN, CScrollImpl< T >::OnScrollPageDown)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_TOP, CScrollImpl< T >::OnScrollTop)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_BOTTOM, CScrollImpl< T >::OnScrollBottom)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_LEFT, CScrollImpl< T >::OnScrollLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_RIGHT, CScrollImpl< T >::OnScrollRight)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_LEFT, CScrollImpl< T >::OnScrollPageLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_RIGHT, CScrollImpl< T >::OnScrollPageRight)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_ALL_LEFT, CScrollImpl< T >::OnScrollAllLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_ALL_RIGHT, CScrollImpl< T >::OnScrollAllRight)\n\tEND_MSG_MAP()\n\n\tLRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tif(wParam != NULL)\n\t\t{\n\t\t\tCDCHandle dc = (HDC)wParam;\n\t\t\tint nMapModeSav = dc.GetMapMode();\n\t\t\tdc.SetMapMode(m_nMapMode);\n\t\t\tPOINT ptViewportOrg = { 0, 0 };\n\t\t\tif(m_nMapMode == MM_TEXT)\n\t\t\t\tdc.SetViewportOrg(-this->m_ptOffset.x, -this->m_ptOffset.y, &ptViewportOrg);\n\t\t\telse\n\t\t\t\tdc.SetViewportOrg(-this->m_ptOffset.x, -this->m_ptOffset.y + this->m_sizeAll.cy, &ptViewportOrg);\n\t\t\tPOINT ptWindowOrg = { 0, 0 };\n\t\t\tdc.SetWindowOrg(m_rectLogAll.left, m_rectLogAll.top, &ptWindowOrg);\n\n\t\t\tpT->DoPaint(dc);\n\n\t\t\tdc.SetMapMode(nMapModeSav);\n\t\t\tdc.SetViewportOrg(ptViewportOrg);\n\t\t\tdc.SetWindowOrg(ptWindowOrg);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCPaintDC dc(pT->m_hWnd);\n\t\t\tdc.SetMapMode(m_nMapMode);\n\t\t\tif(m_nMapMode == MM_TEXT)\n\t\t\t\tdc.SetViewportOrg(-this->m_ptOffset.x, -this->m_ptOffset.y);\n\t\t\telse\n\t\t\t\tdc.SetViewportOrg(-this->m_ptOffset.x, -this->m_ptOffset.y + this->m_sizeAll.cy);\n\t\t\tdc.SetWindowOrg(m_rectLogAll.left, m_rectLogAll.top);\n\t\t\tpT->DoPaint(dc.m_hDC);\n\t\t}\n\t\treturn 0;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CMapScrollWindowImpl - Implements scrolling window with mapping\n\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CMapScrollWindowImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >, public CMapScrollImpl< T >\n{\npublic:\n\tBOOL SubclassWindow(HWND hWnd)\n\t{\n\t\tBOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits >::SubclassWindow(hWnd);\n\t\tif(bRet != FALSE)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->GetSystemSettings();\n\n\t\t\tRECT rect = {};\n\t\t\tthis->GetClientRect(&rect);\n\t\t\tpT->DoSize(rect.right, rect.bottom);\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\tBEGIN_MSG_MAP(CMapScrollWindowImpl)\n\t\tMESSAGE_HANDLER(WM_VSCROLL, CScrollImpl< T >::OnVScroll)\n\t\tMESSAGE_HANDLER(WM_HSCROLL, CScrollImpl< T >::OnHScroll)\n\t\tMESSAGE_HANDLER(WM_MOUSEWHEEL, CScrollImpl< T >::OnMouseWheel)\n\t\tMESSAGE_HANDLER(WM_MOUSEHWHEEL, CScrollImpl< T >::OnMouseHWheel)\n\t\tMESSAGE_HANDLER(WM_SETTINGCHANGE, CScrollImpl< T >::OnSettingChange)\n\t\tMESSAGE_HANDLER(WM_SIZE, CScrollImpl< T >::OnSize)\n\t\tMESSAGE_HANDLER(WM_PAINT, CMapScrollImpl< T >::OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, CMapScrollImpl< T >::OnPaint)\n\tALT_MSG_MAP(1)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_UP, CScrollImpl< T >::OnScrollUp)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_DOWN, CScrollImpl< T >::OnScrollDown)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_UP, CScrollImpl< T >::OnScrollPageUp)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_DOWN, CScrollImpl< T >::OnScrollPageDown)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_TOP, CScrollImpl< T >::OnScrollTop)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_BOTTOM, CScrollImpl< T >::OnScrollBottom)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_LEFT, CScrollImpl< T >::OnScrollLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_RIGHT, CScrollImpl< T >::OnScrollRight)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_LEFT, CScrollImpl< T >::OnScrollPageLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_RIGHT, CScrollImpl< T >::OnScrollPageRight)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_ALL_LEFT, CScrollImpl< T >::OnScrollAllLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_ALL_RIGHT, CScrollImpl< T >::OnScrollAllRight)\n\tEND_MSG_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CFSBWindow - Use as a base instead of CWindow to get flat scroll bar support\n\n#ifdef __ATLCTRLS_H__\n\ntemplate <class TBase = ATL::CWindow>\nclass CFSBWindowT : public TBase, public CFlatScrollBarImpl<CFSBWindowT< TBase > >\n{\npublic:\n// Constructors\n\tCFSBWindowT(HWND hWnd = NULL) : TBase(hWnd)\n\t{ }\n\n\tCFSBWindowT< TBase >& operator =(HWND hWnd)\n\t{\n\t\tthis->m_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n// CWindow overrides that use flat scroll bar API\n// (only those methods that are used by scroll window classes)\n\tint SetScrollPos(int nBar, int nPos, BOOL bRedraw = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn this->FlatSB_SetScrollPos(nBar, nPos, bRedraw);\n\t}\n\n\tBOOL GetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn this->FlatSB_GetScrollInfo(nBar, lpScrollInfo);\n\t}\n\n\tBOOL SetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw = TRUE)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\t\treturn this->FlatSB_SetScrollInfo(nBar, lpScrollInfo, bRedraw);\n\t}\n};\n\ntypedef CFSBWindowT<ATL::CWindow>   CFSBWindow;\n\n#endif // __ATLCTRLS_H__\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CZoomScrollImpl - Provides zooming and scrolling support to any window\n\n// The zoom modes that can be set with the SetZoomMode method\nenum\n{\n\tZOOMMODE_OFF, \n\tZOOMMODE_IN,   // If left mouse button is clicked or dragged, zoom in on point clicked or rectangle dragged.\n\tZOOMMODE_OUT   // If left mouse button clicked, zoom out on point clicked.\n};\n\n// Notification to parent that zoom scale changed as a result of user mouse action.\n#define ZSN_ZOOMCHANGED\t(NM_FIRST - 50) \n\ntemplate <class T>\nclass CZoomScrollImpl : public CScrollImpl< T >\n{\npublic:\n\tenum { m_cxyMinZoomRect = 12 };   // min rect size to zoom in on rect.\n\n\tstruct _ChildPlacement\n\t{\n\t\tHWND hWnd;\n\t\tint x;\n\t\tint y;\n\t\tint cx;\n\t\tint cy;\n\n\t\tbool operator ==(const _ChildPlacement& cp) const { return (memcmp(this, &cp, sizeof(_ChildPlacement)) == 0); }\n\t};\n\n// Data members\n\tSIZE m_sizeLogAll;\t\t\n\tSIZE m_sizeLogLine;\t\n\tSIZE m_sizeLogPage;\n\tfloat m_fZoomScale;\n\tfloat m_fZoomScaleMin;\n\tfloat m_fZoomScaleMax;\n\tfloat m_fZoomDelta;   // Used in ZOOMMODE_IN and ZOOMMODE_OUT on left-button click.\n\tint m_nZoomMode;\t\t\n\tRECT m_rcTrack;\n\tbool m_bTracking;\n\n\tbool m_bZoomChildren;\n\tATL::CSimpleArray<_ChildPlacement> m_arrChildren;\n\n// Constructor\n\tCZoomScrollImpl(): m_fZoomScale(1.0f), m_fZoomScaleMin(0.1f), m_fZoomScaleMax(100.0f), m_fZoomDelta(0.5f), \n\t                   m_nZoomMode(ZOOMMODE_OFF), m_bTracking(false), m_bZoomChildren(false)\n\t{\n\t\tm_sizeLogAll.cx = 0;\n\t\tm_sizeLogAll.cy = 0;\n\t\tm_sizeLogPage.cx = 0;\n\t\tm_sizeLogPage.cy = 0;\n\t\tm_sizeLogLine.cx = 0;\n\t\tm_sizeLogLine.cy = 0;\n\t\t::SetRectEmpty(&m_rcTrack);\n\t}\n\n// Attributes & Operations\n\t// size operations\n\tvoid SetScrollSize(int cxLog, int cyLog, BOOL bRedraw = TRUE, bool bResetOffset = true)\n\t{\n\t\tATLASSERT((cxLog >= 0) && (cyLog >= 0));\n\n\t\t// Set up the defaults\n\t\tif((cxLog == 0) && (cyLog == 0))\n\t\t{\n\t\t\tcxLog = 1;\n\t\t\tcyLog = 1;\n\t\t}\n\n\t\tm_sizeLogAll.cx = cxLog;\n\t\tm_sizeLogAll.cy = cyLog;\n\t\tSIZE sizeAll = {};\n\t\tsizeAll.cx = (int)((float)m_sizeLogAll.cx * m_fZoomScale);\n\t\tsizeAll.cy = (int)((float)m_sizeLogAll.cy * m_fZoomScale);\n\n\t\tCScrollImpl< T >::SetScrollSize(sizeAll, bRedraw, bResetOffset);\n\t}\n\n\tvoid SetScrollSize(SIZE sizeLog, BOOL bRedraw = TRUE, bool bResetOffset = true)\n\t{\n\t\tSetScrollSize(sizeLog.cx, sizeLog.cy, bRedraw, bResetOffset);\n\t}\n\n\tvoid GetScrollSize(SIZE& sizeLog) const\n\t{\n\t\tsizeLog = m_sizeLogAll;\n\t}\n\n\t// line operations\n\tvoid SetScrollLine(int cxLogLine, int cyLogLine)\n\t{\n\t\tATLASSERT((cxLogLine >= 0) && (cyLogLine >= 0));\n\n\t\tm_sizeLogLine.cx = cxLogLine;\n\t\tm_sizeLogLine.cy = cyLogLine;\n\n\t\tSIZE sizeLine = {};\n\t\tsizeLine.cx = (int)((float)m_sizeLogLine.cx * m_fZoomScale);\n\t\tsizeLine.cy = (int)((float)m_sizeLogLine.cy * m_fZoomScale);\n\t\tCScrollImpl< T >::SetScrollLine(sizeLine);\n\t}\n\n\tvoid SetScrollLine(SIZE sizeLogLine)\n\t{\n\t\tSetScrollLine(sizeLogLine.cx, sizeLogLine.cy);\n\t}\n\n\tvoid GetScrollLine(SIZE& sizeLogLine) const\n\t{\n\t\tsizeLogLine = m_sizeLogLine;\n\t}\n\n\t// page operations\n\tvoid SetScrollPage(int cxLogPage, int cyLogPage)\n\t{\n\t\tATLASSERT((cxLogPage >= 0) && (cyLogPage >= 0));\n\n\t\tm_sizeLogPage.cx = cxLogPage;\n\t\tm_sizeLogPage.cy = cyLogPage;\n\n\t\tSIZE sizePage = {};\n\t\tsizePage.cx = (int)((float)m_sizeLogPage.cx * m_fZoomScale);\n\t\tsizePage.cy = (int)((float)m_sizeLogPage.cy * m_fZoomScale);\n\n\t\tCScrollImpl< T >::SetScrollPage(sizePage);\n\t}\n\n\tvoid SetScrollPage(SIZE sizeLogPage)\n\t{\n\t\tSetScrollPage(sizeLogPage.cx, sizeLogPage.cy);\n\t}\n\n\tvoid GetScrollPage(SIZE& sizeLogPage) const\n\t{\n\t\tsizeLogPage = m_sizeLogPage;\n\t}\n\n\tvoid SetZoomScale(float fZoomScale)\n\t{\n\t\tATLASSERT(fZoomScale > 0.0f);\n\t\tif(fZoomScale <= 0.0f)\n\t\t\treturn;\n\n\t\tm_fZoomScale = fZoomScale;\n\t\tif(m_fZoomScale < m_fZoomScaleMin)\n\t\t\tm_fZoomScale = m_fZoomScaleMin;\n\t\telse if(m_fZoomScale > m_fZoomScaleMax)\n\t\t\tm_fZoomScale = m_fZoomScaleMax;\n\t}\n\n\tfloat GetZoomScale() const\n\t{\n\t\treturn m_fZoomScale;\n\t}\n\n\tvoid SetZoomScaleMin(float fZoomScaleMin)\n\t{\n\t\tATLASSERT(fZoomScaleMin > 0.0f);\n\t\tATLASSERT(fZoomScaleMin <= m_fZoomScaleMax);\n\n\t\tm_fZoomScaleMin = fZoomScaleMin;\n\t}\n\n\tfloat GetZoomScaleMin() const\n\t{\n\t\treturn m_fZoomScaleMin;\n\t}\n\n\tvoid SetZoomScaleMax(float fZoomScaleMax)\n\t{\n\t\tATLASSERT(fZoomScaleMax > 0.0f);\n\t\tATLASSERT(m_fZoomScaleMin <= fZoomScaleMax);\n\n\t\tm_fZoomScaleMax = fZoomScaleMax;\n\t}\n\n\tfloat GetZoomScaleMax() const\n\t{\n\t\treturn m_fZoomScaleMax;\n\t}\n\n\tvoid SetZoomDelta(float fZoomDelta)\n\t{\n\t\tATLASSERT(fZoomDelta >= 0.0f);\n\n\t\tif(fZoomDelta >= 0.0f)\n\t\t\tm_fZoomDelta = fZoomDelta;\n\t}\n\n\tfloat GetZoomDelta() const\n\t{\n\t\treturn m_fZoomDelta;\n\t}\n\n\tvoid SetZoomMode(int nZoomMode)\n\t{\n\t\tm_nZoomMode = nZoomMode;\n\t}\n\n\tint GetZoomMode() const\n\t{\n\t\treturn m_nZoomMode;\n\t}\n\n\tvoid SetZoomChildren(bool bEnable = true)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\n\t\tm_bZoomChildren = bEnable;\n\n\t\tm_arrChildren.RemoveAll();\n\t\tif(m_bZoomChildren)\n\t\t{\n\t\t\tfor(HWND hWndChild = ::GetWindow(pT->m_hWnd, GW_CHILD); hWndChild != NULL; hWndChild = ::GetWindow(hWndChild, GW_HWNDNEXT))\n\t\t\t{\n\t\t\t\tRECT rect = {};\n\t\t\t\t::GetWindowRect(hWndChild, &rect);\n\t\t\t\t::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rect, 2);\n\n\t\t\t\t_ChildPlacement cp = {};\n\t\t\t\tcp.hWnd = hWndChild;\n\t\t\t\tcp.x = rect.left;\n\t\t\t\tcp.y = rect.top;\n\t\t\t\tcp.cx = rect.right - rect.left;\n\t\t\t\tcp.cy = rect.bottom - rect.top;\n\t\t\t\tm_arrChildren.Add(cp);\n\t\t\t}\n\t\t}\n\t}\n\n\tbool GetZoomChildren() const\n\t{\n\t\treturn m_bZoomChildren;\n\t}\n\n\tvoid Zoom(int x, int y, float fZoomScale)\n\t{\n\t\tif(fZoomScale <= 0.0f)\n\t\t\treturn;\n\n\t\tif(fZoomScale < m_fZoomScaleMin)\n\t\t\tfZoomScale = m_fZoomScaleMin;\n\t\telse if(fZoomScale > m_fZoomScaleMax)\n\t\t\tfZoomScale = m_fZoomScaleMax;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tPOINT pt = { x, y };\n\t\tif(!pT->PtInDevRect(pt))\n\t\t\treturn;\n\n\t\tpT->ViewDPtoLP(&pt);\n\t\tpT->Zoom(fZoomScale, false);\n\t\tpT->CenterOnLogicalPoint(pt);\n\t}\n\n\tvoid Zoom(POINT pt, float fZoomScale)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Zoom(pt.x, pt.y, fZoomScale);\n\t}\n\n\tvoid Zoom(RECT& rc)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tRECT rcZoom = rc;\n\t\tpT->NormalizeRect(rcZoom);\n\t\tSIZE size = { rcZoom.right - rcZoom.left, rcZoom.bottom - rcZoom.top };\n\t\tPOINT pt = { rcZoom.left + size.cx / 2, rcZoom.top + size.cy / 2 };\n\t\tif((size.cx < m_cxyMinZoomRect) || (size.cy < m_cxyMinZoomRect))\n\t\t{\n\t\t\tpT->Zoom(pt, m_fZoomScale + m_fZoomDelta);\n\t\t\treturn;\n\t\t}\n\n\t\tATLASSERT((size.cx > 0) && (size.cy > 0));\n\t\t\n\t\tfloat fScaleH = (float)(this->m_sizeClient.cx  + 1) / (float)size.cx;\n\t\tfloat fScaleV = (float)(this->m_sizeClient.cy + 1) / (float)size.cy;\n\t\tfloat fZoomScale = __min(fScaleH, fScaleV) * m_fZoomScale;\n\t\tpT->Zoom(pt, fZoomScale);\t\t\n\t}\n\n\tvoid Zoom(float fZoomScale, bool bCenter = true)\n\t{\n\t\tif(fZoomScale <= 0.0f)\n\t\t\treturn;\n\n\t\tif(fZoomScale < m_fZoomScaleMin)\n\t\t\tfZoomScale = m_fZoomScaleMin;\n\t\telse if(fZoomScale > m_fZoomScaleMax)\n\t\t\tfZoomScale = m_fZoomScaleMax;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tPOINT pt = { 0, 0 };\n\t\tif(bCenter)\n\t\t{\n\t\t\tRECT rcClient = {};\n\t\t\t::GetClientRect(pT->m_hWnd, &rcClient);\n\t\t\tpt.x = rcClient.right / 2;\n\t\t\tpt.y = rcClient.bottom / 2;\n\t\t\tpT->ViewDPtoLP(&pt);\n\t\t}\n\n\t\t// Modify the Viewport extent\n\t\tSIZE sizeAll = {};\n\t\tsizeAll.cx = (int)((float)m_sizeLogAll.cx * fZoomScale);\n\t\tsizeAll.cy = (int)((float)m_sizeLogAll.cy * fZoomScale);\n\t\t\n\t\t// Update scroll bars and window\n\t\tCScrollImpl< T >::SetScrollSize(sizeAll);\n\n\t\t// Zoom all children if needed\n\t\tif(m_bZoomChildren && (m_fZoomScale != fZoomScale))\n\t\t{\n\t\t\tfor(int i = 0; i < m_arrChildren.GetSize(); i++)\n\t\t\t{\n\t\t\t\tATLASSERT(::IsWindow(m_arrChildren[i].hWnd));\n\n\t\t\t\t::SetWindowPos(m_arrChildren[i].hWnd, NULL, \n\t\t\t\t\t(int)((float)m_arrChildren[i].x * fZoomScale + 0.5f), \n\t\t\t\t\t(int)((float)m_arrChildren[i].y * fZoomScale + 0.5f), \n\t\t\t\t\t(int)((float)m_arrChildren[i].cx * fZoomScale + 0.5f), \n\t\t\t\t\t(int)((float)m_arrChildren[i].cy * fZoomScale + 0.5f), \n\t\t\t\t\tSWP_NOZORDER | SWP_NOACTIVATE);\n\t\t\t}\n\t\t}\n\n\t\t// Set new zoom scale\n\t\tm_fZoomScale = fZoomScale;\n\n\t\tif(bCenter)\n\t\t\tpT->CenterOnLogicalPoint(pt);\n\t}\n\n\tvoid ZoomIn(bool bCenter = true)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Zoom(m_fZoomScale + m_fZoomDelta, bCenter);\n\t}\n\n\tvoid ZoomOut(bool bCenter = true)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Zoom(m_fZoomScale - m_fZoomDelta, bCenter);\n\t}\n\n\tvoid ZoomDefault(bool bCenter = true)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Zoom(1.0f, bCenter);\n\t}\n\n\t// Helper functions\n\tvoid PrepareDC(CDCHandle dc)\n\t{\n\t\tATLASSERT((this->m_sizeAll.cx >= 0) && (this->m_sizeAll.cy >= 0));\n\t\tdc.SetMapMode(MM_ANISOTROPIC);\n\t\tdc.SetWindowExt(this->m_sizeLogAll);\n\t\tdc.SetViewportExt(this->m_sizeAll);\n\t\tdc.SetViewportOrg(-this->m_ptOffset.x, -this->m_ptOffset.y);\n\t}\n\n\tvoid ViewDPtoLP(LPPOINT lpPoints, int nCount = 1)\n\t{\n\t\tATLASSERT(lpPoints);\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\n\t\tCWindowDC dc(pT->m_hWnd);\n\t\tpT->PrepareDC(dc.m_hDC);\n\t\tdc.DPtoLP(lpPoints, nCount);\n\t}\n\n\tvoid ViewLPtoDP(LPPOINT lpPoints, int nCount = 1)\n\t{\n\t\tATLASSERT(lpPoints);\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\n\t\tCWindowDC dc(pT->m_hWnd);\n\t\tpT->PrepareDC(dc.m_hDC);\n\t\tdc.LPtoDP(lpPoints, nCount);\n\t}\n\n\tvoid ClientToDevice(POINT &pt)\n\t{\n\t\tpt.x += this->m_ptOffset.x;\n\t\tpt.y += this->m_ptOffset.y;\n\t}\t \n\n\tvoid DeviceToClient(POINT &pt)\n\t{\n\t\tpt.x -= this->m_ptOffset.x;\n\t\tpt.y -= this->m_ptOffset.y;\n\t}\n\n\tvoid CenterOnPoint(POINT pt)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tRECT rect = {};\n\t\tpT->GetClientRect(&rect);\n\n\t\tint xOfs = pt.x - (rect.right / 2) + this->m_ptOffset.x;\n\t\tif(xOfs < 0)\n\t\t{\n\t\t\txOfs = 0;\n\t\t}\n\t\telse \n\t\t{\n\t\t\tint xMax = __max((int)(this->m_sizeAll.cx - rect.right), 0);\n\t\t\tif(xOfs > xMax)\n\t\t\t\txOfs = xMax;\n\t\t}\n\t\t\n\t\tint yOfs = pt.y - (rect.bottom / 2) + this->m_ptOffset.y;\n\t\tif(yOfs < 0)\n\t\t{\n\t\t\tyOfs = 0;\n\t\t}\n\t\telse \n\t\t{\n\t\t\tint yMax = __max((int)(this->m_sizeAll.cy - rect.bottom), 0);\n\t\t\tif(yOfs > yMax)\n\t\t\t\tyOfs = yMax;\n\t\t}\n\n\t\tCScrollImpl< T >::SetScrollOffset(xOfs, yOfs);\n\t}\n\n\tvoid CenterOnLogicalPoint(POINT ptLog)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->ViewLPtoDP(&ptLog);\n\t\tpT->DeviceToClient(ptLog);\n\t\tpT->CenterOnPoint(ptLog);\n\t}\n\n\tBOOL PtInDevRect(POINT pt)\n\t{\n\t\tRECT rc = { 0, 0, this->m_sizeAll.cx, this->m_sizeAll.cy };\n\t\t::OffsetRect(&rc, -this->m_ptOffset.x, -this->m_ptOffset.y);\n\t\treturn ::PtInRect(&rc, pt);\n\t}\n\n\tvoid NormalizeRect(RECT& rc)\n\t{\n\t\tif(rc.left > rc.right) \n\t\t{\n\t\t\tint r = rc.right;\n\t\t\trc.right = rc.left;\n\t\t\trc.left = r;\n\t\t}\n\n\t\tif(rc.top > rc.bottom)\n\t\t{\n\t\t\tint b = rc.bottom;\n\t\t\trc.bottom = rc.top;\n\t\t\trc.top = b;\n\t\t}\n\t}\n\n\tvoid DrawTrackRect()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tRECT rc = m_rcTrack;\n\t\tpT->NormalizeRect(rc);\n\t\tif(!::IsRectEmpty(&rc))\n\t\t{\n\t\t\tconst SIZE sizeLines = { 2, 2 };\n\t\t\tCClientDC dc(pT->m_hWnd);\n\t\t\tdc.DrawDragRect(&rc, sizeLines, NULL, sizeLines);\n\t\t}\n\t}\n\n\tvoid NotifyParentZoomChanged()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tint nId = pT->GetDlgCtrlID();\n\t\tNMHDR nmhdr = { pT->m_hWnd, (UINT_PTR)nId, ZSN_ZOOMCHANGED };\n\t\t::SendMessage(pT->GetParent(), WM_NOTIFY, (WPARAM)nId, (LPARAM)&nmhdr);\n\t}\n\n\tvoid DoWheelZoom(int zDelta)\n\t{\n\t\tfloat fZoomScale = m_fZoomScale + ((zDelta > 0) ? m_fZoomDelta : -m_fZoomDelta);\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Zoom(fZoomScale);\n\t\tpT->NotifyParentZoomChanged();\n\t}\n\n\tBEGIN_MSG_MAP(CZoomScrollImpl)\n\t\tMESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)\n\t\tMESSAGE_HANDLER(WM_VSCROLL, CScrollImpl< T >::OnVScroll)\n\t\tMESSAGE_HANDLER(WM_HSCROLL, CScrollImpl< T >::OnHScroll)\n\t\tMESSAGE_HANDLER(WM_MOUSEWHEEL, OnMouseWheel)\n\t\tMESSAGE_HANDLER(WM_MOUSEHWHEEL, CScrollImpl< T >::OnMouseHWheel)\n\t\tMESSAGE_HANDLER(WM_SETTINGCHANGE, CScrollImpl< T >::OnSettingChange)\n\t\tMESSAGE_HANDLER(WM_SIZE, CScrollImpl< T >::OnSize)\n\t\tMESSAGE_HANDLER(WM_PAINT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)\n\t\tMESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)\n\t\tMESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)\n\t\tMESSAGE_HANDLER(WM_CAPTURECHANGED, OnCaptureChanged)\n\tALT_MSG_MAP(1)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_UP, CScrollImpl< T >::OnScrollUp)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_DOWN, CScrollImpl< T >::OnScrollDown)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_UP, CScrollImpl< T >::OnScrollPageUp)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_DOWN, CScrollImpl< T >::OnScrollPageDown)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_TOP, CScrollImpl< T >::OnScrollTop)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_BOTTOM, CScrollImpl< T >::OnScrollBottom)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_LEFT, CScrollImpl< T >::OnScrollLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_RIGHT, CScrollImpl< T >::OnScrollRight)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_LEFT, CScrollImpl< T >::OnScrollPageLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_RIGHT, CScrollImpl< T >::OnScrollPageRight)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_ALL_LEFT, CScrollImpl< T >::OnScrollAllLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_ALL_RIGHT, CScrollImpl< T >::OnScrollAllRight)\n\tEND_MSG_MAP()\n\n\tLRESULT OnSetCursor(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif((LOWORD(lParam) == HTCLIENT) && (m_nZoomMode != ZOOMMODE_OFF))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tif((HWND)wParam == pT->m_hWnd)\n\t\t\t{\n\t\t\t\tDWORD dwPos = ::GetMessagePos();\n\t\t\t\tPOINT pt = { GET_X_LPARAM(dwPos), GET_Y_LPARAM(dwPos) };\n\t\t\t\tpT->ScreenToClient(&pt);\n\t\t\t\tif(pT->PtInDevRect(pt))\n\t\t\t\t{\n\t\t\t\t\t::SetCursor(::LoadCursor(NULL, IDC_CROSS));\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnMouseWheel(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif((GET_KEYSTATE_WPARAM(wParam) & MK_CONTROL) != 0)   // handle zoom if Ctrl is pressed\n\t\t{\n\t\t\tint zDelta = (int)GET_WHEEL_DELTA_WPARAM(wParam);\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->DoWheelZoom(zDelta);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCScrollImpl< T >::OnMouseWheel(uMsg, wParam, lParam, bHandled);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tATLASSERT((m_sizeLogAll.cx >= 0) && (m_sizeLogAll.cy >= 0));\n\t\tATLASSERT((this->m_sizeAll.cx >= 0) && (this->m_sizeAll.cy >= 0));\n\n\t\tif(wParam != NULL)\n\t\t{\n\t\t\tCDCHandle dc = (HDC)wParam;\n\t\t\tint nMapModeSav = dc.GetMapMode();\n\t\t\tdc.SetMapMode(MM_ANISOTROPIC);\n\t\t\tSIZE szWindowExt = { 0, 0 };\n\t\t\tdc.SetWindowExt(m_sizeLogAll, &szWindowExt);\n\t\t\tSIZE szViewportExt = { 0, 0 };\n\t\t\tdc.SetViewportExt(this->m_sizeAll, &szViewportExt);\n\t\t\tPOINT ptViewportOrg = { 0, 0 };\n\t\t\tdc.SetViewportOrg(-this->m_ptOffset.x, -this->m_ptOffset.y, &ptViewportOrg);\n\n\t\t\tpT->DoPaint(dc);\n\n\t\t\tdc.SetMapMode(nMapModeSav);\n\t\t\tdc.SetWindowExt(szWindowExt);\n\t\t\tdc.SetViewportExt(szViewportExt);\n\t\t\tdc.SetViewportOrg(ptViewportOrg);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCPaintDC dc(pT->m_hWnd);\n\t\t\tpT->PrepareDC(dc.m_hDC);\n\t\t\tpT->DoPaint(dc.m_hDC);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif((m_nZoomMode == ZOOMMODE_IN) && !m_bTracking)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tPOINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\t\t\tif(pT->PtInDevRect(pt))\n\t\t\t{\n\t\t\t\tpT->SetCapture();\n\t\t\t\tm_bTracking = true;\n\t\t\t\t::SetRect(&m_rcTrack, pt.x, pt.y, pt.x, pt.y);\n\n\t\t\t\tRECT rcClip;\n\t\t\t\tpT->GetClientRect(&rcClip);\n\t\t\t\tif((this->m_ptOffset.x == 0) && (this->m_ptOffset.y == 0))\n\t\t\t\t{\n\t\t\t\t\tif(rcClip.right > this->m_sizeAll.cx)\n\t\t\t\t\t\trcClip.right = this->m_sizeAll.cx;\n\t\t\t\t\tif(rcClip.bottom > this->m_sizeAll.cy)\n\t\t\t\t\t\trcClip.bottom = this->m_sizeAll.cy;\n\t\t\t\t}\n\t\t\t\t::MapWindowPoints(pT->m_hWnd, NULL, (LPPOINT)&rcClip, 2);\n\t\t\t\t::ClipCursor(&rcClip);\n\t\t\t}\t\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tif(m_bTracking)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tPOINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\n\t\t\tif(pT->PtInDevRect(pt))\n\t\t\t{\n\t\t\t\tpT->DrawTrackRect();\n\t\t\t\tm_rcTrack.right = pt.x + 1;\n\t\t\t\tm_rcTrack.bottom = pt.y + 1;\n\t\t\t\tpT->DrawTrackRect();\n\t\t\t}\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\t::ReleaseCapture();\n\t\tif(m_nZoomMode == ZOOMMODE_OUT)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->Zoom(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), m_fZoomScale - m_fZoomDelta);\n\t\t\tpT->NotifyParentZoomChanged();\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnCaptureChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(m_bTracking)\n\t\t{\n\t\t\tm_bTracking = false;\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->DrawTrackRect();\n\t\t\tpT->Zoom(m_rcTrack);\n\t\t\tpT->NotifyParentZoomChanged();\n\t\t\t::SetRectEmpty(&m_rcTrack);\n\t\t\t::ClipCursor(NULL);\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\t\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// CZoomScrollWindowImpl - Implements scrolling window with zooming\n\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CZoomScrollWindowImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >, public CZoomScrollImpl< T >\n{\npublic:\n\tBOOL SubclassWindow(HWND hWnd)\n\t{\n\t\tBOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits >::SubclassWindow(hWnd);\n\t\tif(bRet != FALSE)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->GetSystemSettings();\n\n\t\t\tRECT rect = {};\n\t\t\tthis->GetClientRect(&rect);\n\t\t\tpT->DoSize(rect.right, rect.bottom);\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\tBEGIN_MSG_MAP(CZoomScrollWindowImpl)\n\t\tMESSAGE_HANDLER(WM_SETCURSOR, CZoomScrollImpl< T >::OnSetCursor)\n\t\tMESSAGE_HANDLER(WM_VSCROLL, CScrollImpl< T >::OnVScroll)\n\t\tMESSAGE_HANDLER(WM_HSCROLL, CScrollImpl< T >::OnHScroll)\n\t\tMESSAGE_HANDLER(WM_MOUSEWHEEL, CZoomScrollImpl< T >::OnMouseWheel)\n\t\tMESSAGE_HANDLER(WM_MOUSEHWHEEL, CScrollImpl< T >::OnMouseHWheel)\n\t\tMESSAGE_HANDLER(WM_SETTINGCHANGE, CScrollImpl< T >::OnSettingChange)\n\t\tMESSAGE_HANDLER(WM_SIZE, CScrollImpl< T >::OnSize)\n\t\tMESSAGE_HANDLER(WM_PAINT, CZoomScrollImpl< T >::OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, CZoomScrollImpl< T >::OnPaint)\n\t\tMESSAGE_HANDLER(WM_LBUTTONDOWN, CZoomScrollImpl< T >::OnLButtonDown)\n\t\tMESSAGE_HANDLER(WM_MOUSEMOVE, CZoomScrollImpl< T >::OnMouseMove)\n\t\tMESSAGE_HANDLER(WM_LBUTTONUP, CZoomScrollImpl< T >::OnLButtonUp)\n\t\tMESSAGE_HANDLER(WM_CAPTURECHANGED, CZoomScrollImpl< T >::OnCaptureChanged)\n\tALT_MSG_MAP(1)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_UP, CScrollImpl< T >::OnScrollUp)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_DOWN, CScrollImpl< T >::OnScrollDown)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_UP, CScrollImpl< T >::OnScrollPageUp)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_DOWN, CScrollImpl< T >::OnScrollPageDown)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_TOP, CScrollImpl< T >::OnScrollTop)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_BOTTOM, CScrollImpl< T >::OnScrollBottom)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_LEFT, CScrollImpl< T >::OnScrollLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_RIGHT, CScrollImpl< T >::OnScrollRight)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_LEFT, CScrollImpl< T >::OnScrollPageLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_PAGE_RIGHT, CScrollImpl< T >::OnScrollPageRight)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_ALL_LEFT, CScrollImpl< T >::OnScrollAllLeft)\n\t\tCOMMAND_ID_HANDLER(ID_SCROLL_ALL_RIGHT, CScrollImpl< T >::OnScrollAllRight)\n\tEND_MSG_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CScrollContainer\n\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CScrollContainerImpl : public CScrollWindowImpl< T, TBase, TWinTraits >\n{\npublic:\n\tDECLARE_WND_CLASS_EX2(NULL, T, 0, -1)\n\n\ttypedef CScrollWindowImpl< T, TBase, TWinTraits >   _baseClass;\n\n// Data members\n\tATL::CWindow m_wndClient;\n\tbool m_bAutoSizeClient;\n\tbool m_bDrawEdgeIfEmpty;\n\n// Constructor\n\tCScrollContainerImpl() : m_bAutoSizeClient(true), m_bDrawEdgeIfEmpty(false)\n\t{\n\t\t// Set CScrollWindowImpl extended style\n\t\tthis->SetScrollExtendedStyle(SCRL_SCROLLCHILDREN);\n\t}\n\n// Attributes\n\tHWND GetClient() const\n\t{\n\t\treturn m_wndClient;\n\t}\n\n\tHWND SetClient(HWND hWndClient, bool bClientSizeAsMin = true)\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\n\t\tHWND hWndOldClient = m_wndClient;\n\t\tm_wndClient = hWndClient;\n\n\t\tthis->SetRedraw(FALSE);\n\t\tthis->SetScrollSize(1, 1, FALSE);\n\n\t\tif(m_wndClient.m_hWnd != NULL)\n\t\t{\n\t\t\tm_wndClient.SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOSIZE);\n\n\t\t\tif(bClientSizeAsMin)\n\t\t\t{\n\t\t\t\tRECT rect = {};\n\t\t\t\tm_wndClient.GetWindowRect(&rect);\n\t\t\t\tif(((rect.right - rect.left) > 0) && ((rect.bottom - rect.top) > 0))\n\t\t\t\t\tthis->SetScrollSize(rect.right - rect.left, rect.bottom - rect.top, FALSE);\n\t\t\t}\n\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->UpdateLayout();\n\t\t}\n\n\t\tthis->SetRedraw(TRUE);\n\t\tthis->RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);\n\n\t\treturn hWndOldClient;\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CScrollContainerImpl)\n\t\tMESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)\n\t\tMESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\n\t\tCHAIN_MSG_MAP(_baseClass)\n\t\tFORWARD_NOTIFICATIONS()\n\tALT_MSG_MAP(1)\n\t\tCHAIN_MSG_MAP_ALT(_baseClass, 1)\n\tEND_MSG_MAP()\n\n\tLRESULT OnSetFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tif(m_wndClient.m_hWnd != NULL)\n\t\t\tm_wndClient.SetFocus();\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn 1;   // no background needed\n\t}\n\n// Overrides for CScrollWindowImpl\n\tvoid DoSize(int cx, int cy)\n\t{\n\t\t_baseClass::DoSize(cx, cy);\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->UpdateLayout();\n\t}\n\n\tvoid DoPaint(CDCHandle dc)\n\t{\n\t\tif(!m_bAutoSizeClient || (m_wndClient.m_hWnd == NULL))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tRECT rect = {};\n\t\t\tpT->GetContainerRect(rect);\n\n\t\t\tif(m_bDrawEdgeIfEmpty && (m_wndClient.m_hWnd == NULL))\n\t\t\t\tdc.DrawEdge(&rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);\n\n\t\t\tdc.FillRect(&rect, COLOR_APPWORKSPACE);\n\t\t}\n\t}\n\n\tvoid ScrollToView(POINT pt)\n\t{\n\t\tCScrollWindowImpl< T, TBase, TWinTraits >::ScrollToView(pt);\n\t}\n\n\tvoid ScrollToView(RECT& rect)\n\t{\n\t\tCScrollWindowImpl< T, TBase, TWinTraits >::ScrollToView(rect);\n\t}\n\n\tvoid ScrollToView(HWND hWnd)   // client window coordinates\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\t(void)pT;   // avoid level 4 warning\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tATLASSERT(m_wndClient.IsWindow());\n\n\t\tRECT rect = {};\n\t\t::GetWindowRect(hWnd, &rect);\n\t\t::MapWindowPoints(NULL, m_wndClient.m_hWnd, (LPPOINT)&rect, 2);\n\t\tScrollToView(rect);\n\t}\n\n// Implementation - overrideable methods\n\tvoid UpdateLayout()\n\t{\n\t\tATLASSERT(::IsWindow(this->m_hWnd));\n\n\t\tif(m_bAutoSizeClient && (m_wndClient.m_hWnd != NULL))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tRECT rect = {};\n\t\t\tpT->GetContainerRect(rect);\n\n\t\t\tm_wndClient.SetWindowPos(NULL, &rect, SWP_NOZORDER | SWP_NOMOVE);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis->Invalidate();\n\t\t}\n\t}\n\n\tvoid GetContainerRect(RECT& rect)\n\t{\n\t\tthis->GetClientRect(&rect);\n\n\t\tif(rect.right < this->m_sizeAll.cx)\n\t\t\trect.right = this->m_sizeAll.cx;\n\n\t\tif(rect.bottom < this->m_sizeAll.cy)\n\t\t\trect.bottom = this->m_sizeAll.cy;\n\t}\n};\n\nclass CScrollContainer : public CScrollContainerImpl<CScrollContainer>\n{\npublic:\n\tDECLARE_WND_CLASS_EX(_T(\"WTL_ScrollContainer\"), 0, -1)\n};\n\n} // namespace WTL\n\n#endif // __ATLSCRL_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlsplit.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLSPLIT_H__\n#define __ATLSPLIT_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atlsplit.h requires atlapp.h to be included first\n#endif\n\n#ifndef __ATLWIN_H__\n\t#error atlsplit.h requires atlwin.h to be included first\n#endif\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CSplitterImpl<T>\n// CSplitterWindowImpl<T, TBase, TWinTraits>\n// CSplitterWindowT<t_bVertical> - CSplitterWindow, CHorSplitterWindow\n\n\nnamespace WTL\n{\n\n///////////////////////////////////////////////////////////////////////////////\n// CSplitterImpl - Provides splitter support to any window\n\n// Splitter panes constants\n#define SPLIT_PANE_LEFT\t\t\t 0\n#define SPLIT_PANE_RIGHT\t\t 1\n#define SPLIT_PANE_TOP\t\t\t SPLIT_PANE_LEFT\n#define SPLIT_PANE_BOTTOM\t\t SPLIT_PANE_RIGHT\n#define SPLIT_PANE_NONE\t\t\t-1\n\n// Splitter extended styles\n#define SPLIT_PROPORTIONAL\t\t0x00000001\n#define SPLIT_NONINTERACTIVE\t\t0x00000002\n#define SPLIT_RIGHTALIGNED\t\t0x00000004\n#define SPLIT_BOTTOMALIGNED\t\tSPLIT_RIGHTALIGNED\n#define SPLIT_GRADIENTBAR\t\t0x00000008\n#define SPLIT_FLATBAR\t\t\t0x00000020\n#define SPLIT_FIXEDBARSIZE\t\t0x00000010\n\n// Note: SPLIT_PROPORTIONAL and SPLIT_RIGHTALIGNED/SPLIT_BOTTOMALIGNED are \n// mutually exclusive. If both are set, splitter defaults to SPLIT_PROPORTIONAL.\n// Also, SPLIT_FLATBAR overrides SPLIT_GRADIENTBAR if both are set.\n\n\ntemplate <class T>\nclass CSplitterImpl\n{\npublic:\n\tenum { m_nPanesCount = 2, m_nPropMax = INT_MAX, m_cxyStep = 10 };\n\n\tbool m_bVertical;\n\tHWND m_hWndPane[m_nPanesCount];\n\tRECT m_rcSplitter;\n\tint m_xySplitterPos;            // splitter bar position\n\tint m_xySplitterPosNew;         // internal - new position while moving\n\tHWND m_hWndFocusSave;\n\tint m_nDefActivePane;\n\tint m_cxySplitBar;              // splitter bar width/height\n\tHCURSOR m_hCursor;\n\tint m_cxyMin;                   // minimum pane size\n\tint m_cxyBarEdge;              \t// splitter bar edge\n\tbool m_bFullDrag;\n\tint m_cxyDragOffset;\t\t// internal\n\tint m_nProportionalPos;\n\tbool m_bUpdateProportionalPos;\n\tDWORD m_dwExtendedStyle;        // splitter specific extended styles\n\tint m_nSinglePane;              // single pane mode\n\tint m_xySplitterDefPos;         // default position\n\tbool m_bProportionalDefPos;     // porportinal def pos\n\n// Constructor\n\tCSplitterImpl(bool bVertical = true) : \n\t              m_bVertical(bVertical), m_xySplitterPos(-1), m_xySplitterPosNew(-1), m_hWndFocusSave(NULL), \n\t              m_nDefActivePane(SPLIT_PANE_NONE), m_cxySplitBar(4), m_hCursor(NULL), m_cxyMin(0), m_cxyBarEdge(0), \n\t              m_bFullDrag(true), m_cxyDragOffset(0), m_nProportionalPos(0), m_bUpdateProportionalPos(true),\n\t              m_dwExtendedStyle(SPLIT_PROPORTIONAL), m_nSinglePane(SPLIT_PANE_NONE), \n\t              m_xySplitterDefPos(-1), m_bProportionalDefPos(false)\n\t{\n\t\tm_hWndPane[SPLIT_PANE_LEFT] = NULL;\n\t\tm_hWndPane[SPLIT_PANE_RIGHT] = NULL;\n\n\t\t::SetRectEmpty(&m_rcSplitter);\n\t}\n\n// Attributes\n\tvoid SetSplitterRect(LPRECT lpRect = NULL, bool bUpdate = true)\n\t{\n\t\tif(lpRect == NULL)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->GetClientRect(&m_rcSplitter);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_rcSplitter = *lpRect;\n\t\t}\n\n\t\tif(IsProportional())\n\t\t\tUpdateProportionalPos();\n\t\telse if(IsRightAligned())\n\t\t\tUpdateRightAlignPos();\n\n\t\tif(bUpdate)\n\t\t\tUpdateSplitterLayout();\n\t}\n\n\tvoid GetSplitterRect(LPRECT lpRect) const\n\t{\n\t\tATLASSERT(lpRect != NULL);\n\t\t*lpRect = m_rcSplitter;\n\t}\n\n\tbool SetSplitterPos(int xyPos = -1, bool bUpdate = true)\n\t{\n\t\tif(xyPos == -1)   // -1 == default position\n\t\t{\n\t\t\tif(m_bProportionalDefPos)\n\t\t\t{\n\t\t\t\tATLASSERT((m_xySplitterDefPos >= 0) && (m_xySplitterDefPos <= m_nPropMax));\n\n\t\t\t\tif(m_bVertical)\n\t\t\t\t\txyPos = ::MulDiv(m_xySplitterDefPos, m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge, m_nPropMax);\n\t\t\t\telse\n\t\t\t\t\txyPos = ::MulDiv(m_xySplitterDefPos, m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge, m_nPropMax);\n\t\t\t}\n\t\t\telse if(m_xySplitterDefPos != -1)\n\t\t\t{\n\t\t\t\txyPos = m_xySplitterDefPos;\n\t\t\t}\n\t\t\telse   // not set, use middle position\n\t\t\t{\n\t\t\t\tif(m_bVertical)\n\t\t\t\t\txyPos = (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) / 2;\n\t\t\t\telse\n\t\t\t\t\txyPos = (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge) / 2;\n\t\t\t}\n\t\t}\n\n\t\t// Adjust if out of valid range\n\t\tint cxyMax = 0;\n\t\tif(m_bVertical)\n\t\t\tcxyMax = m_rcSplitter.right - m_rcSplitter.left;\n\t\telse\n\t\t\tcxyMax = m_rcSplitter.bottom - m_rcSplitter.top;\n\n\t\tif(xyPos < m_cxyMin + m_cxyBarEdge)\n\t\t\txyPos = m_cxyMin;\n\t\telse if(xyPos > (cxyMax - m_cxySplitBar - m_cxyBarEdge - m_cxyMin))\n\t\t\txyPos = cxyMax - m_cxySplitBar - m_cxyBarEdge - m_cxyMin;\n\n\t\t// Set new position and update if requested\n\t\tbool bRet = (m_xySplitterPos != xyPos);\n\t\tm_xySplitterPos = xyPos;\n\n\t\tif(m_bUpdateProportionalPos)\n\t\t{\n\t\t\tif(IsProportional())\n\t\t\t\tStoreProportionalPos();\n\t\t\telse if(IsRightAligned())\n\t\t\t\tStoreRightAlignPos();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_bUpdateProportionalPos = true;\n\t\t}\n\n\t\tif(bUpdate && bRet)\n\t\t\tUpdateSplitterLayout();\n\n\t\treturn bRet;\n\t}\n\n\tint GetSplitterPos() const\n\t{\n\t\treturn m_xySplitterPos;\n\t}\n\n\tvoid SetSplitterPosPct(int nPct, bool bUpdate = true)\n\t{\n\t\tATLASSERT((nPct >= 0) && (nPct <= 100));\n\n\t\tm_nProportionalPos = ::MulDiv(nPct, m_nPropMax, 100);\n\t\tUpdateProportionalPos();\n\n\t\tif(bUpdate)\n\t\t\tUpdateSplitterLayout();\n\t}\n\n\tint GetSplitterPosPct() const\n\t{\n\t\tint cxyTotal = m_bVertical ? (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) : (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge);\n\t\treturn ((cxyTotal > 0) && (m_xySplitterPos >= 0)) ? ::MulDiv(m_xySplitterPos, 100, cxyTotal) : -1;\n\t}\n\n\tbool SetSinglePaneMode(int nPane = SPLIT_PANE_NONE)\n\t{\n\t\tATLASSERT((nPane == SPLIT_PANE_LEFT) || (nPane == SPLIT_PANE_RIGHT) || (nPane == SPLIT_PANE_NONE));\n\t\tif(!((nPane == SPLIT_PANE_LEFT) || (nPane == SPLIT_PANE_RIGHT) || (nPane == SPLIT_PANE_NONE)))\n\t\t\treturn false;\n\n\t\tif(nPane != SPLIT_PANE_NONE)\n\t\t{\n\t\t\tif(::IsWindowVisible(m_hWndPane[nPane]) == FALSE)\n\t\t\t\t::ShowWindow(m_hWndPane[nPane], SW_SHOW);\n\t\t\tint nOtherPane = (nPane == SPLIT_PANE_LEFT) ? SPLIT_PANE_RIGHT : SPLIT_PANE_LEFT;\n\t\t\t::ShowWindow(m_hWndPane[nOtherPane], SW_HIDE);\n\t\t\tif(m_nDefActivePane != nPane)\n\t\t\t\tm_nDefActivePane = nPane;\n\t\t}\n\t\telse if(m_nSinglePane != SPLIT_PANE_NONE)\n\t\t{\n\t\t\tint nOtherPane = (m_nSinglePane == SPLIT_PANE_LEFT) ? SPLIT_PANE_RIGHT : SPLIT_PANE_LEFT;\n\t\t\t::ShowWindow(m_hWndPane[nOtherPane], SW_SHOW);\n\t\t}\n\n\t\tm_nSinglePane = nPane;\n\t\tUpdateSplitterLayout();\n\n\t\treturn true;\n\t}\n\n\tint GetSinglePaneMode() const\n\t{\n\t\treturn m_nSinglePane;\n\t}\n\n\tDWORD GetSplitterExtendedStyle() const\n\t{\n\t\treturn m_dwExtendedStyle;\n\t}\n\n\tDWORD SetSplitterExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\n\t{\n\t\tDWORD dwPrevStyle = m_dwExtendedStyle;\n\t\tif(dwMask == 0)\n\t\t\tm_dwExtendedStyle = dwExtendedStyle;\n\t\telse\n\t\t\tm_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\n\n#ifdef _DEBUG\n\t\tif(IsProportional() && IsRightAligned())\n\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"CSplitterImpl::SetSplitterExtendedStyle - SPLIT_PROPORTIONAL and SPLIT_RIGHTALIGNED are mutually exclusive, defaulting to SPLIT_PROPORTIONAL.\\n\"));\n#endif // _DEBUG\n\n\t\treturn dwPrevStyle;\n\t}\n\n\tvoid SetSplitterDefaultPos(int xyPos = -1)\n\t{\n\t\tm_xySplitterDefPos = xyPos;\n\t\tm_bProportionalDefPos = false;\n\t}\n\n\tvoid SetSplitterDefaultPosPct(int nPct)\n\t{\n\t\tATLASSERT((nPct >= 0) && (nPct <= 100));\n\n\t\tm_xySplitterDefPos = ::MulDiv(nPct, m_nPropMax, 100);\n\t\tm_bProportionalDefPos = true;\n\t}\n\n// Splitter operations\n\tvoid SetSplitterPanes(HWND hWndLeftTop, HWND hWndRightBottom, bool bUpdate = true)\n\t{\n\t\tm_hWndPane[SPLIT_PANE_LEFT] = hWndLeftTop;\n\t\tm_hWndPane[SPLIT_PANE_RIGHT] = hWndRightBottom;\n\t\tATLASSERT((m_hWndPane[SPLIT_PANE_LEFT] == NULL) || (m_hWndPane[SPLIT_PANE_RIGHT] == NULL) || (m_hWndPane[SPLIT_PANE_LEFT] != m_hWndPane[SPLIT_PANE_RIGHT]));\n\t\tif(bUpdate)\n\t\t\tUpdateSplitterLayout();\n\t}\n\n\tbool SetSplitterPane(int nPane, HWND hWnd, bool bUpdate = true)\n\t{\n\t\tATLASSERT((nPane == SPLIT_PANE_LEFT) || (nPane == SPLIT_PANE_RIGHT));\n\t\tif((nPane != SPLIT_PANE_LEFT) && (nPane != SPLIT_PANE_RIGHT))\n\t\t\treturn false;\n\n\t\tm_hWndPane[nPane] = hWnd;\n\t\tATLASSERT((m_hWndPane[SPLIT_PANE_LEFT] == NULL) || (m_hWndPane[SPLIT_PANE_RIGHT] == NULL) || (m_hWndPane[SPLIT_PANE_LEFT] != m_hWndPane[SPLIT_PANE_RIGHT]));\n\t\tif(bUpdate)\n\t\t\tUpdateSplitterLayout();\n\n\t\treturn true;\n\t}\n\n\tHWND GetSplitterPane(int nPane) const\n\t{\n\t\tATLASSERT((nPane == SPLIT_PANE_LEFT) || (nPane == SPLIT_PANE_RIGHT));\n\t\tif((nPane != SPLIT_PANE_LEFT) && (nPane != SPLIT_PANE_RIGHT))\n\t\t\treturn NULL;\n\n\t\treturn m_hWndPane[nPane];\n\t}\n\n\tbool SetActivePane(int nPane)\n\t{\n\t\tATLASSERT((nPane == SPLIT_PANE_LEFT) || (nPane == SPLIT_PANE_RIGHT));\n\t\tif((nPane != SPLIT_PANE_LEFT) && (nPane != SPLIT_PANE_RIGHT))\n\t\t\treturn false;\n\t\tif((m_nSinglePane != SPLIT_PANE_NONE) && (nPane != m_nSinglePane))\n\t\t\treturn false;\n\n\t\t::SetFocus(m_hWndPane[nPane]);\n\t\tm_nDefActivePane = nPane;\n\n\t\treturn true;\n\t}\n\n\tint GetActivePane() const\n\t{\n\t\tint nRet = SPLIT_PANE_NONE;\n\t\tHWND hWndFocus = ::GetFocus();\n\t\tif(hWndFocus != NULL)\n\t\t{\n\t\t\tfor(int nPane = 0; nPane < m_nPanesCount; nPane++)\n\t\t\t{\n\t\t\t\tif((hWndFocus == m_hWndPane[nPane]) || (::IsChild(m_hWndPane[nPane], hWndFocus) != FALSE))\n\t\t\t\t{\n\t\t\t\t\tnRet = nPane;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nRet;\n\t}\n\n\tbool ActivateNextPane(bool bNext = true)\n\t{\n\t\tint nPane = m_nSinglePane;\n\t\tif(nPane == SPLIT_PANE_NONE)\n\t\t{\n\t\t\tswitch(GetActivePane())\n\t\t\t{\n\t\t\tcase SPLIT_PANE_LEFT:\n\t\t\t\tnPane = SPLIT_PANE_RIGHT;\n\t\t\t\tbreak;\n\t\t\tcase SPLIT_PANE_RIGHT:\n\t\t\t\tnPane = SPLIT_PANE_LEFT;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tnPane = bNext ? SPLIT_PANE_LEFT : SPLIT_PANE_RIGHT;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn SetActivePane(nPane);\n\t}\n\n\tbool SetDefaultActivePane(int nPane)\n\t{\n\t\tATLASSERT((nPane == SPLIT_PANE_LEFT) || (nPane == SPLIT_PANE_RIGHT));\n\t\tif((nPane != SPLIT_PANE_LEFT) && (nPane != SPLIT_PANE_RIGHT))\n\t\t\treturn false;\n\n\t\tm_nDefActivePane = nPane;\n\n\t\treturn true;\n\t}\n\n\tbool SetDefaultActivePane(HWND hWnd)\n\t{\n\t\tfor(int nPane = 0; nPane < m_nPanesCount; nPane++)\n\t\t{\n\t\t\tif(hWnd == m_hWndPane[nPane])\n\t\t\t{\n\t\t\t\tm_nDefActivePane = nPane;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;   // not found\n\t}\n\n\tint GetDefaultActivePane() const\n\t{\n\t\treturn m_nDefActivePane;\n\t}\n\n\tvoid DrawSplitter(CDCHandle dc)\n\t{\n\t\tATLASSERT(dc.m_hDC != NULL);\n\t\tif((m_nSinglePane == SPLIT_PANE_NONE) && (m_xySplitterPos == -1))\n\t\t\treturn;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(m_nSinglePane == SPLIT_PANE_NONE)\n\t\t{\n\t\t\tpT->DrawSplitterBar(dc);\n\n\t\t\tfor(int nPane = 0; nPane < m_nPanesCount; nPane++)\n\t\t\t{\n\t\t\t\tif(m_hWndPane[nPane] == NULL)\n\t\t\t\t\tpT->DrawSplitterPane(dc, nPane);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(m_hWndPane[m_nSinglePane] == NULL)\n\t\t\t\tpT->DrawSplitterPane(dc, m_nSinglePane);\n\t\t}\n\t}\n\n\t// call to initiate moving splitter bar with keyboard\n\tvoid MoveSplitterBar()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\n\t\tint x = 0;\n\t\tint y = 0;\n\t\tif(m_bVertical)\n\t\t{\n\t\t\tx = m_xySplitterPos + (m_cxySplitBar / 2) + m_cxyBarEdge;\n\t\t\ty = (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge) / 2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tx = (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) / 2;\n\t\t\ty = m_xySplitterPos + (m_cxySplitBar / 2) + m_cxyBarEdge;\n\t\t}\n\n\t\tPOINT pt = { x, y };\n\t\tpT->ClientToScreen(&pt);\n\t\t::SetCursorPos(pt.x, pt.y);\n\n\t\tm_xySplitterPosNew = m_xySplitterPos;\n\t\tpT->SetCapture();\n\t\tm_hWndFocusSave = pT->SetFocus();\n\t\t::SetCursor(m_hCursor);\n\t\tif(!m_bFullDrag)\n\t\t\tDrawGhostBar();\n\t\tif(m_bVertical)\n\t\t\tm_cxyDragOffset = x - m_rcSplitter.left - m_xySplitterPos;\n\t\telse\n\t\t\tm_cxyDragOffset = y - m_rcSplitter.top - m_xySplitterPos;\n\t}\n\n\tvoid SetOrientation(bool bVertical, bool bUpdate = true)\n\t{\n\t\tif(m_bVertical != bVertical)\n\t\t{\n\t\t\tm_bVertical = bVertical;\n\n\t\t\tm_hCursor = ::LoadCursor(NULL, m_bVertical ? IDC_SIZEWE : IDC_SIZENS);\n\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->GetSystemSettings(false);\n\n\t\t\tif(m_bVertical)\n\t\t\t\tm_xySplitterPos = ::MulDiv(m_xySplitterPos, m_rcSplitter.right - m_rcSplitter.left, m_rcSplitter.bottom - m_rcSplitter.top);\n\t\t\telse\n\t\t\t\tm_xySplitterPos = ::MulDiv(m_xySplitterPos, m_rcSplitter.bottom - m_rcSplitter.top, m_rcSplitter.right - m_rcSplitter.left);\n\t\t}\n\n\t\tif(bUpdate)\n\t\t\tUpdateSplitterLayout();\n\t}\n\n// Overrideables\n\tvoid DrawSplitterBar(CDCHandle dc)\n\t{\n\t\tRECT rect = {};\n\t\tif(GetSplitterBarRect(&rect))\n\t\t{\n\t\t\tdc.FillRect(&rect, COLOR_3DFACE);\n\n\t\t\tif((m_dwExtendedStyle & SPLIT_FLATBAR) != 0)\n\t\t\t{\n\t\t\t\tRECT rect1 = rect;\n\t\t\t\tif(m_bVertical)\n\t\t\t\t\trect1.right = rect1.left + 1;\n\t\t\t\telse\n\t\t\t\t\trect1.bottom = rect1.top + 1;\n\t\t\t\tdc.FillRect(&rect1, COLOR_WINDOW);\n\n\t\t\t\trect1 = rect;\n\t\t\t\tif(m_bVertical)\n\t\t\t\t\trect1.left = rect1.right - 1;\n\t\t\t\telse\n\t\t\t\t\trect1.top = rect1.bottom - 1;\n\t\t\t\tdc.FillRect(&rect1, COLOR_3DSHADOW);\n\t\t\t}\n\t\t\telse if((m_dwExtendedStyle & SPLIT_GRADIENTBAR) != 0)\n\t\t\t{\n\t\t\t\tRECT rect2 = rect;\n\t\t\t\tif(m_bVertical)\n\t\t\t\t\trect2.left = (rect.left + rect.right) / 2 - 1;\n\t\t\t\telse\n\t\t\t\t\trect2.top = (rect.top + rect.bottom) / 2 - 1;\n\n\t\t\t\tdc.GradientFillRect(rect2, ::GetSysColor(COLOR_3DFACE), ::GetSysColor(COLOR_3DSHADOW), m_bVertical);\n\t\t\t}\n\n\t\t\t// draw 3D edge if needed\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tif((pT->GetExStyle() & WS_EX_CLIENTEDGE) != 0)\n\t\t\t\tdc.DrawEdge(&rect, EDGE_RAISED, m_bVertical ? (BF_LEFT | BF_RIGHT) : (BF_TOP | BF_BOTTOM));\n\t\t}\n\t}\n\n\t// called only if pane is empty\n\tvoid DrawSplitterPane(CDCHandle dc, int nPane)\n\t{\n\t\tRECT rect = {};\n\t\tif(GetSplitterPaneRect(nPane, &rect))\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tif((pT->GetExStyle() & WS_EX_CLIENTEDGE) == 0)\n\t\t\t\tdc.DrawEdge(&rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);\n\t\t\tdc.FillRect(&rect, COLOR_APPWORKSPACE);\n\t\t}\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CSplitterImpl)\n\t\tMESSAGE_HANDLER(WM_CREATE, OnCreate)\n\t\tMESSAGE_HANDLER(WM_PAINT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\n\t\tif(IsInteractive())\n\t\t{\n\t\t\tMESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)\n\t\t\tMESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)\n\t\t\tMESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)\n\t\t\tMESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)\n\t\t\tMESSAGE_HANDLER(WM_LBUTTONDBLCLK, OnLButtonDoubleClick)\n\t\t\tMESSAGE_HANDLER(WM_CAPTURECHANGED, OnCaptureChanged)\n\t\t\tMESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)\n\t\t}\n\t\tMESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)\n\t\tMESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate)\n\t\tMESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)\n\tEND_MSG_MAP()\n\n\tLRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->Init();\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\n\t\t// try setting position if not set\n\t\tif((m_nSinglePane == SPLIT_PANE_NONE) && (m_xySplitterPos == -1))\n\t\t\tpT->SetSplitterPos();\n\n\t\t// do painting\n\t\tif(wParam != NULL)\n\t\t{\n\t\t\tpT->DrawSplitter((HDC)wParam);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCPaintDC dc(pT->m_hWnd);\n\t\t\tpT->DrawSplitter(dc.m_hDC);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSetCursor(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(((HWND)wParam == pT->m_hWnd) && (LOWORD(lParam) == HTCLIENT))\n\t\t{\n\t\t\tDWORD dwPos = ::GetMessagePos();\n\t\t\tPOINT ptPos = { GET_X_LPARAM(dwPos), GET_Y_LPARAM(dwPos) };\n\t\t\tpT->ScreenToClient(&ptPos);\n\t\t\tif(IsOverSplitterBar(ptPos.x, ptPos.y))\n\t\t\t\treturn 1;\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 0;\n\t}\n\n\tLRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tint xPos = GET_X_LPARAM(lParam);\n\t\tint yPos = GET_Y_LPARAM(lParam);\n\t\tif(::GetCapture() == pT->m_hWnd)\n\t\t{\n\t\t\tint xyNewSplitPos = 0;\n\t\t\tif(m_bVertical)\n\t\t\t\txyNewSplitPos = xPos - m_rcSplitter.left - m_cxyDragOffset;\n\t\t\telse\n\t\t\t\txyNewSplitPos = yPos - m_rcSplitter.top - m_cxyDragOffset;\n\n\t\t\tif(xyNewSplitPos == -1)   // avoid -1, that means default position\n\t\t\t\txyNewSplitPos = -2;\n\n\t\t\tif(m_xySplitterPos != xyNewSplitPos)\n\t\t\t{\n\t\t\t\tif(m_bFullDrag)\n\t\t\t\t{\n\t\t\t\t\tif(pT->SetSplitterPos(xyNewSplitPos, true))\n\t\t\t\t\t\tpT->UpdateWindow();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tDrawGhostBar();\n\t\t\t\t\tpT->SetSplitterPos(xyNewSplitPos, false);\n\t\t\t\t\tDrawGhostBar();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\t\t// not dragging, just set cursor\n\t\t{\n\t\t\tif(IsOverSplitterBar(xPos, yPos))\n\t\t\t\t::SetCursor(m_hCursor);\n\t\t\tbHandled = FALSE;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tint xPos = GET_X_LPARAM(lParam);\n\t\tint yPos = GET_Y_LPARAM(lParam);\n\t\tif((::GetCapture() != pT->m_hWnd) && IsOverSplitterBar(xPos, yPos))\n\t\t{\n\t\t\tm_xySplitterPosNew = m_xySplitterPos;\n\t\t\tpT->SetCapture();\n\t\t\tm_hWndFocusSave = pT->SetFocus();\n\t\t\t::SetCursor(m_hCursor);\n\t\t\tif(!m_bFullDrag)\n\t\t\t\tDrawGhostBar();\n\t\t\tif(m_bVertical)\n\t\t\t\tm_cxyDragOffset = xPos - m_rcSplitter.left - m_xySplitterPos;\n\t\t\telse\n\t\t\t\tm_cxyDragOffset = yPos - m_rcSplitter.top - m_xySplitterPos;\n\t\t}\n\t\telse if((::GetCapture() == pT->m_hWnd) && !IsOverSplitterBar(xPos, yPos))\n\t\t{\n\t\t\t::ReleaseCapture();\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(::GetCapture() == pT->m_hWnd)\n\t\t{\n\t\t\tm_xySplitterPosNew = m_xySplitterPos;\n\t\t\t::ReleaseCapture();\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnLButtonDoubleClick(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->SetSplitterPos();   // default\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnCaptureChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tif(!m_bFullDrag)\n\t\t\tDrawGhostBar();\n\n\t\tif((m_xySplitterPosNew != -1) && (!m_bFullDrag || (m_xySplitterPos != m_xySplitterPosNew)))\n\t\t{\n\t\t\tm_xySplitterPos = m_xySplitterPosNew;\n\t\t\tm_xySplitterPosNew = -1;\n\t\t\tUpdateSplitterLayout();\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->UpdateWindow();\n\t\t}\n\n\t\tif(m_hWndFocusSave != NULL)\n\t\t\t::SetFocus(m_hWndFocusSave);\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(::GetCapture() == pT->m_hWnd)\n\t\t{\n\t\t\tswitch(wParam)\n\t\t\t{\n\t\t\tcase VK_RETURN:\n\t\t\t\tm_xySplitterPosNew = m_xySplitterPos;\n\t\t\t\t// FALLTHROUGH\n\t\t\tcase VK_ESCAPE:\n\t\t\t\t::ReleaseCapture();\n\t\t\t\tbreak;\n\t\t\tcase VK_LEFT:\n\t\t\tcase VK_RIGHT:\n\t\t\t\tif(m_bVertical)\n\t\t\t\t{\n\t\t\t\t\tPOINT pt = {};\n\t\t\t\t\t::GetCursorPos(&pt);\n\t\t\t\t\tint xyPos = m_xySplitterPos + ((wParam == VK_LEFT) ? -pT->m_cxyStep : pT->m_cxyStep);\n\t\t\t\t\tint cxyMax = m_rcSplitter.right - m_rcSplitter.left;\n\t\t\t\t\tif(xyPos < (m_cxyMin + m_cxyBarEdge))\n\t\t\t\t\t\txyPos = m_cxyMin;\n\t\t\t\t\telse if(xyPos > (cxyMax - m_cxySplitBar - m_cxyBarEdge - m_cxyMin))\n\t\t\t\t\t\txyPos = cxyMax - m_cxySplitBar - m_cxyBarEdge - m_cxyMin;\n\t\t\t\t\tpt.x += xyPos - m_xySplitterPos;\n\t\t\t\t\t::SetCursorPos(pt.x, pt.y);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase VK_UP:\n\t\t\tcase VK_DOWN:\n\t\t\t\tif(!m_bVertical)\n\t\t\t\t{\n\t\t\t\t\tPOINT pt = {};\n\t\t\t\t\t::GetCursorPos(&pt);\n\t\t\t\t\tint xyPos = m_xySplitterPos + ((wParam == VK_UP) ? -pT->m_cxyStep : pT->m_cxyStep);\n\t\t\t\t\tint cxyMax = m_rcSplitter.bottom - m_rcSplitter.top;\n\t\t\t\t\tif(xyPos < (m_cxyMin + m_cxyBarEdge))\n\t\t\t\t\t\txyPos = m_cxyMin;\n\t\t\t\t\telse if(xyPos > (cxyMax - m_cxySplitBar - m_cxyBarEdge - m_cxyMin))\n\t\t\t\t\t\txyPos = cxyMax - m_cxySplitBar - m_cxyBarEdge - m_cxyMin;\n\t\t\t\t\tpt.y += xyPos - m_xySplitterPos;\n\t\t\t\t\t::SetCursorPos(pt.x, pt.y);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tbHandled = FALSE;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tLRESULT OnSetFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(::GetCapture() != pT->m_hWnd)\n\t\t{\n\t\t\tif(m_nSinglePane == SPLIT_PANE_NONE)\n\t\t\t{\n\t\t\t\tif((m_nDefActivePane == SPLIT_PANE_LEFT) || (m_nDefActivePane == SPLIT_PANE_RIGHT))\n\t\t\t\t\t::SetFocus(m_hWndPane[m_nDefActivePane]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t::SetFocus(m_hWndPane[m_nSinglePane]);\n\t\t\t}\n\t\t}\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnMouseActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tLRESULT lRet = pT->DefWindowProc(uMsg, wParam, lParam);\n\t\tif((lRet == MA_ACTIVATE) || (lRet == MA_ACTIVATEANDEAT))\n\t\t{\n\t\t\tDWORD dwPos = ::GetMessagePos();\n\t\t\tPOINT pt = { GET_X_LPARAM(dwPos), GET_Y_LPARAM(dwPos) };\n\t\t\tpT->ScreenToClient(&pt);\n\t\t\tRECT rcPane = {};\n\t\t\tfor(int nPane = 0; nPane < m_nPanesCount; nPane++)\n\t\t\t{\n\t\t\t\tif(GetSplitterPaneRect(nPane, &rcPane) && (::PtInRect(&rcPane, pt) != FALSE))\n\t\t\t\t{\n\t\t\t\t\tm_nDefActivePane = nPane;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn lRet;\n\t}\n\n\tLRESULT OnSettingChange(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->GetSystemSettings(true);\n\n\t\treturn 0;\n\t}\n\n// Implementation - internal helpers\n\tvoid Init()\n\t{\n\t\tm_hCursor = ::LoadCursor(NULL, m_bVertical ? IDC_SIZEWE : IDC_SIZENS);\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->GetSystemSettings(false);\n\t}\n\n\tvoid UpdateSplitterLayout()\n\t{\n\t\tif((m_nSinglePane == SPLIT_PANE_NONE) && (m_xySplitterPos == -1))\n\t\t\treturn;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tRECT rect = {};\n\t\tif(m_nSinglePane == SPLIT_PANE_NONE)\n\t\t{\n\t\t\tif(GetSplitterBarRect(&rect))\n\t\t\t\tpT->InvalidateRect(&rect);\n\n\t\t\tfor(int nPane = 0; nPane < m_nPanesCount; nPane++)\n\t\t\t{\n\t\t\t\tif(GetSplitterPaneRect(nPane, &rect))\n\t\t\t\t{\n\t\t\t\t\tif(m_hWndPane[nPane] != NULL)\n\t\t\t\t\t\t::SetWindowPos(m_hWndPane[nPane], NULL, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER);\n\t\t\t\t\telse\n\t\t\t\t\t\tpT->InvalidateRect(&rect);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(GetSplitterPaneRect(m_nSinglePane, &rect))\n\t\t\t{\n\t\t\t\tif(m_hWndPane[m_nSinglePane] != NULL)\n\t\t\t\t\t::SetWindowPos(m_hWndPane[m_nSinglePane], NULL, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER);\n\t\t\t\telse\n\t\t\t\t\tpT->InvalidateRect(&rect);\n\t\t\t}\n\t\t}\n\t}\n\n\tbool GetSplitterBarRect(LPRECT lpRect) const\n\t{\n\t\tATLASSERT(lpRect != NULL);\n\t\tif((m_nSinglePane != SPLIT_PANE_NONE) || (m_xySplitterPos == -1))\n\t\t\treturn false;\n\n\t\tif(m_bVertical)\n\t\t{\n\t\t\tlpRect->left = m_rcSplitter.left + m_xySplitterPos;\n\t\t\tlpRect->top = m_rcSplitter.top;\n\t\t\tlpRect->right = m_rcSplitter.left + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge;\n\t\t\tlpRect->bottom = m_rcSplitter.bottom;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlpRect->left = m_rcSplitter.left;\n\t\t\tlpRect->top = m_rcSplitter.top + m_xySplitterPos;\n\t\t\tlpRect->right = m_rcSplitter.right;\n\t\t\tlpRect->bottom = m_rcSplitter.top + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tbool GetSplitterPaneRect(int nPane, LPRECT lpRect) const\n\t{\n\t\tATLASSERT((nPane == SPLIT_PANE_LEFT) || (nPane == SPLIT_PANE_RIGHT));\n\t\tATLASSERT(lpRect != NULL);\n\t\tbool bRet = true;\n\t\tif(m_nSinglePane != SPLIT_PANE_NONE)\n\t\t{\n\t\t\tif(nPane == m_nSinglePane)\n\t\t\t\t*lpRect = m_rcSplitter;\n\t\t\telse\n\t\t\t\tbRet = false;\n\t\t}\n\t\telse if(nPane == SPLIT_PANE_LEFT)\n\t\t{\n\t\t\tif(m_bVertical)\n\t\t\t{\n\t\t\t\tlpRect->left = m_rcSplitter.left;\n\t\t\t\tlpRect->top = m_rcSplitter.top;\n\t\t\t\tlpRect->right = m_rcSplitter.left + m_xySplitterPos;\n\t\t\t\tlpRect->bottom = m_rcSplitter.bottom;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlpRect->left = m_rcSplitter.left;\n\t\t\t\tlpRect->top = m_rcSplitter.top;\n\t\t\t\tlpRect->right = m_rcSplitter.right;\n\t\t\t\tlpRect->bottom = m_rcSplitter.top + m_xySplitterPos;\n\t\t\t}\n\t\t}\n\t\telse if(nPane == SPLIT_PANE_RIGHT)\n\t\t{\n\t\t\tif(m_bVertical)\n\t\t\t{\n\t\t\t\tlpRect->left = m_rcSplitter.left + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge;\n\t\t\t\tlpRect->top = m_rcSplitter.top;\n\t\t\t\tlpRect->right = m_rcSplitter.right;\n\t\t\t\tlpRect->bottom = m_rcSplitter.bottom;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlpRect->left = m_rcSplitter.left;\n\t\t\t\tlpRect->top = m_rcSplitter.top + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge;\n\t\t\t\tlpRect->right = m_rcSplitter.right;\n\t\t\t\tlpRect->bottom = m_rcSplitter.bottom;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tbRet = false;\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\tbool IsOverSplitterRect(int x, int y) const\n\t{\n\t\t// -1 == don't check\n\t\treturn (((x == -1) || ((x >= m_rcSplitter.left) && (x <= m_rcSplitter.right))) &&\n\t\t\t((y == -1) || ((y >= m_rcSplitter.top) && (y <= m_rcSplitter.bottom))));\n\t}\n\n\tbool IsOverSplitterBar(int x, int y) const\n\t{\n\t\tif(m_nSinglePane != SPLIT_PANE_NONE)\n\t\t\treturn false;\n\t\tif((m_xySplitterPos == -1) || !IsOverSplitterRect(x, y))\n\t\t\treturn false;\n\t\tint xy = m_bVertical ? x : y;\n\t\tint xyOff = m_bVertical ? m_rcSplitter.left : m_rcSplitter.top;\n\n\t\treturn ((xy >= (xyOff + m_xySplitterPos)) && (xy < (xyOff + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge)));\n\t}\n\n\tvoid DrawGhostBar()\n\t{\n\t\tRECT rect = {};\n\t\tif(GetSplitterBarRect(&rect))\n\t\t{\n\t\t\t// convert client to window coordinates\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tRECT rcWnd = {};\n\t\t\tpT->GetWindowRect(&rcWnd);\n\t\t\t::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rcWnd, 2);\n\t\t\t::OffsetRect(&rect, -rcWnd.left, -rcWnd.top);\n\n\t\t\t// invert the brush pattern (looks just like frame window sizing)\n\t\t\tCBrush brush(CDCHandle::GetHalftoneBrush());\n\t\t\tif(brush.m_hBrush != NULL)\n\t\t\t{\n\t\t\t\tCWindowDC dc(pT->m_hWnd);\n\t\t\t\tCBrushHandle brushOld = dc.SelectBrush(brush);\n\t\t\t\tdc.PatBlt(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, PATINVERT);\n\t\t\t\tdc.SelectBrush(brushOld);\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid GetSystemSettings(bool bUpdate)\n\t{\n\t\tif((m_dwExtendedStyle & SPLIT_FIXEDBARSIZE) == 0)\n\t\t{\n\t\t\tm_cxySplitBar = ::GetSystemMetrics(m_bVertical ? SM_CXSIZEFRAME : SM_CYSIZEFRAME);\n\t\t}\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tif((pT->GetExStyle() & WS_EX_CLIENTEDGE) != 0)\n\t\t{\n\t\t\tm_cxyBarEdge = 2 * ::GetSystemMetrics(m_bVertical ? SM_CXEDGE : SM_CYEDGE);\n\t\t\tm_cxyMin = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_cxyBarEdge = 0;\n\t\t\tm_cxyMin = 2 * ::GetSystemMetrics(m_bVertical ? SM_CXEDGE : SM_CYEDGE);\n\t\t}\n\n\t\t::SystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0, &m_bFullDrag, 0);\n\n\t\tif(bUpdate)\n\t\t\tUpdateSplitterLayout();\n\t}\n\n\tbool IsProportional() const\n\t{\n\t\treturn ((m_dwExtendedStyle & SPLIT_PROPORTIONAL) != 0);\n\t}\n\n\tvoid StoreProportionalPos()\n\t{\n\t\tint cxyTotal = m_bVertical ? (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) : (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge);\n\t\tif(cxyTotal > 0)\n\t\t\tm_nProportionalPos = ::MulDiv(m_xySplitterPos, m_nPropMax, cxyTotal);\n\t\telse\n\t\t\tm_nProportionalPos = 0;\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CSplitterImpl::StoreProportionalPos - %i\\n\"), m_nProportionalPos);\n\t}\n\n\tvoid UpdateProportionalPos()\n\t{\n\t\tint cxyTotal = m_bVertical ? (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) : (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge);\n\t\tif(cxyTotal > 0)\n\t\t{\n\t\t\tint xyNewPos = ::MulDiv(m_nProportionalPos, cxyTotal, m_nPropMax);\n\t\t\tm_bUpdateProportionalPos = false;\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->SetSplitterPos(xyNewPos, false);\n\t\t}\n\t}\n\n\tbool IsRightAligned() const\n\t{\n\t\treturn ((m_dwExtendedStyle & SPLIT_RIGHTALIGNED) != 0);\n\t}\n\n\tvoid StoreRightAlignPos()\n\t{\n\t\tint cxyTotal = m_bVertical ? (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) : (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge);\n\t\tif(cxyTotal > 0)\n\t\t\tm_nProportionalPos = cxyTotal - m_xySplitterPos;\n\t\telse\n\t\t\tm_nProportionalPos = 0;\n\t\tATLTRACE2(atlTraceUI, 0, _T(\"CSplitterImpl::StoreRightAlignPos - %i\\n\"), m_nProportionalPos);\n\t}\n\n\tvoid UpdateRightAlignPos()\n\t{\n\t\tint cxyTotal = m_bVertical ? (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) : (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge);\n\t\tif(cxyTotal > 0)\n\t\t{\n\t\t\tm_bUpdateProportionalPos = false;\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->SetSplitterPos(cxyTotal - m_nProportionalPos, false);\n\t\t}\n\t}\n\n\tbool IsInteractive() const\n\t{\n\t\treturn ((m_dwExtendedStyle & SPLIT_NONINTERACTIVE) == 0);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CSplitterWindowImpl - Implements a splitter window\n\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CSplitterWindowImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >, public CSplitterImpl< T >\n{\npublic:\n\tDECLARE_WND_CLASS_EX2(NULL, T, CS_DBLCLKS, COLOR_WINDOW)\n\n\tCSplitterWindowImpl(bool bVertical = true) : CSplitterImpl< T >(bVertical)\n\t{ }\n\n\tBOOL SubclassWindow(HWND hWnd)\n\t{\n\t\tBOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits >::SubclassWindow(hWnd);\n\t\tif(bRet != FALSE)\n\t\t{\n\t\t\tT* pT = static_cast<T*>(this);\n\t\t\tpT->Init();\n\n\t\t\tthis->SetSplitterRect();\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\tBEGIN_MSG_MAP(CSplitterWindowImpl)\n\t\tMESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\t\tCHAIN_MSG_MAP(CSplitterImpl< T >)\n\t\tFORWARD_NOTIFICATIONS()\n\tEND_MSG_MAP()\n\n\tLRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\t// handled, no background painting needed\n\t\treturn 1;\n\t}\n\n\tLRESULT OnSize(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(wParam != SIZE_MINIMIZED)\n\t\t\tthis->SetSplitterRect();\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CSplitterWindow/CHorSplitterWindow - Implements splitter windows to be used as is\n\ntemplate <bool t_bVertical = true>\nclass CSplitterWindowT : public CSplitterWindowImpl<CSplitterWindowT<t_bVertical> >\n{\npublic:\n\tDECLARE_WND_CLASS_EX2(_T(\"WTL_SplitterWindow\"), CSplitterWindowT<t_bVertical>, CS_DBLCLKS, COLOR_WINDOW)\n\n\tCSplitterWindowT() : CSplitterWindowImpl<CSplitterWindowT<t_bVertical> >(t_bVertical)\n\t{ }\n};\n\ntypedef CSplitterWindowT<true>    CSplitterWindow;\ntypedef CSplitterWindowT<false>   CHorSplitterWindow;\n\n} // namespace WTL\n\n#endif // __ATLSPLIT_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atltheme.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLTHEME_H__\n#define __ATLTHEME_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atltheme.h requires atlapp.h to be included first\n#endif\n\n#ifndef __ATLWIN_H__\n\t#error atltheme.h requires atlwin.h to be included first\n#endif\n\n#include <vssym32.h>\n\n// Note: To create an application that also runs on older versions of Windows,\n// use delay load of uxtheme.dll and ensure that no calls to the Theme API are\n// made if theming is not supported. It is enough to check if m_hTheme is NULL.\n// Example:\n//\tif(m_hTheme != NULL)\n//\t{\n//\t\tDrawThemeBackground(dc, BP_PUSHBUTTON, PBS_NORMAL, &rect, NULL);\n//\t\tDrawThemeText(dc, BP_PUSHBUTTON, PBS_NORMAL, L\"Button\", -1, DT_SINGLELINE | DT_CENTER | DT_VCENTER, 0, &rect);\n//\t}\n//\telse\n//\t{\n//\t\tdc.DrawFrameControl(&rect, DFC_BUTTON, DFCS_BUTTONPUSH);\n//\t\tdc.DrawText(_T(\"Button\"), -1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER);\n//\t}\n//\n// Delay load is NOT AUTOMATIC for VC++ 7, you have to link to delayimp.lib, \n// and add uxtheme.dll in the Linker.Input.Delay Loaded DLLs section of the \n// project properties.\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CTheme\n// CThemeImpl<T, TBase>\n//\n// CBufferedPaint\n// CBufferedPaintImpl<T>\n// CBufferedPaintWindowImpl<T, TBase, TWinTraits>\n// CBufferedAnimation\n// CBufferedAnimationImpl<T, TState>\n// CBufferedAnimationWindowImpl<T, TState, TBase, TWinTraits>\n//\n// Global functions:\n//   AtlDrawThemeClientEdge()\n\n\nnamespace WTL\n{\n\n///////////////////////////////////////////////////////////////////////////////\n// CTheme - wrapper for theme handle\n\nclass CTheme\n{\npublic:\n// Data members\n\tHTHEME m_hTheme;\n\tstatic int m_nIsThemingSupported;\n\n// Constructor\n\tCTheme(HTHEME hTheme = NULL) : m_hTheme(hTheme)\n\t{\n\t\tIsThemingSupported();\n\t}\n\n// Operators and helpers\n\tbool IsThemeNull() const\n\t{\n\t\treturn (m_hTheme == NULL);\n\t}\n\n\tCTheme& operator =(HTHEME hTheme)\n\t{\n\t\tm_hTheme = hTheme;\n\t\treturn *this;\n\t}\n\n\toperator HTHEME() const\n\t{\n\t\treturn m_hTheme;\n\t}\n\n\tvoid Attach(HTHEME hTheme)\n\t{\n\t\tm_hTheme = hTheme;\n\t}\n\n\tHTHEME Detach()\n\t{\n\t\tHTHEME hTheme = m_hTheme;\n\t\tm_hTheme = NULL;\n\t\treturn hTheme;\n\t}\n\n// Theme support helper\n\tstatic bool IsThemingSupported()\n\t{\n\t\tif(m_nIsThemingSupported == -1)\n\t\t{\n\t\t\tCStaticDataInitCriticalSectionLock lock;\n\t\t\tif(FAILED(lock.Lock()))\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CTheme::IsThemingSupported.\\n\"));\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif(m_nIsThemingSupported == -1)\n\t\t\t{\n\t\t\t\tHMODULE hThemeDLL = ::LoadLibrary(_T(\"uxtheme.dll\"));\n\t\t\t\tm_nIsThemingSupported = (hThemeDLL != NULL) ? 1 : 0;\n\t\t\t\tif(hThemeDLL != NULL)\n\t\t\t\t\t::FreeLibrary(hThemeDLL);\n\t\t\t}\n\n\t\t\tlock.Unlock();\n\t\t}\n\n\t\tATLASSERT(m_nIsThemingSupported != -1);\n\t\treturn (m_nIsThemingSupported == 1);\n\t}\n\n// Operations and theme properties\n\tHTHEME OpenThemeData(HWND hWnd, LPCWSTR pszClassList)\n\t{\n\t\tif(!IsThemingSupported())\n\t\t\treturn NULL;\n\n\t\tATLASSERT(m_hTheme == NULL);\n\t\tm_hTheme = ::OpenThemeData(hWnd, pszClassList);\n\t\treturn m_hTheme;\n\t}\n\n\tHRESULT CloseThemeData()\n\t{\n\t\tHRESULT hRet = S_FALSE;\n\t\tif(m_hTheme != NULL)\n\t\t{\n\t\t\thRet = ::CloseThemeData(m_hTheme);\n\t\t\tif(SUCCEEDED(hRet))\n\t\t\t\tm_hTheme = NULL;\n\t\t}\n\t\treturn hRet;\n\t}\n\n\tHRESULT DrawThemeBackground(HDC hDC, int nPartID, int nStateID, LPCRECT pRect, LPCRECT pClipRect = NULL)\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::DrawThemeBackground(m_hTheme, hDC, nPartID, nStateID, pRect, pClipRect);\n\t}\n\n// Missing in original uxtheme.h\n#ifdef DTBG_CLIPRECT\n\tHRESULT DrawThemeBackgroundEx(HDC hDC, int nPartID, int nStateID, LPCRECT pRect, const DTBGOPTS* pOptions = NULL)\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::DrawThemeBackgroundEx(m_hTheme, hDC, nPartID, nStateID, pRect, pOptions);\n\t}\n#endif // DTBG_CLIPRECT\n\n\tHRESULT DrawThemeText(HDC hDC, int nPartID, int nStateID, LPCWSTR pszText, int nCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, LPCRECT pRect)\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::DrawThemeText(m_hTheme, hDC, nPartID, nStateID, pszText, nCharCount, dwTextFlags, dwTextFlags2, pRect);\n\t}\n\n\tHRESULT GetThemeBackgroundContentRect(HDC hDC, int nPartID, int nStateID,  LPCRECT pBoundingRect, LPRECT pContentRect) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeBackgroundContentRect(m_hTheme, hDC, nPartID, nStateID,  pBoundingRect, pContentRect);\n\t}\n\n\tHRESULT GetThemeBackgroundExtent(HDC hDC, int nPartID, int nStateID, LPCRECT pContentRect, LPRECT pExtentRect) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeBackgroundExtent(m_hTheme, hDC, nPartID, nStateID, pContentRect, pExtentRect);\n\t}\n\n\tHRESULT GetThemePartSize(HDC hDC, int nPartID, int nStateID, LPCRECT pRect, enum THEMESIZE eSize, LPSIZE pSize) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemePartSize(m_hTheme, hDC, nPartID, nStateID, pRect, eSize, pSize);\n\t}\n\n\tHRESULT GetThemeTextExtent(HDC hDC, int nPartID, int nStateID, LPCWSTR pszText, int nCharCount, DWORD dwTextFlags, LPCRECT  pBoundingRect, LPRECT pExtentRect) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeTextExtent(m_hTheme, hDC, nPartID, nStateID, pszText, nCharCount, dwTextFlags, pBoundingRect, pExtentRect);\n\t}\n\n\tHRESULT GetThemeTextMetrics(HDC hDC, int nPartID, int nStateID, PTEXTMETRICW pTextMetric) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeTextMetrics(m_hTheme, hDC, nPartID, nStateID, pTextMetric);\n\t}\n\n\tHRESULT GetThemeBackgroundRegion(HDC hDC, int nPartID, int nStateID, LPCRECT pRect, HRGN* pRegion) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeBackgroundRegion(m_hTheme, hDC, nPartID, nStateID, pRect, pRegion);\n\t}\n\n\tHRESULT HitTestThemeBackground(HDC hDC, int nPartID, int nStateID, DWORD dwOptions, LPCRECT pRect, HRGN hrgn, POINT ptTest, WORD* pwHitTestCode) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::HitTestThemeBackground(m_hTheme, hDC, nPartID, nStateID, dwOptions, pRect, hrgn, ptTest, pwHitTestCode);\n\t}\n\n\tHRESULT DrawThemeEdge(HDC hDC, int nPartID, int nStateID, LPCRECT pDestRect, UINT uEdge, UINT uFlags, LPRECT pContentRect = NULL)\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::DrawThemeEdge(m_hTheme, hDC, nPartID, nStateID, pDestRect, uEdge, uFlags, pContentRect);\n\t}\n\n\tHRESULT DrawThemeIcon(HDC hDC, int nPartID, int nStateID, LPCRECT pRect, HIMAGELIST himl, int nImageIndex)\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::DrawThemeIcon(m_hTheme, hDC, nPartID, nStateID, pRect, himl, nImageIndex);\n\t}\n\n\tBOOL IsThemePartDefined(int nPartID, int nStateID) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::IsThemePartDefined(m_hTheme, nPartID, nStateID);\n\t}\n\n\tBOOL IsThemeBackgroundPartiallyTransparent(int nPartID, int nStateID) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::IsThemeBackgroundPartiallyTransparent(m_hTheme, nPartID, nStateID);\n\t}\n\n\tHRESULT GetThemeColor(int nPartID, int nStateID, int nPropID, COLORREF* pColor) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeColor(m_hTheme, nPartID, nStateID, nPropID, pColor);\n\t}\n\n\tHRESULT GetThemeMetric(HDC hDC, int nPartID, int nStateID, int nPropID, int* pnVal) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeMetric(m_hTheme, hDC, nPartID, nStateID, nPropID, pnVal);\n\t}\n\n\tHRESULT GetThemeString(int nPartID, int nStateID, int nPropID, LPWSTR pszBuff, int cchMaxBuffChars) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeString(m_hTheme, nPartID, nStateID, nPropID, pszBuff, cchMaxBuffChars);\n\t}\n\n\tHRESULT GetThemeBool(int nPartID, int nStateID, int nPropID, BOOL* pfVal) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeBool(m_hTheme, nPartID, nStateID, nPropID, pfVal);\n\t}\n\n\tHRESULT GetThemeInt(int nPartID, int nStateID, int nPropID, int* pnVal) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeInt(m_hTheme, nPartID, nStateID, nPropID, pnVal);\n\t}\n\n\tHRESULT GetThemeEnumValue(int nPartID, int nStateID, int nPropID, int* pnVal) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeEnumValue(m_hTheme, nPartID, nStateID, nPropID, pnVal);\n\t}\n\n\tHRESULT GetThemePosition(int nPartID, int nStateID, int nPropID, LPPOINT pPoint) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemePosition(m_hTheme, nPartID, nStateID, nPropID, pPoint);\n\t}\n\n\t// deprecated\n\tHRESULT GetThemeFont(int nPartID, HDC hDC, int nStateID, int nPropID, LOGFONTW* pFont) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeFont(m_hTheme, hDC, nPartID, nStateID, nPropID, pFont);\n\t}\n\n\tHRESULT GetThemeFont(HDC hDC, int nPartID, int nStateID, int nPropID, LOGFONTW* pFont) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeFont(m_hTheme, hDC, nPartID, nStateID, nPropID, pFont);\n\t}\n\n\tHRESULT GetThemeRect(int nPartID, int nStateID, int nPropID, LPRECT pRect) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeRect(m_hTheme, nPartID, nStateID, nPropID, pRect);\n\t}\n\n\tHRESULT GetThemeMargins(HDC hDC, int nPartID, int nStateID, int nPropID, LPRECT pRect, PMARGINS pMargins) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeMargins(m_hTheme, hDC, nPartID, nStateID, nPropID, pRect, pMargins);\n\t}\n\n\tHRESULT GetThemeIntList(int nPartID, int nStateID, int nPropID, INTLIST* pIntList) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeIntList(m_hTheme, nPartID, nStateID, nPropID, pIntList);\n\t}\n\n\tHRESULT GetThemePropertyOrigin(int nPartID, int nStateID, int nPropID, enum PROPERTYORIGIN* pOrigin) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemePropertyOrigin(m_hTheme, nPartID, nStateID, nPropID, pOrigin);\n\t}\n\n\tHRESULT GetThemeFilename(int nPartID, int nStateID, int nPropID, LPWSTR pszThemeFileName, int cchMaxBuffChars) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeFilename(m_hTheme, nPartID, nStateID, nPropID, pszThemeFileName, cchMaxBuffChars);\n\t}\n\n\tCOLORREF GetThemeSysColor(int nColorID) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeSysColor(m_hTheme, nColorID);\n\t}\n\n\tHBRUSH GetThemeSysColorBrush(int nColorID) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeSysColorBrush(m_hTheme, nColorID);\n\t}\n\n\tint GetThemeSysSize(int nSizeID) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeSysSize(m_hTheme, nSizeID);\n\t}\n\n\tBOOL GetThemeSysBool(int nBoolID) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeSysBool(m_hTheme, nBoolID);\n\t}\n\n\tHRESULT GetThemeSysFont(int nFontID, LOGFONTW* plf) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeSysFont(m_hTheme, nFontID, plf);\n\t}\n\n\tHRESULT GetThemeSysString(int nStringID, LPWSTR pszStringBuff, int cchMaxStringChars) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeSysString(m_hTheme, nStringID, pszStringBuff, cchMaxStringChars);\n\t}\n\n\tHRESULT GetThemeSysInt(int nIntID, int* pnValue) const\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeSysInt(m_hTheme, nIntID, pnValue);\n\t}\n\n\tHTHEME OpenThemeDataEx(HWND hWnd, LPCWSTR pszClassList, DWORD dwFlags)\n\t{\n\t\tif(!IsThemingSupported())\n\t\t\treturn NULL;\n\n\t\tATLASSERT(m_hTheme == NULL);\n\t\tm_hTheme = ::OpenThemeDataEx(hWnd, pszClassList, dwFlags);\n\t\treturn m_hTheme;\n\t}\n\n#if (_WIN32_WINNT >= 0x0600)\n\tHRESULT DrawThemeTextEx(HDC hDC, int nPartID, int nStateID, LPCWSTR pszText, int cchText, DWORD dwTextFlags, LPRECT lpRect, const DTTOPTS* pOptions)\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::DrawThemeTextEx(m_hTheme, hDC, nPartID, nStateID, pszText, cchText, dwTextFlags, lpRect, pOptions);\n\t}\n\n\tHRESULT GetThemeTransitionDuration(int nPartID, int nFromStateID, int nToStateID, int nPropID, DWORD& dwDuration)\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeTransitionDuration(m_hTheme, nPartID, nFromStateID, nToStateID, nPropID, &dwDuration);\n\t}\n#endif // (_WIN32_WINNT >= 0x0600)\n\n#if (_WIN32_WINNT >= 0x0600)\n\tHRESULT GetThemeBitmap(int nPartID, int nStateID, int nPropID, ULONG uFlags, HBITMAP& hBitmap)\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeBitmap(m_hTheme, nPartID, nStateID, nPropID, uFlags, &hBitmap);\n\t}\n\n\tHRESULT GetThemeStream(int nPartID, int nStateID, int nPropID, VOID** ppvStream, DWORD* pcbStream, HINSTANCE hInstance)\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeStream(m_hTheme, nPartID, nStateID, nPropID, ppvStream, pcbStream, hInstance);\n\t}\n#endif // (_WIN32_WINNT >= 0x0600)\n\n#if (_WIN32_WINNT >= 0x0602)\n\tHRESULT GetThemeAnimationProperty(int iStoryboardId, int iTargetId, TA_PROPERTY eProperty, VOID* pvProperty, DWORD cbSize, DWORD* pcbSizeOut)\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeAnimationProperty(m_hTheme, iStoryboardId, iTargetId, eProperty, pvProperty, cbSize, pcbSizeOut);\n\t}\n\n\tHRESULT GetThemeAnimationTransform(int iStoryboardId, int iTargetId, DWORD dwTransformIndex, TA_TRANSFORM* pTransform, DWORD cbSize, DWORD* pcbSizeOut)\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeAnimationTransform(m_hTheme, iStoryboardId, iTargetId, dwTransformIndex, pTransform, cbSize, pcbSizeOut);\n\t}\n\n\tHRESULT GetThemeTimingFunction(int iTimingFunctionId, TA_TIMINGFUNCTION* pTimingFunction, DWORD cbSize, DWORD* pcbSizeOut)\n\t{\n\t\tATLASSERT(m_hTheme != NULL);\n\t\treturn ::GetThemeTimingFunction(m_hTheme, iTimingFunctionId, pTimingFunction, cbSize, pcbSizeOut);\n\t}\n#endif // (_WIN32_WINNT >= 0x0602)\n};\n\n__declspec(selectany) int CTheme::m_nIsThemingSupported = -1;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CThemeImpl - theme support implementation\n\n// Derive from this class to implement window with theme support.\n// Example:\n//\tclass CMyThemeWindow : public CWindowImpl<CMyThemeWindow>, public CThemeImpl<CMyThemeWindow>\n//\t{\n//\t...\n//\t\tBEGIN_MSG_MAP(CMyThemeWindow)\n//\t\t\tCHAIN_MSG_MAP(CThemeImpl<CMyThemeWindow>)\n//\t\t\t...\n//\t\tEND_MSG_MAP()\n//\t...\n//\t};\n//\n// If you set theme class list, the class will automaticaly open/close/reopen theme data.\n\n\n// Helper for drawing theme client edge\ninline bool AtlDrawThemeClientEdge(HTHEME hTheme, HWND hWnd, HRGN hRgnUpdate = NULL, HBRUSH hBrush = NULL, int nPartID = 0, int nStateID = 0)\n{\n\tATLASSERT(hTheme != NULL);\n\tATLASSERT(::IsWindow(hWnd));\n\n\tCWindowDC dc(hWnd);\n\tif(dc.IsNull())\n\t\treturn false;\n\n\t// Get border size\n\tint cxBorder = ::GetSystemMetrics(SM_CXBORDER);\n\tint cyBorder = ::GetSystemMetrics(SM_CYBORDER);\n\tif(SUCCEEDED(::GetThemeInt(hTheme, nPartID, nStateID, TMT_SIZINGBORDERWIDTH, &cxBorder)))\n\t\tcyBorder = cxBorder;\n\n\tRECT rect = {};\n\t::GetWindowRect(hWnd, &rect);            \n\n\t// Remove the client edge from the update region\n\tint cxEdge = ::GetSystemMetrics(SM_CXEDGE);\n\tint cyEdge = ::GetSystemMetrics(SM_CYEDGE);\n\t::InflateRect(&rect, -cxEdge, -cyEdge);\n\tCRgn rgn;\n\trgn.CreateRectRgnIndirect(&rect);\n\tif(rgn.IsNull())\n\t\treturn false;\n\n\tif(hRgnUpdate != NULL)\n\t\trgn.CombineRgn(hRgnUpdate, rgn, RGN_AND);\n\n\t::OffsetRect(&rect, -rect.left, -rect.top);\n\n\t::OffsetRect(&rect, cxEdge, cyEdge);\n\tdc.ExcludeClipRect(&rect);\n\t::InflateRect(&rect, cxEdge, cyEdge);\n\n\t::DrawThemeBackground(hTheme, dc, nPartID, nStateID, &rect, NULL);\n\n\t// Use background brush too, since theme border might not cover everything\n\tif((cxBorder < cxEdge) && (cyBorder < cyEdge))\n\t{\n\t\tif(hBrush == NULL)\n\t\t\thBrush = (HBRUSH)::GetClassLongPtr(hWnd, GCLP_HBRBACKGROUND);\n\n\t\t::InflateRect(&rect, cxBorder - cxEdge, cyBorder - cyEdge);\n\t\tdc.FillRect(&rect, hBrush);\n\t}\n\n\t::DefWindowProc(hWnd, WM_NCPAINT, (WPARAM)rgn.m_hRgn, 0L);\n\n\treturn true;\n}\n\n\n// Theme extended styles\n#define THEME_EX_3DCLIENTEDGE\t\t0x00000001\n#define THEME_EX_THEMECLIENTEDGE\t0x00000002\n\ntemplate <class T, class TBase = CTheme>\nclass CThemeImpl : public TBase\n{\npublic:\n// Data members\n\tLPWSTR m_lpstrThemeClassList;\n\tDWORD m_dwExtendedStyle;   // theme specific extended styles\n\n// Constructor & destructor\n\tCThemeImpl() : m_lpstrThemeClassList(NULL), m_dwExtendedStyle(0)\n\t{ }\n\n\t~CThemeImpl()\n\t{\n\t\tdelete [] m_lpstrThemeClassList;\n\t}\n\n// Attributes\n\tbool SetThemeClassList(LPCWSTR lpstrThemeClassList)\n\t{\n\t\tif(m_lpstrThemeClassList != NULL)\n\t\t{\n\t\t\tdelete [] m_lpstrThemeClassList;\n\t\t\tm_lpstrThemeClassList = NULL;\n\t\t}\n\n\t\tif(lpstrThemeClassList == NULL)\n\t\t\treturn true;\n\n\t\tint cchLen = lstrlenW(lpstrThemeClassList) + 1;\n\t\tATLTRY(m_lpstrThemeClassList = new WCHAR[cchLen]);\n\t\tif(m_lpstrThemeClassList == NULL)\n\t\t\treturn false;\n\n\t\tATL::Checked::wcscpy_s(m_lpstrThemeClassList, cchLen, lpstrThemeClassList);\n\n\t\treturn true;\n\t}\n\n\tbool GetThemeClassList(LPWSTR lpstrThemeClassList, int cchListBuffer) const\n\t{\n\t\tint cchLen = lstrlenW(m_lpstrThemeClassList) + 1;\n\t\tif(cchListBuffer < cchLen)\n\t\t\treturn false;\n\n\t\tATL::Checked::wcscpy_s(lpstrThemeClassList, cchListBuffer, m_lpstrThemeClassList);\n\n\t\treturn true;\n\t}\n\n\tLPCWSTR GetThemeClassList() const\n\t{\n\t\treturn m_lpstrThemeClassList;\n\t}\n\n\tDWORD SetThemeExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\n\t{\n\t\tDWORD dwPrevStyle = m_dwExtendedStyle;\n\t\tif(dwMask == 0)\n\t\t\tm_dwExtendedStyle = dwExtendedStyle;\n\t\telse\n\t\t\tm_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\n\n\t\treturn dwPrevStyle;\n\t}\n\n\tDWORD GetThemeExtendedStyle() const\n\t{\n\t\treturn m_dwExtendedStyle;\n\t}\n\n// Operations\n\tHTHEME OpenThemeData()\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tATLASSERT(m_lpstrThemeClassList != NULL);\n\t\tif(m_lpstrThemeClassList == NULL)\n\t\t\treturn NULL;\n\t\tthis->CloseThemeData();\n\n\t\treturn TBase::OpenThemeData(pT->m_hWnd, m_lpstrThemeClassList);\n\t}\n\n\tHTHEME OpenThemeData(LPCWSTR pszClassList)\n\t{\n\t\tif(!SetThemeClassList(pszClassList))\n\t\t\treturn NULL;\n\n\t\treturn OpenThemeData();\n\t}\n\n\tHRESULT SetWindowTheme(LPCWSTR pszSubAppName, LPCWSTR pszSubIDList)\n\t{\n\t\tif(!this->IsThemingSupported())\n\t\t\treturn S_FALSE;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::SetWindowTheme(pT->m_hWnd, pszSubAppName, pszSubIDList);\n\t}\n\n\tHTHEME GetWindowTheme() const\n\t{\n\t\tif(!this->IsThemingSupported())\n\t\t\treturn NULL;\n\n\t\tconst T* pT = static_cast<const T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::GetWindowTheme(pT->m_hWnd);\n\t}\n\n\tHRESULT EnableThemeDialogTexture(DWORD dwFlags)\n\t{\n\t\tif(!this->IsThemingSupported())\n\t\t\treturn S_FALSE;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::EnableThemeDialogTexture(pT->m_hWnd, dwFlags);\n\t}\n\n\tBOOL IsThemeDialogTextureEnabled() const\n\t{\n\t\tif(!this->IsThemingSupported())\n\t\t\treturn FALSE;\n\n\t\tconst T* pT = static_cast<const T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::IsThemeDialogTextureEnabled(pT->m_hWnd);\n\t}\n\n\tHRESULT DrawThemeParentBackground(HDC hDC, const RECT* pRect = NULL)\n\t{\n\t\tif(!this->IsThemingSupported())\n\t\t\treturn S_FALSE;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::DrawThemeParentBackground(pT->m_hWnd, hDC, pRect);\n\t}\n\n#if (_WIN32_WINNT >= 0x0600)\n\tHRESULT SetWindowThemeAttribute(WINDOWTHEMEATTRIBUTETYPE type, PVOID pvAttribute, DWORD cbAttribute)\n\t{\n\t\tif(!this->IsThemingSupported())\n\t\t\treturn S_FALSE;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::SetWindowThemeAttribute(pT->m_hWnd, type, pvAttribute, cbAttribute);\n\t}\n\n\tHRESULT SetWindowThemeNonClientAttributes(DWORD dwAttributes, DWORD dwMask)\n\t{\n\t\tif(!this->IsThemingSupported())\n\t\t\treturn S_FALSE;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tWTA_OPTIONS opt = { dwAttributes, dwMask };\n\t\treturn ::SetWindowThemeAttribute(pT->m_hWnd, WTA_NONCLIENT, (PVOID)&opt, sizeof(opt));\n\t}\n\n\tHRESULT DrawThemeParentBackgroundEx(HDC hDC, DWORD dwFlags, const RECT* lpRect = NULL)\n\t{\n\t\tif(!this->IsThemingSupported())\n\t\t\treturn S_FALSE;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\treturn ::DrawThemeParentBackgroundEx(pT->m_hWnd, hDC, dwFlags, lpRect);\n\t}\n#endif // (_WIN32_WINNT >= 0x0600)\n\n// Message map and handlers\n\t// Note: If you handle any of these messages in your derived class,\n\t// it is better to put CHAIN_MSG_MAP at the start of your message map.\n\tBEGIN_MSG_MAP(CThemeImpl)\n\t\tMESSAGE_HANDLER(WM_CREATE, OnCreate)\n\t\tMESSAGE_HANDLER(WM_DESTROY, OnDestroy)\n\t\tMESSAGE_HANDLER(WM_THEMECHANGED, OnThemeChanged)\n\t\tMESSAGE_HANDLER(WM_NCPAINT, OnNcPaint)\n\tEND_MSG_MAP()\n\n\tLRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tif(m_lpstrThemeClassList != NULL)\n\t\t\tOpenThemeData();\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tthis->CloseThemeData();\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnThemeChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\n\t{\n\t\tthis->CloseThemeData();\n\t\tif(m_lpstrThemeClassList != NULL)\n\t\t\tthis->OpenThemeData();\n\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tLRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tATLASSERT(::IsWindow(pT->m_hWnd));\n\t\tLRESULT lRet = 0;\n\t\tbHandled = FALSE;\n\t\tif(this->IsThemingSupported() && ((pT->GetExStyle() & WS_EX_CLIENTEDGE) != 0))\n\t\t{\n\t\t\tif((m_dwExtendedStyle & THEME_EX_3DCLIENTEDGE) != 0)\n\t\t\t{\n\t\t\t\tlRet = ::DefWindowProc(pT->m_hWnd, uMsg, wParam, lParam);\n\t\t\t\tbHandled = TRUE;\n\t\t\t}\n\t\t\telse if((this->m_hTheme != NULL) && ((m_dwExtendedStyle & THEME_EX_THEMECLIENTEDGE) != 0))\n\t\t\t{\n\t\t\t\tHRGN hRgn = (wParam != 1) ? (HRGN)wParam : NULL;\n\t\t\t\tif(pT->DrawThemeClientEdge(hRgn))\n\t\t\t\t\tbHandled = TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn lRet;\n\t}\n\n// Drawing helper\n\tbool DrawThemeClientEdge(HRGN hRgnUpdate)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\treturn AtlDrawThemeClientEdge(this->m_hTheme, pT->m_hWnd, hRgnUpdate, NULL, 0, 0);\n\t}\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// Buffered Paint and Animation\n\n#if (_WIN32_WINNT >= 0x0600)\n\n///////////////////////////////////////////////////////////////////////////////\n// CBufferedPaintBase - Buffered Paint support for othe classes\n\nclass CBufferedPaintBase\n{\npublic:\n\tstatic int m_nIsBufferedPaintSupported;\n\n\tCBufferedPaintBase()\n\t{\n\t\tif(IsBufferedPaintSupported())\n\t\t\tATLVERIFY(SUCCEEDED(::BufferedPaintInit()));\n\t}\n\n\t~CBufferedPaintBase()\n\t{\n\t\tif(IsBufferedPaintSupported())\n\t\t\tATLVERIFY(SUCCEEDED(::BufferedPaintUnInit()));\n\t}\n\n\tstatic bool IsBufferedPaintSupported()\n\t{\n\t\tif(m_nIsBufferedPaintSupported == -1)\n\t\t{\n\t\t\tCStaticDataInitCriticalSectionLock lock;\n\t\t\tif(FAILED(lock.Lock()))\n\t\t\t{\n\t\t\t\tATLTRACE2(atlTraceUI, 0, _T(\"ERROR : Unable to lock critical section in CBufferedPaintBase::IsBufferedPaintSupported.\\n\"));\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif(m_nIsBufferedPaintSupported == -1)\n\t\t\t\tm_nIsBufferedPaintSupported = RunTimeHelper::IsVista() ? 1 : 0;\n\n\t\t\tlock.Unlock();\n\t\t}\n\n\t\tATLASSERT(m_nIsBufferedPaintSupported != -1);\n\t\treturn (m_nIsBufferedPaintSupported == 1);\n\t}\n};\n\n__declspec(selectany) int CBufferedPaintBase::m_nIsBufferedPaintSupported = -1;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CBufferedPaint - support for buffered paint functions\n\nclass CBufferedPaint\n{\npublic:\n\tHPAINTBUFFER m_hPaintBuffer;\n\n\tCBufferedPaint() : m_hPaintBuffer(NULL)\n\t{ }\n\n\t~CBufferedPaint()\n\t{\n\t\tATLVERIFY(SUCCEEDED(End()));\n\t}\n\n\tbool IsNull() const\n\t{\n\t\treturn (m_hPaintBuffer == NULL);\n\t}\n\n\tHPAINTBUFFER Begin(HDC hdcTarget, const RECT* prcTarget, BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS* pPaintParams, HDC* phdcPaint)\n\t{\n\t\tATLASSERT(m_hPaintBuffer == NULL);\n\t\tm_hPaintBuffer = ::BeginBufferedPaint(hdcTarget, prcTarget, dwFormat, pPaintParams, phdcPaint);\n\t\treturn m_hPaintBuffer;\n\t}\n\n\tHRESULT End(BOOL bUpdate = TRUE)\n\t{\n\t\tHRESULT hRet = S_FALSE;\n\t\tif(m_hPaintBuffer != NULL)\n\t\t{\n\t\t\thRet = ::EndBufferedPaint(m_hPaintBuffer, bUpdate);\n\t\t\tm_hPaintBuffer = NULL;\n\t\t}\n\t\treturn hRet;\n\t}\n\n\tHRESULT GetTargetRect(LPRECT pRect) const\n\t{\n\t\tATLASSERT(m_hPaintBuffer != NULL);\n\t\treturn ::GetBufferedPaintTargetRect(m_hPaintBuffer, pRect);\n\t}\n\n\tHDC GetTargetDC() const\n\t{\n\t\tATLASSERT(m_hPaintBuffer != NULL);\n\t\treturn ::GetBufferedPaintTargetDC(m_hPaintBuffer);\n\t}\n\n\tHDC GetPaintDC() const\n\t{\n\t\tATLASSERT(m_hPaintBuffer != NULL);\n\t\treturn ::GetBufferedPaintDC(m_hPaintBuffer);\n\t}\n\n\tHRESULT GetBits(RGBQUAD** ppbBuffer, int* pcxRow) const\n\t{\n\t\tATLASSERT(m_hPaintBuffer != NULL);\n\t\treturn ::GetBufferedPaintBits(m_hPaintBuffer, ppbBuffer, pcxRow);\n\t}\n\n\tHRESULT Clear(const RECT* pRect = NULL)\n\t{\n\t\tATLASSERT(m_hPaintBuffer != NULL);\n\t\treturn ::BufferedPaintClear(m_hPaintBuffer, pRect);\n\t}\n\n\tHRESULT SetAlpha(BYTE alpha, const RECT* pRect = NULL)\n\t{\n\t\tATLASSERT(m_hPaintBuffer != NULL);\n\t\treturn ::BufferedPaintSetAlpha(m_hPaintBuffer, pRect, alpha);\n\t}\n\n\tHRESULT MakeOpaque(const RECT* pRect = NULL)\n\t{\n\t\tATLASSERT(m_hPaintBuffer != NULL);\n\t\treturn ::BufferedPaintSetAlpha(m_hPaintBuffer, pRect, 255);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CBufferedPaintImpl - provides buffered paint for any window\n\ntemplate <class T>\nclass ATL_NO_VTABLE CBufferedPaintImpl : public CBufferedPaintBase\n{\npublic:\n\tCBufferedPaint m_BufferedPaint;\n\tBP_BUFFERFORMAT m_dwFormat;\n\tBP_PAINTPARAMS m_PaintParams;\n\n\tCBufferedPaintImpl() : m_dwFormat(BPBF_TOPDOWNDIB)\n\t{\n\t\tmemset(&m_PaintParams, 0, sizeof(BP_PAINTPARAMS));\n\t\tm_PaintParams.cbSize = sizeof(BP_PAINTPARAMS);\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CBufferedPaintImpl)\n\t\tMESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\n\t\tMESSAGE_HANDLER(WM_PAINT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\n\tEND_MSG_MAP()\n\n\tLRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn 1;   // no background needed\n\t}\n\n\tLRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(wParam != NULL)\n\t\t{\n\t\t\tRECT rect = {};\n\t\t\tpT->GetClientRect(&rect);\n\t\t\tpT->DoPaint((HDC)wParam, rect);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCPaintDC dc(pT->m_hWnd);\n\t\t\tpT->DoBufferedPaint(dc.m_hDC, dc.m_ps.rcPaint);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n// Overrideables\n\tvoid DoBufferedPaint(CDCHandle dc, RECT& rect)\n\t{\n\t\tHDC hDCPaint = NULL;\n\t\tif(IsBufferedPaintSupported())\n\t\t\tm_BufferedPaint.Begin(dc, &rect, m_dwFormat, &m_PaintParams, &hDCPaint);\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(hDCPaint != NULL)\n\t\t\tpT->DoPaint(hDCPaint, rect);\n\t\telse\n\t\t\tpT->DoPaint(dc.m_hDC, rect);\n\n\t\tif(IsBufferedPaintSupported())\n\t\t\tm_BufferedPaint.End();\n\t}\n\n\tvoid DoPaint(CDCHandle /*dc*/, RECT& /*rect*/)\n\t{\n\t\t// must be implemented in a derived class\n\t\tATLASSERT(FALSE);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CBufferedPaintWindowImpl - implements a window that uses buffered paint\n\ntemplate <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CBufferedPaintWindowImpl : \n\t\tpublic ATL::CWindowImpl<T, TBase, TWinTraits>, \n\t\tpublic CBufferedPaintImpl< T >\n{\npublic:\n\tBEGIN_MSG_MAP(CBufferedPaintWindowImpl)\n\t\tCHAIN_MSG_MAP(CBufferedPaintImpl< T >)\n\tEND_MSG_MAP()\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CBufferedAnimation - support for buffered animation\n\nclass CBufferedAnimation\n{\npublic:\n\tHANIMATIONBUFFER m_hAnimationBuffer;\n\n\tCBufferedAnimation() : m_hAnimationBuffer(NULL)\n\t{ }\n\n\t~CBufferedAnimation()\n\t{\n\t\tATLVERIFY(SUCCEEDED(End()));\n\t}\n\n\tbool IsNull() const\n\t{\n\t\treturn (m_hAnimationBuffer == NULL);\n\t}\n\n\tHANIMATIONBUFFER Begin(HWND hWnd, HDC hDCTarget, const RECT* pRectTarget, BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS* pPaintParams, BP_ANIMATIONPARAMS* pAnimationParams, HDC* phdcFrom, HDC* phdcTo)\n\t{\n\t\tATLASSERT(m_hAnimationBuffer == NULL);\n\t\tm_hAnimationBuffer = ::BeginBufferedAnimation(hWnd, hDCTarget, pRectTarget, dwFormat, pPaintParams, pAnimationParams, phdcFrom, phdcTo);\n\t\treturn m_hAnimationBuffer;\n\t}\n\n\tHRESULT End(BOOL bUpdate = TRUE)\n\t{\n\t\tHRESULT hRet = S_FALSE;\n\t\tif(m_hAnimationBuffer != NULL)\n\t\t{\n\t\t\thRet = ::EndBufferedAnimation(m_hAnimationBuffer, bUpdate);\n\t\t\tm_hAnimationBuffer = NULL;\n\t\t}\n\t\treturn hRet;\n\t}\n\n\tstatic bool IsRendering(HWND hWnd, HDC hDC)\n\t{\n\t\treturn (::BufferedPaintRenderAnimation(hWnd, hDC) != FALSE);\n\t}\n\n\tstatic HRESULT StopAllAnimations(HWND hWnd)\n\t{\n\t\treturn ::BufferedPaintStopAllAnimations(hWnd);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CBufferedAnimationImpl - provides buffered animation support for any window\n\n// Note: You can either use m_State and m_NewState to store the state information\n// for the animation change, or map your state to those data members. DoPaint()\n// should only rely on the state information that is passed to it.\n\ntemplate <class T, class TState = DWORD_PTR>\nclass ATL_NO_VTABLE CBufferedAnimationImpl : public CBufferedPaintBase\n{\npublic:\n\tBP_BUFFERFORMAT m_dwFormat;\n\tBP_PAINTPARAMS m_PaintParams;\n\tBP_ANIMATIONPARAMS m_AnimationParams;\n\n\tTState m_State;\n\tTState m_NewState;\n\n\tCBufferedAnimationImpl(TState InitialState) : m_dwFormat(BPBF_TOPDOWNDIB)\n\t{\n\t\tmemset(&m_PaintParams, 0, sizeof(BP_PAINTPARAMS));\n\t\tm_PaintParams.cbSize = sizeof(BP_PAINTPARAMS);\n\n\t\tmemset(&m_AnimationParams, 0, sizeof(BP_ANIMATIONPARAMS));\n\t\tm_AnimationParams.cbSize = sizeof(BP_ANIMATIONPARAMS);\n\t\tm_AnimationParams.style = BPAS_LINEAR;\n\t\tm_AnimationParams.dwDuration = 500;\n\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->SetState(InitialState);\n\t\tpT->SetNewState(InitialState);\n\t}\n\n\tDWORD GetDuration() const\n\t{\n\t\treturn m_AnimationParams.dwDuration;\n\t}\n\n\tvoid SetDuration(DWORD dwDuration)\n\t{\n\t\tm_AnimationParams.dwDuration = dwDuration;\n\t}\n\n\tvoid DoAnimation(TState NewState, const RECT* pRect = NULL)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tpT->SetNewState(NewState);\n\n\t\tpT->InvalidateRect(pRect, FALSE);\n\t\tpT->UpdateWindow();\n\n\t\tpT->SetState(NewState);\n\t}\n\n// Message map and handlers\n\tBEGIN_MSG_MAP(CBufferedAnimationImpl)\n\t\tMESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\n\t\tMESSAGE_HANDLER(WM_PAINT, OnPaint)\n\t\tMESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\n\tEND_MSG_MAP()\n\n\tLRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\treturn 1;   // no background needed\n\t}\n\n\tLRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(wParam != NULL)\n\t\t{\n\t\t\tRECT rect = {};\n\t\t\tpT->GetClientRect(&rect);\n\t\t\tpT->DoPaint((HDC)wParam, rect, m_NewState);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCPaintDC dc(pT->m_hWnd);\n\t\t\tpT->DoAnimationPaint(dc.m_hDC, dc.m_ps.rcPaint);\n\t\t}\n\n\t\treturn 0;\n\t}\n\n// Overrideables\n\tvoid SetState(TState State)\n\t{\n\t\tm_State = State;\n\t}\n\n\tvoid SetNewState(TState State)\n\t{\n\t\tm_NewState = State;\n\t}\n\n\tbool AreStatesEqual() const\n\t{\n\t\treturn (m_State == m_NewState);\n\t}\n\n\tvoid DoAnimationPaint(CDCHandle dc, RECT& rect)\n\t{\n\t\tT* pT = static_cast<T*>(this);\n\t\tif(IsBufferedPaintSupported() && CBufferedAnimation::IsRendering(pT->m_hWnd, dc))\n\t\t\treturn;\n\n\t\tDWORD dwDurationSave = m_AnimationParams.dwDuration;\n\t\tif(pT->AreStatesEqual())\n\t\t\tm_AnimationParams.dwDuration = 0;\n\n\t\tHDC hdcFrom = NULL, hdcTo = NULL;\n\t\tCBufferedAnimation ba;\n\t\tif(IsBufferedPaintSupported())\n\t\t\tba.Begin(pT->m_hWnd, dc, &rect, m_dwFormat, &m_PaintParams, &m_AnimationParams, &hdcFrom, &hdcTo);\n\n\t\tif(!ba.IsNull())\n\t\t{\n\t\t\tif(hdcFrom != NULL)\n\t\t\t\tpT->DoPaint(hdcFrom, rect, m_State);\n\n\t\t\tif (hdcTo != NULL)\n\t\t\t\tpT->DoPaint(hdcTo, rect, m_NewState);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpT->DoPaint(dc.m_hDC, rect, m_NewState);\n\t\t}\n\n\t\tm_AnimationParams.dwDuration = dwDurationSave;\n\t}\n\n\tvoid DoPaint(CDCHandle /*dc*/, RECT& /*rect*/, TState /*State*/)\n\t{\n\t\t// must be implemented in a derived class\n\t\tATLASSERT(FALSE);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CBufferedAnimationWindowImpl - implements a window that uses buffered animation\n\ntemplate <class T, class TState = DWORD_PTR, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\nclass ATL_NO_VTABLE CBufferedAnimationWindowImpl : \n\t\tpublic ATL::CWindowImpl<T, TBase, TWinTraits>, \n\t\tpublic CBufferedAnimationImpl< T, TState >\n{\npublic:\n\tCBufferedAnimationWindowImpl(TState InitialState) : CBufferedAnimationImpl< T, TState >(InitialState)\n\t{ }\n\n\ttypedef CBufferedAnimationImpl< T, TState >   _baseBufferedAnimation;\n\tBEGIN_MSG_MAP(CBufferedAnimationWindowImpl)\n\t\tCHAIN_MSG_MAP(_baseBufferedAnimation)\n\tEND_MSG_MAP()\n};\n\n#endif // (_WIN32_WINNT >= 0x0600)\n\n} // namespace WTL\n\n#endif // __ATLTHEME_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atluser.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLUSER_H__\n#define __ATLUSER_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atluser.h requires atlapp.h to be included first\n#endif\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CMenuItemInfo\n// CMenuT<t_bManaged>\n// CAcceleratorT<t_bManaged>\n// CIconT<t_bManaged>\n// CCursorT<t_bManaged>\n// CResource\n//\n// Global functions:\n//   AtlMessageBox()\n//\n//   AtlLoadAccelerators()\n//   AtlLoadMenu()\n//   AtlLoadBitmap()\n//   AtlLoadSysBitmap()\n//   AtlLoadCursor()\n//   AtlLoadSysCursor()\n//   AtlLoadIcon()\n//   AtlLoadSysIcon()\n//   AtlLoadBitmapImage()\n//   AtlLoadCursorImage()\n//   AtlLoadIconImage()\n//   AtlLoadSysBitmapImage()\n//   AtlLoadSysCursorImage()\n//   AtlLoadSysIconImage()\n//   AtlLoadString()\n\n\nnamespace WTL\n{\n\n///////////////////////////////////////////////////////////////////////////////\n// AtlMessageBox - accepts both memory and resource based strings\n\ninline int AtlMessageBox(HWND hWndOwner, ATL::_U_STRINGorID message, ATL::_U_STRINGorID title = (LPCTSTR)NULL, UINT uType = MB_OK | MB_ICONINFORMATION)\n{\n\tATLASSERT((hWndOwner == NULL) || ::IsWindow(hWndOwner));\n\n\tLPTSTR lpstrMessage = NULL;\n\tif(IS_INTRESOURCE(message.m_lpstr))\n\t{\n\t\tfor(int nLen = 256; ; nLen *= 2)\n\t\t{\n\t\t\tATLTRY(lpstrMessage = new TCHAR[nLen]);\n\t\t\tif(lpstrMessage == NULL)\n\t\t\t{\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tint nRes = ::LoadString(ModuleHelper::GetResourceInstance(), LOWORD(message.m_lpstr), lpstrMessage, nLen);\n\t\t\tif(nRes < nLen - 1)\n\t\t\t\tbreak;\n\t\t\tdelete [] lpstrMessage;\n\t\t\tlpstrMessage = NULL;\n\t\t}\n\n\t\tmessage.m_lpstr = lpstrMessage;\n\t}\n\n\tLPTSTR lpstrTitle = NULL;\n\tif(IS_INTRESOURCE(title.m_lpstr) && (LOWORD(title.m_lpstr) != 0))\n\t{\n\t\tfor(int nLen = 256; ; nLen *= 2)\n\t\t{\n\t\t\tATLTRY(lpstrTitle = new TCHAR[nLen]);\n\t\t\tif(lpstrTitle == NULL)\n\t\t\t{\n\t\t\t\tATLASSERT(FALSE);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tint nRes = ::LoadString(ModuleHelper::GetResourceInstance(), LOWORD(title.m_lpstr), lpstrTitle, nLen);\n\t\t\tif(nRes < nLen - 1)\n\t\t\t\tbreak;\n\t\t\tdelete [] lpstrTitle;\n\t\t\tlpstrTitle = NULL;\n\t\t}\n\n\t\ttitle.m_lpstr = lpstrTitle;\n\t}\n\n\tint nRet = ::MessageBox(hWndOwner, message.m_lpstr, title.m_lpstr, uType);\n\n\tdelete [] lpstrMessage;\n\tdelete [] lpstrTitle;\n\n\treturn nRet;\n}\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CMenu\n\nclass CMenuItemInfo : public MENUITEMINFO\n{\npublic:\n\tCMenuItemInfo()\n\t{\n\t\tmemset(this, 0, sizeof(MENUITEMINFO));\n\t\tcbSize = sizeof(MENUITEMINFO);\n\t}\n};\n\n\n// forward declarations\ntemplate <bool t_bManaged> class CMenuT;\ntypedef CMenuT<false>   CMenuHandle;\ntypedef CMenuT<true>    CMenu;\n\n\ntemplate <bool t_bManaged>\nclass CMenuT\n{\npublic:\n// Data members\n\tHMENU m_hMenu;\n\n// Constructor/destructor/operators\n\tCMenuT(HMENU hMenu = NULL) : m_hMenu(hMenu)\n\t{ }\n\n\t~CMenuT()\n\t{\n\t\tif(t_bManaged && (m_hMenu != NULL))\n\t\t\tDestroyMenu();\n\t}\n\n\tCMenuT<t_bManaged>& operator =(HMENU hMenu)\n\t{\n\t\tAttach(hMenu);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HMENU hMenuNew)\n\t{\n\t\tATLASSERT(::IsMenu(hMenuNew));\n\t\tif(t_bManaged && (m_hMenu != NULL) && (m_hMenu != hMenuNew))\n\t\t\t::DestroyMenu(m_hMenu);\n\t\tm_hMenu = hMenuNew;\n\t}\n\n\tHMENU Detach()\n\t{\n\t\tHMENU hMenu = m_hMenu;\n\t\tm_hMenu = NULL;\n\t\treturn hMenu;\n\t}\n\n\toperator HMENU() const { return m_hMenu; }\n\n\tbool IsNull() const { return (m_hMenu == NULL); }\n\n\tBOOL IsMenu() const\n\t{\n\t\treturn ::IsMenu(m_hMenu);\n\t}\n\n// Create/destroy methods\n\tBOOL CreateMenu()\n\t{\n\t\tATLASSERT(m_hMenu == NULL);\n\t\tm_hMenu = ::CreateMenu();\n\t\treturn (m_hMenu != NULL) ? TRUE : FALSE;\n\t}\n\n\tBOOL CreatePopupMenu()\n\t{\n\t\tATLASSERT(m_hMenu == NULL);\n\t\tm_hMenu = ::CreatePopupMenu();\n\t\treturn (m_hMenu != NULL) ? TRUE : FALSE;\n\t}\n\n\tBOOL LoadMenu(ATL::_U_STRINGorID menu)\n\t{\n\t\tATLASSERT(m_hMenu == NULL);\n\t\tm_hMenu = ::LoadMenu(ModuleHelper::GetResourceInstance(), menu.m_lpstr);\n\t\treturn (m_hMenu != NULL) ? TRUE : FALSE;\n\t}\n\n\tBOOL LoadMenuIndirect(const void* lpMenuTemplate)\n\t{\n\t\tATLASSERT(m_hMenu == NULL);\n\t\tm_hMenu = ::LoadMenuIndirect(lpMenuTemplate);\n\t\treturn (m_hMenu != NULL) ? TRUE : FALSE;\n\t}\n\n\tBOOL DestroyMenu()\n\t{\n\t\tif (m_hMenu == NULL)\n\t\t\treturn FALSE;\n\t\tBOOL bRet = ::DestroyMenu(m_hMenu);\n\t\tif(bRet)\n\t\t\tm_hMenu = NULL;\n\t\treturn bRet;\n\t}\n\n// Menu Operations\n\tBOOL DeleteMenu(UINT nPosition, UINT nFlags)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::DeleteMenu(m_hMenu, nPosition, nFlags);\n\t}\n\n\tBOOL TrackPopupMenu(UINT nFlags, int x, int y, HWND hWnd, LPCRECT lpRect = NULL)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\tx = _FixTrackMenuPopupX(x, y);\n\t\treturn ::TrackPopupMenu(m_hMenu, nFlags, x, y, 0, hWnd, lpRect);\n\t}\n\n\tBOOL TrackPopupMenuEx(UINT uFlags, int x, int y, HWND hWnd, LPTPMPARAMS lptpm = NULL)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\tx = _FixTrackMenuPopupX(x, y);\n\t\treturn ::TrackPopupMenuEx(m_hMenu, uFlags, x, y, hWnd, lptpm);\n\t}\n\n\t// helper that fixes popup menu X position when it's off-screen\n\tstatic int _FixTrackMenuPopupX(int x, int y)\n\t{\n\t\tPOINT pt = { x, y };\n\t\tHMONITOR hMonitor = ::MonitorFromPoint(pt, MONITOR_DEFAULTTONULL);\n\t\tif(hMonitor == NULL)\n\t\t{\n\t\t\tHMONITOR hMonitorNear = ::MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);\n\t\t\tif(hMonitorNear != NULL)\n\t\t\t{\n\t\t\t\tMONITORINFO mi = { sizeof(MONITORINFO) };\n\t\t\t\tif(::GetMonitorInfo(hMonitorNear, &mi) != FALSE)\n\t\t\t\t{\n\t\t\t\t\tif(x < mi.rcWork.left)\n\t\t\t\t\t\tx = mi.rcWork.left;\n\t\t\t\t\telse if(x > mi.rcWork.right)\n\t\t\t\t\t\tx = mi.rcWork.right;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn x;\n\t}\n\n\tBOOL GetMenuInfo(LPMENUINFO lpMenuInfo) const\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::GetMenuInfo(m_hMenu, lpMenuInfo);\n\t}\n\n\tBOOL SetMenuInfo(LPCMENUINFO lpMenuInfo)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::SetMenuInfo(m_hMenu, lpMenuInfo);\n\t}\n\n// Menu Item Operations\n\tBOOL AppendMenu(UINT nFlags, UINT_PTR nIDNewItem = 0, LPCTSTR lpszNewItem = NULL)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::AppendMenu(m_hMenu, nFlags, nIDNewItem, lpszNewItem);\n\t}\n\n\tBOOL AppendMenu(UINT nFlags, HMENU hSubMenu, LPCTSTR lpszNewItem)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\tATLASSERT(::IsMenu(hSubMenu));\n\t\treturn ::AppendMenu(m_hMenu, nFlags | MF_POPUP, (UINT_PTR)hSubMenu, lpszNewItem);\n\t}\n\n\tBOOL AppendMenu(UINT nFlags, UINT_PTR nIDNewItem, HBITMAP hBmp)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::AppendMenu(m_hMenu, nFlags | MF_BITMAP, nIDNewItem, (LPCTSTR)hBmp);\n\t}\n\n\tBOOL AppendMenu(UINT nFlags, HMENU hSubMenu, HBITMAP hBmp)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\tATLASSERT(::IsMenu(hSubMenu));\n\t\treturn ::AppendMenu(m_hMenu, nFlags | (MF_BITMAP | MF_POPUP), (UINT_PTR)hSubMenu, (LPCTSTR)hBmp);\n\t}\n\n\tUINT CheckMenuItem(UINT nIDCheckItem, UINT nCheck)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn (UINT)::CheckMenuItem(m_hMenu, nIDCheckItem, nCheck);\n\t}\n\n\tUINT EnableMenuItem(UINT nIDEnableItem, UINT nEnable)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::EnableMenuItem(m_hMenu, nIDEnableItem, nEnable);\n\t}\n\n\tBOOL HiliteMenuItem(HWND hWnd, UINT uIDHiliteItem, UINT uHilite)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::HiliteMenuItem(hWnd, m_hMenu, uIDHiliteItem, uHilite);\n\t}\n\n\tint GetMenuItemCount() const\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::GetMenuItemCount(m_hMenu);\n\t}\n\n\tUINT GetMenuItemID(int nPos) const\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::GetMenuItemID(m_hMenu, nPos);\n\t}\n\n\tUINT GetMenuState(UINT nID, UINT nFlags) const\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::GetMenuState(m_hMenu, nID, nFlags);\n\t}\n\n\tint GetMenuString(UINT nIDItem, LPTSTR lpString, int nMaxCount, UINT nFlags) const\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::GetMenuString(m_hMenu, nIDItem, lpString, nMaxCount, nFlags);\n\t}\n\n\tint GetMenuStringLen(UINT nIDItem, UINT nFlags) const\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::GetMenuString(m_hMenu, nIDItem, NULL, 0, nFlags);\n\t}\n\n\tBOOL GetMenuString(UINT nIDItem, BSTR& bstrText, UINT nFlags) const\n\t{\n\t\tUSES_CONVERSION;\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\tATLASSERT(bstrText == NULL);\n\n\t\tint nLen = GetMenuStringLen(nIDItem, nFlags);\n\t\tif(nLen == 0)\n\t\t{\n\t\t\tbstrText = ::SysAllocString(OLESTR(\"\"));\n\t\t\treturn (bstrText != NULL) ? TRUE : FALSE;\n\t\t}\n\n\t\tnLen++;   // increment to include terminating NULL char\n\t\tATL::CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\n\t\tLPTSTR lpszText = buff.Allocate(nLen);\n\t\tif(lpszText == NULL)\n\t\t\treturn FALSE;\n\n\t\tif(!GetMenuString(nIDItem, lpszText, nLen, nFlags))\n\t\t\treturn FALSE;\n\n\t\tbstrText = ::SysAllocString(T2OLE(lpszText));\n\t\treturn (bstrText != NULL) ? TRUE : FALSE;\n\t}\n\n#ifdef __ATLSTR_H__\n\tint GetMenuString(UINT nIDItem, ATL::CString& strText, UINT nFlags) const\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\n\t\tint nLen = GetMenuStringLen(nIDItem, nFlags);\n\t\tif(nLen == 0)\n\t\t\treturn 0;\n\n\t\tnLen++;   // increment to include terminating NULL char\n\t\tLPTSTR lpstr = strText.GetBufferSetLength(nLen);\n\t\tif(lpstr == NULL)\n\t\t\treturn 0;\n\t\tint nRet = GetMenuString(nIDItem, lpstr, nLen, nFlags);\n\t\tstrText.ReleaseBuffer();\n\t\treturn nRet;\n\t}\n#endif // __ATLSTR_H__\n\n\tCMenuHandle GetSubMenu(int nPos) const\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn CMenuHandle(::GetSubMenu(m_hMenu, nPos));\n\t}\n\n\tBOOL InsertMenu(UINT nPosition, UINT nFlags, UINT_PTR nIDNewItem = 0, LPCTSTR lpszNewItem = NULL)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::InsertMenu(m_hMenu, nPosition, nFlags, nIDNewItem, lpszNewItem);\n\t}\n\n\tBOOL InsertMenu(UINT nPosition, UINT nFlags, HMENU hSubMenu, LPCTSTR lpszNewItem)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\tATLASSERT(::IsMenu(hSubMenu));\n\t\treturn ::InsertMenu(m_hMenu, nPosition, nFlags | MF_POPUP, (UINT_PTR)hSubMenu, lpszNewItem);\n\t}\n\n\tBOOL InsertMenu(UINT nPosition, UINT nFlags, UINT_PTR nIDNewItem, HBITMAP hBmp)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::InsertMenu(m_hMenu, nPosition, nFlags | MF_BITMAP, nIDNewItem, (LPCTSTR)hBmp);\n\t}\n\n\tBOOL InsertMenu(UINT nPosition, UINT nFlags, HMENU hSubMenu, HBITMAP hBmp)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\tATLASSERT(::IsMenu(hSubMenu));\n\t\treturn ::InsertMenu(m_hMenu, nPosition, nFlags | (MF_BITMAP | MF_POPUP), (UINT_PTR)hSubMenu, (LPCTSTR)hBmp);\n\t}\n\n\tBOOL ModifyMenu(UINT nPosition, UINT nFlags, UINT_PTR nIDNewItem = 0, LPCTSTR lpszNewItem = NULL)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::ModifyMenu(m_hMenu, nPosition, nFlags, nIDNewItem, lpszNewItem);\n\t}\n\n\tBOOL ModifyMenu(UINT nPosition, UINT nFlags, HMENU hSubMenu, LPCTSTR lpszNewItem)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\tATLASSERT(::IsMenu(hSubMenu));\n\t\treturn ::ModifyMenu(m_hMenu, nPosition, nFlags | MF_POPUP, (UINT_PTR)hSubMenu, lpszNewItem);\n\t}\n\n\tBOOL ModifyMenu(UINT nPosition, UINT nFlags, UINT_PTR nIDNewItem, HBITMAP hBmp)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::ModifyMenu(m_hMenu, nPosition, nFlags | MF_BITMAP, nIDNewItem, (LPCTSTR)hBmp);\n\t}\n\n\tBOOL ModifyMenu(UINT nPosition, UINT nFlags, HMENU hSubMenu, HBITMAP hBmp)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\tATLASSERT(::IsMenu(hSubMenu));\n\t\treturn ::ModifyMenu(m_hMenu, nPosition, nFlags | (MF_BITMAP | MF_POPUP), (UINT_PTR)hSubMenu, (LPCTSTR)hBmp);\n\t}\n\n\tBOOL RemoveMenu(UINT nPosition, UINT nFlags)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::RemoveMenu(m_hMenu, nPosition, nFlags);\n\t}\n\n\tBOOL SetMenuItemBitmaps(UINT nPosition, UINT nFlags, HBITMAP hBmpUnchecked, HBITMAP hBmpChecked)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::SetMenuItemBitmaps(m_hMenu, nPosition, nFlags, hBmpUnchecked, hBmpChecked);\n\t}\n\n\tBOOL CheckMenuRadioItem(UINT nIDFirst, UINT nIDLast, UINT nIDItem, UINT nFlags)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::CheckMenuRadioItem(m_hMenu, nIDFirst, nIDLast, nIDItem, nFlags);\n\t}\n\n\tBOOL GetMenuItemInfo(UINT uItem, BOOL bByPosition, LPMENUITEMINFO lpmii) const\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn (BOOL)::GetMenuItemInfo(m_hMenu, uItem, bByPosition, lpmii);\n\t}\n\n\tBOOL SetMenuItemInfo(UINT uItem, BOOL bByPosition, LPMENUITEMINFO lpmii)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn (BOOL)::SetMenuItemInfo(m_hMenu, uItem, bByPosition, lpmii);\n\t}\n\n\tBOOL InsertMenuItem(UINT uItem, BOOL bByPosition, LPMENUITEMINFO lpmii)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn (BOOL)::InsertMenuItem(m_hMenu, uItem, bByPosition, lpmii);\n\t}\n\n\tUINT GetMenuDefaultItem(BOOL bByPosition = FALSE, UINT uFlags = 0U) const\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::GetMenuDefaultItem(m_hMenu, (UINT)bByPosition, uFlags);\n\t}\n\n\tBOOL SetMenuDefaultItem(UINT uItem = (UINT)-1,  BOOL bByPosition = FALSE)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::SetMenuDefaultItem(m_hMenu, uItem, (UINT)bByPosition);\n\t}\n\n\tBOOL GetMenuItemRect(HWND hWnd, UINT uItem, LPRECT lprcItem) const\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::GetMenuItemRect(hWnd, m_hMenu, uItem, lprcItem);\n\t}\n\n\tint MenuItemFromPoint(HWND hWnd, POINT point) const\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::MenuItemFromPoint(hWnd, m_hMenu, point);\n\t}\n\n// Context Help Functions\n\tBOOL SetMenuContextHelpId(DWORD dwContextHelpId)\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::SetMenuContextHelpId(m_hMenu, dwContextHelpId);\n\t}\n\n\tDWORD GetMenuContextHelpId() const\n\t{\n\t\tATLASSERT(::IsMenu(m_hMenu));\n\t\treturn ::GetMenuContextHelpId(m_hMenu);\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CAccelerator\n\ntemplate <bool t_bManaged>\nclass CAcceleratorT\n{\npublic:\n\tHACCEL m_hAccel;\n\n// Constructor/destructor/operators\n\tCAcceleratorT(HACCEL hAccel = NULL) : m_hAccel(hAccel)\n\t{ }\n\n\t~CAcceleratorT()\n\t{\n\t\tif(t_bManaged && (m_hAccel != NULL))\n\t\t\t::DestroyAcceleratorTable(m_hAccel);\n\t}\n\n\tCAcceleratorT<t_bManaged>& operator =(HACCEL hAccel)\n\t{\n\t\tAttach(hAccel);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HACCEL hAccel)\n\t{\n\t\tif(t_bManaged && (m_hAccel != NULL))\n\t\t\t::DestroyAcceleratorTable(m_hAccel);\n\t\tm_hAccel = hAccel;\n\t}\n\n\tHACCEL Detach()\n\t{\n\t\tHACCEL hAccel = m_hAccel;\n\t\tm_hAccel = NULL;\n\t\treturn hAccel;\n\t}\n\n\toperator HACCEL() const { return m_hAccel; }\n\n\tbool IsNull() const { return m_hAccel == NULL; }\n\n// Create/destroy methods\n\tHACCEL LoadAccelerators(ATL::_U_STRINGorID accel)\n\t{\n\t\tATLASSERT(m_hAccel == NULL);\n\t\tm_hAccel = ::LoadAccelerators(ModuleHelper::GetResourceInstance(), accel.m_lpstr);\n\t\treturn m_hAccel;\n\t}\n\n\tHACCEL CreateAcceleratorTable(LPACCEL pAccel, int cEntries)\n\t{\n\t\tATLASSERT(m_hAccel == NULL);\n\t\tATLASSERT(pAccel != NULL);\n\t\tm_hAccel = ::CreateAcceleratorTable(pAccel, cEntries);\n\t\treturn m_hAccel;\n\t}\n\n\tvoid DestroyObject()\n\t{\n\t\tif(m_hAccel != NULL)\n\t\t{\n\t\t\t::DestroyAcceleratorTable(m_hAccel);\n\t\t\tm_hAccel = NULL;\n\t\t}\n\t}\n\n// Operations\n\tint CopyAcceleratorTable(LPACCEL lpAccelDst, int cEntries)\n\t{\n\t\tATLASSERT(m_hAccel != NULL);\n\t\tATLASSERT(lpAccelDst != NULL);\n\t\treturn ::CopyAcceleratorTable(m_hAccel, lpAccelDst, cEntries);\n\t}\n\n\tint GetEntriesCount() const\n\t{\n\t\tATLASSERT(m_hAccel != NULL);\n\t\treturn ::CopyAcceleratorTable(m_hAccel, NULL, 0);\n\t}\n\n\tBOOL TranslateAccelerator(HWND hWnd, LPMSG pMsg)\n\t{\n\t\tATLASSERT(m_hAccel != NULL);\n\t\tATLASSERT(::IsWindow(hWnd));\n\t\tATLASSERT(pMsg != NULL);\n\t\treturn ::TranslateAccelerator(hWnd, m_hAccel, pMsg);\n\t}\n};\n\ntypedef CAcceleratorT<false>   CAcceleratorHandle;\ntypedef CAcceleratorT<true>    CAccelerator;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CIcon\n\ntemplate <bool t_bManaged>\nclass CIconT\n{\npublic:\n\tHICON m_hIcon;\n\n// Constructor/destructor/operators\n\tCIconT(HICON hIcon = NULL) : m_hIcon(hIcon)\n\t{ }\n\n\t~CIconT()\n\t{\n\t\tif(t_bManaged && (m_hIcon != NULL))\n\t\t\t::DestroyIcon(m_hIcon);\n\t}\n\n\tCIconT<t_bManaged>& operator =(HICON hIcon)\n\t{\n\t\tAttach(hIcon);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HICON hIcon)\n\t{\n\t\tif(t_bManaged && (m_hIcon != NULL))\n\t\t\t::DestroyIcon(m_hIcon);\n\t\tm_hIcon = hIcon;\n\t}\n\n\tHICON Detach()\n\t{\n\t\tHICON hIcon = m_hIcon;\n\t\tm_hIcon = NULL;\n\t\treturn hIcon;\n\t}\n\n\toperator HICON() const { return m_hIcon; }\n\n\tbool IsNull() const { return m_hIcon == NULL; }\n\n// Create/destroy methods\n\tHICON LoadIcon(ATL::_U_STRINGorID icon)\n\t{\n\t\tATLASSERT(m_hIcon == NULL);\n\t\tm_hIcon = ::LoadIcon(ModuleHelper::GetResourceInstance(), icon.m_lpstr);\n\t\treturn m_hIcon;\n\t}\n\n\tHICON LoadIcon(ATL::_U_STRINGorID icon, int cxDesired, int cyDesired, UINT fuLoad = 0)\n\t{\n\t\tATLASSERT(m_hIcon == NULL);\n\t\tm_hIcon = (HICON) ::LoadImage(ModuleHelper::GetResourceInstance(), icon.m_lpstr, IMAGE_ICON, cxDesired, cyDesired, fuLoad);\n\t\treturn m_hIcon;\n\t}\n\n\tHICON LoadOEMIcon(LPCTSTR lpstrIconName)\n\t{\n\t\tATLASSERT(m_hIcon == NULL);\n\t\tATLASSERT(IsOEMIcon(lpstrIconName));\n\t\tm_hIcon = ::LoadIcon(NULL, lpstrIconName);\n\t\treturn m_hIcon;\n\t}\n\n\tHICON CreateIcon(int nWidth, int nHeight, BYTE cPlanes, BYTE cBitsPixel, CONST BYTE* lpbANDbits, CONST BYTE *lpbXORbits)\n\t{\n\t\tATLASSERT(m_hIcon == NULL);\n\t\tATLASSERT(lpbANDbits != NULL);\n\t\tATLASSERT(lpbXORbits != NULL);\n\t\tm_hIcon = ::CreateIcon(ModuleHelper::GetResourceInstance(), nWidth, nHeight, cPlanes, cBitsPixel, lpbANDbits, lpbXORbits);\n\t\treturn m_hIcon;\n\t}\n\n\tHICON CreateIconFromResource(PBYTE pBits, DWORD dwResSize, DWORD dwVersion = 0x00030000)\n\t{\n\t\tATLASSERT(m_hIcon == NULL);\n\t\tATLASSERT(pBits != NULL);\n\t\tm_hIcon = ::CreateIconFromResource(pBits, dwResSize, TRUE, dwVersion);\n\t\treturn m_hIcon;\n\t}\n\n\tHICON CreateIconFromResourceEx(PBYTE pbBits, DWORD cbBits, DWORD dwVersion = 0x00030000, int cxDesired = 0, int cyDesired = 0, UINT uFlags = LR_DEFAULTCOLOR)\n\t{\n\t\tATLASSERT(m_hIcon == NULL);\n\t\tATLASSERT(pbBits != NULL);\n\t\tATLASSERT(cbBits > 0);\n\t\tm_hIcon = ::CreateIconFromResourceEx(pbBits, cbBits, TRUE, dwVersion, cxDesired, cyDesired, uFlags);\n\t\treturn m_hIcon;\n\t}\n\n\tHICON CreateIconIndirect(PICONINFO pIconInfo)\n\t{\n\t\tATLASSERT(m_hIcon == NULL);\n\t\tATLASSERT(pIconInfo != NULL);\n\t\tm_hIcon = ::CreateIconIndirect(pIconInfo);\n\t\treturn m_hIcon;\n\t}\n\n\tHICON ExtractIcon(LPCTSTR lpszExeFileName, UINT nIconIndex)\n\t{\n\t\tATLASSERT(m_hIcon == NULL);\n\t\tATLASSERT(lpszExeFileName != NULL);\n\t\tm_hIcon = ::ExtractIcon(ModuleHelper::GetModuleInstance(), lpszExeFileName, nIconIndex);\n\t\treturn m_hIcon;\n\t}\n\n\tHICON ExtractAssociatedIcon(HINSTANCE hInst, LPTSTR lpIconPath, LPWORD lpiIcon)\n\t{\n\t\tATLASSERT(m_hIcon == NULL);\n\t\tATLASSERT(lpIconPath != NULL);\n\t\tATLASSERT(lpiIcon != NULL);\n\t\tm_hIcon = ::ExtractAssociatedIcon(hInst, lpIconPath, lpiIcon);\n\t\treturn m_hIcon;\n\t}\n\n\tBOOL DestroyIcon()\n\t{\n\t\tATLASSERT(m_hIcon != NULL);\n\t\tBOOL bRet = ::DestroyIcon(m_hIcon);\n\t\tif(bRet != FALSE)\n\t\t\tm_hIcon = NULL;\n\t\treturn bRet;\n\t}\n\n// Operations\n\tHICON CopyIcon()\n\t{\n\t\tATLASSERT(m_hIcon != NULL);\n\t\treturn ::CopyIcon(m_hIcon);\n\t}\n\n\tHICON DuplicateIcon()\n\t{\n\t\tATLASSERT(m_hIcon != NULL);\n\t\treturn ::DuplicateIcon(NULL, m_hIcon);\n\t}\n\n\tBOOL DrawIcon(HDC hDC, int x, int y)\n\t{\n\t\tATLASSERT(m_hIcon != NULL);\n\t\treturn ::DrawIcon(hDC, x, y, m_hIcon);\n\t}\n\n\tBOOL DrawIcon(HDC hDC, POINT pt)\n\t{\n\t\tATLASSERT(m_hIcon != NULL);\n\t\treturn ::DrawIcon(hDC, pt.x, pt.y, m_hIcon);\n\t}\n\n\tBOOL DrawIconEx(HDC hDC, int x, int y, int cxWidth, int cyWidth, UINT uStepIfAniCur = 0, HBRUSH hbrFlickerFreeDraw = NULL, UINT uFlags = DI_NORMAL)\n\t{\n\t\tATLASSERT(m_hIcon != NULL);\n\t\treturn ::DrawIconEx(hDC, x, y, m_hIcon, cxWidth, cyWidth, uStepIfAniCur, hbrFlickerFreeDraw, uFlags);\n\t}\n\n\tBOOL DrawIconEx(HDC hDC, POINT pt, SIZE size, UINT uStepIfAniCur = 0, HBRUSH hbrFlickerFreeDraw = NULL, UINT uFlags = DI_NORMAL)\n\t{\n\t\tATLASSERT(m_hIcon != NULL);\n\t\treturn ::DrawIconEx(hDC, pt.x, pt.y, m_hIcon, size.cx, size.cy, uStepIfAniCur, hbrFlickerFreeDraw, uFlags);\n\t}\n\n\tBOOL GetIconInfo(PICONINFO pIconInfo) const\n\t{\n\t\tATLASSERT(m_hIcon != NULL);\n\t\tATLASSERT(pIconInfo != NULL);\n\t\treturn ::GetIconInfo(m_hIcon, pIconInfo);\n\t}\n\n#if (_WIN32_WINNT >= 0x0600)\n\tBOOL GetIconInfoEx(PICONINFOEX pIconInfo) const\n\t{\n\t\tATLASSERT(m_hIcon != NULL);\n\t\tATLASSERT(pIconInfo != NULL);\n\t\treturn ::GetIconInfoEx(m_hIcon, pIconInfo);\n\t}\n#endif // (_WIN32_WINNT >= 0x0600)\n\n#if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\n\tHRESULT LoadIconMetric(ATL::_U_STRINGorID icon, int lims)\n\t{\n\t\tATLASSERT(m_hIcon == NULL);\n\t\tUSES_CONVERSION;\n\t\treturn ::LoadIconMetric(ModuleHelper::GetResourceInstance(), T2CW(icon.m_lpstr), lims, &m_hIcon);\n\t}\n\n\tHRESULT LoadIconWithScaleDown(ATL::_U_STRINGorID icon, int cx, int cy)\n\t{\n\t\tATLASSERT(m_hIcon == NULL);\n\t\tUSES_CONVERSION;\n\t\treturn ::LoadIconWithScaleDown(ModuleHelper::GetResourceInstance(), T2CW(icon.m_lpstr), cx, cy, &m_hIcon);\n\t}\n\n\tHRESULT LoadOEMIconMetric(LPCTSTR lpstrIconName, int lims)\n\t{\n\t\tATLASSERT(m_hIcon == NULL);\n\t\tATLASSERT(IsOEMIcon(lpstrIconName));\n\t\treturn ::LoadIconMetric(NULL, (LPCWSTR)lpstrIconName, lims, &m_hIcon);\n\t}\n\n\tHRESULT LoadOEMIconWithScaleDown(LPCTSTR lpstrIconName, int cx, int cy)\n\t{\n\t\tATLASSERT(m_hIcon == NULL);\n\t\tATLASSERT(IsOEMIcon(lpstrIconName));\n\t\tUSES_CONVERSION;\n\t\treturn ::LoadIconWithScaleDown(NULL, (LPCWSTR)lpstrIconName, cx, cy, &m_hIcon);\n\t}\n#endif // defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\n\n\t// Helper\n\tstatic bool IsOEMIcon(LPCTSTR lpstrIconName)\n\t{\n#if (WINVER >= 0x0600)\n\t\treturn ((lpstrIconName == IDI_APPLICATION) || (lpstrIconName == IDI_ASTERISK) || (lpstrIconName == IDI_EXCLAMATION) ||\n\t\t          (lpstrIconName == IDI_HAND) || (lpstrIconName == IDI_QUESTION) || (lpstrIconName == IDI_WINLOGO) ||\n\t\t          (lpstrIconName == IDI_SHIELD));\n#else // !(WINVER >= 0x0600)\n\t\treturn ((lpstrIconName == IDI_APPLICATION) || (lpstrIconName == IDI_ASTERISK) || (lpstrIconName == IDI_EXCLAMATION) ||\n\t\t          (lpstrIconName == IDI_HAND) || (lpstrIconName == IDI_QUESTION) || (lpstrIconName == IDI_WINLOGO));\n#endif // !(WINVER >= 0x0600)\n\t}\n};\n\ntypedef CIconT<false>   CIconHandle;\ntypedef CIconT<true>    CIcon;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CCursor\n\n// protect template member from a winuser.h macro\n#ifdef CopyCursor\n  #undef CopyCursor\n#endif\n\ntemplate <bool t_bManaged>\nclass CCursorT\n{\npublic:\n\tHCURSOR m_hCursor;\n\n// Constructor/destructor/operators\n\tCCursorT(HCURSOR hCursor = NULL) : m_hCursor(hCursor)\n\t{ }\n\n\t~CCursorT()\n\t{\n\t\tif(t_bManaged && (m_hCursor != NULL))\n\t\t\tDestroyCursor();\n\t}\n\n\tCCursorT<t_bManaged>& operator =(HCURSOR hCursor)\n\t{\n\t\tAttach(hCursor);\n\t\treturn *this;\n\t}\n\n\tvoid Attach(HCURSOR hCursor)\n\t{\n\t\tif(t_bManaged && (m_hCursor != NULL))\n\t\t\tDestroyCursor();\n\t\tm_hCursor = hCursor;\n\t}\n\n\tHCURSOR Detach()\n\t{\n\t\tHCURSOR hCursor = m_hCursor;\n\t\tm_hCursor = NULL;\n\t\treturn hCursor;\n\t}\n\n\toperator HCURSOR() const { return m_hCursor; }\n\n\tbool IsNull() const { return m_hCursor == NULL; }\n\n// Create/destroy methods\n\tHCURSOR LoadCursor(ATL::_U_STRINGorID cursor)\n\t{\n\t\tATLASSERT(m_hCursor == NULL);\n\t\tm_hCursor = ::LoadCursor(ModuleHelper::GetResourceInstance(), cursor.m_lpstr);\n\t\treturn m_hCursor;\n\t}\n\n\tHCURSOR LoadSysCursor(LPCTSTR lpstrCursorName)\n\t{\n\t\tATLASSERT(m_hCursor == NULL);\n\t\tATLASSERT((lpstrCursorName == IDC_ARROW) || (lpstrCursorName == IDC_IBEAM) || (lpstrCursorName == IDC_WAIT) ||\n\t\t\t(lpstrCursorName == IDC_CROSS) || (lpstrCursorName == IDC_UPARROW) || (lpstrCursorName == IDC_SIZE) ||\n\t\t\t(lpstrCursorName == IDC_ICON) || (lpstrCursorName == IDC_SIZENWSE) || (lpstrCursorName == IDC_SIZENESW) ||\n\t\t\t(lpstrCursorName == IDC_SIZEWE) || (lpstrCursorName == IDC_SIZENS) || (lpstrCursorName == IDC_SIZEALL) ||\n\t\t\t(lpstrCursorName == IDC_NO) || (lpstrCursorName == IDC_APPSTARTING) || (lpstrCursorName == IDC_HELP) ||\n\t\t\t(lpstrCursorName == IDC_HAND));\n\t\tm_hCursor = ::LoadCursor(NULL, lpstrCursorName);\n\t\treturn m_hCursor;\n\t}\n\n\t// deprecated\n\tHCURSOR LoadOEMCursor(LPCTSTR lpstrCursorName)\n\t{\n\t\treturn LoadSysCursor(lpstrCursorName);\n\t}\n\n\tHCURSOR LoadCursor(ATL::_U_STRINGorID cursor, int cxDesired, int cyDesired, UINT fuLoad = 0)\n\t{\n\t\tATLASSERT(m_hCursor == NULL);\n\t\tm_hCursor = (HCURSOR) ::LoadImage(ModuleHelper::GetResourceInstance(), cursor.m_lpstr, IMAGE_CURSOR, cxDesired, cyDesired, fuLoad);\n\t\treturn m_hCursor;\n\t}\n\n\tHCURSOR LoadCursorFromFile(LPCTSTR pstrFilename)\n\t{\n\t\tATLASSERT(m_hCursor == NULL);\n\t\tATLASSERT(pstrFilename != NULL);\n\t\tm_hCursor = ::LoadCursorFromFile(pstrFilename);\n\t\treturn m_hCursor;\n\t}\n\n\tHCURSOR CreateCursor(int xHotSpot, int yHotSpot, int nWidth, int nHeight, CONST VOID *pvANDPlane, CONST VOID *pvXORPlane)\n\t{\n\t\tATLASSERT(m_hCursor == NULL);\n\t\tm_hCursor = ::CreateCursor(ModuleHelper::GetResourceInstance(), xHotSpot, yHotSpot, nWidth, nHeight, pvANDPlane, pvXORPlane);\n\t\treturn m_hCursor;\n\t}\n\n\tHCURSOR CreateCursorFromResource(PBYTE pBits, DWORD dwResSize, DWORD dwVersion = 0x00030000)\n\t{\n\t\tATLASSERT(m_hCursor == NULL);\n\t\tATLASSERT(pBits != NULL);\n\t\tm_hCursor = (HCURSOR)::CreateIconFromResource(pBits, dwResSize, FALSE, dwVersion);\n\t\treturn m_hCursor;\n\t}\n\n\tHCURSOR CreateCursorFromResourceEx(PBYTE pbBits, DWORD cbBits, DWORD dwVersion = 0x00030000, int cxDesired = 0, int cyDesired = 0, UINT uFlags = LR_DEFAULTCOLOR)\n\t{\n\t\tATLASSERT(m_hCursor == NULL);\n\t\tATLASSERT(pbBits != NULL);\n\t\tATLASSERT(cbBits > 0);\n\t\tm_hCursor = (HCURSOR)::CreateIconFromResourceEx(pbBits, cbBits, FALSE, dwVersion, cxDesired, cyDesired, uFlags);\n\t\treturn m_hCursor;\n\t}\n\n\tBOOL DestroyCursor()\n\t{\n\t\tATLASSERT(m_hCursor != NULL);\n\t\tBOOL bRet = ::DestroyCursor(m_hCursor);\n\t\tif(bRet != FALSE)\n\t\t\tm_hCursor = NULL;\n\t\treturn bRet;\n\t}\n\n// Operations\n\tHCURSOR CopyCursor()\n\t{\n\t\tATLASSERT(m_hCursor != NULL);\n\t\treturn (HCURSOR)::CopyIcon((HICON)m_hCursor);\n\t}\n\n\tBOOL GetCursorInfo(LPCURSORINFO pCursorInfo)\n\t{\n\t\tATLASSERT(m_hCursor != NULL);\n\t\tATLASSERT(pCursorInfo != NULL);\n\t\treturn ::GetCursorInfo(pCursorInfo);\n\t}\n};\n\ntypedef CCursorT<false>   CCursorHandle;\ntypedef CCursorT<true>    CCursor;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CResource - Wraps a generic Windows resource.\n//             Use it with custom resource types other than the\n//             standard RT_CURSOR, RT_BITMAP, etc.\n\nclass CResource\n{\npublic:\n\tHGLOBAL m_hGlobal;\n\tHRSRC m_hResource;\n\n// Constructor/destructor\n\tCResource() : m_hGlobal(NULL), m_hResource(NULL)\n\t{ }\n\n\t~CResource()\n\t{\n\t\tRelease();\n\t}\n\n// Load methods\n\tbool Load(ATL::_U_STRINGorID Type, ATL::_U_STRINGorID ID)\n\t{\n\t\tATLASSERT(m_hResource == NULL);\n\t\tATLASSERT(m_hGlobal == NULL);\n\n\t\tm_hResource = ::FindResource(ModuleHelper::GetResourceInstance(), ID.m_lpstr, Type.m_lpstr);\n\t\tif(m_hResource == NULL)\n\t\t\treturn false;\n\n\t\tm_hGlobal = ::LoadResource(ModuleHelper::GetResourceInstance(), m_hResource);\n\t\tif(m_hGlobal == NULL)\n\t\t{\n\t\t\tm_hResource = NULL;\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tbool LoadEx(ATL::_U_STRINGorID ID, ATL::_U_STRINGorID Type, WORD wLanguage)\n\t{\n\t\tATLASSERT(m_hResource == NULL);\n\t\tATLASSERT(m_hGlobal == NULL);\n\n\t\tm_hResource = ::FindResourceEx(ModuleHelper::GetResourceInstance(), Type.m_lpstr, ID.m_lpstr, wLanguage);\n\t\tif(m_hResource == NULL)\n\t\t\treturn false;\n\n\t\tm_hGlobal = ::LoadResource(ModuleHelper::GetResourceInstance(), m_hResource);\n\t\tif(m_hGlobal == NULL)\n\t\t{\n\t\t\tm_hResource = NULL;\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n// Misc. operations\n\tDWORD GetSize() const\n\t{\n\t\tATLASSERT(m_hResource != NULL);\n\t\treturn ::SizeofResource(ModuleHelper::GetResourceInstance(), m_hResource);\n\t}\n\n\tLPVOID Lock()\n\t{\n\t\tATLASSERT(m_hResource != NULL);\n\t\tATLASSERT(m_hGlobal != NULL);\n\t\tLPVOID pVoid = ::LockResource(m_hGlobal);\n\t\tATLASSERT(pVoid != NULL);\n\t\treturn pVoid;\n\t}\n\n\tvoid Release()\n\t{\n\t\tif(m_hGlobal != NULL)\n\t\t{\n\t\t\tFreeResource(m_hGlobal);\n\t\t\tm_hGlobal = NULL;\n\t\t\tm_hResource = NULL;\n\t\t}\n\t}\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Toolbar resource descriptor\n\nstruct _AtlToolBarData\n{\n\tWORD wVersion;\n\tWORD wWidth;\n\tWORD wHeight;\n\tWORD wItemCount;\n\n\tWORD* items()\n\t\t{ return (WORD*)(this+1); }\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Global functions for loading resources\n\ninline HACCEL AtlLoadAccelerators(ATL::_U_STRINGorID table)\n{\n\treturn ::LoadAccelerators(ModuleHelper::GetResourceInstance(), table.m_lpstr);\n}\n\ninline HMENU AtlLoadMenu(ATL::_U_STRINGorID menu)\n{\n\treturn ::LoadMenu(ModuleHelper::GetResourceInstance(), menu.m_lpstr);\n}\n\ninline HBITMAP AtlLoadBitmap(ATL::_U_STRINGorID bitmap)\n{\n\treturn ::LoadBitmap(ModuleHelper::GetResourceInstance(), bitmap.m_lpstr);\n}\n\n#ifdef OEMRESOURCE\ninline HBITMAP AtlLoadSysBitmap(ATL::_U_STRINGorID bitmap)\n{\n#ifdef _DEBUG\n\tWORD wID = LOWORD(bitmap.m_lpstr);\n\tATLASSERT((wID >= 32734) && (wID <= 32767));\n#endif // _DEBUG\n\treturn ::LoadBitmap(NULL, bitmap.m_lpstr);\n}\n#endif // OEMRESOURCE\n\ninline HCURSOR AtlLoadCursor(ATL::_U_STRINGorID cursor)\n{\n\treturn ::LoadCursor(ModuleHelper::GetResourceInstance(), cursor.m_lpstr);\n}\n\ninline HCURSOR AtlLoadSysCursor(LPCTSTR lpCursorName)\n{\n\tATLASSERT((lpCursorName == IDC_ARROW) || (lpCursorName == IDC_IBEAM) || (lpCursorName == IDC_WAIT) ||\n\t\t(lpCursorName == IDC_CROSS) || (lpCursorName == IDC_UPARROW) || (lpCursorName == IDC_SIZE) ||\n\t\t(lpCursorName == IDC_ICON) || (lpCursorName == IDC_SIZENWSE) || (lpCursorName == IDC_SIZENESW) ||\n\t\t(lpCursorName == IDC_SIZEWE) || (lpCursorName == IDC_SIZENS) || (lpCursorName == IDC_SIZEALL) ||\n\t\t(lpCursorName == IDC_NO) || (lpCursorName == IDC_APPSTARTING) || (lpCursorName == IDC_HELP) ||\n\t\t(lpCursorName == IDC_HAND));\n\treturn ::LoadCursor(NULL, lpCursorName);\n}\n\ninline HICON AtlLoadIcon(ATL::_U_STRINGorID icon)\n{\n\treturn ::LoadIcon(ModuleHelper::GetResourceInstance(), icon.m_lpstr);\n}\n\ninline HICON AtlLoadSysIcon(LPCTSTR lpIconName)\n{\n#if (WINVER >= 0x0600)\n\tATLASSERT((lpIconName == IDI_APPLICATION) || (lpIconName == IDI_ASTERISK) || (lpIconName == IDI_EXCLAMATION) ||\n\t          (lpIconName == IDI_HAND) || (lpIconName == IDI_QUESTION) || (lpIconName == IDI_WINLOGO) ||\n\t          (lpIconName == IDI_SHIELD));\n#else // !(WINVER >= 0x0600)\n\tATLASSERT((lpIconName == IDI_APPLICATION) || (lpIconName == IDI_ASTERISK) || (lpIconName == IDI_EXCLAMATION) ||\n\t          (lpIconName == IDI_HAND) || (lpIconName == IDI_QUESTION) || (lpIconName == IDI_WINLOGO));\n#endif // !(WINVER >= 0x0600)\n\treturn ::LoadIcon(NULL, lpIconName);\n}\n\ninline HBITMAP AtlLoadBitmapImage(ATL::_U_STRINGorID bitmap, UINT fuLoad = LR_DEFAULTCOLOR)\n{\n\treturn (HBITMAP)::LoadImage(ModuleHelper::GetResourceInstance(), bitmap.m_lpstr, IMAGE_BITMAP, 0, 0, fuLoad);\n}\n\ninline HCURSOR AtlLoadCursorImage(ATL::_U_STRINGorID cursor, UINT fuLoad = LR_DEFAULTCOLOR | LR_DEFAULTSIZE, int cxDesired = 0, int cyDesired = 0)\n{\n\treturn (HCURSOR)::LoadImage(ModuleHelper::GetResourceInstance(), cursor.m_lpstr, IMAGE_CURSOR, cxDesired, cyDesired, fuLoad);\n}\n\ninline HICON AtlLoadIconImage(ATL::_U_STRINGorID icon, UINT fuLoad = LR_DEFAULTCOLOR | LR_DEFAULTSIZE, int cxDesired = 0, int cyDesired = 0)\n{\n\treturn (HICON)::LoadImage(ModuleHelper::GetResourceInstance(), icon.m_lpstr, IMAGE_ICON, cxDesired, cyDesired, fuLoad);\n}\n\n#ifdef OEMRESOURCE\ninline HBITMAP AtlLoadSysBitmapImage(WORD wBitmapID, UINT fuLoad = LR_DEFAULTCOLOR)\n{\n\tATLASSERT((wBitmapID >= 32734) && (wBitmapID <= 32767));\n\tATLASSERT((fuLoad & LR_LOADFROMFILE) == 0);   // this one doesn't load from a file\n\treturn (HBITMAP)::LoadImage(NULL, MAKEINTRESOURCE(wBitmapID), IMAGE_BITMAP, 0, 0, fuLoad);\n}\n#endif // OEMRESOURCE\n\ninline HCURSOR AtlLoadSysCursorImage(ATL::_U_STRINGorID cursor, UINT fuLoad = LR_DEFAULTCOLOR | LR_DEFAULTSIZE, int cxDesired = 0, int cyDesired = 0)\n{\n#ifdef _DEBUG\n\tWORD wID = LOWORD(cursor.m_lpstr);\n\tATLASSERT(((wID >= 32512) && (wID <= 32516)) || ((wID >= 32640) && (wID <= 32648)) || (wID == 32650) || (wID == 32651));\n\tATLASSERT((fuLoad & LR_LOADFROMFILE) == 0);   // this one doesn't load from a file\n#endif // _DEBUG\n\treturn (HCURSOR)::LoadImage(NULL, cursor.m_lpstr, IMAGE_CURSOR, cxDesired, cyDesired, fuLoad);\n}\n\ninline HICON AtlLoadSysIconImage(ATL::_U_STRINGorID icon, UINT fuLoad = LR_DEFAULTCOLOR | LR_DEFAULTSIZE, int cxDesired = 0, int cyDesired = 0)\n{\n#ifdef _DEBUG\n\tWORD wID = LOWORD(icon.m_lpstr);\n\tATLASSERT((wID >= 32512) && (wID <= 32517));\n\tATLASSERT((fuLoad & LR_LOADFROMFILE) == 0);   // this one doesn't load from a file\n#endif // _DEBUG\n\treturn (HICON)::LoadImage(NULL, icon.m_lpstr, IMAGE_ICON, cxDesired, cyDesired, fuLoad);\n}\n\ninline bool AtlLoadString(UINT uID, BSTR& bstrText)\n{\n\tUSES_CONVERSION;\n\tATLASSERT(bstrText == NULL);\n\n\tLPTSTR lpstrText = NULL;\n\tint nRes = 0;\n\tfor(int nLen = 256; ; nLen *= 2)\n\t{\n\t\tATLTRY(lpstrText = new TCHAR[nLen]);\n\t\tif(lpstrText == NULL)\n\t\t\tbreak;\n\t\tnRes = ::LoadString(ModuleHelper::GetResourceInstance(), uID, lpstrText, nLen);\n\t\tif(nRes < nLen - 1)\n\t\t\tbreak;\n\t\tdelete [] lpstrText;\n\t\tlpstrText = NULL;\n\t}\n\n\tif(lpstrText != NULL)\n\t{\n\t\tif(nRes != 0)\n\t\t\tbstrText = ::SysAllocString(T2OLE(lpstrText));\n\t\tdelete [] lpstrText;\n\t}\n\n\treturn (bstrText != NULL) ? true : false;\n}\n\n} // namespace WTL\n\n#endif // __ATLUSER_H__\n"
  },
  {
    "path": "third_party/WTL/Include/atlwinx.h",
    "content": "// Windows Template Library - WTL version 10.0\n// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved.\n//\n// This file is a part of the Windows Template Library.\n// The use and distribution terms for this software are covered by the\n// Microsoft Public License (http://opensource.org/licenses/MS-PL)\n// which can be found in the file MS-PL.txt at the root folder.\n\n#ifndef __ATLWINX_H__\n#define __ATLWINX_H__\n\n#pragma once\n\n#ifndef __ATLAPP_H__\n\t#error atlwinx.h requires atlapp.h to be included first\n#endif\n\n#include <atlwin.h>\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes in this file:\n//\n// CWindowEx\n\n\n/////////////////////////////////////////////////////////////////////////////\n// Additional macros needed for template classes\n\n#ifndef DECLARE_WND_CLASS_EX2\n  #define DECLARE_WND_CLASS_EX2(WndClassName, EnclosingClass, style, bkgnd) \\\n  static ATL::CWndClassInfo& GetWndClassInfo() \\\n  { \\\n\tstatic ATL::CWndClassInfo wc = \\\n\t{ \\\n\t\t{ sizeof(WNDCLASSEX), style, EnclosingClass::StartWindowProc, \\\n\t\t  0, 0, NULL, NULL, NULL, (HBRUSH)(bkgnd + 1), NULL, WndClassName, NULL }, \\\n\t\t  NULL, NULL, IDC_ARROW, TRUE, 0, _T(\"\") \\\n\t}; \\\n\treturn wc; \\\n  }\n#endif // DECLARE_WND_CLASS_EX2\n\n#ifndef DECLARE_WND_SUPERCLASS2\n  #define DECLARE_WND_SUPERCLASS2(WndClassName, EnclosingClass, OrigWndClassName) \\\n  static ATL::CWndClassInfo& GetWndClassInfo() \\\n  { \\\n\tstatic ATL::CWndClassInfo wc = \\\n\t{ \\\n\t\t{ sizeof(WNDCLASSEX), 0, EnclosingClass::StartWindowProc, \\\n\t\t  0, 0, NULL, NULL, NULL, NULL, NULL, WndClassName, NULL }, \\\n\t\t  OrigWndClassName, NULL, NULL, TRUE, 0, _T(\"\") \\\n\t}; \\\n\treturn wc; \\\n  }\n#endif // DECLARE_WND_SUPERCLASS2\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Command Chaining Macros\n\n#define CHAIN_COMMANDS(theChainClass) \\\n\tif(uMsg == WM_COMMAND) \\\n\t\tCHAIN_MSG_MAP(theChainClass)\n\n#define CHAIN_COMMANDS_ALT(theChainClass, msgMapID) \\\n\tif(uMsg == WM_COMMAND) \\\n\t\tCHAIN_MSG_MAP_ALT(theChainClass, msgMapID)\n\n#define CHAIN_COMMANDS_MEMBER(theChainMember) \\\n\tif(uMsg == WM_COMMAND) \\\n\t\tCHAIN_MSG_MAP_MEMBER(theChainMember)\n\n#define CHAIN_COMMANDS_ALT_MEMBER(theChainMember, msgMapID) \\\n\tif(uMsg == WM_COMMAND) \\\n\t\tCHAIN_MSG_MAP_ALT_MEMBER(theChainMember, msgMapID)\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Macros for parent message map to selectively reflect control messages\n\n// NOTE: ReflectNotifications is a member of ATL's CWindowImplRoot\n//  (and overridden in 2 cases - CContainedWindowT and CAxHostWindow)\n//  Since we can't modify ATL, we'll provide the needed additions\n//  in a separate function (that is not a member of CWindowImplRoot)\n\nnamespace WTL\n{\n\ninline LRESULT WtlReflectNotificationsFiltered(HWND hWndParent, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled,\n                                               UINT uMsgFilter = WM_NULL, UINT_PTR idFromFilter = 0, HWND hWndChildFilter = NULL)\n{\n\tif((uMsgFilter != WM_NULL) && (uMsgFilter != uMsg))\n\t{\n\t\t// The notification message doesn't match the filter.\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tHWND hWndChild = NULL;\n\tUINT_PTR idFrom = 0;\n\n\tswitch(uMsg)\n\t{\n\tcase WM_COMMAND:\n\t\tif(lParam != NULL)\t// not from a menu\n\t\t{\n\t\t\thWndChild = (HWND)lParam;\n\t\t\tidFrom = (UINT_PTR)LOWORD(wParam);\n\t\t}\n\t\tbreak;\n\tcase WM_NOTIFY:\n\t\thWndChild = ((LPNMHDR)lParam)->hwndFrom;\n\t\tidFrom = ((LPNMHDR)lParam)->idFrom;\n\t\tbreak;\n\tcase WM_PARENTNOTIFY:\n\t\tswitch(LOWORD(wParam))\n\t\t{\n\t\tcase WM_CREATE:\n\t\tcase WM_DESTROY:\n\t\t\thWndChild = (HWND)lParam;\n\t\t\tidFrom = (UINT_PTR)HIWORD(wParam);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\thWndChild = ::GetDlgItem(hWndParent, HIWORD(wParam));\n\t\t\tidFrom = (UINT_PTR)::GetDlgCtrlID(hWndChild);\n\t\t\tbreak;\n\t\t}\n\t\tbreak;\n\tcase WM_DRAWITEM:\n\t\tif(wParam)\t// not from a menu\n\t\t{\n\t\t\thWndChild = ((LPDRAWITEMSTRUCT)lParam)->hwndItem;\n\t\t\tidFrom = (UINT_PTR)wParam;\n\t\t}\n\t\tbreak;\n\tcase WM_MEASUREITEM:\n\t\tif(wParam)\t// not from a menu\n\t\t{\n\t\t\thWndChild = ::GetDlgItem(hWndParent, ((LPMEASUREITEMSTRUCT)lParam)->CtlID);\n\t\t\tidFrom = (UINT_PTR)wParam;\n\t\t}\n\t\tbreak;\n\tcase WM_COMPAREITEM:\n\t\tif(wParam)\t// not from a menu\n\t\t{\n\t\t\thWndChild = ((LPCOMPAREITEMSTRUCT)lParam)->hwndItem;\n\t\t\tidFrom = (UINT_PTR)wParam;\n\t\t}\n\t\tbreak;\n\tcase WM_DELETEITEM:\n\t\tif(wParam)\t// not from a menu\n\t\t{\n\t\t\thWndChild = ((LPDELETEITEMSTRUCT)lParam)->hwndItem;\n\t\t\tidFrom = (UINT_PTR)wParam;\n\t\t}\n\t\tbreak;\n\tcase WM_VKEYTOITEM:\n\tcase WM_CHARTOITEM:\n\tcase WM_HSCROLL:\n\tcase WM_VSCROLL:\n\tcase WM_CTLCOLORBTN:\n\tcase WM_CTLCOLORDLG:\n\tcase WM_CTLCOLOREDIT:\n\tcase WM_CTLCOLORLISTBOX:\n\tcase WM_CTLCOLORMSGBOX:\n\tcase WM_CTLCOLORSCROLLBAR:\n\tcase WM_CTLCOLORSTATIC:\n\t\thWndChild = (HWND)lParam;\n\t\tidFrom = (UINT_PTR)::GetDlgCtrlID(hWndChild);\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n\t}\n\n\tif((hWndChild == NULL) ||\n\t\t((hWndChildFilter != NULL) && (hWndChildFilter != hWndChild)))\n\t{\n\t\t// Either hWndChild isn't valid, or\n\t\t// hWndChild doesn't match the filter.\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tif((idFromFilter != 0) && (idFromFilter != idFrom))\n\t{\n\t\t// The dialog control id doesn't match the filter.\n\t\tbHandled = FALSE;\n\t\treturn 1;\n\t}\n\n\tATLASSERT(::IsWindow(hWndChild));\n\tLRESULT lResult = ::SendMessage(hWndChild, OCM__BASE + uMsg, wParam, lParam);\n\tif((lResult == 0) && (uMsg >= WM_CTLCOLORMSGBOX) && (uMsg <= WM_CTLCOLORSTATIC))\n\t{\n\t\t// Try to prevent problems with WM_CTLCOLOR* messages when\n\t\t// the message wasn't really handled\n\t\tbHandled = FALSE;\n\t}\n\n\treturn lResult;\n}\n\n} // namespace WTL\n\n// Try to prevent problems with WM_CTLCOLOR* messages when\n// the message wasn't really handled\n#define REFLECT_NOTIFICATIONS_EX() \\\n{ \\\n\tbHandled = TRUE; \\\n\tlResult = this->ReflectNotifications(uMsg, wParam, lParam, bHandled); \\\n\tif((lResult == 0) && (uMsg >= WM_CTLCOLORMSGBOX) && (uMsg <= WM_CTLCOLORSTATIC)) \\\n\t\tbHandled = FALSE; \\\n\tif(bHandled) \\\n\t\treturn TRUE; \\\n}\n\n#define REFLECT_NOTIFICATIONS_MSG_FILTERED(uMsgFilter) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = WTL::WtlReflectNotificationsFiltered(this->m_hWnd, uMsg, wParam, lParam, bHandled, uMsgFilter, 0, NULL); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define REFLECT_NOTIFICATIONS_ID_FILTERED(idFromFilter) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = WTL::WtlReflectNotificationsFiltered(this->m_hWnd, uMsg, wParam, lParam, bHandled, WM_NULL, idFromFilter, NULL); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define REFLECT_NOTIFICATIONS_HWND_FILTERED(hWndChildFilter) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = WTL::WtlReflectNotificationsFiltered(this->m_hWnd, uMsg, wParam, lParam, bHandled, WM_NULL, 0, hWndChildFilter); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define REFLECT_NOTIFICATIONS_MSG_ID_FILTERED(uMsgFilter, idFromFilter) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = WTL::WtlReflectNotificationsFiltered(this->m_hWnd, uMsg, wParam, lParam, bHandled, uMsgFilter, idFromFilter, NULL); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define REFLECT_NOTIFICATIONS_MSG_HWND_FILTERED(uMsgFilter, hWndChildFilter) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = WTL::WtlReflectNotificationsFiltered(this->m_hWnd, uMsg, wParam, lParam, bHandled, uMsgFilter, 0, hWndChildFilter); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define REFLECT_COMMAND(id, code) \\\n\tif((uMsg == WM_COMMAND) && (id == LOWORD(wParam)) && (code == HIWORD(wParam))) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = this->ReflectNotifications(uMsg, wParam, lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define REFLECT_COMMAND_ID(id) \\\n\tif((uMsg == WM_COMMAND) && (id == LOWORD(wParam))) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = this->ReflectNotifications(uMsg, wParam, lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define REFLECT_COMMAND_CODE(code) \\\n\tif((uMsg == WM_COMMAND) && (code == HIWORD(wParam))) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = this->ReflectNotifications(uMsg, wParam, lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define REFLECT_COMMAND_RANGE(idFirst, idLast) \\\n\tif((uMsg == WM_COMMAND) && (LOWORD(wParam) >= idFirst) && (LOWORD(wParam) <= idLast)) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = this->ReflectNotifications(uMsg, wParam, lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define REFLECT_COMMAND_RANGE_CODE(idFirst, idLast, code) \\\n\tif((uMsg == WM_COMMAND) && (code == HIWORD(wParam)) && (LOWORD(wParam) >= idFirst) && (LOWORD(wParam) <= idLast)) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = this->ReflectNotifications(uMsg, wParam, lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define REFLECT_NOTIFY(id, cd) \\\n\tif((uMsg == WM_NOTIFY) && (id == ((LPNMHDR)lParam)->idFrom) && (cd == ((LPNMHDR)lParam)->code)) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = this->ReflectNotifications(uMsg, wParam, lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define REFLECT_NOTIFY_ID(id) \\\n\tif((uMsg == WM_NOTIFY) && (id == ((LPNMHDR)lParam)->idFrom)) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = this->ReflectNotifications(uMsg, wParam, lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define REFLECT_NOTIFY_CODE(cd) \\\n\tif((uMsg == WM_NOTIFY) && (cd == ((LPNMHDR)lParam)->code)) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = this->ReflectNotifications(uMsg, wParam, lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define REFLECT_NOTIFY_RANGE(idFirst, idLast) \\\n\tif((uMsg == WM_NOTIFY) && (((LPNMHDR)lParam)->idFrom >= idFirst) && (((LPNMHDR)lParam)->idFrom <= idLast)) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = this->ReflectNotifications(uMsg, wParam, lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n#define REFLECT_NOTIFY_RANGE_CODE(idFirst, idLast, cd) \\\n\tif((uMsg == WM_NOTIFY) && (cd == ((LPNMHDR)lParam)->code) && (((LPNMHDR)lParam)->idFrom >= idFirst) && (((LPNMHDR)lParam)->idFrom <= idLast)) \\\n\t{ \\\n\t\tbHandled = TRUE; \\\n\t\tlResult = this->ReflectNotifications(uMsg, wParam, lParam, bHandled); \\\n\t\tif(bHandled) \\\n\t\t\treturn TRUE; \\\n\t}\n\n\n///////////////////////////////////////////////////////////////////////////////\n// GetClassLong/SetClassLong redefinition to avoid problems with class members\n\n#ifdef SetClassLongPtrA\n  #undef SetClassLongPtrA\n  inline LONG_PTR SetClassLongPtrA(HWND hWnd, int nIndex, LONG_PTR dwNewLong)\n  {\n\treturn ::SetClassLongA(hWnd, nIndex, LONG(dwNewLong));\n  }\n#endif\n\n#ifdef SetClassLongPtrW\n  #undef SetClassLongPtrW\n  inline LONG_PTR SetClassLongPtrW(HWND hWnd, int nIndex, LONG_PTR dwNewLong)\n  {\n\treturn ::SetClassLongW(hWnd, nIndex, LONG(dwNewLong));\n  }\n#endif\n\n#ifdef GetClassLongPtrA\n  #undef GetClassLongPtrA\n  inline LONG_PTR GetClassLongPtrA(HWND hWnd, int nIndex)\n  {\n\treturn ::GetClassLongA(hWnd, nIndex);\n  }\n#endif\n\n#ifdef GetClassLongPtrW\n  #undef GetClassLongPtrW\n  inline LONG_PTR GetClassLongPtrW(HWND hWnd, int nIndex)\n  {\n\treturn ::GetClassLongW(hWnd, nIndex);\n  }\n#endif\n\n\n///////////////////////////////////////////////////////////////////////////////\n// CWindowEx - extension of ATL::CWindow\n\nnamespace WTL\n{\n\nclass CWindowEx : public ATL::CWindow\n{\npublic:\n\tCWindowEx(HWND hWnd = NULL) : ATL::CWindow(hWnd)\n\t{ }\n\n\tCWindowEx& operator =(HWND hWnd)\n\t{\n\t\tm_hWnd = hWnd;\n\t\treturn *this;\n\t}\n\n\toperator HWND() const\n\t{\n\t\treturn m_hWnd;\n\t}\n\n// Methods\n\tBOOL PrintWindow(HDC hDC, UINT uFlags = 0)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn ::PrintWindow(m_hWnd, hDC, uFlags);\n\t}\n\n\tBOOL DragDetect(POINT pt)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn ::DragDetect(m_hWnd, pt);\n\t}\n\n\tBOOL DragDetect()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\n\t\tPOINT pt = {};\n\t\t::GetCursorPos(&pt);\n\t\treturn ::DragDetect(m_hWnd, pt);\n\t}\n\n\tCWindowEx GetAncestor(UINT uFlags) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn CWindowEx(::GetAncestor(m_hWnd, uFlags));\n\t}\n\n\t// Note: Does not work properly on Vista Aero and above\n\tBOOL AnimateWindow(DWORD dwFlags, DWORD dwTime = 200)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn ::AnimateWindow(m_hWnd, dwTime, dwFlags);\n\t}\n\n\tBOOL FlashWindowEx(DWORD dwFlags, UINT uCount, DWORD dwTimeout = 0)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\n\t\tFLASHWINFO fi = { sizeof(FLASHWINFO) };\n\t\tfi.hwnd = m_hWnd;\n\t\tfi.dwFlags = dwFlags;\n\t\tfi.uCount = uCount;\n\t\tfi.dwTimeout = dwTimeout;\n\t\treturn ::FlashWindowEx(&fi);\n\t}\n\n\tBOOL StopFlashWindowEx()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\n\t\tFLASHWINFO fi = { sizeof(FLASHWINFO) };\n\t\tfi.hwnd = m_hWnd;\n\t\tfi.dwFlags = FLASHW_STOP;\n\t\treturn ::FlashWindowEx(&fi);\n\t}\n\n// Class long properties\n\tDWORD GetClassLong(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn ::GetClassLong(m_hWnd, nIndex);\n\t}\n\n\tDWORD SetClassLong(int nIndex, LONG dwNewLong)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn ::SetClassLong(m_hWnd, nIndex, dwNewLong);\n\t}\n\n\tULONG_PTR GetClassLongPtr(int nIndex) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn ::GetClassLongPtr(m_hWnd, nIndex);\n\t}\n\n\tULONG_PTR SetClassLongPtr(int nIndex, LONG_PTR dwNewLong)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\treturn ::SetClassLongPtr(m_hWnd, nIndex, dwNewLong);\n\t}\n\n// Layered windows\n\tBOOL SetLayeredWindowAttributes(COLORREF crlKey, BYTE byteAlpha, DWORD dwFlags)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT((GetExStyle() & WS_EX_LAYERED) != 0);\n\n\t\treturn ::SetLayeredWindowAttributes(m_hWnd, crlKey, byteAlpha, dwFlags);\n\t}\n\n\tBOOL UpdateLayeredWindow(HDC hdcDst, LPPOINT pptDst, LPSIZE psize, HDC hdcSrc, LPPOINT pptSrc, COLORREF crlKey, BLENDFUNCTION* pblend, DWORD dwFlags)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT((GetExStyle() & WS_EX_LAYERED) != 0);\n\n\t\treturn ::UpdateLayeredWindow(m_hWnd, hdcDst, pptDst, psize, hdcSrc, pptSrc, crlKey, pblend, dwFlags);\n\t}\n\n\tBOOL UpdateLayeredWindow(LPPOINT pptDst = NULL)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT((GetExStyle() & WS_EX_LAYERED) != 0);\n\n\t\treturn ::UpdateLayeredWindow(m_hWnd, NULL, pptDst, NULL, NULL, NULL, CLR_NONE, NULL, 0);\n\t}\n\n\tBOOL GetLayeredWindowAttributes(COLORREF* pcrlKey, BYTE* pbyteAlpha, DWORD* pdwFlags) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\t\tATLASSERT((GetExStyle() & WS_EX_LAYERED) != 0);\n\n\t\treturn ::GetLayeredWindowAttributes(m_hWnd, pcrlKey, pbyteAlpha, pdwFlags);\n\t}\n\n// Mouse tracking\n\tBOOL StartTrackMouseLeave()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\n\t\tTRACKMOUSEEVENT tme = {};\n\t\ttme.cbSize = sizeof(TRACKMOUSEEVENT);\n\t\ttme.dwFlags = TME_LEAVE;\n\t\ttme.hwndTrack = m_hWnd;\n\t\treturn ::TrackMouseEvent(&tme);\n\t}\n\n\tBOOL StartTrackMouse(DWORD dwFlags, DWORD dwHoverTime = HOVER_DEFAULT)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\n\t\tTRACKMOUSEEVENT tme = {};\n\t\ttme.cbSize = sizeof(TRACKMOUSEEVENT);\n\t\ttme.dwFlags = dwFlags;\n\t\ttme.hwndTrack = m_hWnd;\n\t\ttme.dwHoverTime = dwHoverTime;\n\t\treturn ::TrackMouseEvent(&tme);\n\t}\n\n\tBOOL CancelTrackMouse(DWORD dwType)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\n\t\tTRACKMOUSEEVENT tme = {};\n\t\ttme.cbSize = sizeof(TRACKMOUSEEVENT);\n\t\ttme.dwFlags = TME_CANCEL | dwType;\n\t\ttme.hwndTrack = m_hWnd;\n\t\treturn ::TrackMouseEvent(&tme);\n\t}\n\n// CString support\n#ifdef __ATLSTR_H__\n\tint GetWindowText(ATL::CString& strText) const\n\t{\n\t\tint nLength = GetWindowTextLength();\n\t\tLPTSTR pszText = strText.GetBuffer(nLength + 1);\n\t\tnLength = ::GetWindowText(m_hWnd, pszText, nLength + 1);\n\t\tstrText.ReleaseBuffer(nLength);\n\n\t\treturn nLength;\n\t}\n\n\tUINT GetDlgItemText(int nID, ATL::CString& strText) const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\n\t\tHWND hItem = GetDlgItem(nID);\n\t\tif(hItem != NULL)\n\t\t{\n\t\t\tint nLength = ::GetWindowTextLength(hItem);\n\t\t\tLPTSTR pszText = strText.GetBuffer(nLength + 1);\n\t\t\tnLength = ::GetWindowText(hItem, pszText, nLength + 1);\n\t\t\tstrText.ReleaseBuffer(nLength);\n\n\t\t\treturn nLength;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tstrText.Empty();\n\n\t\t\treturn 0;\n\t\t}\n\t}\n#endif // __ATLSTR_H__\n\n// Dialog window only\n\tUINT DlgGetDefID() const\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\n\t\tLRESULT lRet = ::SendMessage(m_hWnd, DM_GETDEFID, 0, 0L);\n\t\tUINT uID = 0U;\n\t\tif(HIWORD(lRet) == DC_HASDEFID)\n\t\t\tuID = LOWORD(lRet);\n\n\t\treturn uID;\n\t}\n\n\tvoid DlgSetDefID(UINT uID)\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\n\t\t::SendMessage(m_hWnd, DM_SETDEFID, uID, 0L);\n\t}\n\n\tvoid DlgReposition()\n\t{\n\t\tATLASSERT(::IsWindow(m_hWnd));\n\n\t\t::SendMessage(m_hWnd, DM_REPOSITION, 0, 0L);\n\t}\n};\n\n} // namespace WTL\n\n#endif // __ATLWINX_H__\n"
  },
  {
    "path": "third_party/WTL/MS-PL.txt",
    "content": "Microsoft Public License (MS-PL)\n\nThis license governs use of the accompanying software. If you use the software, you\naccept this license. If you do not accept the license, do not use the software.\n\n1. Definitions\nThe terms \"reproduce,\" \"reproduction,\" \"derivative works,\" and \"distribution\" have the\nsame meaning here as under U.S. copyright law.\nA \"contribution\" is the original software, or any additions or changes to the software.\nA \"contributor\" is any person that distributes its contribution under this license.\n\"Licensed patents\" are a contributor's patent claims that read directly on its contribution.\n\n2. Grant of Rights\n(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.\n(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.\n\n3. Conditions and Limitations\n(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.\n(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.\n(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.\n(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.\n(E) The software is licensed \"as-is.\" You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.\n"
  },
  {
    "path": "third_party/ced/.gitignore",
    "content": "CMakeCache.txt\nCMakeFiles\nMakefile\nbin\ncmake_install.cmake\ngtest\nlib\n"
  },
  {
    "path": "third_party/ced/CMakeLists.txt",
    "content": "# Copyright 2016 Google Inc.  All Rights Reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n# Old enough to support Ubuntu Precise.\ncmake_minimum_required(VERSION 2.8.7)\n\nif (WIN32)\n  if (NOT EXISTS \"compact_enc_det/compact_enc_det.h\")\n    message(FATAL_ERROR \"\\nCould not find source code.  Make sure you are running this script from the root of the distribution tree.\")\n  endif()\n\n  if (NOT EXISTS \"gtest\")\n    message(STATUS \"Google Test not present.  Fetching from the web...\")\n    file(DOWNLOAD \"https://github.com/google/googletest/archive/master.zip\" ${CMAKE_SOURCE_DIR}/master.zip)\n    execute_process(COMMAND ${CMAKE_COMMAND} -E tar x master.zip)\n    file(REMOVE master.zip)\n    file(RENAME googletest-master gtest)\n  endif()\n\n  # Configure gtest.\n  execute_process(COMMAND ${CMAKE_COMMAND} .\n                          WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/gtest)\nendif()\n\nproject(CED CXX)\nset(CMAKE_SUPPRESS_DEVELOPER_WARNINGS 1 CACHE INTERNAL \"No dev warnings\")\n\noption(BUILD_SHARED_LIBS \"Build shared libraries\" OFF)\n\nif(\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"GNU\")\n  set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -std=c++11 -Wno-narrowing\")\nelseif(\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\")\n  set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -std=c++11 -Wno-c++11-narrowing\")\nelseif(\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"MSVC\")\n  if (NOT BUILD_SHARED_LIBS)\n    foreach(flag_var\n            CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE\n            CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)\n      if(${flag_var} MATCHES \"/MD\")\n        string(REGEX REPLACE \"/MD\" \"/MT\" ${flag_var} \"${${flag_var}}\")\n      endif(${flag_var} MATCHES \"/MD\")\n    endforeach(flag_var)\n  endif()\nendif()\n\nset(EXTRA_TARGET_LINK_LIBRARIES)\n\nif(WIN32)\n  add_definitions(-DUNICODE -D_UNICODE -DSTRICT -DNOMINMAX)\n  set(THREADING threadwin)\nelse()\n  set(THREADING thread)\n  list(APPEND EXTRA_TARGET_LINK_LIBRARIES -pthread)\nendif()\n\nset(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)\nset(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)\nset(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)\n\nset(CED_LIBRARY_SOURCES\n    compact_enc_det/compact_enc_det.cc\n    compact_enc_det/compact_enc_det_hint_code.cc\n    util/encodings/encodings.cc\n    util/languages/languages.cc\n    )\n\nadd_library(ced ${CED_LIBRARY_SOURCES})\n\ntarget_include_directories(ced PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})\n\n# Uncomment to put CED into WHATWG-compliant mode.\n#add_definitions(-DHTML5_MODE)\n\nset(GTEST_INCLUDE_DIR \"gtest/googletest/include\")\nset(GTEST_LIB_DIR \"${CMAKE_SOURCE_DIR}/gtest/lib\")\n\nset(CED_UNITTEST_SOURCES\n    compact_enc_det/compact_enc_det_unittest.cc\n    compact_enc_det/compact_enc_det_fuzz_test.cc\n    compact_enc_det/detail_head_string.inc\n    util/encodings/encodings_unittest.cc\n    )\n\nadd_executable(ced_unittest ${CED_UNITTEST_SOURCES})\ninclude_directories(${CMAKE_SOURCE_DIR}/${GTEST_INCLUDE_DIR})\nif (WIN32)\n  set(GTEST_LIB_DIR_DBG \"${GTEST_LIB_DIR}/Debug\")\n  set(GTEST_LIB_DIR_REL \"${GTEST_LIB_DIR}/Release\")\n  target_link_libraries(ced_unittest\n                        ced\n                        debug ${GTEST_LIB_DIR_DBG}/gtest.lib optimized ${GTEST_LIB_DIR_REL}/gtest.lib\n                        debug ${GTEST_LIB_DIR_DBG}/gtest_main.lib optimized ${GTEST_LIB_DIR_REL}/gtest_main.lib\n                        ${EXTRA_TARGET_LINK_LIBRARIES})\n  message(\"\\nConfiguration completed.  Open the created projects with Visual Studio to build the packages.\\n\")\nelse()\n  target_link_libraries(ced_unittest\n                        ced\n                        ${GTEST_LIB_DIR}/libgtest.a\n                        ${GTEST_LIB_DIR}/libgtest_main.a\n                        ${EXTRA_TARGET_LINK_LIBRARIES}\n                        )\nendif()\n"
  },
  {
    "path": "third_party/ced/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "third_party/ced/README.md",
    "content": "### Introduction\n\nCompact Encoding Detection(CED for short) is a library written in C++ that\nscans given raw bytes and detect the most likely text encoding.\n\nBasic usage:\n\n```\n#include \"compact_enc_det/compact_enc_det.h\"\n\nconst char* text = \"Input text\";\nbool is_reliable;\nint bytes_consumed;\n\nEncoding encoding = CompactEncDet::DetectEncoding(\n        text, strlen(text),\n        nullptr, nullptr, nullptr,\n        UNKNOWN_ENCODING,\n        UNKNOWN_LANGUAGE,\n        CompactEncDet::WEB_CORPUS,\n        false,\n        &bytes_consumed,\n        &is_reliable);\n\n```\n\n### How to build\n\nYou need [CMake](https://cmake.org/) to build the package. After unzipping\nthe source code , run `autogen.sh` to build everything automatically.\nThe script also downloads [Google Test](https://github.com/google/googletest)\nframework needed to build the unittest.\n\n```\n$ cd compact_enc_det\n$ ./autogen.sh\n...\n$ bin/ced_unittest\n```\n\nOn Windows, run `cmake .` to download the test framework, and generate\nproject files for Visual Studio.\n\n```\nD:\\packages\\compact_enc_det> cmake .\n```\n"
  },
  {
    "path": "third_party/ced/autogen.sh",
    "content": "#!/bin/bash\n#\n# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# Run this script to generate the configure script and other files that will\n# be included in the distribution.  These files are not checked in because they\n# are automatically generated.\n\nset -e\ngtest_release='release-1.12.1'\n\nif [ ! -z \"$@\" ]; then\n  for argument in \"$@\"; do\n    case $argument in\n\t  # make curl silent\n      \"-s\")\n        curlopts=\"-s\"\n        ;;\n    esac\n  done\nfi\n\n\n# Check that we're being run from the right directory.\nif test ! -f compact_enc_det/compact_enc_det.h; then\n  cat >&2 << __EOF__\nCould not find source code.  Make sure you are running this script from the\nroot of the distribution tree.\n__EOF__\n  exit 1\nfi\n\n# Check that gtest is present. It is used to build unit test suite.\nif test ! -e gtest; then\n  if test -z $(which curl); then\n    echo \"curl cannot be found. Please install it to build the package.\"\n    exit 1\n  fi\n\n  echo \"Google Test not present.  Fetching from the web...\"\n  curl $curlopts -L -o main.zip https://codeload.github.com/google/googletest/zip/$gtest_release\n  unzip -q main.zip\n  rm main.zip\n  mv googletest-$gtest_release gtest\nfi\n\nif test -z $(which cmake); then\n  echo \"CMake cannot be found. Please install it to build the package.\"\n  exit 1\nfi\n\n# Build gtest\n(cd gtest && cmake . && make)\n\n# Build the main package\ncmake . && make\n\nset -ex\n\nexit 0\n"
  },
  {
    "path": "third_party/ced/compact_enc_det/compact_enc_det.cc",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include \"compact_enc_det/compact_enc_det.h\"\n\n#include <math.h>                       // for sqrt\n#include <stddef.h>                     // for size_t\n#include <stdio.h>                      // for printf, fprintf, NULL, etc\n#include <stdlib.h>                     // for qsort\n#include <string.h>                     // for memset, memcpy, memcmp, etc\n#include <memory>\n#include <string>                       // for string, operator==, etc\n\n#include \"compact_enc_det/compact_enc_det_hint_code.h\"\n#include \"util/string_util.h\"\n#include \"util/basictypes.h\"\n#include \"util/commandlineflags.h\"\n#include \"util/logging.h\"\n\nusing std::string;\n\n// TODO as of 2007.10.09:\n//\n// Consider font=TT-BHxxx as user-defined => binary\n// Demote GB18030 if no 8x3x pair\n// Map byte2 ascii punct to 0x60, digits to 0x7e, gets them into hires\n// Consider removing/ignoring bytes 01-1F to avoid crap pollution\n// Possibly boost declared encoding in robust scan\n// googlebot tiny files\n// look for ranges of encodings\n// consider tags just as > < within aligned block of 32\n// flag too few characters in postproc (Latin 6 problem)\n// Remove slow scan beyond 16KB\n// Consider removing kMostLikelyEncoding or cut it in half\n\n\n// A note on mixed encodings\n//\n// The most common encoding error on the web is a page containing a mixture of\n// CP-1252 and UTF-8. A less common encoding error is a third-party feed that\n// has been converted from CP-1252 to UTF-8 and then those bytes converted a\n// second time to UTF-8. CED originally attempted to detect these error cases\n// by using two  synthetic encodings, UTF8CP1252 and UTF8UTF8. The intended\n// implementation was to start these just below CP1252 and UTF8 respectively in\n// overall  liklihood, and allow 1252 and UTF8 to fall behind if mixtures are\n// found.\n//\n// The UTF8UTF8 encoding is a possible outcome from CED, but unfortunately the\n// UTF8CP1252 internal encoding was added late and not put into encodings.proto,\n// so at the final step it is mapped to UTF8UTF8 also. This was a bad idea and\n// is removed in this November 2011 CL.\n//\n// Mixed encoding detection never worked out as well as envisioned, so the\n// ced_allow_utf8utf8 flag normally disables all this.\n//\n// The effect is that CP-1252 and UTF-8 mixtures will usually be detected as\n// UTF8, and the inputconverter code for UTF8 normally will convert bare\n// CP-1252 bytes to UTF-8, instead of the less-helpful FFFD substitution. UTF-8\n// and double-UTF-8 mixtures will be detected as UTF-8, and the double\n// conversion will stand.\n//\n// However, it is occasionally useful to use CED to detect double-converted\n// UTF-8 coming from third-party data feeds, so they can be fixed at the source.\n// For this purpose, the  UTF8UTF8 encoding remains available under the\n// ced_allow_utf8utf8 flag.\n//\n// When UTF8UTF8 is detected, the inputconverter code will undo the double\n// conversion, giving good text.\n\n// Norbert Runge has noted these words in CP1252 that are mistakenly identified\n// as UTF-8 because of the last pair of characters:\n//  NESTLÉ®               0xC9 0xAE U+00C9 U+00AE   C9AE = U+026E;SMALL LEZH\n//  drauß\\u2019           0xDF 0x92 U+00DF U+2019   DF92 = U+07D2;NKO LETTER N\n//  Mutterschoß\\u201c     0xDF 0x93 U+00DF U+201C   DF93 = U+07D3;NKO LETTER BA\n//  Schoß\\u201c           0xDF 0x93 U+00DF U+201C\n//  weiß\\u201c            0xDF 0x93 U+00DF U+00AB\n//  Schnellfuß\\u201c      0xDF 0x93 U+00DF U+201C\n//  süß«                  0xDF 0xAB U+00DF U+00AB   DFAB = U+07EB;NKO HIGH TONE\n// These four byte combinations now explicitly boost Latin1/CP1252.\n\n// And for reference, here are a couple of Portuguese spellings\n// that may be mistaken as double-byte encodings.\n//   informações          0xE7 0xF5\n//   traição              0xE7 0xE3\n\n\nstatic const char* kVersion = \"2.2\";\n\nDEFINE_bool(ced_allow_utf8utf8, false, \"Allow the UTF8UTF8 encoding, \"\n                                       \"to handle mixtures of CP1252 \"\n                                       \"converted to UTF-8 zero, one, \"\n                                       \"or two times\");\nDEFINE_int32(enc_detect_slow_max_kb, 16,\n             \"Maximum number of Kbytes to examine for \"\n             \"7-bit-only (2022, Hz, UTF7) encoding detect. \"\n             \"You are unlikely to want to change this.\");\nDEFINE_int32(enc_detect_fast_max_kb, 256,\n             \"Maximum number of Kbytes to examine for encoding detect. \"\n             \"You are unlikely to want to change this.\");\n\nDEFINE_int32(ced_reliable_difference, 300, \"30 * Bits of minimum probablility \"\n             \"difference 1st - 2nd to be considered reliable \\n\"\n             \"  2 corresponds to min 4x difference\\n\"\n             \"  4 corresponds to min 16x difference\\n\"\n             \"  8 corresponds to min 256x difference\\n\"\n             \"  10 corresponds to min 1024x difference\\n\"\n             \"  20 corresponds to min 1Mx difference.\");\n\n// Text debug output options\nDEFINE_bool(enc_detect_summary, false,\n            \"Print first 16 interesting pairs at exit.\");\nDEFINE_bool(counts, false, \"Count major-section usage\");\n\n// PostScript debug output options\nDEFINE_bool(enc_detect_detail, false,\n             \"Print PostScript of every update, to stderr.\");\nDEFINE_bool(enc_detect_detail2, false,\n             \"More PostScript detail of every update, to stderr.\");\nDEFINE_bool(enc_detect_source, false, \"Include source text in detail\");\n// Encoding name must exactly match FIRST column of kI18NInfoByEncoding in\n// lang_enc.cc\n\n// Following flags are not in use. Replace them with constants to\n// avoid static initialization.\n\n//DEFINE_string(enc_detect_watch1, \"\", \"Do detail2 about this encoding name.\");\n//DEFINE_string(enc_detect_watch2, \"\", \"Do detail2 about this encoding name.\");\n\nstatic const char* const FLAGS_enc_detect_watch1 = \"\";\nstatic const char* const FLAGS_enc_detect_watch2 = \"\";\n\n// Only for experiments. Delete soon.\nDEFINE_bool(force127, false, \"Force Latin1, Latin2, Latin7 based on trigrams\");\n\n// Demo-mode/debugging experiment\nDEFINE_bool(demo_nodefault, false,\n             \"Default to all equal; no boost for declared encoding.\");\nDEFINE_bool(dirtsimple, false, \"Just scan and count for all encodings\");\nDEFINE_bool(ced_echo_input, false, \"Echo ced input to stderr\");\n\n\nstatic const int XDECILOG2 = 3;             // Multiplier for log base 2 ** n/10\nstatic const int XLOG2 = 30;                // Multiplier for log base 2 ** n\n\nstatic const int kFinalPruneDifference = 10 * XLOG2;\n                                            // Final bits of minimum\n                                            // probability difference 1st-nth\n                                            // to be pruned\n\nstatic const int kInititalPruneDifference = kFinalPruneDifference * 4;\n                                            // Initial bits of minimum\n                                            // probability difference 1st-nth\n                                            // to be pruned\n                                            //\nstatic const int kPruneDiffDecrement = kFinalPruneDifference;\n                                            // Decrements bits of minimum\n                                            // probability difference 1st-nth\n                                            // to be pruned\n\nstatic const int kSmallInitDiff = 2 * XLOG2;       // bits of minimum\n                                            // probability difference, base to\n                                            // superset encodings\n\nstatic const int kBoostInitial = 20 * XLOG2;    // bits of boost for\n                                            // initial byte patterns (BOM, 00)\n\nstatic const int kBadPairWhack = 20 * XLOG2;    // bits of whack for\n                                            // one bad pair\n\nstatic const int kBoostOnePair = 20 * XLOG2;    // bits of boost for\n                                            // one good pair in Hz, etc.\n\nstatic const int kGentleOnePair = 4 * XLOG2;    // bits of boost for\n                                            // one good sequence\n                                            //\nstatic const int kGentlePairWhack = 2 * XLOG2;       // bits of whack\n                                            // for ill-formed sequence\n\nstatic const int kGentlePairBoost = 2 * XLOG2;       // bits of boost\n                                            // for well-formed sequence\n\nstatic const int kDeclaredEncBoost = 5 * XDECILOG2;  // bits/10 of boost for\n                                            // best declared encoding per bigram\n\nstatic const int kBestEncBoost = 5 * XDECILOG2;     // bits/10 of boost for\n                                            // best encoding per bigram\n\nstatic const int kTrigramBoost = 2 * XLOG2; // bits of boost for Latin127 tri\n\nstatic const int kMaxPairs = 48;            // Max interesting pairs to look at\n                                            // If you change this,\n                                            // adjust *PruneDiff*\n\nstatic const int kPruneMask = 0x07;         // Prune every 8 interesting pairs\n\n\nstatic const int kBestPairsCount = 16;      // For first N pairs, do extra boost\n                                            // based on most likely encoding\n                                            // of pair over entire web\n\nstatic const int kDerateHintsBelow = 12;    // If we have fewer than N bigrams,\n                                            // weaken the hints enough that\n                                            // unhinted encodings have a hope of\n                                            // rising to the top\n\nstatic const int kMinRescanLength = 800;    // Don't bother rescanning for\n                                            // unreliable encoding if fewer\n                                            // than this many bytes unscanned.\n                                            // We will rescan at most last half\n                                            // of this.\n\nstatic const int kStrongBinary = 12;  // Make F_BINARY the only encoding\nstatic const int kWeakerBinary = 4;   // Make F_BINARY likely encoding\n\n// These are byte counts from front of file\nstatic const int kBinaryHardAsciiLimit = 6 * 1024;  // Not binary if all ASCII\nstatic const int kBinarySoftAsciiLimit = 8 * 1024;  //   \"   if mostly ASCII\n\n// We try here to avoid having title text dominate the encoding detection,\n// for the not-infrequent error case of title in encoding1, body in encoding2:\n// we want to bias toward encoding2 winning.\n//\n// kMaxBigramsTagTitleText should be a multiple of 2, 3, and 4, so that we\n// rarely cut off mid-character in the original (not-yet-detected) encoding.\n// This matters most for UTF-8 two- and three-byte codes and for\n// Shift-JIS three-byte codes.\nstatic const int kMaxBigramsTagTitleText = 12;      // Keep only some tag text\nstatic const int kWeightshiftForTagTitleText = 4;   // Give text in tags, etc.\n                                                    // 1/16 normal weight\n\nstatic const int kStrongPairs = 6;          // Let reliable enc with this many\n                                            // pairs overcome missing hint\n\nenum CEDInternalFlags {\n  kCEDNone = 0,           // The empty flag\n  kCEDRescanning = 1,     // Do not further recurse\n  kCEDSlowscore = 2,      // Do extra scoring\n  kCEDForceTags = 4,      // Always examine text inside tags\n};\n\n// Forward declaration\nEncoding InternalDetectEncoding(\n    CEDInternalFlags flags, const char* text, int text_length,\n    const char* url_hint, const char* http_charset_hint,\n    const char* meta_charset_hint, const int encoding_hint,\n    const Language language_hint,  // User interface lang\n    const CompactEncDet::TextCorpusType corpus_type,\n    bool ignore_7bit_mail_encodings, int* bytes_consumed, bool* is_reliable,\n    Encoding* second_best_enc);\n\ntypedef struct {\n  const uint8* hires[4];  // Pointers to possible high-resolution bigram deltas\n  uint8 x_bar;          // Average byte2 value\n  uint8 y_bar;          // Average byte1 value\n  uint8 x_stddev;       // Standard deviation of byte2 value\n  uint8 y_stddev;       // Standard deviation of byte1 value\n  int so;               // Scaling offset -- add to probabilities below\n  uint8 b1[256];        // Unigram probability for first byte of aligned bigram\n  uint8 b2[256];        // Unigram probability for second byte of aligned bigram\n  uint8 b12[256];       // Unigram probability for cross bytes of aligned bigram\n} UnigramEntry;\n\n//typedef struct {\n//  uint8 b12[256*256]; // Bigram probability for aligned bigram\n//} FullBigramEntry;\n\n\n// Include all the postproc-generated tables here:\n// RankedEncoding\n// kMapToEncoding\n// unigram_table\n// kMostLIkelyEncoding\n// kTLDHintProbs\n// kCharsetHintProbs\n// HintEntry, kMaxTldKey kMaxTldVector, etc.\n// =============================================================================\n\n#include \"compact_enc_det/compact_enc_det_generated_tables.h\"\n\n\n#define F_ASCII F_Latin1    // \"ASCII\" is a misnomer, so this code uses \"Latin1\"\n\n#define F_BINARY F_X_BINARYENC        // We are mid-update for name change\n#define F_UTF8UTF8 F_X_UTF8UTF8       // We are mid-update for name change\n#define F_BIG5_CP950 F_BIG5           // We are mid-update for name change\n#define F_Unicode F_UTF_16LE          // We are mid-update for name change\n// =============================================================================\n\n// 7-bit encodings have at least one \"interesting\" byte value < 0x80\n//   (00 0E 1B + ~)\n// JIS 2022-cn 2022-kr hz utf7\n// Unicode UTF-16 UTF-32\n// 8-bit encodings have no interesting byte values < 0x80\nstatic const uint32 kSevenBitActive = 0x00000001;   // needs <80 to detect\nstatic const uint32 kUTF7Active     = 0x00000002;   // <80 and +\nstatic const uint32 kHzActive       = 0x00000004;   // <80 and ~\nstatic const uint32 kIso2022Active  = 0x00000008;   // <80 and 1B 0E 0F\nstatic const uint32 kUTF8Active     = 0x00000010;\nstatic const uint32 kUTF8UTF8Active = 0x00000020;\nstatic const uint32 kUTF1632Active  = 0x00000040;   // <80 and 00\nstatic const uint32 kBinaryActive   = 0x00000080;   // <80 and 00\nstatic const uint32 kTwobyteCode    = 0x00000100;   // Needs 8xxx\nstatic const uint32 kIsIndicCode    = 0x00000200;   //\nstatic const uint32 kHighAlphaCode  = 0x00000400;   // full alphabet in 8x-Fx\nstatic const uint32 kHighAccentCode = 0x00000800;   // accents in 8x-Fx\nstatic const uint32 kEUCJPActive    = 0x00001000;   // Have to mess with phase\n\n\n// Debug only. not thread safe\nstatic int encdet_used = 0;\nstatic int rescore_used = 0;\nstatic int rescan_used = 0;\nstatic int robust_used = 0;\nstatic int looking_used = 0;\nstatic int doing_used = 0;\n\n\n// For debugging only -- about 256B/entry times about 500 = 128KB\n// TODO: only allocate this if being used\ntypedef struct {\n  int offset;\n  int best_enc;     // Best ranked encoding for this bigram, or\n                    // -1 for overhead entries\n  string label;\n  int detail_enc_prob[NUM_RANKEDENCODING];\n} DetailEntry;\n\nstatic int watch1_rankedenc = -1;     // Debug. not threadsafe\nstatic int watch2_rankedenc = -1;     // Debug. not threadsafe\n////static int next_detail_entry = 0;     // Debug. not threadsafe\n////static DetailEntry details[kMaxPairs * 10];  // Allow 10 details per bigram\n// End For debugging only\n\n// Must match kTestPrintableAsciiTildePlus exit codes, minus one\nenum PairSet {AsciiPair = 0, OtherPair = 1, NUM_PAIR_SETS = 2};\n\n// The reasons for pruning\nenum PruneReason {PRUNE_NORMAL, PRUNE_SLOWEND, PRUNE_FINAL};\n\nstatic const char* kWhatSetName[] = {\"Ascii\", \"Other\"};\n\n\n// State for encodings that do shift-out/shift-in between one- and two-byte\n// regions (ISO-2022-xx, HZ)\nenum StateSoSi {SOSI_NONE, SOSI_ERROR, SOSI_ONEBYTE, SOSI_TWOBYTE};\n\ntypedef struct {\n  const uint8* initial_src;       // For calculating byte offsets\n  const uint8* limit_src;         // Range of input source\n  const uint8* prior_src;         // Source consumed by prior call to BoostPrune\n  const uint8* last_pair;         // Last pair inserted into interesting_pairs\n\n  DetailEntry* debug_data;        // Normally NULL. Ptr to debug data for\n                                  // FLAGS_enc_detect_detail PostScript data\n  int next_detail_entry;          // Debug\n\n  bool done;\n  bool reliable;\n  bool hints_derated;\n  int declared_enc_1;             // From http/meta hint\n  int declared_enc_2;             // from http/meta hint\n  int prune_count;                // Number of times we have pruned\n\n  int trigram_highwater_mark;       // Byte offset of last trigram processing\n  bool looking_for_latin_trigrams;  // True if we should test for doing\n                                    //  Latin1/2/7 trigram processing\n  bool do_latin_trigrams;           // True if we actually are scoring trigrams\n\n  // Miscellaneous state variables for difficult encodings\n  int binary_quadrants_count;     // Number of four bigram quadrants seen:\n                                  //  0xxxxxxx0xxxxxxx 0xxxxxxx1xxxxxx\n                                  //  1xxxxxxx0xxxxxxx 1xxxxxxx1xxxxxx\n  int binary_8x4_count;           // Number of 8x4 buckets seen:\n  uint32 binary_quadrants_seen;   // Bit[i] set if bigram i.......i....... seen\n  uint32 binary_8x4_seen;         // Bit[i] set if bigram iii.....ii...... seen\n  int utf7_starts;                // Count of possible UTF-7 beginnings seen\n  int prior_utf7_offset;          // Source consumed by prior UTF-7 string\n  int next_utf8_ministate;        // Mini state for UTF-8 sequences\n  int utf8_minicount[6];          // Number of correct 2- 3- 4-byte seq, errors\n  int next_utf8utf8_ministate;    // Mini state for UTF8UTF8 sequences\n  int utf8utf8_odd_byte;          // UTF8UTF8 seq has odd number of bytes\n  int utf8utf8_minicount[6];      // Number of correct 2- 3- 4-byte seq, errors\n  StateSoSi next_2022_state;            // Mini state for 2022 sequences\n  StateSoSi next_hz_state;              // Mini state for HZ sequences\n  bool next_eucjp_oddphase;             // Mini state for EUC-JP sequences\n  int byte32_count[8];            // Count of top 3 bits of byte1 of bigram\n                                  // 0x1x 2x3x 4x5x 6x7x 8x9x AxBx CxDx ExFx\n  uint32 active_special;          // Bits showing which special cases are active\n\n  Encoding tld_hint;              // Top TLD encoding or UNKNOWN\n  Encoding http_hint;             // What the document says about itself or\n  Encoding meta_hint;             // UNKNOWN_ENCODING. BOM is initial byte\n  Encoding bom_hint;              // order mark for UTF-xx\n\n  // small cache of previous interesting bigrams\n  int next_prior_bigram;\n  int prior_bigram[4];\n  int prior_binary[1];\n\n  int top_rankedencoding;         // Top two probabilities and families\n  int second_top_rankedencoding;\n  int top_prob;\n  int second_top_prob;\n  int prune_difference;           // Prune things this much below the top prob\n  int rankedencoding_list_len;                // Number of active encodings\n  int rankedencoding_list[NUM_RANKEDENCODING];  // List of active encodings\n                                                //\n  int enc_prob[NUM_RANKEDENCODING];           // Cumulative probability per enc\n                                              // This is where all the action is\n  int hint_prob[NUM_RANKEDENCODING];          // Initial hint probabilities\n  int hint_weight[NUM_RANKEDENCODING];        // Number of hints for this enc\n\n  // Two sets -- one for printable ASCII, one for the rest\n  int prior_interesting_pair[NUM_PAIR_SETS];  // Pairs consumed by prior call\n  int next_interesting_pair[NUM_PAIR_SETS];   // Next pair to write\n  char interesting_pairs[NUM_PAIR_SETS][kMaxPairs * 2];   // Two bytes per pair\n  int interesting_offsets[NUM_PAIR_SETS][kMaxPairs];      // Src offset of pair\n  int interesting_weightshift[NUM_PAIR_SETS][kMaxPairs];  // weightshift of pair\n} DetectEncodingState;\n\n\n// Record a debug event that changes probabilities\nvoid SetDetailsEncProb(DetectEncodingState* destatep,\n                       int offset, int best_enc, const char* label) {\n  int next = destatep->next_detail_entry;\n  destatep->debug_data[next].offset = offset;\n  destatep->debug_data[next].best_enc = best_enc;\n  destatep->debug_data[next].label = label;\n  memcpy(&destatep->debug_data[next].detail_enc_prob,\n         &destatep->enc_prob,\n         sizeof(destatep->enc_prob));\n  ++destatep->next_detail_entry;\n}\n\n// Record a debug event that changes probabilities, copy offset\nvoid SetDetailsEncProbCopyOffset(DetectEncodingState* destatep,\n                                 int best_enc, const char* label) {\n  int next = destatep->next_detail_entry;\n  destatep->debug_data[next].offset = destatep->debug_data[next - 1].offset;\n  destatep->debug_data[next].best_enc = best_enc;\n  destatep->debug_data[next].label = label;\n  memcpy(&destatep->debug_data[next].detail_enc_prob,\n         &destatep->enc_prob,\n         sizeof(destatep->enc_prob));\n  ++destatep->next_detail_entry;\n}\n\n// Record a debug event that changes probs and has simple text label\nvoid SetDetailsEncLabel(DetectEncodingState* destatep, const char* label) {\n  int next = destatep->next_detail_entry;\n  destatep->debug_data[next].offset = destatep->debug_data[next - 1].offset;\n  destatep->debug_data[next].best_enc = -1;\n  destatep->debug_data[next].label = label;\n  memcpy(&destatep->debug_data[next].detail_enc_prob,\n         &destatep->enc_prob,\n         sizeof(destatep->enc_prob));\n  ++destatep->next_detail_entry;\n}\n\n// Record a debug event that is just a text label, no change in probs\nvoid SetDetailsLabel(DetectEncodingState* destatep, const char* label) {\n  int next = destatep->next_detail_entry;\n  destatep->debug_data[next].offset = destatep->debug_data[next - 1].offset;\n  destatep->debug_data[next].best_enc = -1;\n  destatep->debug_data[next].label = label;\n  memcpy(&destatep->debug_data[next].detail_enc_prob,\n         &destatep->debug_data[next - 1].detail_enc_prob,\n         sizeof(destatep->enc_prob));\n  ++destatep->next_detail_entry;\n}\n\n\n// Maps superset encodings to base, to see if 2 encodings are compatible\n// (Non-identity mappings are marked \"-->\" below.)\nstatic const Encoding kMapEncToBaseEncoding[] = {\n  ISO_8859_1,       // 0: Teragram ASCII\n  ISO_8859_2,       // 1: Teragram Latin2\n  ISO_8859_3,       // 2: in BasisTech but not in Teragram\n  ISO_8859_4,       // 3: Teragram Latin4\n  ISO_8859_5,       // 4: Teragram ISO-8859-5\n  ISO_8859_6,       // 5: Teragram Arabic\n  ISO_8859_7,       // 6: Teragram Greek\n  MSFT_CP1255,      // 7: Teragram Hebrew --> 36\n  ISO_8859_9,       // 8: in BasisTech but not in Teragram\n  ISO_8859_10,      // 9: in BasisTech but not in Teragram\n  JAPANESE_EUC_JP,  // 10: Teragram EUC_JP\n  JAPANESE_SHIFT_JIS,  // 11: Teragram SJS\n  JAPANESE_JIS,     // 12: Teragram JIS\n  CHINESE_BIG5,     // 13: Teragram BIG5\n  CHINESE_GB,       // 14: Teragram GB\n  CHINESE_EUC_CN,   // 15: Teragram EUC-CN\n  KOREAN_EUC_KR,    // 16: Teragram KSC\n  UNICODE,          // 17: Teragram Unicode\n  CHINESE_EUC_CN,   // 18: Teragram EUC --> 15\n  CHINESE_EUC_CN,   // 19: Teragram CNS --> 15\n  CHINESE_BIG5,     // 20: Teragram BIG5_CP950 --> 13\n  JAPANESE_SHIFT_JIS,   // 21: Teragram CP932 --> 11\n  UTF8,             // 22\n  UNKNOWN_ENCODING, // 23\n  ISO_8859_1,       // 24: ISO_8859_1 with all characters <= 127 --> 0\n  RUSSIAN_KOI8_R,   // 25: Teragram KOI8R\n  RUSSIAN_CP1251,   // 26: Teragram CP1251\n  ISO_8859_1,       // 27: CP1252 aka MSFT euro ascii --> 0\n  RUSSIAN_KOI8_RU,  // 28: CP21866 aka KOI8_RU, used for Ukrainian\n  MSFT_CP1250,      // 29: CP1250 aka MSFT eastern european\n  ISO_8859_1,       // 30: aka ISO_8859_0 aka ISO_8859_1 euroized --> 0\n  ISO_8859_9,       // 31: used for Turkish\n  ISO_8859_13,      // 32: used in Baltic countries --> 43\n  ISO_8859_11,      // 33: aka TIS-620, used for Thai\n  ISO_8859_11,      // 34: used for Thai --> 33\n  MSFT_CP1256,      // 35: used for Arabic\n  MSFT_CP1255,      // 36: Logical Hebrew Microsoft\n  MSFT_CP1255,      // 37: Iso Hebrew Logical --> 36\n  MSFT_CP1255,      // 38: Iso Hebrew Visual --> 36\n  CZECH_CP852,      // 39\n  ISO_8859_2,       // 40: aka ISO_IR_139 aka KOI8_CS --> 1\n  MSFT_CP1253,      // 41: used for Greek, but NOT a superset of 8859-7\n  RUSSIAN_CP866,    // 42\n  ISO_8859_13,      // 43\n  ISO_2022_KR,      // 44\n  CHINESE_GB,       // 45 GBK --> 14\n  CHINESE_GB,       // 46 GB18030 --> 14\n  CHINESE_BIG5,     // 47 BIG5_HKSCS --> 13\n  ISO_2022_KR,      // 48 ISO_2022_CN --> 44\n  TSCII,            // 49 Indic encoding\n  TAMIL_MONO,       // 50 Indic encoding - Tamil\n  TAMIL_BI,         // 51 Indic encoding - Tamil\n  JAGRAN,           // 52 Indic encoding - Devanagari\n  MACINTOSH_ROMAN,  // 53\n  UTF7,             // 54\n  BHASKAR,          // 55 Indic encoding - Devanagari\n  HTCHANAKYA,       // 56 Indic encoding - Devanagari\n  UTF16BE,          // 57\n  UTF16LE,          // 58\n  UTF32BE,          // 59\n  UTF32LE,          // 60\n  BINARYENC,        // 61\n  HZ_GB_2312,       // 62\n  UTF8UTF8,         // 63\n  TAM_ELANGO,       // 64 Elango - Tamil\n  TAM_LTTMBARANI,   // 65 Barani - Tamil\n  TAM_SHREE,        // 66 Shree - Tamil\n  TAM_TBOOMIS,      // 67 TBoomis - Tamil\n  TAM_TMNEWS,       // 68 TMNews - Tamil\n  TAM_WEBTAMIL,     // 69 Webtamil - Tamil\n  KDDI_SHIFT_JIS,         // 70 KDDI Shift_JIS\n  DOCOMO_SHIFT_JIS,       // 71 DoCoMo Shift_JIS\n  SOFTBANK_SHIFT_JIS,     // 72 SoftBank Shift_JIS\n  KDDI_ISO_2022_JP,       // 73 KDDI ISO-2022-JP\n  SOFTBANK_ISO_2022_JP,   // 74 SOFTBANK ISO-2022-JP\n};\n\nCOMPILE_ASSERT(arraysize(kMapEncToBaseEncoding) == NUM_ENCODINGS,\n               kMapEncToBaseEncoding_has_incorrect_size);\n\n// Maps base encodings to 0, supersets to 1+, undesired to -1\n// (Non-identity mappings are marked \"-->\" below.)\nstatic const int kMapEncToSuperLevel[] = {\n  0,       // 0: Teragram ASCII\n  0,       // 1: Teragram Latin2\n  0,       // 2: in BasisTech but not in Teragram\n  0,       // 3: Teragram Latin4\n  0,       // 4: Teragram ISO-8859-5\n  0,       // 5: Teragram Arabic\n  0,       // 6: Teragram Greek\n  0,       // 7: Teragram Hebrew\n  0,       // 8: in BasisTech but not in Teragram\n  0,      // 9: in BasisTech but not in Teragram\n  0,      // 10: Teragram EUC_JP\n  0,      // 11: Teragram SJS\n  0,      // 12: Teragram JIS\n  0,      // 13: Teragram BIG5\n  0,       // 14: Teragram GB\n  0,      // 15: Teragram EUC-CN\n  0,      // 16: Teragram KSC\n  0,          // 17: Teragram Unicode\n  -1,     // 18: Teragram EUC --> 15\n  -1,     // 19: Teragram CNS --> 15\n  1,      // 20: Teragram BIG5_CP950 --> 13\n  1,      // 21: Teragram CP932 --> 11\n  0,             // 22\n  -1,     // 23\n  -1,       // 24: ISO_8859_1 with all characters <= 127 --> 0\n  0,      // 25: Teragram KOI8R\n  0,      // 26: Teragram CP1251\n  1,       // 27: CP1252 aka MSFT euro ascii --> 0\n  0,      // 28: CP21866 aka KOI8_RU, used for Ukrainian\n  0,      // 29: CP1250 aka MSFT eastern european\n  1,       // 30: aka ISO_8859_0 aka ISO_8859_1 euroized --> 0\n  0,       // 31: used for Turkish\n  1,      // 32: used in Baltic countries --> 43\n  0,      // 33: aka TIS-620, used for Thai\n  1,      // 34: used for Thai --> 33\n  0,      // 35: used for Arabic\n  0,      // 36: Logical Hebrew Microsoft\n  -1,      // 37: Iso Hebrew Logical --> 36\n  -1,       // 38: Iso Hebrew Visual --> 7\n  0,      // 39\n  1,       // 40: aka ISO_IR_139 aka KOI8_CS --> 1\n  0,       // 41: used for Greek, NOT superset of 8859-7\n  0,      // 42\n  0,      // 43\n  0,      // 44\n  1,       // 45 GBK --> 14\n  1,       // 46 GB18030 --> 14\n  1,      // 47 BIG5_HKSCS --> 13\n  1,      // 48 ISO_2022_CN --> 44\n  0,      // 49 Indic encoding\n  0,       // 50 Indic encoding - Tamil\n  0,         // 51 Indic encoding - Tamil\n  0,           // 52 Indic encoding - Devanagari\n  0,      // 53\n  0,      // 54\n  0,      // 55 Indic encoding - Devanagari\n  0,      // 56 Indic encoding - Devanagari\n  0,          // 57\n  0,          // 58\n  0,          // 59\n  0,          // 60\n  0,        // 61\n  0,       // 62\n  2,         // 63\n  0, 0, 0, 0, 0, 0,         // add six more Tamil\n  0, 0, 0, 0, 0,            // add five encodings with emoji\n};\n\nCOMPILE_ASSERT(arraysize(kMapEncToSuperLevel) == NUM_ENCODINGS,\n               kMapEncToSuperLevel_has_incorrect_size);\n\n\n\n// Subscripted by Encoding enum value\nstatic const uint32 kSpecialMask[] = {\n  kHighAccentCode,                    // 0\n  kHighAccentCode,\n  kHighAccentCode,\n  kHighAccentCode,\n  kHighAlphaCode,                     // 4\n  kHighAlphaCode,\n  kHighAlphaCode,\n  kHighAlphaCode,\n  kHighAccentCode,\n  kHighAccentCode,\n\n  kTwobyteCode + kEUCJPActive,        // 10 euc-jp\n  kTwobyteCode,\n  kSevenBitActive + kIso2022Active,   // jis\n  kTwobyteCode,\n  kTwobyteCode,\n  kTwobyteCode,\n  kTwobyteCode,\n  kSevenBitActive + kUTF1632Active,   // Unicode\n  kTwobyteCode,\n  kTwobyteCode,\n\n  kTwobyteCode,                       // 20\n  kTwobyteCode,\n  kUTF8Active,                        // UTF-8\n  0,\n  0,\n  kHighAlphaCode,                     // 25\n  kHighAlphaCode,\n  kHighAccentCode,\n  kHighAlphaCode,\n  kHighAccentCode,\n\n  kHighAccentCode,                   // 30\n  kHighAccentCode,\n  kHighAccentCode,\n  kHighAlphaCode,\n  kHighAlphaCode,\n  kHighAlphaCode,                    // 35\n  kHighAlphaCode,\n  kHighAlphaCode,\n  kHighAlphaCode,\n  0,\n\n  0,                                  // 40\n  kHighAlphaCode,\n  kHighAlphaCode,\n  kHighAccentCode,\n  kSevenBitActive + kIso2022Active,   // 2022-kr\n  kTwobyteCode,\n  kTwobyteCode,\n  kTwobyteCode,\n  kSevenBitActive + kIso2022Active,   // 2022-cn\n  kHighAlphaCode + kIsIndicCode,       // 49 TSCII\n\n  kHighAlphaCode + kIsIndicCode,       // 50 TAMIL_MONO\n  kHighAlphaCode + kIsIndicCode,       // 51 TAMIL_BI\n  kHighAlphaCode + kIsIndicCode,       // 52 JAGRAN\n  kHighAccentCode,                     // 53 MACINTOSH_ROMAN\n  kSevenBitActive + kUTF7Active,      // 54 UTF-7\n  kHighAlphaCode + kIsIndicCode,       // 55 BHASKAR Indic encoding - Devanagari\n  kHighAlphaCode + kIsIndicCode,       // 56 HTCHANAKYA Indic encoding - Devanagari\n  kSevenBitActive + kUTF1632Active,   // 57 UTF16BE\n  kSevenBitActive + kUTF1632Active,   // 58 UTF16LE\n  kSevenBitActive + kUTF1632Active,   // 59 UTF32BE\n  kSevenBitActive + kUTF1632Active,   // 60 UTF32LE\n\n  kSevenBitActive + kBinaryActive,    // 61 BINARYENC\n  kSevenBitActive + kHzActive,        // 62 HZ_GB_2312\n  kHighAccentCode + kUTF8Active + kUTF8UTF8Active,      // 63 UTF8UTF8\n  kHighAlphaCode + kIsIndicCode,       // 64 Elango - Tamil\n  kHighAlphaCode + kIsIndicCode,       // 65 Barani - Tamil\n  kHighAlphaCode + kIsIndicCode,       // 66 Shree - Tamil\n  kHighAlphaCode + kIsIndicCode,       // 67 TBoomis - Tamil\n  kHighAlphaCode + kIsIndicCode,       // 68 TMNews - Tamil\n  kHighAlphaCode + kIsIndicCode,       // 69 Webtamil - Tamil\n  kTwobyteCode,                       // 70 KDDI Shift_JIS\n  kTwobyteCode,                       // 71 DoCoMo Shift_JIS\n  kTwobyteCode,                       // 72 SoftBank Shift_JIS\n  kSevenBitActive + kIso2022Active,   // 73 KDDI-ISO-2022-JP\n  kSevenBitActive + kIso2022Active,   // 74 SOFTBANK-ISO-2022-JP\n};\n\nCOMPILE_ASSERT(arraysize(kSpecialMask) == NUM_ENCODINGS,\n               kSpecialMask_has_incorrect_size);\n\n\n/***\n  kHighAlphaCode -- full alphabet in 8x-Fx range, not just accents\n\n  ISO_8859_5,       // 4: Teragram ISO-8859-5 Cyrl      UL bd\n  RUSSIAN_CP1251,   // 26: Teragram CP1251              UL cdef\n  RUSSIAN_KOI8_R,   // 25: Teragram KOI8R               LU cdef\n  RUSSIAN_KOI8_RU,  // 28: CP21866 aka KOI8_RU,         LU cdef\n  RUSSIAN_CP866,     // 42                              89ae\n\n  ISO_8859_6,       // 5: Teragram Arabic               nocase cde\n  MSFT_CP1256,      // 35: used for Arabic              nocase cde\n\n  ISO_8859_7,       // 6: Teragram Greek                UL cdef\n  MSFT_CP1253,       // 41: used for Greek              UL cdef\n\n  ISO_8859_8,       // 7: Teragram Hebrew               nocase ef\n  MSFT_CP1255,      // 36: Logical Hebrew Microsoft     nocase ef\n  ISO_8859_8_I,     // 37: Iso Hebrew Logical           nocase ef\n  HEBREW_VISUAL,    // 38: Iso Hebrew Visual            nocase ef\n\n  ISO_8859_11,      // 33: aka TIS-620, used for Thai   nocase abcde\n  MSFT_CP874,       // 34: used for Thai                nocase abcde\n\n  TSCII,             // 49                              8-f\n  TAMIL_MONO,        // 50\n  TAMIL_BI,          // 51\n  JAGRAN,            // 52\n  BHASKAR,           // 55 Indic encoding - Devanagari\n  HTCHANAKYA,        // 56 Indic encoding - Devanagari\n***/\n\n// We can scan bytes using this at about 500 MB/sec 2.8GHz P4\n// Slow scan uses this, stopping on NUL ESC SO SI bad C0 and + ~\n// We allow FF, 0x0C, here because it gives a better result for old\n// Ascii text formatted for a TTY\n// non-zero exits scan loop -- 1 for printable ASCII, 2 otherwise\nstatic const char kTestPrintableAsciiTildePlus[256] = {\n  2,2,2,2,2,2,2,2, 2,0,0,2,0,0,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  0,0,0,0,0,0,0,0, 0,0,0,1,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,1,2,\n\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n};\n\n// We can scan bytes using this at about 550 MB/sec 2.8GHz P4\n// Slow scan uses this, stopping on NUL ESC SO SI and bad C0\n// after Hz and UTF7 are pruned away\n// We allow Form Feed, 0x0C, here\nstatic const char kTestPrintableAscii[256] = {\n  2,2,2,2,2,2,2,2, 2,0,0,2,0,0,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,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1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,62,-1,-1,-1,63,\n  52,53,54,55,56,57,58,59, 60,61,-1,-1,-1,-1,-1,-1,\n\n  -1, 0, 1, 2, 3, 4, 5, 6,  7, 8, 9,10,11,12,13,14,\n  15,16,17,18,19,20,21,22, 23,24,25,-1,-1,-1,-1,-1,\n  -1,26,27,28,29,30,31,32, 33,34,35,36,37,38,39,40,\n  41,42,43,44,45,46,47,48, 49,50,51,-1,-1,-1,-1,-1,\n\n  -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,\n\n  -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,\n};\n\n\n// Subscripted by <state, byte/16>\n// Accepts Cx->8x Dx->8x Ex->8x->8x Fx->8x->8x->8x\n//\n// Fixed Problem: GB has sequences like B2DB B8D6 BDE1 B9B9\n// which we can mis-parse as an error byte followed by good UTF-8:\n//                                      B2 DBB8 D6BD E1B9B9\n// To counteract this, we now require an ASCII7 byte to resync out\n// of the error state\n// Next problem: good UTF-8 with bad byte\n// efbc a012 eea4 bee7 b280 c2b7\n// efbca0 12 eea4be e7b280 c2b7\n//        ^^ bad byte\n// fix: change state0 byte 1x to be don't-care\n//\n// Short UTF-8 ending in ASCII7 byte should resync immediately:\n// E0 20 E0 A6 AA should give one error and resync at 2nd E0\n//\nstatic const char kMiniUTF8State[8][16] = {\n  {0,0,0,0,0,0,0,0, 7,7,7,7,1,1,2,4,},      // [0] start char (allow cr/lf/ht)\n  {0,7,0,0,0,0,0,0, 0,0,0,0,7,7,7,7,},      // [1] continue 1 of 2\n  {0,7,0,0,0,0,0,0, 3,3,3,3,7,7,7,7,},      // [2] continue 1 of 3\n  {0,7,0,0,0,0,0,0, 0,0,0,0,7,7,7,7,},      // [3] continue 2 of 3\n  {0,7,0,0,0,0,0,0, 5,5,5,5,7,7,7,7,},      // [4] continue 1 of 4\n  {0,7,0,0,0,0,0,0, 6,6,6,6,7,7,7,7,},      // [5] continue 2 of 4\n  {0,7,0,0,0,0,0,0, 0,0,0,0,7,7,7,7,},      // [6] continue 3 of 4\n  {0,7,0,0,0,0,0,0, 7,7,7,7,7,7,7,7,},      // [7] error, soak up continues,\n                                            // ONLY resync after Ascii char\n                                            //     then restart\n};\n// Counter to increment: 0-don'tcare 1-error 2-good_2B 3-good_3B 4-good_4B\nstatic const char kMiniUTF8Count[8][16] = {\n  {0,0,0,0,0,0,0,0, 1,1,1,1,0,0,0,0,},      // [0] start char (allow cr/lf/ht)\n  {1,1,1,1,1,1,1,1, 2,2,2,2,1,1,1,1,},      // [1] continue 1 of 2\n  {1,1,1,1,1,1,1,1, 0,0,0,0,1,1,1,1,},      // [2] continue 1 of 3\n  {1,1,1,1,1,1,1,1, 3,3,3,3,1,1,1,1,},      // [3] continue 2 of 3\n  {1,1,1,1,1,1,1,1, 0,0,0,0,1,1,1,1,},      // [4] continue 1 of 4\n  {1,1,1,1,1,1,1,1, 0,0,0,0,1,1,1,1,},      // [5] continue 2 of 4\n  {1,1,1,1,1,1,1,1, 4,4,4,4,1,1,1,1,},      // [6] continue 3 of 4\n  {0,1,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,},      // [7] error, soak up continues,\n                                            //     then restart\n};\n\n// Subscripted by <state, f(byte1) + g(byte2)>\n// where f(x)= E2->4, Cx->8 and C3->12 and 0 otherwise\n// and g(x) = (x >> 4) & 3        8x->0 9x->1 Ax->2 Bx->3 Cx->0, etc.\n//                                (no checking for illegal bytes)\n// Here are example patterns of CP1252 converted to UTF-8 0/1/2 times. We want\n// to detect two, so we can back-convert to one.\n// zero one    two                 pattern\n// ---- ------ ----------------    -----------------\n// 81   C281   C382C281            C3->8x->C2->xx\n// 98   CB9C   C38BC593            C3->8x->C5->xx\n// C3   C383   C383C692            C3->8x->C6->xx\n// C8   C388   C383CB86            C3->8x->CB->xx\n// 83   C692   C386E28099          C3->8x->E2->xx->8x\n// 80   E282AC C3A2E2809AC2AC      C3->A2->E2->xx->xx->Cx->xx\n// 92   E28099 C3A2E282ACE284A2    C3->A2->E2->xx->xx->E2->xx->xx\n//\n// We also want to detect bare-byte extra UTF-8 conversions:\n// zero one    two                 pattern\n// ---- ------ ----------------    -----------------\n// C3   C3     C383                C3->8x->C2->xx\n// D3   D3     C393                C3->9x->C2->xx->C2->xx\n// E3   E3     C3A3                C3->Ax->C2->xx->C2->xx->C2->xx\n// F3   F3     C3B2                C3->Bx->C2->xx->C2->xx->C2->xx->C2->xx\n//\n\n/**\nCP1252 => UTF8 => UTF8UTF8\n80 => E282AC => C3A2E2809AC2AC\n81 => C281 => C382C281\n82 => E2809A => C3A2E282ACC5A1\n83 => C692 => C386E28099\n84 => E2809E => C3A2E282ACC5BE\n85 => E280A6 => C3A2E282ACC2A6\n86 => E280A0 => C3A2E282ACC2A0\n87 => E280A1 => C3A2E282ACC2A1\n88 => CB86 => C38BE280A0\n89 => E280B0 => C3A2E282ACC2B0\n8A => C5A0 => C385C2A0\n8B => E280B9 => C3A2E282ACC2B9\n8C => C592 => C385E28099\n8D => C28D => C382C28D\n8E => C5BD => C385C2BD\n8F => C28F => C382C28F\n90 => C290 => C382C290\n91 => E28098 => C3A2E282ACCB9C\n92 => E28099 => C3A2E282ACE284A2\n93 => E2809C => C3A2E282ACC593\n94 => E2809D => C3A2E282ACC29D\n95 => E280A2 => C3A2E282ACC2A2\n96 => E28093 => C3A2E282ACE2809C\n97 => E28094 => C3A2E282ACE2809D\n98 => CB9C => C38BC593\n99 => E284A2 => C3A2E2809EC2A2\n9A => C5A1 => C385C2A1\n9B => E280BA => C3A2E282ACC2BA\n9C => C593 => C385E2809C\n9D => C29D => C382C29D\n9E => C5BE => C385C2BE\n9F => C5B8 => C385C2B8\nA0 => C2A0 => C382C2A0\nA1 => C2A1 => C382C2A1\nA2 => C2A2 => C382C2A2\nA3 => C2A3 => C382C2A3\nA4 => C2A4 => C382C2A4\nA5 => C2A5 => C382C2A5\nA6 => C2A6 => C382C2A6\nA7 => C2A7 => C382C2A7\nA8 => C2A8 => C382C2A8\nA9 => C2A9 => C382C2A9\nAA => C2AA => C382C2AA\nAB => C2AB => C382C2AB\nAC => C2AC => C382C2AC\nAD => C2AD => C382C2AD\nAE => C2AE => C382C2AE\nAF => C2AF => C382C2AF\nB0 => C2B0 => C382C2B0\nB1 => C2B1 => C382C2B1\nB2 => C2B2 => C382C2B2\nB3 => C2B3 => C382C2B3\nB4 => C2B4 => C382C2B4\nB5 => C2B5 => C382C2B5\nB6 => C2B6 => C382C2B6\nB7 => C2B7 => C382C2B7\nB8 => C2B8 => C382C2B8\nB9 => C2B9 => C382C2B9\nBA => C2BA => C382C2BA\nBB => C2BB => C382C2BB\nBC => C2BC => C382C2BC\nBD => C2BD => C382C2BD\nBE => C2BE => C382C2BE\nBF => C2BF => C382C2BF\nC0 => C380 => C383E282AC\nC1 => C381 => C383C281\nC2 => C382 => C383E2809A\nC3 => C383 => C383C692\nC4 => C384 => C383E2809E\nC5 => C385 => C383E280A6\nC6 => C386 => C383E280A0\nC7 => C387 => C383E280A1\nC8 => C388 => C383CB86\nC9 => C389 => C383E280B0\nCA => C38A => C383C5A0\nCB => C38B => C383E280B9\nCC => C38C => C383C592\nCD => C38D => C383C28D\nCE => C38E => C383C5BD\nCF => C38F => C383C28F\nD0 => C390 => C383C290\nD1 => C391 => C383E28098\nD2 => C392 => C383E28099\nD3 => C393 => C383E2809C\nD4 => C394 => C383E2809D\nD5 => C395 => C383E280A2\nD6 => C396 => C383E28093\nD7 => C397 => C383E28094\nD8 => C398 => C383CB9C\nD9 => C399 => C383E284A2\nDA => C39A => C383C5A1\nDB => C39B => C383E280BA\nDC => C39C => C383C593\nDD => C39D => C383C29D\nDE => C39E => C383C5BE\nDF => C39F => C383C5B8\nE0 => C3A0 => C383C2A0\nE1 => C3A1 => C383C2A1\nE2 => C3A2 => C383C2A2\nE3 => C3A3 => C383C2A3\nE4 => C3A4 => C383C2A4\nE5 => C3A5 => C383C2A5\nE6 => C3A6 => C383C2A6\nE7 => C3A7 => C383C2A7\nE8 => C3A8 => C383C2A8\nE9 => C3A9 => C383C2A9\nEA => C3AA => C383C2AA\nEB => C3AB => C383C2AB\nEC => C3AC => C383C2AC\nED => C3AD => C383C2AD\nEE => C3AE => C383C2AE\nEF => C3AF => C383C2AF\nF0 => C3B0 => C383C2B0\nF1 => C3B1 => C383C2B1\nF2 => C3B2 => C383C2B2\nF3 => C3B3 => C383C2B3\nF4 => C3B4 => C383C2B4\nF5 => C3B5 => C383C2B5\nF6 => C3B6 => C383C2B6\nF7 => C3B7 => C383C2B7\nF8 => C3B8 => C383C2B8\nF9 => C3B9 => C383C2B9\nFA => C3BA => C383C2BA\nFB => C3BB => C383C2BB\nFC => C3BC => C383C2BC\nFD => C3BD => C383C2BD\nFE => C3BE => C383C2BE\nFF => C3BF => C383C2BF\n**/\n\n// Subscripted by <state, f(byte1) + g(byte2)>\n// where f(x)= E2->4, C2/5/6/B->8 and C3->12 and 0 otherwise\n// and g(x) = (x >> 4) & 3        8x->0 9x->1 Ax->2 Bx->3 Cx->0, etc.\n\n// 81   C281   C382C281            C3->8x->C2->xx\n// 98   CB9C   C38BC593            C3->8x->C5->xx\n// C3   C383   C383C692            C3->8x->C6->xx\n// C8   C388   C383CB86            C3->8x->CB->xx\n//                                 [0]     [2]   [0]\n// 83   C692   C386E28099          C3->8x->E2->xx->xx\n//   odd_byte=0                    [0]     [2]       [0+]  odd_byte flipped\n//   odd_byte=1                    [0+]    [2] [0]   [0]   odd_byte unflipped\n// 80   E282AC C3A2E2809AC2AC      C3->A2->E2->xx->xx->Cx->xx\n//   odd_byte=0                    [0]     [3]         [4]   [0+]\n//   odd_byte=1                    [0+]    [3] [4]     [4]   [0]\n// 92   E28099 C3A2E282ACE284A2    C3->A2->E2->xx->xx->E2->xx->xx\n//   odd_byte=0                    [0]     [3]         [4] [0]   [0]\n//   odd_byte=1                    [0+]    [3] [4]     [4]       [0+]\n//\n// When an E2xxxx sequence is encountered, we absorb the two bytes E2xx and flip\n// the odd_byte state. If that goes from 0 to 1, the next pair is offset up\n// by one byte, picking up the two bytes just after E2xxxx. If odd_byte goes\n// from 1 to 0, the next two bytes picked up are the two bytes xxxx of E2xxxx.\n// These are absorbed with no error in state 0 or state 4\n//\n// C3   C3     C383                C3->8x->C2->xx\n// D3   D3     C393                C3->9x->C2->xx->C2->xx\n// E3   E3     C3A3                C3->Ax->C2->xx->C2->xx->C2->xx\n// F3   F3     C3B2                C3->Bx->C2->xx->C2->xx->C2->xx->C2->xx\n// Counter3 for Fx Ex sequences is incremented at last C2\n\nstatic const char kMiniUTF8UTF8State[8][16] = {\n  // xxxx  E2xx     CXxx    C3xx\n  //       8 9 a b  8 9 a b 8 9 a b\n  {0,0,0,0,1,1,1,1, 1,1,1,1,2,2,3,5,},      // [0] looking for C38x/C3Ax/2020/8x8x, or err\n  {0,0,0,0,1,1,1,1, 1,1,1,1,2,2,3,5,},      // [1] error, back to looking\n  {1,1,1,1,0,0,0,0, 0,0,0,0,1,1,1,1,},      // [2] C38x looking for CXxx/E2xxxx\n  //       + + + +                          //      E2xxxx flips odd_byte\n  {1,1,1,1,4,4,4,4, 7,7,7,7,1,1,1,1,},      // [3] C3Ax looking for E2xx or C2xxC2xx\n  //       + + + +                          //      E2xxxx flips odd_byte\n  {4,4,4,4,0,0,0,0, 0,0,0,0,1,1,1,1,},      // [4] C3AxE2xx-- looking for C2xx/E2xxxx\n  //       + + + +                          //      E2xxxx flips odd_byte\n  {1,1,1,1,1,1,1,1, 6,6,6,6,1,1,1,1,},      // [5] C3Bx -- looking for C2xxC2xxC2xx\n  {1,1,1,1,1,1,1,1, 7,7,7,7,1,1,1,1,},      // [6] C3Bx -- looking for C2xxC2xx\n  {1,1,1,1,1,1,1,1, 0,0,0,0,1,1,1,1,},      // [7] C3Bx -- looking for C2xx\n};\n// Counter to increment: 0-don'tcare 1-error 2-good_2B 3-good_3B 4-good_4B\nstatic const char kMiniUTF8UTF8Count[8][16] = {\n  // xxxx  E2xx     C2Xx    C3xx\n  //       8 9 a b  8 9 a b 8 9 a b\n  {0,0,0,0,1,1,1,1, 1,1,1,1,0,0,0,0,},      // [0] looking for C38x/C3Ax/2020/8x8x, or err\n  {0,0,0,0,1,1,1,1, 1,1,1,1,0,0,0,0,},      // [1] error, back to looking\n  {1,1,1,1,3,3,3,3, 2,2,2,2,1,1,1,1,},      // [2] C38x looking for CXxx/E2xxxx\n  //       + + + +                          //      E2xxxx flips odd_byte\n  {1,1,1,1,0,0,0,0, 0,0,0,0,1,1,1,1,},      // [3] C3Ax looking for E2xx\n  //       + + + +                          //      E2xxxx flips odd_byte\n  {1,1,1,1,4,4,4,4, 4,4,4,4,1,1,1,1,},      // [4] C3AxE2xx-- looking for C2xx/E2xxxx\n  //       + + + +                          //      E2xxxx flips odd_byte\n  {1,1,1,1,1,1,1,1, 0,0,0,0,1,1,1,1,},      // [5] C3Bx -- looking for C2xxC2xxC2xx\n  {1,1,1,1,1,1,1,1, 0,0,0,0,1,1,1,1,},      // [6] C3Bx -- looking for C2xxC2xx\n  {1,1,1,1,1,1,1,1, 3,3,3,3,1,1,1,1,},      // [7] C3Bx -- looking for C2xx\n};\n\nstatic const char kMiniUTF8UTF8Odd[8][16] = {\n  // xxxx  E2xx     C2Xx    C3xx\n  //       8 9 a b  8 9 a b 8 9 a b\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,},      // [0] looking for C38x/C3Ax/2020/8x8x, or err\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,},      // [1] error, back to looking\n  {0,0,0,0,1,1,1,1, 0,0,0,0,0,0,0,0,},      // [2] C38x looking for CXxx/E2xxxx\n  //       + + + +                          //      E2xxxx flips odd_byte\n  {0,0,0,0,1,1,1,1, 0,0,0,0,0,0,0,0,},      // [3] C3Ax looking for E2xx\n  //       + + + +                          //      E2xxxx flips odd_byte\n  {0,0,0,0,1,1,1,1, 0,0,0,0,0,0,0,0,},      // [4] C3AxE2xx-- looking for C2xx/E2xxxx\n  //       + + + +                          //      E2xxxx flips odd_byte\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,},      // [5] C3Bx -- looking for C2xxC2xxC2xx\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,},      // [6] C3Bx -- looking for C2xxC2xx\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,},      // [7] C3Bx -- looking for C2xx\n};\n\n// Turn a pair of bytes into the subscript for UTF8UTF8 tables above\nint UTF88Sub(char s0, char s1) {\n  int sub = (s1 >> 4) & 0x03;\n  uint8 u0 = static_cast<uint8>(s0);\n  if (u0 == 0xc3) {\n    sub += 12;\n  } else if ((u0 & 0xf0) == 0xc0) {\n    if ((u0 == 0xc2) || (u0 == 0xc5) || (u0 == 0xc6) || (u0 == 0xcb)) {\n      sub += 8;\n    }\n  } else if (u0 == 0xe2) {\n    sub += 4;\n  }\n  return sub;\n}\n\n\n\n\n\n// Default probability for an encoding rankedencoding\n// Based on a scan of 55M web pages\n// These values are 255 - log base 2**1/10 (occurrences / total)\n// Large values are most likely. This the reverse of some Google code\n// 255 = 1.0, 245 = 1/2, 235 = 1/4, 15 = 1/2**24, 0 = 0 (< 1/50M)\n//\n// TODO change this to be per encoding, not permuted\n//\n\n\n// Support function for unit test program\n// Return ranked encoding corresponding to enc\n// (also exported to compact_enc_det_text.cc)\nint CompactEncDet::BackmapEncodingToRankedEncoding(Encoding enc) {\n  for (int i = 0; i < NUM_RANKEDENCODING; ++i) {\n    if (kMapToEncoding[i] == enc) {\n      return i;\n    }\n  }\n  return -1;\n}\n\n\nstring DecodeActive(uint32 active) {\n  string temp(\"\");\n  if (active & kBinaryActive) {\n    temp.append(\"Binary \");\n  }\n  if (active & kUTF1632Active) {\n    temp.append(\"UTF1632 \");\n  }\n  if (active & kUTF8UTF8Active) {\n    temp.append(\"UTF8UTF8 \");\n  }\n  if (active & kUTF8Active) {\n    temp.append(\"UTF8 \");\n  }\n  if (active & kIso2022Active) {\n    temp.append(\"Iso2022 \");\n  }\n  if (active & kHzActive) {\n    temp.append(\"Hz \");\n  }\n  if (active & kUTF7Active) {\n    temp.append(\"UTF7A \");\n  }\n  if (active & kSevenBitActive) {\n    temp.append(\"SevenBit \");\n  }\n  if (active & kIsIndicCode) {\n    temp.append(\"Indic \");\n  }\n  if (active & kHighAlphaCode) {\n    temp.append(\"HighAlpha \");\n  }\n  if (active & kHighAccentCode) {\n    temp.append(\"HighAccent \");\n  }\n  if (active & kEUCJPActive) {\n    temp.append(\"EUCJP \");\n  }\n  return temp;\n}\n\nstatic inline bool SevenBitEncoding(int enc) {\n  return ((kSpecialMask[enc] & kSevenBitActive) != 0);\n}\nstatic inline bool TwoByteEncoding(int enc) {\n  return ((kSpecialMask[enc] & kTwobyteCode) != 0);\n}\nstatic inline bool IndicEncoding(int enc) {\n  return ((kSpecialMask[enc] & kIsIndicCode) != 0);\n}\nstatic inline bool HighAlphaEncoding(int enc) {\n  return ((kSpecialMask[enc] & kHighAlphaCode) != 0);\n}\nstatic inline bool HighAccentEncoding(int enc) {\n  return ((kSpecialMask[enc] & kHighAccentCode) != 0);\n}\n\n\nstatic inline bool AnyActive(DetectEncodingState* destatep) {\n  return (destatep->active_special != 0);\n}\nstatic inline bool SevenBitActive(DetectEncodingState* destatep) {\n  return (destatep->active_special & kSevenBitActive) != 0;\n}\nstatic inline bool HzActive(DetectEncodingState* destatep) {\n  return (destatep->active_special & kHzActive) != 0;\n}\nstatic inline bool Iso2022Active(DetectEncodingState* destatep) {\n  return (destatep->active_special & kIso2022Active) != 0;\n}\nstatic inline bool UTF8Active(DetectEncodingState* destatep) {\n  return (destatep->active_special & kUTF8Active) != 0;\n}\nstatic inline bool UTF8UTF8Active(DetectEncodingState* destatep) {\n  return (destatep->active_special & kUTF8UTF8Active) != 0;\n}\nstatic inline bool UTF1632Active(DetectEncodingState* destatep) {\n  return (destatep->active_special & kUTF1632Active) != 0;\n}\nstatic inline bool BinaryActive(DetectEncodingState* destatep) {\n  return (destatep->active_special & kBinaryActive) != 0;\n}\nstatic inline bool UTF7OrHzActive(DetectEncodingState* destatep) {\n  return (destatep->active_special & (kHzActive + kUTF7Active)) != 0;\n}\nstatic inline bool EUCJPActive(DetectEncodingState* destatep) {\n  return ((destatep->active_special & kEUCJPActive) != 0);\n}\nstatic inline bool OtherActive(DetectEncodingState* destatep) {\n  return (destatep->active_special & (kIso2022Active + kBinaryActive +\n                                      kUTF8Active + kUTF8UTF8Active +\n                                      kUTF1632Active + kEUCJPActive)) != 0;\n}\n\n\nstatic inline bool CEDFlagRescanning(CEDInternalFlags flags) {\n  return (flags & kCEDRescanning) != 0;\n}\n\nstatic inline bool CEDFlagForceTags(CEDInternalFlags flags) {\n  return (flags & kCEDForceTags) != 0;\n}\n\n\nstatic inline int maxint(int a, int b) {return (a > b) ? a : b;}\nstatic inline int minint(int a, int b) {return (a < b) ? a : b;}\n\nstatic inline const char* MyRankedEncName(int r_enc) {\n  return MyEncodingName(kMapToEncoding[r_enc]);\n}\n\n\n// Only for debugging. not thread safe\nstatic const int kPsSourceWidth = 32;\nstatic int pssourcenext = 0;    // debug only. not threadsafe. dump only >= this\nstatic int pssourcewidth = 0;   // debug only.\nstatic char* pssource_mark_buffer = NULL;\nint next_do_src_line;\nint do_src_offset[16];\n\n\nvoid PsSourceInit(int len) {\n   pssourcenext = 0;\n   pssourcewidth = len;\n   delete[] pssource_mark_buffer;\n   // Allocate 2 Ascii characters per input byte\n   pssource_mark_buffer = new char[(pssourcewidth * 2) + 8];  // 8 = overscan\n   memset(pssource_mark_buffer, ' ', pssourcewidth * 2);\n   memset(pssource_mark_buffer + (pssourcewidth * 2), '\\0', 8);\n\n   next_do_src_line = 0;\n   memset(do_src_offset, 0, sizeof(do_src_offset));\n}\n\nvoid PsSourceFinish() {\n  // Print preceding mark buffer\n  int j = (pssourcewidth * 2) - 1;\n  while ((0 <= j) && (pssource_mark_buffer[j] == ' ')) {--j;}   // trim\n  pssource_mark_buffer[j + 1] = '\\0';\n  fprintf(stderr, \"(      %s) do-src\\n\", pssource_mark_buffer);\n  memset(pssource_mark_buffer, ' ', pssourcewidth * 2);\n  memset(pssource_mark_buffer + (pssourcewidth * 2), '\\0', 8);\n\n  delete[] pssource_mark_buffer;\n  pssource_mark_buffer = NULL;\n}\n\n// Dump aligned len bytes src... if not already dumped\nvoid PsSource(const uint8* src, const uint8* isrc, const uint8* srclimit) {\n  int offset = src - isrc;\n  offset -= (offset % pssourcewidth);     // round down to multiple of len bytes\n  if (offset < pssourcenext) {\n    return;\n  }\n  pssourcenext = offset + pssourcewidth;  // Min offset for next dump\n\n  // Print preceding mark buffer\n  int j = (pssourcewidth * 2) - 1;\n  while ((0 <= j) && (pssource_mark_buffer[j] == ' ')) {--j;}   // trim\n  pssource_mark_buffer[j + 1] = '\\0';\n  fprintf(stderr, \"(      %s) do-src\\n\", pssource_mark_buffer);\n  memset(pssource_mark_buffer, ' ', pssourcewidth * 2);\n  memset(pssource_mark_buffer + (pssourcewidth * 2), '\\0', 8);\n\n  // Print source bytes\n  const uint8* src_aligned = isrc + offset;\n  int length = srclimit - src_aligned;\n  length = minint(pssourcewidth, length);\n\n  fprintf(stderr, \"(%05x \", offset);\n  for (int i = 0; i < length; ++i) {\n    char c = src_aligned[i];\n    if (c == '\\n') {c = ' ';}\n    if (c == '\\r') {c = ' ';}\n    if (c == '\\t') {c = ' ';}\n    if (c == '(') {\n      fprintf(stderr, \"%s\", \"\\\\( \");\n    } else if (c == ')') {\n      fprintf(stderr, \"%s\", \"\\\\) \");\n    } else if (c == '\\\\') {\n      fprintf(stderr, \"%s\", \"\\\\\\\\ \");\n    } else if ((0x20 <= c) && (c <= 0x7e)) {\n      fprintf(stderr, \"%c \", c);\n    } else {\n      fprintf(stderr, \"%02x\", c);\n    }\n  }\n  fprintf(stderr, \") do-src\\n\");\n  // Remember which source offsets are where, mod 16\n  do_src_offset[next_do_src_line & 0x0f] = offset;\n  ++next_do_src_line;\n}\n\n// Mark bytes in just-previous source bytes\nvoid PsMark(const uint8* src, int len, const uint8* isrc, int weightshift) {\n  int offset = src - isrc;\n  offset = (offset % pssourcewidth);     // mod len bytes\n  char mark = (weightshift == 0) ? '-' : 'x';\n\n  pssource_mark_buffer[(offset * 2)] = '=';\n  pssource_mark_buffer[(offset * 2) + 1] = '=';\n  for (int i = 1; i < len; ++i) {\n    pssource_mark_buffer[(offset + i) * 2] = mark;\n    pssource_mark_buffer[((offset + i) * 2) + 1] = mark;\n  }\n}\n\n\n// Highlight trigram bytes in just-previous source bytes\n// Unfortunately, we have to skip back N lines since source was printed for\n// up to 8 bigrams before we get here. Match on src+1 to handle 0/31 better\nvoid PsHighlight(const uint8* src, const uint8* isrc, int trigram_val, int n) {\n  int offset = (src + 1) - isrc;\n  int offset32 = (offset % pssourcewidth);    // mod len bytes\n  offset -= offset32;                     // round down to multiple of len bytes\n\n  for (int i = 1; i <= 16; ++i) {\n    if (do_src_offset[(next_do_src_line - i) & 0x0f] == offset) {\n      fprintf(stderr, \"%d %d %d do-highlight%d\\n\",\n              i, offset32 - 1, trigram_val, n);\n      break;\n    }\n  }\n}\n\n\nvoid InitDetectEncodingState(DetectEncodingState* destatep) {\n  destatep->initial_src = NULL;       // Filled in by caller\n  destatep->limit_src = NULL;\n  destatep->prior_src = NULL;\n  destatep->last_pair = NULL;\n\n  destatep->debug_data = NULL;\n  destatep->next_detail_entry = 0;\n\n  destatep->done = false;\n  destatep->reliable = false;\n  destatep->hints_derated = false;\n  //destatep->declared_enc_1 init in ApplyHints\n  //destatep->declared_enc_2 init in ApplyHints\n  destatep->prune_count = 0;\n\n  destatep->trigram_highwater_mark = 0;\n  destatep->looking_for_latin_trigrams = false;\n  destatep->do_latin_trigrams = false;\n\n  // Miscellaneous state variables for difficult encodings\n  destatep->binary_quadrants_count = 0;\n  destatep->binary_8x4_count = 0;\n  destatep->binary_quadrants_seen = 0;\n  destatep->binary_8x4_seen = 0;\n  destatep->utf7_starts = 0;\n  destatep->prior_utf7_offset = 0;\n  destatep->next_utf8_ministate = 0;\n  for (int i = 0; i < 6; i++) {destatep->utf8_minicount[i] = 0;}\n  destatep->next_utf8utf8_ministate = 0;\n  destatep->utf8utf8_odd_byte = 0;\n  for (int i = 0; i < 6; i++) {destatep->utf8utf8_minicount[i] = 0;}\n  destatep->next_2022_state = SOSI_NONE;\n  destatep->next_hz_state = SOSI_NONE;\n  destatep->next_eucjp_oddphase = false;\n  for (int i = 0; i < 8; i++) {destatep->byte32_count[i] = 0;}\n  destatep->active_special = 0xffffffff;\n  destatep->tld_hint = UNKNOWN_ENCODING;\n  destatep->http_hint = UNKNOWN_ENCODING;\n  destatep->meta_hint = UNKNOWN_ENCODING;\n  destatep->bom_hint = UNKNOWN_ENCODING;\n  destatep->top_rankedencoding = 0;         // ASCII [seven-bit] is the default\n  destatep->second_top_rankedencoding = 0;  // ASCII [seven-bit] is the default\n  destatep->top_prob = -1;\n  destatep->second_top_prob = -1;\n  // This is wide for first pruning, shrinks for 2nd and later\n  destatep->prune_difference = kInititalPruneDifference;\n\n  destatep->next_prior_bigram = 0;\n  destatep->prior_bigram[0] = -1;\n  destatep->prior_bigram[1] = -1;\n  destatep->prior_bigram[2] = -1;\n  destatep->prior_bigram[3] = -1;\n\n  destatep->prior_binary[0] = -1;\n\n  // Initialize with all but Indic encodings, which we never detect\n  int k = 0;\n  for (int rankedencoding = 0;\n        rankedencoding < NUM_RANKEDENCODING;\n        rankedencoding++) {\n    Encoding enc = kMapToEncoding[rankedencoding];\n    if (!IndicEncoding(enc)) {\n      destatep->rankedencoding_list[k++] = rankedencoding;\n    }\n  }\n  destatep->rankedencoding_list_len = k;\n\n  // This is where all the action is\n  memset(destatep->enc_prob, 0, sizeof(destatep->enc_prob));\n\n  memset(destatep->hint_prob, 0, sizeof(destatep->hint_prob));\n  memset(destatep->hint_weight, 0, sizeof(destatep->hint_weight));\n\n  destatep->prior_interesting_pair[AsciiPair] = 0;\n  destatep->prior_interesting_pair[OtherPair] = 0;\n  destatep->next_interesting_pair[AsciiPair] = 0;\n  destatep->next_interesting_pair[OtherPair] = 0;\n  // interesting_pairs/offsets/weightshifts not initialized; no need\n}\n\n// Probability strings are uint8, with zeros removed via simple run-length:\n//  (<skip-take byte> <data bytes>)*\n// skip-take:\n//  00  end\n//  x0  skip 16 x locations, take 0 data values\n//  xy  skip x locations, take y data values\n// Multiply all the incoming values by 3 to account for 3x unigram sums\n//\n// {{0x77,0x69,0x6e,0x64,0x31,0x32,0x35,0x35,\n//   0x01,0xc2,0x10,0x41,0xfe,0x71,0xba,0x00,}}, // \"wind1255\"\n//\n// Weight is 0..100 percent\n//\n// Returns subscript of largest (most probable) value\n//\n\n\n//  {{0x6e,0x6c,0x5f,0x5f, 0x05,0xb2,0xae,0xa0,0x32,0xa1,0x36,0x31,0x42,0x39,0x3b,0x33,0x45,0x11,0x6f,0x00,}}, // \"nl__\"\n//        // ASCII-7-bit=178  Latin1=174  UTF8=160  GB=50  CP1252=161  BIG5=49  Latin2=66  CP1251=57  CP1256=59  CP1250=51  Latin5=69  ISO-8859-15=111  [top ASCII-7-bit]\nint ApplyCompressedProb(const char* iprob, int len,\n                         int weight, DetectEncodingState* destatep) {\n  int* dst = &destatep->enc_prob[0];\n  int* dst2 = &destatep->hint_weight[0];\n  const uint8* prob = reinterpret_cast<const uint8*>(iprob);\n  const uint8* problimit = prob + len;\n\n  int largest = -1;\n  int subscript_of_largest = 0;\n\n  // Continue with first byte and subsequent ones\n  while (prob < problimit) {\n    int skiptake = *prob++;\n    int skip = (skiptake & 0xf0) >> 4;\n    int take = skiptake & 0x0f;\n    if (skiptake == 00) {\n      break;\n    } else if (take == 0) {\n      dst += (skip << 4);\n      dst2 += (skip << 4);\n    } else {\n      dst += skip;    // Normal case\n      dst2 += skip;  // Normal case\n      for (int i = 0; i < take; i++) {\n        int enc = static_cast<int>(dst - &destatep->enc_prob[0]) + i;\n        if (largest < prob[i]) {\n          largest = prob[i];\n          subscript_of_largest = enc;\n        }\n\n        int increment = prob[i] * 3;    // The actual increment\n\n        // Do maximum of previous hints plus this new one\n        if (weight > 0) {\n          increment = (increment * weight)  / 100;\n          dst[i] = maxint(dst[i], increment);\n          dst2[i] = 1;              // New total weight\n        }\n      }\n      prob += take;\n      dst += take;\n      dst2 += take;\n    }\n  }\n  return subscript_of_largest;\n}\n\n\n// Returns subscript of largest (most probable) value [for unit test]\nint TopCompressedProb(const char* iprob, int len) {\n  const uint8* prob = reinterpret_cast<const uint8*>(iprob);\n  const uint8* problimit = prob + len;\n  int next_prob_sub = 0;\n  int topprob = 0;\n  int toprankenc = 0;\n\n  while (prob < problimit) {\n    int skiptake = *prob++;\n    int skip = (skiptake & 0xf0) >> 4;\n    int take = skiptake & 0x0f;\n    if (skiptake == 0) {\n      break;\n    } else if (take == 0) {\n      next_prob_sub += (skip << 4);\n    } else {\n      next_prob_sub += skip;    // Normal case\n      for (int i = 0; i < take; i++) {\n        if (topprob < prob[i]) {\n          topprob = prob[i];\n          toprankenc = next_prob_sub + i;\n        }\n      }\n      prob += take;\n      next_prob_sub += take;\n    }\n  }\n  return toprankenc;\n}\n\n\n// Find subscript of matching key in first 8 bytes of sorted hint array, or -1\nint HintBinaryLookup8(const HintEntry* hintprobs, int hintprobssize,\n                     const char* norm_key) {\n  // Key is always in range [lo..hi)\n  int lo = 0;\n  int hi = hintprobssize;\n  while (lo < hi) {\n    int mid = (lo + hi) >> 1;\n    int comp = memcmp(&hintprobs[mid].key_prob[0], norm_key, 8);\n    if (comp < 0) {\n      lo = mid + 1;\n    } else if (comp > 0) {\n      hi = mid;\n    } else {\n      return mid;\n    }\n  }\n  return -1;\n}\n\n// Find subscript of matching key in first 4 bytes of sorted hint array, or -1\nint HintBinaryLookup4(const HintEntry* hintprobs, int hintprobssize,\n                     const char* norm_key) {\n  // Key is always in range [lo..hi)\n  int lo = 0;\n  int hi = hintprobssize;\n  while (lo < hi) {\n    int mid = (lo + hi) >> 1;\n    int comp = memcmp(&hintprobs[mid].key_prob[0], norm_key, 4);\n    if (comp < 0) {\n      lo = mid + 1;\n    } else if (comp > 0) {\n      hi = mid;\n    } else {\n      return mid;\n    }\n  }\n  return -1;\n}\n\nstatic inline void Boost(DetectEncodingState* destatep, int r_enc, int boost) {\n  destatep->enc_prob[r_enc] += boost;\n}\n\nstatic inline void Whack(DetectEncodingState* destatep, int r_enc, int whack) {\n  destatep->enc_prob[r_enc] -= whack;\n}\n\n// Apply initial probability hint based on top level domain name\n// Weight is 0..100 percent\n// Return 1 if name match found\nint ApplyTldHint(const char* url_tld_hint, int weight,\n                  DetectEncodingState* destatep) {\n  if (url_tld_hint[0] == '~') {\n    return 0;\n  }\n  string normalized_tld = MakeChar4(string(url_tld_hint));\n  int n = HintBinaryLookup4(kTLDHintProbs, kTLDHintProbsSize,\n                           normalized_tld.c_str());\n  if (n >= 0) {\n    // TLD is four bytes, probability table is ~12 bytes\n    int best_sub = ApplyCompressedProb(&kTLDHintProbs[n].key_prob[kMaxTldKey],\n                                       kMaxTldVector, weight, destatep);\n    // Never boost ASCII7; do CP1252 instead\n    if (best_sub == F_ASCII_7_bit) {best_sub = F_CP1252;}\n    destatep->declared_enc_1 = best_sub;\n    if (destatep->debug_data != NULL) {\n      // Show TLD hint\n      SetDetailsEncProb(destatep, 0, best_sub, url_tld_hint);\n    }\n    return 1;\n  }\n  return 0;\n}\n\n// Apply initial probability hint based on charset= name\n// Weight is 0..100 percent\n// Return 1 if name match found\nint ApplyCharsetHint(const char* charset_hint, int weight,\n                      DetectEncodingState* destatep) {\n  if (charset_hint[0] == '~') {\n    return 0;\n  }\n  string normalized_charset = MakeChar44(string(charset_hint));\n  int n = HintBinaryLookup8(kCharsetHintProbs, kCharsetHintProbsSize,\n                           normalized_charset.c_str());\n  if (n >= 0) {\n    // Charset is eight bytes, probability table is ~eight bytes\n    int best_sub = ApplyCompressedProb(&kCharsetHintProbs[n].key_prob[kMaxCharsetKey],\n                                       kMaxCharsetVector, weight, destatep);\n    // Never boost ASCII7; do CP1252 instead\n    if (best_sub == F_ASCII_7_bit) {best_sub = F_CP1252;}\n    destatep->declared_enc_1 = best_sub;\n\n    // If first explicitly declared charset is confusable with Latin1/1252, put\n    // both declared forms in declared_enc_*, displacing Latin1/1252.\n    // This avoids a bit of Latin1 creep.\n    // Also boost the declared encoding and its pair\n    // TODO: This should all be folded into postproc-enc-detect.cc\n    if ((destatep->http_hint == UNKNOWN_ENCODING) &&\n        (destatep->meta_hint == UNKNOWN_ENCODING)) {\n      // This is the first charset=hint\n      switch (best_sub) {\n      case F_Latin2:            // 8859-2 Latin2, east euro\n        destatep->declared_enc_2 = F_CP1250;\n        Boost(destatep, F_Latin2, kGentleOnePair);\n        Boost(destatep, F_CP1250, kGentleOnePair);\n        break;\n      case F_CP1250:\n        destatep->declared_enc_2 = F_Latin2;\n        Boost(destatep, F_Latin2, kGentleOnePair);\n        Boost(destatep, F_CP1250, kGentleOnePair);\n        break;\n\n      case F_Latin3:            // 8859-3 Latin3, south euro, Esperanto\n        destatep->declared_enc_2 = F_ASCII_7_bit;\n        Boost(destatep, F_Latin3, kGentleOnePair);\n        break;\n\n      case F_Latin4:            // 8859-4 Latin4, north euro\n        destatep->declared_enc_2 = F_ASCII_7_bit;\n        Boost(destatep, F_Latin4, kGentleOnePair);\n        break;\n\n      case F_ISO_8859_5:        // 8859-5 Cyrillic\n        destatep->declared_enc_2 = F_ASCII_7_bit;       // Don't boost 1251\n        Boost(destatep, F_ISO_8859_5, kGentleOnePair);  // (too different)\n        break;\n      case F_CP1251:\n        destatep->declared_enc_2 = F_ASCII_7_bit;       // Don't boost -5\n        Boost(destatep, F_CP1251, kGentleOnePair);      // (too different)\n        break;\n\n      case F_Arabic:            // 8859-6 Arabic\n        destatep->declared_enc_2 = F_CP1256;\n        Boost(destatep, F_Arabic, kGentleOnePair);\n        Boost(destatep, F_CP1256, kGentleOnePair);\n        break;\n      case F_CP1256:\n        destatep->declared_enc_2 = F_Arabic;\n        Boost(destatep, F_Arabic, kGentleOnePair);\n        Boost(destatep, F_CP1256, kGentleOnePair);\n        break;\n\n      case F_Greek:             // 8859-7 Greek\n        destatep->declared_enc_2 = F_CP1253;\n        Boost(destatep, F_Greek, kGentleOnePair);\n        Boost(destatep, F_CP1253, kGentleOnePair);\n        break;\n      case F_CP1253:\n        destatep->declared_enc_2 = F_Greek;\n        Boost(destatep, F_Greek, kGentleOnePair);\n        Boost(destatep, F_CP1253, kGentleOnePair);\n        break;\n\n      case F_Hebrew:            // 8859-8 Hebrew\n        destatep->declared_enc_2 = F_CP1255;\n        Boost(destatep, F_Hebrew, kGentleOnePair);\n        Boost(destatep, F_CP1255, kGentleOnePair);\n        break;\n      case F_CP1255:\n        destatep->declared_enc_2 = F_Hebrew;\n        Boost(destatep, F_Hebrew, kGentleOnePair);\n        Boost(destatep, F_CP1255, kGentleOnePair);\n        break;\n\n      case F_Latin5:            // 8859-9 Latin5, Turkish\n        destatep->declared_enc_2 = F_ASCII_7_bit;       // Don't boost 1254\n        Boost(destatep, F_Latin5, kGentleOnePair);      // (too different)\n        break;\n      case F_CP1254:\n        destatep->declared_enc_2 = F_ASCII_7_bit;       // Don't boost Latin5\n        Boost(destatep, F_CP1254, kGentleOnePair);      // (too different)\n        break;\n\n      case F_Latin6:            // 8859-10 Latin6, Nordic\n        destatep->declared_enc_2 = F_ASCII_7_bit;\n        Boost(destatep, F_Latin6, kGentleOnePair);\n        break;\n\n      case F_ISO_8859_11:       // 8859-11 Thai,\n        destatep->declared_enc_2 = F_CP874;\n        Boost(destatep, F_ISO_8859_11, kGentleOnePair);\n        Boost(destatep, F_CP874, kGentleOnePair);\n        break;\n      case F_CP874:\n        destatep->declared_enc_2 = F_ISO_8859_11;\n        Boost(destatep, F_ISO_8859_11, kGentleOnePair);\n        Boost(destatep, F_CP874, kGentleOnePair);\n        break;\n\n      case F_ISO_8859_13:       // 8859-13 Latin7, Baltic\n        destatep->declared_enc_2 = F_CP1257;\n        Boost(destatep, F_ISO_8859_13, kGentleOnePair);\n        Boost(destatep, F_CP1257, kGentleOnePair);\n        break;\n      case F_CP1257:\n        destatep->declared_enc_2 = F_ISO_8859_13;\n        Boost(destatep, F_ISO_8859_13, kGentleOnePair);\n        Boost(destatep, F_CP1257, kGentleOnePair);\n        break;\n\n      case F_ISO_8859_15:       // 8859-15 Latin9, Latin0, Euro-ized Latin1\n        destatep->declared_enc_2 = F_ASCII_7_bit;\n        Boost(destatep, F_ISO_8859_15, kGentleOnePair);\n        break;\n\n\n        // Greek all-caps is confusable with KOI8x all-lower and Hebrew.\n        // This turns some Greek documents into Cyrillic, etc. by mistake.\n        // Greek and Hebrew are boosted explicitly above; do KOI8x here.\n        // Boosting the declared encodingmakes it harder for the wrong one to\n        // creep up.\n      case F_KOI8R:\n        Boost(destatep, F_KOI8R, kGentleOnePair);\n        break;\n      case F_KOI8U:\n        Boost(destatep, F_KOI8U, kGentleOnePair);\n        break;\n\n      default:\n        break;\n      }\n    }\n\n    if (destatep->debug_data != NULL) {\n      // Show charset hint\n      SetDetailsEncProb(destatep, 0, best_sub, charset_hint);\n    }\n\n    //\n    // Some fix-ups for the declared encodings\n    //\n\n    // If non-UTF8, non-Latin1/1252 encoding declared, disable UTF8 combos\n    // TODO: This should all be folded into postproc-enc-detect.cc\n    if ((best_sub != F_UTF8) &&\n        (best_sub != F_Latin1) &&\n        (best_sub != F_CP1252)) {\n      Whack(destatep, F_UTF8UTF8, kBadPairWhack * 4);         // demote\n    }\n\n    // Latin2 and CP1250 differ in the overlap part, such as B1 or B9\n    // The initial probabilites for charset=Latin2 explicitly put CP1250\n    // down twice as far as normal, and vice versa. This is done in\n    // postproc-enc-detect.cc\n\n    // If charset=user-defined, treat as Binary --\n    // we can safely only do low ASCII, might be Indic\n    if (normalized_charset.substr(0,4) == \"user\") {\n      Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n    }\n\n    return 1;\n  }\n  return 0;\n}\n\n// Apply initial probability hint based on caller-supplied encoding\n// Negative hint whacks ~encoding, non-negative boosts encoding\n//\n// Negative hints are an experiment to see if they might be useful.\n// Not operator used instead of unary minus to allow specifying not-zero\nint ApplyEncodingHint(const int encoding_hint, int weight,\n                       DetectEncodingState* destatep) {\n  Encoding enc_hint = static_cast<Encoding>((encoding_hint < 0) ?\n                                            ~encoding_hint : encoding_hint);\n  // Map to the right internal subscript\n  int rankedenc_hint = CompactEncDet::BackmapEncodingToRankedEncoding(enc_hint);\n\n  // I'm not sure how strong this hint should be. Weight 100% = 1 bigram\n  int increment = (kBoostOnePair * weight) / 100;\n\n  if (encoding_hint < 0) {\n    destatep->enc_prob[rankedenc_hint] -= increment;\n  } else {\n    destatep->enc_prob[rankedenc_hint] += increment;\n  }\n\n  if (destatep->debug_data != NULL) {\n    // Show encoding hint\n    SetDetailsEncProb(destatep, 0, -1, MyEncodingName(enc_hint));\n  }\n  return 1;\n}\n\n// Apply initial probability hint based on user interface language\n// Weight is 0..100 percent\n// Return 1 if name match found\nint ApplyUILanguageHint(const Language language_hint,\n                        int weight, DetectEncodingState* destatep) {\n  if (language_hint == UNKNOWN_LANGUAGE) {\n    return 0;\n  }\n  string normalized_lang = MakeChar8(LanguageName(language_hint));\n  int n = HintBinaryLookup8(kLangHintProbs, kLangHintProbsSize,\n                           normalized_lang.c_str());\n  if (n >= 0) {\n    // Language is eight bytes, probability table is ~eight bytes\n    int best_sub = ApplyCompressedProb(&kLangHintProbs[n].key_prob[kMaxLangKey],\n                                       kMaxLangVector, weight, destatep);\n    // Never boost ASCII7; do CP1252 instead\n    if (best_sub == F_ASCII_7_bit) {best_sub = F_CP1252;}\n    destatep->declared_enc_1 = best_sub;\n    if (destatep->debug_data != NULL) {\n      // Show language hint\n      SetDetailsEncProb(destatep, 0, best_sub, normalized_lang.c_str());\n    }\n    return 1;\n  }\n  return 0;\n}\n\n// Apply initial probability hint based on corpus type (web, email, etc)\n// Return 1 if name match found\nint ApplyDefaultHint(const CompactEncDet::TextCorpusType corpus_type,\n                      DetectEncodingState* destatep) {\n\n  for (int i = 0; i < NUM_RANKEDENCODING; i++) {\n    // Set the default probability\n    destatep->enc_prob[i] = kDefaultProb[i] * 3;\n    // Deliberately set 2022 seven-bit encodings to zero,\n    // so we can look for actual use\n    // TODO: This should all be folded into postproc-enc-detect.cc\n    if (SevenBitEncoding(kMapToEncoding[i])) {\n      destatep->enc_prob[i] = 0;\n    }\n  }\n\n  //  A little corpus distinction\n  switch (corpus_type) {\n  case CompactEncDet::WEB_CORPUS:\n  case CompactEncDet::XML_CORPUS:\n    // Allow double-converted UTF-8 to start nearly equal to normal UTF-8\n    destatep->enc_prob[F_UTF8UTF8] =\n      destatep->enc_prob[F_UTF8] - kSmallInitDiff;\n  break;\n  case CompactEncDet::QUERY_CORPUS:\n  case CompactEncDet::EMAIL_CORPUS:\n  default:\n    break;\n  }\n\n  if (FLAGS_demo_nodefault) {\n    // Demo, make initial probs all zero\n    for (int i = 0; i < NUM_RANKEDENCODING; i++) {\n      destatep->enc_prob[i] = 0;\n    }\n  }\n\n  if (destatep->debug_data != NULL) {\n    // Show default hint\n    SetDetailsEncProb(destatep, 0, -1, \"Default\");\n  }\n  return 1;\n}\n\n\n\n// Do reverse search for c in [str..str+len)\n// Note: initial pointer is to FRONT of string, not back\nconst char* MyMemrchr(const char* str, char c, size_t len) {\n  const char* ret = str + len;\n  while (str <= --ret) {\n    if (*ret == c) {return ret;}\n  }\n  return NULL;\n}\n\n\n// Minimum real URL is 11 bytes: \"http://a.bc\" -- shorter is assumed to be TLD\n// Now that we are no longer trying to do Indic font-based encodigns, we\n// don't need the full URL and can go back to simple TLD. This test remains for\n// backwards compatility with any caller using full URL.\nstatic const int kMinURLLength = 11;\n\n// Extract TLD from a full URL or just a TLD\n// Return hostname and length if a full URL\nvoid ExtractTLD(const char* url_hint, char* tld_hint, int tld_hint_len,\n                const char** ret_host_start, int* ret_host_len) {\n  // url_hint can either be a full URL (preferred) or just top-level domain name\n  // Extract the TLD from a full URL and use it for\n  // a normal TLD hint\n\n  strncpy(tld_hint, \"~\", tld_hint_len);\n  tld_hint[tld_hint_len - 1] = '\\0';\n  *ret_host_start = NULL;\n  *ret_host_len = 0;\n\n  int url_len = (url_hint != NULL) ? strlen(url_hint) : 0;\n  if (url_len == 0) {\n    // Empty TLD\n    return;\n  }\n\n  // Minimum real URL is 11 bytes: \"http://a.bc\" -- shorter is assumed to be TLD\n  if (kMinURLLength <= url_len) {\n    // See if it really is a URL\n    const char* first_slash = strchr(url_hint, '/');\n    if ((first_slash != NULL) && (first_slash != url_hint) &&\n        (first_slash[-1] == ':') && (first_slash[1] == '/') &&\n        (memrchr(url_hint, '.', first_slash - url_hint) == NULL)) {\n      // We found :// and no dot in front of it, so declare a real URL\n\n      const char* hostname_start = first_slash + 2;\n      const char* hostname_end = strchr(hostname_start, '/');\n      if (hostname_end == NULL) {\n        // No slash; end is first byte off end of the URL string\n        hostname_end = url_hint + url_len;\n      }\n      size_t hostname_len = hostname_end - hostname_start;\n      const char* port_start =\n        (const char*)memchr(hostname_start, ':', hostname_len);\n      if (port_start != NULL) {\n        // Port; shorten hostname\n        hostname_end = port_start;\n        hostname_len = hostname_end - hostname_start;\n      }\n\n      const char* tld_start = MyMemrchr(hostname_start, '.', hostname_len);\n      if (tld_start != NULL) {\n        // Remember the TLD we just found\n        int tld_len = hostname_start + hostname_len - tld_start - 1;\n        if (tld_len > (tld_hint_len - 1)) {\n          tld_len = tld_hint_len - 1;\n        }\n        memcpy(tld_hint, tld_start + 1, tld_len);\n        tld_hint[tld_len] = '\\0';\n      }\n      *ret_host_start = hostname_start;\n      *ret_host_len = hostname_len;\n      return;\n    }\n  } else {\n    strncpy(tld_hint, url_hint, tld_hint_len);\n    tld_hint[tld_hint_len - 1] = '\\0';\n  }\n}\n\n// Apply hints, if any, to probabilities\n// NOTE: Encoding probabilites are all zero at this point\nvoid ApplyHints(const char* url_hint,\n                const char* http_charset_hint,\n                const char* meta_charset_hint,\n                const int encoding_hint,\n                const Language language_hint,\n                const CompactEncDet::TextCorpusType corpus_type,\n                DetectEncodingState* destatep) {\n  int hint_count = 0;\n  // url_hint can either be a full URL (preferred) or just top-level domain name\n  // Extract the TLD from a full URL and use it for\n  // a normal TLD hint\n\n  char tld_hint[16];\n  const char* hostname_start = NULL;\n  int hostname_len = 0;\n  ExtractTLD(url_hint, tld_hint, sizeof(tld_hint),\n             &hostname_start, &hostname_len);\n\n\n  // Initial hints give slight boost to Ascii-7-bit and code page 1252\n  // ApplyXxx routines copy enc_1 to enc_2 then update declared_enc_1\n  // This gives a boost to 1252 if one of HTTP/META is specified,\n  // but this could be the wrong thing to do if Latin2/3/4/etc. is specified\n  destatep->declared_enc_1 = F_CP1252;\n  destatep->declared_enc_2 = F_ASCII_7_bit;\n\n  // Applying various hints takes max of new hint and any old hint.\n  // This does better on multiple hints that a weighted average\n\n  // Weight is 0..100 percent\n  if ((http_charset_hint != NULL) && (http_charset_hint[0] != '~')) {\n    destatep->declared_enc_2 = destatep->declared_enc_1;\n    hint_count += ApplyCharsetHint(http_charset_hint, 100, destatep);\n    destatep->http_hint = kMapToEncoding[destatep->declared_enc_1];\n    if ((destatep->declared_enc_1 == F_CP1252) ||\n        (destatep->declared_enc_1 == F_Latin1)) {\n      destatep->looking_for_latin_trigrams = true;\n    }\n  }\n  if ((meta_charset_hint != NULL) && (meta_charset_hint[0] != '~')) {\n    destatep->declared_enc_2 = destatep->declared_enc_1;\n    hint_count += ApplyCharsetHint(meta_charset_hint, 100, destatep);\n    destatep->meta_hint = kMapToEncoding[destatep->declared_enc_1];\n    if ((destatep->declared_enc_1 == F_CP1252) ||\n        (destatep->declared_enc_1 == F_Latin1)) {\n      destatep->looking_for_latin_trigrams = true;\n    }\n  }\n  if (encoding_hint != UNKNOWN_ENCODING) {\n    destatep->declared_enc_2 = destatep->declared_enc_1;\n    hint_count += ApplyEncodingHint(encoding_hint, 50, destatep);\n  }\n  if (language_hint != UNKNOWN_LANGUAGE) {\n    destatep->declared_enc_2 = destatep->declared_enc_1;\n    hint_count += ApplyUILanguageHint(language_hint, 50, destatep);\n  }\n  // Use top level domain if not .com and <=1 other hint was available\n  if (url_hint != NULL) {\n    destatep->tld_hint = CompactEncDet::TopEncodingOfTLDHint(tld_hint);\n    if (hint_count == 0) {\n      // Apply with weight 100%\n      destatep->declared_enc_2 = destatep->declared_enc_1;\n      hint_count += ApplyTldHint(tld_hint, 100, destatep);\n      if ((destatep->declared_enc_1 == F_CP1252) ||\n          (destatep->declared_enc_1 == F_Latin1)) {\n        destatep->looking_for_latin_trigrams = true;\n      }\n      if (strcmp(\"hu\", tld_hint) == 0) {\n        // Hungarian is particularly difficult to separate Latin2 from Latin1,\n        // so always look for trigram scanning if bare TLD=hu hint\n        destatep->looking_for_latin_trigrams = true;\n      }\n    // Treat .com as no TLD hint at all\n    } else if ((hint_count == 1) && (strcmp(\"com\", tld_hint) != 0)) {\n      // Either shift weighting or consider doing no TLD here -- seems to\n      // distract from correct charset= hints. Or perhaps apply only if\n      // charset = Latin1/1252...\n      // Apply with weight 50%\n      destatep->declared_enc_2 = destatep->declared_enc_1;\n      hint_count += ApplyTldHint(tld_hint, 50, destatep);\n      if ((destatep->declared_enc_1 == F_CP1252) ||\n          (destatep->declared_enc_1 == F_Latin1)) {\n        destatep->looking_for_latin_trigrams = true;  // These need trigrams\n      }\n    }\n    // Else ignore TLD hint entirely\n  }\n\n  // Use all-web default distribution if not even a TLD hint\n  if (hint_count == 0) {\n    destatep->looking_for_latin_trigrams = true;    // Default needs trigrams\n    destatep->declared_enc_2 = destatep->declared_enc_1;\n    hint_count += ApplyDefaultHint(corpus_type, destatep);\n  }\n\n\n// ISO-Microsoft Pairs\n//    F_Latin1, F_CP1252,\n//    F_Latin2, F_CP1250,   NOT really strict subset/superset pairs\n//    F_Latin3,\n//    F_Latin4,\n//    F_ISO_8859_5, F_CP1251,\n//    F_Arabic, F_CP1256,   NOT\n//    F_Greek,  F_CP1253,   NOT really pairs\n//                              (or upgrade incvt to make Greek use CP)\n//    F_Hebrew, F_CP1255,   NOT really pairs\n//    F_Latin5, F_CP1254,\n//    F_Latin6,\n//    F_ISO_8859_11,\n//    F_ISO_8859_13, F_CP1257,\n//    F_ISO_8859_15,\n// ISO-Microsoft Pairs\n\n  // Get important families started together\n  // // This should fall out of the initializatoin vectors for charset,\n  // but we need to get rid of families alltogetrher\n  //\n  // TODO make this more graceful\n\n  // Add small bias for subsets\n\n  // Subtract small bias for supersets\n  destatep->enc_prob[F_CP932] = destatep->enc_prob[F_SJS] - kSmallInitDiff;\n\n  destatep->enc_prob[F_GBK] = destatep->enc_prob[F_GB] - kSmallInitDiff;\n  destatep->enc_prob[F_GB18030] = destatep->enc_prob[F_GB] - kSmallInitDiff;\n\n  destatep->enc_prob[F_BIG5_CP950] = destatep->enc_prob[F_BIG5] -\n    kSmallInitDiff;\n  destatep->enc_prob[F_BIG5_HKSCS] = destatep->enc_prob[F_BIG5] -\n    kSmallInitDiff;\n\n  // Deliberate over-bias Ascii7 and underbias Binary [unneeded]\n  // destatep->enc_prob[F_ASCII_7_bit] = destatep->enc_prob[F_ASCII_7_bit] + kSmallInitDiff;\n  // destatep->enc_prob[F_BINARY] = destatep->enc_prob[F_BINARY] - (kBoostInitial / 2);\n\n  if (destatep->debug_data != NULL) {\n    // Show state at end of hints\n    SetDetailsEncProb(destatep, 0, -1, \"Endhints\");\n    if(FLAGS_enc_detect_detail2) {\n      // Add a line showing the watched encoding(s)\n      if (watch1_rankedenc >= 0) {\n        SetDetailsEncProb(destatep, 0,\n                          watch1_rankedenc, FLAGS_enc_detect_watch1);\n      }\n      if (watch2_rankedenc >= 0) {\n        SetDetailsEncProb(destatep, 0,\n                          watch2_rankedenc, FLAGS_enc_detect_watch2);\n      }\n    }     // End detail2\n  }\n\n  // If duplicate hints, set second one to ASCII_7BIT to prevent double-boost\n  if (destatep->declared_enc_1 == destatep->declared_enc_2) {\n    destatep->declared_enc_2 = F_ASCII_7_bit;\n  }\n\n  if (FLAGS_force127) {\n    destatep->do_latin_trigrams = true;\n    if (FLAGS_enc_detect_source) {\n      PsHighlight(0, destatep->initial_src, 0, 2);\n    }\n  }\n\n\n  if (FLAGS_counts && destatep->looking_for_latin_trigrams) {++looking_used;}\n  if (FLAGS_counts && destatep->do_latin_trigrams) {++doing_used;}\n\n  //\n  // At this point, destatep->enc_prob[] is an initial probability vector based\n  // on the given hints/default. In general, it spreads out least-likely\n  // encodings to be about 2**-25 below the most-likely encoding.\n  // For input text with lots of bigrams, an unlikely encoding can rise to\n  // the top at a rate of about 2**6 per bigram, and more commonly 2**2 per\n  // bigram. So more than 4 bigrams and commonly more than 12 are\n  // needed to overcome the initial hints when the least-likely encoding\n  // is in fact the correct answer. So if the entire text has very few bigrams\n  // (as a two-word query might), it can be impossible for the correct\n  // encoding to win.\n  //\n  // To compensate for this, we take the initial hint vector and effectively\n  // apply it at the rate of 1/16 every bigram for the first 16 bigrams. The\n  // actual mechanism is done just before the last prune.\n  //\n\n  // Remember Initial hint probabilities\n  memcpy(destatep->hint_prob, destatep->enc_prob, sizeof(destatep->enc_prob));\n}\n\n// Look for specific high-value patterns in the first 4 bytes\n// Byte order marks (BOM)\n//  EFBBBF    UTF-8\n//  FEFF      UTF-16 BE\n//  FFFE      UTF-16 LE\n//  FFFE0000  UTF-32 BE\n//  0000FEFF  UTF-32 LE\n//\n// Likely UTF-x of seven-bit ASCII\n//  00xx      UTF-16 BE  xx printable ASCII\n//  xx00      UTF-16 LE\n//  000000xx  UTF-32 BE\n//  xx000000  UTF-32 LE\n//\nvoid InitialBytesBoost(const uint8* src,\n                       int text_length,\n                       DetectEncodingState* destatep) {\n  if (text_length < 4) {return;}\n\n  uint32 pair01 = (src[0] << 8) | src[1];\n  uint32 pair23 = (src[2] << 8) | src[3];\n  uint32 quad0123 = (pair01 << 16) | pair23;\n\n  bool utf_16_indication = false;\n  bool utf_32_indication = false;\n  int best_enc = -1;\n\n  // Byte order marks\n  // UTF-8\n  if ((quad0123 & 0xffffff00) == 0xEFBBBF00) {\n    destatep->bom_hint = UTF8;\n    Boost(destatep, F_UTF8, kBoostInitial * 2);\n    Boost(destatep, F_UTF8UTF8, kBoostInitial * 2);\n    best_enc = F_UTF8;\n  // UTF-32 (test before UTF-16)\n  } else if (quad0123 == 0x0000FEFF) {\n    destatep->bom_hint = UTF32BE;\n    Boost(destatep, F_UTF_32BE, kBoostInitial * 2);\n    best_enc = F_UTF_32BE;\n  } else if (quad0123 == 0xFFFE0000) {\n    destatep->bom_hint = UTF32LE;\n    Boost(destatep, F_UTF_32LE, kBoostInitial * 2);\n    best_enc = F_UTF_32LE;\n  // UTF-16\n  } else if (pair01 == 0xFEFF) {\n    destatep->bom_hint = UTF16BE;\n    Boost(destatep, F_UTF_16BE, kBoostInitial * 3);\n    best_enc = F_UTF_16BE;\n  } else if (pair01 == 0xFFFE) {\n    destatep->bom_hint = UTF16LE;\n    Boost(destatep, F_UTF_16LE, kBoostInitial * 3);\n    best_enc = F_UTF_16LE;\n\n  // Possible seven-bit ASCII encoded as UTF-16/32\n  // UTF-32 (test before UTF-16)\n  } else if (((quad0123 & 0xffffff00) == 0) &&\n             (kIsPrintableAscii[src[3]] != 0)) {\n    Boost(destatep, F_UTF_32BE, kBoostInitial);\n    Whack(destatep, F_UTF_32LE, kBadPairWhack);         // Illegal char\n    best_enc = F_UTF_32BE;\n  } else if (((quad0123 & 0x00ffffff) == 0) &&\n             (kIsPrintableAscii[src[0]] != 0)) {\n    Boost(destatep, F_UTF_32LE, kBoostInitial);\n    Whack(destatep, F_UTF_32BE, kBadPairWhack);         // Illegal char\n    best_enc = F_UTF_32LE;\n  } else if ((src[0] == 0x00) && (kIsPrintableAscii[src[1]] != 0)) {\n    Boost(destatep, F_UTF_16BE, kBoostInitial);\n    best_enc = F_UTF_16BE;\n  } else if ((src[1] == 0x00) && (kIsPrintableAscii[src[0]] != 0)) {\n    Boost(destatep, F_UTF_16LE, kBoostInitial);\n    best_enc = F_UTF_16LE;\n\n  // Whack if 0000 or FFFF\n  // UTF-32 (test before UTF-16)\n  } else if (quad0123 == 0x00000000) {\n    Whack(destatep, F_UTF_32BE, kBadPairWhack);         // Illegal char\n    Whack(destatep, F_UTF_32LE, kBadPairWhack);\n    Whack(destatep, F_UTF_16BE, kBadPairWhack);\n    Whack(destatep, F_UTF_16LE, kBadPairWhack);\n    best_enc = -1;\n  } else if (quad0123 == 0xffffffff) {\n    Whack(destatep, F_UTF_32BE, kBadPairWhack);         // Illegal char\n    Whack(destatep, F_UTF_32LE, kBadPairWhack);\n    Whack(destatep, F_UTF_16BE, kBadPairWhack);\n    Whack(destatep, F_UTF_16LE, kBadPairWhack);\n    best_enc = -1;\n  } else if (pair01 == 0x0000) {\n    Whack(destatep, F_UTF_16BE, kBadPairWhack);         // Illegal char\n    Whack(destatep, F_UTF_16LE, kBadPairWhack);\n    best_enc = -1;\n  } else if (pair01 == 0xffff) {\n    Whack(destatep, F_UTF_16BE, kBadPairWhack);         // Illegal char\n    Whack(destatep, F_UTF_16LE, kBadPairWhack);\n    best_enc = -1;\n\n\n  // These are the first four bytes of some known binary file formats\n\n  // Boost BINARY bigtime if JPEG FFD8FFxx\n  // Boost BINARY bigtime if png  89504E47  (.PNG)\n  // Boost BINARY bigtime if gif  47494638  (GIF8)\n  // Boost BINARY bigtime if zip  504B0304  (PK..)\n  // Boost BINARY bigtime if gzip 1F8B08xx\n  // Boost BINARY bigtime if gzip 78DAxxxx\n  // Boost BINARY if PDF 25504446 (%PDF)\n  // Boost BINARY if SWF (FWSx or CWSx where x <= 0x1f)\n  } else if ((quad0123 & 0xffffff00) == 0xFFD8FF00) {       // JPEG FFD8FFxx\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n  } else if (quad0123 == 0x89504E47) {                      // Hex 89 P N G\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n  } else if (quad0123 == 0x47494638) {                      // Hex GIF8\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n  } else if (quad0123 == 0x504B0304) {                      // Hex P K 03 04\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n  } else if ((quad0123 & 0xffffff00) == 0x1F8B0800) {       // gzip 1F8B08xx\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n  } else if (pair01 == 0x78DA) {                            // gzip 78DAxxxx\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n  } else if (quad0123 == 0x25504446) {                      // Hex %PDF\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n  } else if ((quad0123 & 0xffffff1f) == 0x66535700) {       // Hex FWSx\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n  } else if ((quad0123 & 0xffffff1f) == 0x63535700) {       // Hex CWSx\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n\n  // More binary detect prefixes\n  // 7F E L F   Executable and linking format\n  // M M 00 *   TIFF (little-endian)\n  // * 00 M M   TIFF (big-endian)\n  // 01 f c p   Final cut pro\n  } else if (quad0123 == 0x7F454C46) {                      // Hex 7F E L F\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n  } else if (quad0123 == 0x4D4D002A) {                      // Hex M M 00 *\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n  } else if (quad0123 == 0x2A004D4D) {                      // Hex * 00 M M\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n  } else if (quad0123 == 0x01666370) {                      // Hex 01 f c p\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n\n  // More binary detect prefixes; all-ASCII names; heavy weight to avoid ASCII\n  // prefix overcoming binary\n  // C C S D    USGS ISIS 3-D cube files\n  // S I M P    FITS image header    \"SIMPLE \"\n  } else if (quad0123 == 0x43435344) {                      // Hex C C S D\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n  } else if (quad0123 == 0x53494D50) {                      // Hex S I M P\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n\n  // More binary detect prefixes; all-ASCII names; lighter weight\n  // H W P      Hangul word processor\n  // 8 B P S    Photoshop\n  // P D S _    xx \"PDS_VERSION_ID \"\n  } else if (quad0123 == 0x48575020) {                      // Hex H W P\n    if ((19 <= text_length) &&\n        (memcmp(src, \"HWP.Document.File.V\", 19) == 0)) {\n      Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n    } else if ((19 <= text_length) &&\n               (memcmp(src, \"HWP Document File V\", 19) == 0)) {\n      Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n    } else {\n      Boost(destatep, F_BINARY, kBoostInitial * kWeakerBinary);\n    }\n  } else if (quad0123 == 0x38425053) {                      // Hex 8 B P S\n    Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n  } else if (quad0123 == 0x5044535F) {                      // Hex P D S _\n    if ((14 <= text_length) && (memcmp(src, \"PDS_VERSION_ID\", 14) == 0)) {\n      Boost(destatep, F_BINARY, kBoostInitial * kStrongBinary);\n    } else {\n      Boost(destatep, F_BINARY, kBoostInitial * kWeakerBinary);\n    }\n  }\n\n  // There are several main Windows EXE file formats.\n  // Not examined here (prefix too short; never see them in Google pipeline)\n  // M Z        DOS .exe  Mark Zbikowski\n  // N E        DOS 4.0 16-bit\n  // L E        OS/2 VxD drivers\n  // L X        OS/2\n  // P E        Windows NT\n\n\n  // More user-defined\n  // http://www.freenet.am/armscii/ Armenian\n\n  // If any hints or BOM, etc. keep UTF 16/32 around\n  if ((destatep->enc_prob[F_UTF_16BE] > 0) ||\n      (destatep->enc_prob[F_UTF_16LE] > 0)) {\n    utf_16_indication = true;\n  }\n  if ((destatep->enc_prob[F_UTF_32BE] > 0) ||\n      (destatep->enc_prob[F_UTF_32LE] > 0)) {\n    utf_32_indication = true;\n  }\n\n\n  // Kill UTF16/32 right now if no positive indication of them\n  // Otherwise, they tend to rise to the top in 7-bit files with an\n  // occasional 0x02 byte  in some comment or javascript\n  if (!utf_16_indication) {\n    Whack(destatep, F_UTF_16BE, kBadPairWhack * 8);\n    Whack(destatep, F_UTF_16LE, kBadPairWhack * 8);\n    Whack(destatep, F_Unicode, kBadPairWhack * 8);\n  }\n  if (!utf_32_indication) {\n    Whack(destatep, F_UTF_32BE, kBadPairWhack * 8);\n    Whack(destatep, F_UTF_32LE, kBadPairWhack * 8);\n  }\n\n  // Usually kill mixed encodings\n  if (!FLAGS_ced_allow_utf8utf8) {\n    Whack(destatep, F_UTF8UTF8, kBadPairWhack * 8);\n  }\n  // 2011.11.07 never use UTF8CP1252 -- answer will be UTF8 instead\n  Whack(destatep, F_UTF8CP1252, kBadPairWhack * 8);\n\n  if (destatep->debug_data != NULL) {\n    // Show first four bytes of the input\n    char buff[16];\n    snprintf(buff, sizeof(buff), \"%04x%04x\", pair01, pair23);\n    SetDetailsEncProb(destatep, 0, best_enc, buff);\n  }\n}\n\n\n\n// Descending order\nint IntCompare(const void* v1, const void* v2) {\n  const int* p1 = reinterpret_cast<const int*>(v1);\n  const int* p2 = reinterpret_cast<const int*>(v2);\n  if (*p1 < *p2) {return 1;}\n  if (*p1 > *p2) {return -1;}\n  return 0;\n}\n\nbool Base64Char(uint8 c) {\n  if (('A' <= c) && (c <= 'Z')) {return true;}\n  if (('a' <= c) && (c <= 'z')) {return true;}\n  if (('0' <= c) && (c <= '9')) {return true;}\n  if ('+' == c) {return true;}\n  if ('/' == c) {return true;}\n  return false;\n}\n\nint Base64ScanLen(const uint8* start, const uint8* limit) {\n  // We have a plausible beginning; scan entire base64 string\n  const uint8* ib64str = start;\n  const uint8* b64str = ib64str;\n  const uint8* b64strlimit = limit;\n  // if starts with + +++, assume it is drawing, so bogus\n  if (((limit - start) > 3) && (start[0] == '+') &&\n    (start[1] == '+') && (start[2] == '+')) {\n    return 81;\n  }\n  // Scan over base64\n  while ((b64str < b64strlimit) && (kBase64Value[*b64str++] >= 0))  {\n  }\n  b64str--;      // We overshot by 1\n  return b64str - ib64str;\n}\n\n// Input is at least 8-character legal base64 string after +.\n// But might be say + \"Presse+Termine\"\nbool GoodUnicodeFromBase64(const uint8* start, const uint8* limit) {\n  // Reject base64 string len N if density of '+' is > 1 + N/16 (expect 1/64)\n  // Reject base64 string len N if density of A-Z is < 1 + N/16 (expect 26/64)\n  // Reject base64 string len N if density of a-z is < 1 + N/16 (expect 26/64)\n  // Reject base64 string len N if density of 0-9 is < 1 + N/32 (expect 10/64)\n  // NOTE: this requires at least one lower AND one upper AND one digit to pass\n  //\n  int plus_count = 0;\n  int lower_count = 0;\n  int upper_count = 0;\n  int digit_count = 0;\n  int len = limit - start;\n  for (const uint8* src = start; src < limit; ++src) {\n    uint8 c = *src;\n    if (('a' <= c) && (c <= 'z')) {\n      ++lower_count;\n    } else if (('A' <= c) && (c <= 'Z')) {\n      ++upper_count;\n    } else if (('0' <= c) && (c <= '0')) {\n      ++digit_count;\n    } else if (*src == '+') {\n      ++plus_count;\n    }\n  }\n\n  if (plus_count > (1 + (len >> 4))) {return false;}\n  if (lower_count < (1 + (len >> 4))) {return false;}\n  if (upper_count < (1 + (len >> 4))) {return false;}\n  if (digit_count < (1 + (len >> 5))) {return false;}\n\n  // checking the last character to reduce false positive\n  // since the last character may be padded to 0 bits at the end.\n  // refer to http://en.wikipedia.org/wiki/UTF-7\n  int nmod8 = len & 7;\n  const uint8 last = *(start+len-1);\n  // When UTF-7 string length%8=3, the last two bits must be padded as 0\n  if ((nmod8 == 3) && (kBase64Value[last] & 3)) {return false;}\n  // When UTF-7 string length%8=6, the last four bits must be padded as 0\n  if ((nmod8 == 6) && (kBase64Value[last] & 15)) {return false;}\n  return true;\n}\n\n// Prune here after N bytes\n// Boost here for seven-bit sequences (at every prune)\n// if (sevenbitrankedencoding)\n//   + UTF7   scan and boost/demote len mod 8 = 0 3 6\n//   ~ Hz     scan and boost/demote len mod 8 = 0 2 4 6\n//   1B 2022  scan and boost/demote len mod 8 = 0 2 4 6\n//   0E 2022  scan and boost/demote len mod 8 = 0 2 4 6\n//   [0F 2022  boost/demote]\n//   00 UTF16/32  scan and boost/demote offset = even/odd\n//\n// If still some seven-bit possibilities > pure ASCII,\n// scan each possibility for clearer prob, s.t. about\n// two good sequences is a clear win\n// A-Z 00-19 00xx-64xx   (B = 04xx)\n// a-z 1A-33 68xx-CCxx   (f = 7Cxx)\n// 0-9 34-3D D0xx-F4xx   (1 = D4xx)\n// +   3E    F8xx\n// /   3F    FCxx\n// do another chunk  with slow scan\n\n\n// Boost, whack, or leave alone UTF-7 probablilty\nvoid UTF7BoostWhack(DetectEncodingState* destatep, int next_pair, uint8 byte2) {\n  int off = destatep->interesting_offsets[AsciiPair][next_pair];\n  if (off >= destatep->prior_utf7_offset) {\n    // Not part of a previous successful UTF-7 string\n    ++destatep->utf7_starts;\n\n    if (byte2 == '-') {\n      // +- encoding for '+'  neutral\n    } else if (!Base64Char(byte2)) {\n      // Not base64 -- not UTF-7, whack\n      Whack(destatep, F_UTF7, kBadPairWhack);                 // Illegal pair\n    } else {\n      // Starts with base64 byte, might be a good UTF7 sequence\n      const uint8* start = destatep->initial_src + off + 1;   // over the +\n      int n = Base64ScanLen(start, destatep->limit_src);\n      int nmod8 = n & 7;\n      if ((n == 3) || (n == 6)) {\n        // short but legal -- treat as neutral\n      } else if ((nmod8 == 0) | (nmod8 == 3) | (nmod8 == 6)) {\n        // Good length. Check for good Unicode.\n        if (GoodUnicodeFromBase64(start, start + n)) {\n          // Good length and Unicode, boost\n          Boost(destatep, F_UTF7, kBoostOnePair);         // Found good\n          destatep->prior_utf7_offset = off + n + 1;\n        } else {\n          // Bad Unicode. Whack\n          Whack(destatep, F_UTF7, kBadPairWhack);         // Illegal length\n        }\n      } else {\n        // Bad length. Whack\n        Whack(destatep, F_UTF7, kBadPairWhack);         // Illegal length\n      }\n    }\n  }\n}\n\n// Boost, whack, or leave alone HZ probablilty\nvoid HzBoostWhack(DetectEncodingState* destatep, uint8 byte2) {\n  if ((byte2 == '{') || (byte2 == '}')) {\n    Boost(destatep, F_HZ_GB_2312, kBoostOnePair);         // Found ~{ or ~}\n  } else if ((byte2 == '~') || (byte2 == '\\n')) {\n    destatep->enc_prob[F_HZ_GB_2312] += 0;                // neutral\n  } else {\n    Whack(destatep, F_HZ_GB_2312, kBadPairWhack);         // Illegal pair\n  }\n}\n\n// Boost, whack, or leave alone BINARY probablilty\nvoid BinaryBoostWhack(DetectEncodingState* destatep, uint8 byte1, uint8 byte2) {\n  int quadrant = ((byte1 & 0x80) >> 6) | ((byte2 & 0x80) >> 7);\n  int bucket8x4 = ((byte1 & 0xe0) >> 3) | ((byte2 & 0xc0) >> 6);\n  uint32 quad_mask = 1 << quadrant;\n  uint32 bucket8x4_mask = 1 << bucket8x4;\n  if ((destatep->binary_quadrants_seen & quad_mask) == 0) {\n    destatep->binary_quadrants_seen |= quad_mask;\n    destatep->binary_quadrants_count += 1;\n    if (destatep->binary_quadrants_count == 4) {\n      Boost(destatep, F_BINARY, kBoostOnePair * 2);   // Found all 4 quadrants,\n                                                      // boost 2 pairs\n    }\n  }\n  if ((destatep->binary_8x4_seen & bucket8x4_mask) == 0) {\n    destatep->binary_8x4_seen |= bucket8x4_mask;\n    destatep->binary_8x4_count += 1;\n    if (destatep->binary_8x4_count >= 11) {\n      Boost(destatep, F_BINARY, kBoostOnePair * 4);   // Found 11+/20 buckets,\n                                                      // boost 4 pairs each time\n    }\n  }\n}\n\n\n// Demote UTF-16/32 on 0000 or FFFF, favoring Binary\nvoid UTF1632BoostWhack(DetectEncodingState* destatep, int offset, uint8 byte1) {\n  if (byte1 == 0) {     // We have 0000\n    Whack(destatep, F_UTF_16BE, kBadPairWhack);           // Illegal pair\n    Whack(destatep, F_UTF_16LE, kBadPairWhack);           // Illegal pair\n    switch (offset & 3) {\n    case 0:         // We get called with 0 4 8, etc. for ASCII/BMP as UTF-32BE\n      Whack(destatep, F_UTF_32LE, kBadPairWhack);         // Illegal pair\n      Boost(destatep, F_UTF_32BE, kSmallInitDiff);        // Good pair\n      break;\n    case 1:         // We get called with 1 5 9, etc. for ASCII as UTF-32LE\n    case 2:         // We get called with 2 6 10, etc. for BMP as UTF-32LE\n      Whack(destatep, F_UTF_32BE, kBadPairWhack);         // Illegal pair\n      Boost(destatep, F_UTF_32LE, kSmallInitDiff);        // Good pair\n      break;\n    case 3:         // ambiguous\n      break;\n    }\n  } else {              // We have ffff\n    Whack(destatep, F_UTF_32BE, kBadPairWhack);           // Illegal pair\n    Whack(destatep, F_UTF_32LE, kBadPairWhack);           // Illegal pair\n    Whack(destatep, F_UTF_16BE, kBadPairWhack);           // Illegal pair\n    Whack(destatep, F_UTF_16LE, kBadPairWhack);           // Illegal pair\n  }\n}\n\n// Make even offset\nvoid UTF16MakeEven(DetectEncodingState* destatep, int next_pair) {\n  destatep->interesting_offsets[OtherPair][next_pair] &= ~1;\n}\n\nbool ConsecutivePair(DetectEncodingState* destatep, int i) {\n  if (i <= 0) {\n    return false;\n  }\n  return destatep->interesting_offsets[OtherPair][i] ==\n         (destatep->interesting_offsets[OtherPair][i - 1] + 2);\n}\n\n// boost, whack, or leave alone UTF-8 probablilty\n// Any whacks are also applied to UTF8UTF8; CheckUTF8UTF8Seq assumes good UTF8\n// Returns total boost\nint CheckUTF8Seq(DetectEncodingState* destatep, int weightshift) {\n  int startcount = destatep->prior_interesting_pair[OtherPair];\n  int endcount = destatep->next_interesting_pair[OtherPair];\n\n  int demotion_count = 0;\n  for (int i = startcount; i < endcount; ++i) {\n    int sub;\n    char* s = &destatep->interesting_pairs[OtherPair][i * 2];\n    // Demote four byte patterns that are more likely Latin1 than UTF-8\n    // C9AE, DF92, DF93, DFAB. See note at top.\n    // Demotion also boosts Latin1 and CP1252\n    uint8 s0 = static_cast<uint8>(s[0]);\n    uint8 s1 = static_cast<uint8>(s[1]);\n    if ((s0 == 0xc9) && (s1 == 0xae)) {++demotion_count;}\n    if ((s0 == 0xdf) && (s1 == 0x92)) {++demotion_count;}\n    if ((s0 == 0xdf) && (s1 == 0x93)) {++demotion_count;}\n    if ((s0 == 0xdf) && (s1 == 0xab)) {++demotion_count;}\n\n    if (!ConsecutivePair(destatep, i)) {\n      // Insert a blank into the sequence; avoid wrong splices\n      sub = (' ' >> 4) & 0x0f;\n      ++destatep->utf8_minicount[\n          static_cast<int>(kMiniUTF8Count[static_cast<int>(destatep->next_utf8_ministate)][sub])];\n      destatep->next_utf8_ministate =\n        kMiniUTF8State[destatep->next_utf8_ministate][sub];\n    }\n    // Byte 0\n    sub = (s0 >> 4) & 0x0f;\n    ++destatep->utf8_minicount[\n        static_cast<int>(kMiniUTF8Count[static_cast<int>(destatep->next_utf8_ministate)][sub])];\n    destatep->next_utf8_ministate =\n      kMiniUTF8State[destatep->next_utf8_ministate][sub];\n    // Byte 1\n    sub = (s1 >> 4) & 0x0f;\n    ++destatep->utf8_minicount[\n        static_cast<int>(kMiniUTF8Count[static_cast<int>(destatep->next_utf8_ministate)][sub])];\n    destatep->next_utf8_ministate =\n      kMiniUTF8State[destatep->next_utf8_ministate][sub];\n    DCHECK((0 <= destatep->next_utf8_ministate) &&\n           (destatep->next_utf8_ministate < 8));\n  }\n\n\n  // For the four specific byte combinations above, Latin1/CP1252 is more likely\n  if (demotion_count > 0) {\n    Boost(destatep, F_Latin1, kGentleOnePair * demotion_count);\n    Boost(destatep, F_CP1252, kGentleOnePair * demotion_count);\n  }\n\n  // Boost UTF8 for completed good sequences\n  int total_boost = 2 * destatep->utf8_minicount[2] +\n                    3 * destatep->utf8_minicount[3] +\n                    4 * destatep->utf8_minicount[4];\n  // But not so much for demoted bytes\n  total_boost -= (3 * demotion_count);\n\n  total_boost *= kGentleOnePair;\n  total_boost >>= weightshift;\n  // Design: boost both UTF8 and UTF8UTF8 for each good sequence\n  Boost(destatep, F_UTF8, total_boost);\n  Boost(destatep, F_UTF8UTF8, total_boost);\n\n  destatep->utf8_minicount[5] += destatep->utf8_minicount[2];   // total chars\n  destatep->utf8_minicount[5] += destatep->utf8_minicount[3];   // total chars\n  destatep->utf8_minicount[5] += destatep->utf8_minicount[4];   // total chars\n  destatep->utf8_minicount[2] = 0;\n  destatep->utf8_minicount[3] = 0;\n  destatep->utf8_minicount[4] = 0;\n\n  // Whack (2 bytes) for errors\n  int error_whack = 2 * destatep->utf8_minicount[1];\n  error_whack *= kGentlePairWhack;\n  error_whack >>= weightshift;\n  Whack(destatep, F_UTF8, error_whack);\n  Whack(destatep, F_UTF8UTF8, error_whack);\n  destatep->utf8_minicount[1] = 0;\n\n  return total_boost - error_whack;\n}\n\n\n// Boost, whack, or leave alone UTF8UTF8 probablilty\n//\n// We are looking for\n// (1) chars ONLY in set UTF8(0080)..UTF8(00FF), including for 80..9F the\n//     MS CP1252 mappings, and\n// (2) sequences of 2 or more such characters\n//\n// If so, we could be looking at some non-7-bit encoding extra-converted\n// to UTF-8. The most common observed is CP1252->UTF8 twice,\n//    1252=>UTF8 : 1252=>UTF8\n// where the colon means \"take those bytes and pretend that they are 1252\".\n// We have a couple of examples of BIG5 bytes converted as though\n// they were 1252,\n//    BIG5 : 1252=>UTF8\n//\n// Of course, we don't want correctly converted 1252 to be flagged here\n//    1252=>UTF8\n// So we want the input high bytes to be in pairs or longer, hence the\n// output UTF8 in groups of four bytes or more\n//\n// Good chars: C2xx, C3xx,\n// Good chars: C592, C593, C5A0, C5A1, C5B8, C5BD, C5BE, C692, CB86, CB9C\n// Good chars: E280xx E282AC E284A2\n//             C2xx 1100001x 10xxxxxx   (128/128)\n//             C5xx 11000101 10xx00xx   (16/4)\n//             C5xx 11000101 10111xxx   (8/3)\n//             C692 11000110 10010010   (1/1)\n//             CBxx 11001011 100xx1x0   (8/2)\n//             E28x 11100010 10000xx0   (4/3)\n//\n// Returns total boost\nint CheckUTF8UTF8Seq(DetectEncodingState* destatep, int weightshift) {\n  int this_pair = destatep->prior_interesting_pair[OtherPair];\n  int startbyteoffset = this_pair * 2;\n  int endbyteoffset = destatep->next_interesting_pair[OtherPair] * 2;\n  char* startbyte = &destatep->interesting_pairs[OtherPair][startbyteoffset];\n  char* endbyte = &destatep->interesting_pairs[OtherPair][endbyteoffset];\n\n  int pair_number = this_pair;\n  for (char* s = startbyte; s < endbyte; s += 2) {\n    int next = destatep->next_utf8utf8_ministate;\n    if (!ConsecutivePair(destatep, pair_number)) {\n      // Insert two blanks into the sequence to avoid wrong splices\n      // go back to no odd-byte offset\n      destatep->utf8utf8_odd_byte = 0;\n      int sub = UTF88Sub(' ', ' ');\n      ++destatep->utf8utf8_minicount[static_cast<int>(kMiniUTF8UTF8Count[next][sub])];\n      next = kMiniUTF8UTF8State[next][sub];\n    }\n\n    int odd = destatep->utf8utf8_odd_byte;\n    if (s + 1 + odd >= endbyte) continue;\n    int sub = UTF88Sub(s[0 + odd], s[1 + odd]);\n    destatep->utf8utf8_odd_byte ^= kMiniUTF8UTF8Odd[next][sub];\n    ++destatep->utf8utf8_minicount[\n        static_cast<int>(kMiniUTF8UTF8Count[next][sub])];\n    destatep->next_utf8utf8_ministate = kMiniUTF8UTF8State[next][sub];\n    ++pair_number;\n  }\n\n  // Boost for completed good sequences; each count covers two chars.\n  // Design: boost UTF8UTF8 above UTF8 for each good sequence\n  int total_boost = (2) * destatep->utf8utf8_minicount[2] +\n                    (2) * destatep->utf8utf8_minicount[3] +\n                    (2) * destatep->utf8utf8_minicount[4];\n  total_boost *= kGentleOnePair;\n  total_boost >>= weightshift;\n  Boost(destatep, F_UTF8UTF8, total_boost);\n\n  // Track total characters\n  destatep->utf8utf8_minicount[5] += destatep->utf8utf8_minicount[2];\n  destatep->utf8utf8_minicount[5] += destatep->utf8utf8_minicount[3];\n  destatep->utf8utf8_minicount[5] += destatep->utf8utf8_minicount[4];\n  destatep->utf8utf8_minicount[2] = 0;\n  destatep->utf8utf8_minicount[3] = 0;\n  destatep->utf8utf8_minicount[4] = 0;\n\n  // Design: Do not whack UTF8UTF8 below UTF8 for each bad sequence\n\n  destatep->utf8utf8_minicount[1] = 0;\n  return total_boost;\n}\n\n\n// We give a gentle boost for each paired SO ... SI, whack others\nvoid CheckIso2022ActiveSeq(DetectEncodingState* destatep) {\n  int this_pair = destatep->prior_interesting_pair[OtherPair];\n  int startbyteoffset = this_pair * 2;\n  int endbyteoffset = destatep->next_interesting_pair[OtherPair] * 2;\n  char* startbyte = &destatep->interesting_pairs[OtherPair][startbyteoffset];\n  char* endbyte = &destatep->interesting_pairs[OtherPair][endbyteoffset];\n\n  // Initial <esc> char must precede SO/SI\n  // HZ_GB_2312 has no alternation constraint on 1- and 2-byte segments\n  // ISO-2022-JP (JIS) has no alternation constraint on 1- and 2-byte segments\n  // ISO-2022-CN has no alternation constraint on 1- and 2-byte segments\n  // ISO-2022-KR requires alternation between 1- and 2-byte segments\n  // JIS:\n  //  <esc> ( B ISO-2022-JP     [1b 28 42]  SI to ASCII\n  //  <esc> ( J ISO-2022-JP     [1b 28 4a]  SI to X0201\n  //  <esc> $ @ ISO-2022-JP     [1b 24 40]  SO to X0208-78 twobyte\n  //  <esc> $ B ISO-2022-JP     [1b 24 42]  SO to X0208-83 twobyte\n  for (char* s = startbyte; s < endbyte; s += 2) {\n    if (s[0] == 0x1b) {\n      if (s[1] == 0x24) {\n        // <esc> $  is SO\n        destatep->next_2022_state = SOSI_TWOBYTE;       // SO to two-byte\n      } else if (s[1] == 0x28) {\n        if (destatep->next_2022_state == SOSI_TWOBYTE) {\n          Boost(destatep, F_JIS, kGentlePairBoost);\n        } else if (destatep->next_2022_state == SOSI_ONEBYTE) {\n          Whack(destatep, F_JIS, kGentlePairWhack);\n        }\n        destatep->next_2022_state = SOSI_ONEBYTE;       // JIS SI to one-byte\n      } else {\n        Whack(destatep, F_JIS, kBadPairWhack);\n        Whack(destatep, F_ISO_2022_CN, kBadPairWhack);\n        Whack(destatep, F_ISO_2022_KR, kBadPairWhack);\n        destatep->next_2022_state = SOSI_ERROR;     // not 2022\n      }\n    } else if (s[0] == 0x0e)  {\n      // <so>\n      Whack(destatep, F_JIS, kBadPairWhack);\n      if (destatep->next_2022_state != SOSI_NONE) {\n        destatep->next_2022_state = SOSI_TWOBYTE;       // SO to two-byte\n      } else {\n        // ESC required before SO/SI\n        Whack(destatep, F_ISO_2022_CN, kBadPairWhack * 4);\n        Whack(destatep, F_ISO_2022_KR, kBadPairWhack * 4);\n        destatep->next_2022_state = SOSI_ERROR;     // SO not after SI\n      }\n    } else if (s[0] == 0x0f)  {\n      // <si>\n      Whack(destatep, F_JIS, kBadPairWhack);\n      if (destatep->next_2022_state != SOSI_NONE) {\n        if (destatep->next_2022_state == SOSI_TWOBYTE) {\n          Boost(destatep, F_ISO_2022_CN, kGentlePairBoost);\n          Boost(destatep, F_ISO_2022_KR, kGentlePairBoost);\n        } else if (destatep->next_2022_state == SOSI_ONEBYTE) {\n          Whack(destatep, F_ISO_2022_CN, kGentlePairWhack);\n          Whack(destatep, F_ISO_2022_KR, kGentlePairWhack);\n        }\n        destatep->next_2022_state = SOSI_ONEBYTE;       // SI to one-byte\n      } else {\n        // ESC required before SO/SI\n        Whack(destatep, F_ISO_2022_CN, kBadPairWhack * 4);\n        Whack(destatep, F_ISO_2022_KR, kBadPairWhack * 4);\n        destatep->next_2022_state = SOSI_ERROR;     // SI not after SO\n      }\n    } else if (s[0] <= 0x1f)  {\n      // Some other control code. Allow ht lf [ff] cr\n      if ((s[0] != 0x09) && (s[0] != 0x0a) &&\n          (s[0] != 0x0c) && (s[0] != 0x0d)) {\n        // Otherwise these can float to the top on bad bytes\n        Whack(destatep, F_JIS, kBadPairWhack);\n        Whack(destatep, F_ISO_2022_CN, kBadPairWhack);\n        Whack(destatep, F_ISO_2022_KR, kBadPairWhack);\n      }\n    }\n  }\n\n  // If no start, keep the probability pinned at zero (or below)\n  if (destatep->next_2022_state == SOSI_NONE) {\n    destatep->enc_prob[F_ISO_2022_CN] =\n      minint(0, destatep->enc_prob[F_ISO_2022_CN]);\n    destatep->enc_prob[F_ISO_2022_KR] =\n      minint(0, destatep->enc_prob[F_ISO_2022_KR]);\n    destatep->enc_prob[F_JIS] =\n      minint(0, destatep->enc_prob[F_JIS]);\n  }\n}\n\n// We give a gentle boost for each paired ~{ ... ~}, whack others\nvoid CheckHzActiveSeq(DetectEncodingState* destatep) {\n  int this_pair = destatep->prior_interesting_pair[AsciiPair];\n  int startbyteoffset = this_pair * 2;\n  int endbyteoffset = destatep->next_interesting_pair[AsciiPair] * 2;\n  char* startbyte = &destatep->interesting_pairs[AsciiPair][startbyteoffset];\n  char* endbyte = &destatep->interesting_pairs[AsciiPair][endbyteoffset];\n\n  for (char* s = startbyte; s < endbyte; s += 2) {\n    // Look for initial ~{ pair\n    if ((s[0] == '~') && (s[1] == '{')) {\n      destatep->next_hz_state = SOSI_TWOBYTE;       // SO to two-byte\n    }\n    // Also look for closing ~} pair\n    if ((s[0] == '~') && (s[1] == '}'))  {\n      if (destatep->next_hz_state == SOSI_TWOBYTE) {\n        Boost(destatep, F_HZ_GB_2312, kGentlePairBoost);\n      } else if (destatep->next_hz_state == SOSI_ONEBYTE) {\n        Whack(destatep, F_HZ_GB_2312, kGentlePairWhack);\n      }\n      destatep->next_hz_state = SOSI_ONEBYTE;       // SI to one-byte\n    }\n  }\n\n  // If no start, keep the probability pinned at zero (or below)\n  if (destatep->next_hz_state == SOSI_NONE) {\n    destatep->enc_prob[F_HZ_GB_2312] =\n      minint(0, destatep->enc_prob[F_HZ_GB_2312]);\n  }\n}\n\n// We give a gentle boost after an odd number of 8Fxxxx triples, which\n// put subsequent bigrams out of phase until a low byte or another 8Fxxxx\nvoid CheckEucJpSeq(DetectEncodingState* destatep) {\n  int this_pair = destatep->prior_interesting_pair[OtherPair];\n  int startbyteoffset = this_pair * 2;\n  int endbyteoffset = destatep->next_interesting_pair[OtherPair] * 2;\n  char* startbyte = &destatep->interesting_pairs[OtherPair][startbyteoffset];\n  char* endbyte = &destatep->interesting_pairs[OtherPair][endbyteoffset];\n\n  for (char* s = startbyte; s < endbyte; s += 2) {\n    // Boost if out of phase (otherwise, EUC-JP will score badly after 8Fxxxx)\n    if (destatep->next_eucjp_oddphase) {\n      //printf(\"  EucJp boost[%02x%02x]\\n\", s[0], s[1]);    // TEMP\n      Boost(destatep, F_EUC_JP, kGentlePairBoost * 2);\n    }\n\n    uint8 s0 = static_cast<uint8>(s[0]);\n    uint8 s1 = static_cast<uint8>(s[1]);\n    // Look for phase flip at 8F\n    if ((s0 & 0x80) == 0x00) {\n      destatep->next_eucjp_oddphase = false;\n    } else if (s0 == 0x8f) {\n      destatep->next_eucjp_oddphase = !destatep->next_eucjp_oddphase;\n    }\n    if ((s1 & 0x80) == 0x00) {\n      destatep->next_eucjp_oddphase = false;\n    } else if (s1 == 0x8f) {\n      destatep->next_eucjp_oddphase = !destatep->next_eucjp_oddphase;\n    }\n  }\n}\n\n// Boost, whack, or leave alone BINARY probablilty\n// Also called if UTF 16/32 active\nvoid CheckBinaryDensity(const uint8* src, DetectEncodingState* destatep,\n                        int delta_otherpairs) {\n  // No change if not much gathered information\n  if (delta_otherpairs == 0) {\n    // Only ASCII pairs this call\n    return;\n  }\n  int next_pair = destatep->next_interesting_pair[OtherPair];\n\n  // Look at density of interesting pairs [0..src)\n  int delta_offset =  static_cast<int>(src - destatep->initial_src);   // actual\n\n  // Look at density of interesting pairs [0..next_interesting)\n  int low_byte = destatep->interesting_offsets[OtherPair][0];\n  //int high_byte = destatep->interesting_offsets[OtherPair][next_pair - 1] + 2;\n  //int byte_span = high_byte - low_byte;\n  int byte_span = delta_offset - low_byte;\n\n  // If all ASCII for the first 4KB, reject\n  // If mostly ASCII in the first 5KB, reject\n  if ((low_byte >= kBinaryHardAsciiLimit) || (delta_offset >= kBinarySoftAsciiLimit)) {\n    // Not binary early enough in text\n    Whack(destatep, F_BINARY, kBadPairWhack * 4);\n    Whack(destatep, F_UTF_32BE, kBadPairWhack * 4);\n    Whack(destatep, F_UTF_32LE, kBadPairWhack * 4);\n    Whack(destatep, F_UTF_16BE, kBadPairWhack * 4);\n    Whack(destatep, F_UTF_16LE, kBadPairWhack * 4);\n    return;\n  }\n\n  // Density 1.0 for N pairs takes 2*N bytes\n  // Whack if < 1/16 after first non_ASCII pair\n  if ((next_pair * 2 * 16) < byte_span) {\n    // Not dense enough\n    Whack(destatep, F_BINARY, kBadPairWhack * 4);\n    Whack(destatep, F_UTF_32BE, kBadPairWhack * 4);\n    Whack(destatep, F_UTF_32LE, kBadPairWhack * 4);\n    Whack(destatep, F_UTF_16BE, kBadPairWhack * 4);\n    Whack(destatep, F_UTF_16LE, kBadPairWhack * 4);\n  }\n\n  if (next_pair < 8) {\n    // Fewer than 8 non-ASCII total; too soon to boost\n    return;\n  }\n\n  // Density 1.0 for N pairs takes 2*N bytes\n  // Boost if density >= 1/4, whack if < 1/16\n  if ((next_pair * 2 * 4) >= byte_span) {\n    // Very dense\n    // Only boost if at least 2 quadrants seen\n    if (destatep->binary_quadrants_count >= 2) {\n      Boost(destatep, F_BINARY, kSmallInitDiff);\n      Boost(destatep, F_UTF_32BE, kSmallInitDiff);\n      Boost(destatep, F_UTF_32LE, kSmallInitDiff);\n      Boost(destatep, F_UTF_16BE, kSmallInitDiff);\n      Boost(destatep, F_UTF_16LE, kSmallInitDiff);\n    }\n  }\n}\n\n\n// Look at a number of special-case encodings whose reliable detection depends\n// on sequencing or other properties\n// AsciiPair probibilities (UTF7 and HZ) are all done here\nvoid ActiveSpecialBoostWhack(const uint8* src, DetectEncodingState* destatep) {\n  int delta_asciipairs = destatep->next_interesting_pair[AsciiPair] -\n    destatep->prior_interesting_pair[AsciiPair];\n  int delta_otherpairs = destatep->next_interesting_pair[OtherPair] -\n    destatep->prior_interesting_pair[OtherPair];\n\n  // The two pure ASCII encodings\n  if (UTF7OrHzActive(destatep) && (delta_asciipairs > 0)) {\n    // Adjust per pair\n    for (int i = 0; i < delta_asciipairs; ++i) {\n      int next_pair = destatep->prior_interesting_pair[AsciiPair] + i;\n      uint8 byte1 = destatep->interesting_pairs[AsciiPair][next_pair * 2 + 0];\n      uint8 byte2 = destatep->interesting_pairs[AsciiPair][next_pair * 2 + 1];\n      if (byte1 == '+') {\n        // Boost, whack, or leave alone UTF-7 probablilty\n        UTF7BoostWhack(destatep, next_pair, byte2);\n        if (destatep->debug_data != NULL) {\n          // Show UTF7 entry\n          char buff[16];\n          snprintf(buff, sizeof(buff), \"%02x%02x+\", byte1, byte2);\n          SetDetailsEncProb(destatep,\n                            destatep->interesting_offsets[AsciiPair][next_pair],\n                            kMostLikelyEncoding[(byte1 << 8) + byte2],\n                            buff);\n        }\n      } else if (byte1 == '~') {\n        // Boost, whack, or leave alone HZ probablilty\n        HzBoostWhack(destatep, byte2);\n        if (destatep->debug_data != NULL) {\n          // Show Hz entry\n          char buff[16];\n          snprintf(buff, sizeof(buff), \"%02x%02x~\", byte1, byte2);\n          SetDetailsEncProb(destatep,\n                            destatep->interesting_offsets[AsciiPair][next_pair],\n                            kMostLikelyEncoding[(byte1 << 8) + byte2],\n                            buff);\n        }\n      }\n    }\n\n    // Kill UTF-7 now if at least 8 + pairs and not confirmed valid UTF-7\n    if ((destatep->utf7_starts >= 8) && (destatep->prior_utf7_offset == 0)) {\n      Whack(destatep, F_UTF7, kBadPairWhack * 8);         // flush\n    }\n  }\n\n\n\n  // All the other encodings\n  if (OtherActive(destatep) && (delta_otherpairs > 0)) {\n    // Adjust per pair\n    int biggest_weightshift = 0;\n    for (int i = 0; i < delta_otherpairs; ++i) {\n      int next_pair = destatep->prior_interesting_pair[OtherPair] + i;\n      uint8 byte1 = destatep->interesting_pairs[OtherPair][next_pair * 2 + 0];\n      uint8 byte2 = destatep->interesting_pairs[OtherPair][next_pair * 2 + 1];\n      int off = destatep->interesting_offsets[OtherPair][next_pair];\n      int weightshift = destatep->interesting_weightshift[OtherPair][next_pair];\n      biggest_weightshift = maxint(biggest_weightshift, weightshift);\n\n      if (byte1 == 0x00) {\n        if (byte2 == 0x00) {\n          UTF1632BoostWhack(destatep, off, byte1);\n        } else if ((kIsPrintableAscii[byte2] != 0) && ((off & 1) != 0)) {\n          // We have 00xx at an odd offset. Turn into preceding even offset\n          // for possible Ascii text in UTF-16LE or UTF-32LE (vs BE)\n          // This will cascade into caller's probability update\n          // 00 is illegal for all other encodings, so it doesn't matter to them\n          UTF16MakeEven(destatep, next_pair);\n        }\n        if (destatep->debug_data != NULL) {\n          // Show 0000 detail entry for this bigram\n          char buff[16];\n          snprintf(buff, sizeof(buff), \"%02x%02xZ\", byte1, byte2);\n          SetDetailsEncProb(destatep,\n                            destatep->interesting_offsets[OtherPair][next_pair],\n                            kMostLikelyEncoding[(byte1 << 8) + byte2],\n                            buff);\n        }\n      }\n      if (byte1 == 0xff) {\n        if (byte2 == 0xff) {\n          UTF1632BoostWhack(destatep, off, byte1);\n        }\n        if (destatep->debug_data != NULL) {\n          // Show FFFF detail entry for this bigram\n          char buff[16];\n          snprintf(buff, sizeof(buff), \"%02x%02xF\", byte1, byte2);\n          SetDetailsEncProb(destatep,\n                            destatep->interesting_offsets[OtherPair][next_pair],\n                            kMostLikelyEncoding[(byte1 << 8) + byte2],\n                            buff);\n        }\n      }\n      if (BinaryActive(destatep)) {\n        BinaryBoostWhack(destatep, byte1, byte2);\n      }\n    }         // End for i\n\n    // Adjust per entire-pair-span\n    if (UTF8Active(destatep)) {\n      CheckUTF8Seq(destatep, biggest_weightshift);\n    }\n\n    if (UTF8UTF8Active(destatep)) {\n      CheckUTF8UTF8Seq(destatep, biggest_weightshift);\n    }\n\n    if (Iso2022Active(destatep)) {\n      CheckIso2022ActiveSeq(destatep);\n    }\n\n    if (HzActive(destatep)) {\n      CheckHzActiveSeq(destatep);\n    }\n\n    if (EUCJPActive(destatep)) {\n      CheckEucJpSeq(destatep);\n    }\n\n    if (BinaryActive(destatep) || UTF1632Active(destatep)) {\n      CheckBinaryDensity(src, destatep, delta_otherpairs);\n    }\n  }\n  // ISO-2022 do OK on their own, using stright probabilities? Not on bad bytes\n\n  if (destatep->debug_data != NULL) {\n    // Show sequencing result\n    SetDetailsEncLabel(destatep, \"seq\");\n  }\n}\n\n\nvoid PrintTopEnc(DetectEncodingState* destatep, int n) {\n  // Print top n or fewer\n  int temp_sort[NUM_RANKEDENCODING];\n  for (int j = 0; j < destatep->rankedencoding_list_len; ++j) {\n    int rankedencoding = destatep->rankedencoding_list[j];\n    temp_sort[j] = destatep->enc_prob[rankedencoding];\n  }\n\n  qsort(temp_sort, destatep->rankedencoding_list_len,\n        sizeof(temp_sort[0]), IntCompare);\n\n  int top_n = minint(n, destatep->rankedencoding_list_len);\n  int showme = temp_sort[top_n - 1];    // Print this value and above\n\n  printf(\"rankedencodingList top %d: \", top_n);\n  for (int j = 0; j < destatep->rankedencoding_list_len; ++j) {\n    int rankedencoding = destatep->rankedencoding_list[j];\n    if (showme <= destatep->enc_prob[rankedencoding]) {\n      printf(\"%s=%d \",\n             MyEncodingName(kMapToEncoding[rankedencoding]),\n             destatep->enc_prob[rankedencoding]);\n    }\n  }\n  printf(\"\\n\\n\");\n}\n\n// If the same bigram repeats, don't boost its best encoding too much\nbool RepeatedBigram(DetectEncodingState* destatep, uint8 byte1, uint8 byte2) {\n  int this_bigram = (byte1 << 8) | byte2;\n  // If 00xx 01xx 02xx ... 1fxx, take out bottom 4 bits of xx.\n  // This ignores parts of Yahoo 0255 0254 0243 0247 0245 0243 0250 0255 ...\n  // It may screw up UTF-16BE\n  // It may screw up ISO-2022 (1b24 suppresses 1b28)\n  if (byte1 < 0x20) {\n    this_bigram &= 0xfff0;\n  }\n  if (this_bigram == destatep->prior_bigram[0]) {return true;}\n  if (this_bigram == destatep->prior_bigram[1]) {return true;}\n  if (this_bigram == destatep->prior_bigram[2]) {return true;}\n  if (this_bigram == destatep->prior_bigram[3]) {return true;}\n  // Round-robin replacement\n  destatep->prior_bigram[destatep->next_prior_bigram] = this_bigram;\n  destatep->next_prior_bigram = (destatep->next_prior_bigram + 1) & 3;\n  return false;\n}\n\n// Sometimes illegal bytes are used as markers between text that Javascript\n// is going to decode. Don't overboost the Binary encoding for markers 01-FF.\n// Just count first pair per 8x4 bucket\nbool RepeatedBinary(DetectEncodingState* destatep, uint8 byte1, uint8 byte2) {\n  int bucket8x4 = ((byte1 & 0xe0) >> 3) | ((byte2 & 0xc0) >> 6);\n  uint32 bucket8x4_mask = 1 << bucket8x4;\n  if ((destatep->binary_8x4_seen & bucket8x4_mask) == 0) {\n    destatep->binary_8x4_seen |= bucket8x4_mask;\n    destatep->binary_8x4_count += 1;\n    return false;\n  }\n  return true;\n}\n\n\n\n\n// Find current top two rankedencoding probabilities\nvoid ReRank(DetectEncodingState* destatep) {\n  destatep->top_prob = -1;\n  destatep->second_top_prob = -1;\n  // Leave unchanged\n  //destatep->top_rankedencoding =\n  //  destatep->rankedencoding_list[0];     // Just to make well-defined\n  //destatep->second_top_rankedencoding =\n  //  destatep->rankedencoding_list[1];     // Just to make well-defined\n  for (int j = 0; j < destatep->rankedencoding_list_len; j++) {\n    int rankedencoding = destatep->rankedencoding_list[j];\n    if (destatep->top_prob < destatep->enc_prob[rankedencoding]) {\n      // Make sure top 2 are in different superset groups\n      if (kMapEncToBaseEncoding[kMapToEncoding[destatep->top_rankedencoding]] !=\n          kMapEncToBaseEncoding[kMapToEncoding[rankedencoding]]) {\n        destatep->second_top_prob =\n          destatep->top_prob;             // old top to second\n        destatep->second_top_rankedencoding =\n          destatep->top_rankedencoding;   // old top to second\n      }\n      destatep->top_prob = destatep->enc_prob[rankedencoding];\n      destatep->top_rankedencoding = rankedencoding;\n    } else if (destatep->second_top_prob < destatep->enc_prob[rankedencoding]) {\n      if (kMapEncToBaseEncoding[kMapToEncoding[destatep->top_rankedencoding]] !=\n          kMapEncToBaseEncoding[kMapToEncoding[rankedencoding]]) {\n        destatep->second_top_prob = destatep->enc_prob[rankedencoding];\n        destatep->second_top_rankedencoding = rankedencoding;\n      }\n    }\n  }\n}\n\nvoid SimplePrune(DetectEncodingState* destatep, int prune_diff) {\n  // Prune the list of active encoding families\n  int keep_prob = destatep->top_prob - prune_diff;\n\n  destatep->active_special = 0;\n  int k = 0;\n  for (int j = 0; j < destatep->rankedencoding_list_len; j++) {\n    bool keep = true;\n    int rankedencoding = destatep->rankedencoding_list[j];\n\n    // If count is too low, ditch it\n    if (destatep->enc_prob[rankedencoding] < keep_prob) {keep = false;}\n\n    // Keep it. This will always keep at least top_prob rankedencoding\n    if (keep) {\n      destatep->active_special |= kSpecialMask[kMapToEncoding[rankedencoding]];\n      destatep->rankedencoding_list[k++] = rankedencoding;\n    }\n  }\n\n  destatep->rankedencoding_list_len = k;\n}\n\n// Recalculate reliable\nvoid CalcReliable(DetectEncodingState* destatep) {\n  // Encoding result is reliable if big difference in top two, or if\n  // only Ascii7 ever encountered\n  // Also reliable if exactly one OtherPair and it's best encoding matches top\n  destatep->reliable = false;\n  if (destatep->next_interesting_pair[OtherPair] == 0) {\n    // Only 7-bit ASCII\n    destatep->reliable = true;\n    return;\n  }\n  if ((destatep->top_prob - destatep->second_top_prob) >=\n      FLAGS_ced_reliable_difference) {\n    destatep->reliable = true;\n    return;\n  }\n  if (destatep->next_interesting_pair[OtherPair] == 1) {\n    uint8 byte1 = destatep->interesting_pairs[OtherPair][0];\n    uint8 byte2 = destatep->interesting_pairs[OtherPair][1];\n    int best_enc = kMostLikelyEncoding[(byte1 << 8) + byte2];\n    if (best_enc == destatep->top_rankedencoding) {\n      destatep->reliable = true;\n      return;\n    }\n  }\n\n  // If we pruned to one encoding, we are done\n  if (destatep->rankedencoding_list_len == 1) {\n    destatep->reliable = true;\n    destatep->done = true;\n    return;\n  }\n\n  // If we pruned to two or three encodings in the same *superset/subset\n  // rankedencoding*  and enough pairs, we are done. Else keep going\n  if (destatep->rankedencoding_list_len == 2) {\n    Encoding enc0 = kMapToEncoding[destatep->rankedencoding_list[0]];\n    Encoding enc1 = kMapToEncoding[destatep->rankedencoding_list[1]];\n    if (kMapEncToBaseEncoding[enc0] == kMapEncToBaseEncoding[enc1]) {\n      if (destatep->prune_count >= 3) {\n        destatep->reliable = true;\n        destatep->done = true;\n        return;\n      }\n    }\n  } else if (destatep->rankedencoding_list_len == 3) {\n    Encoding enc0 = kMapToEncoding[destatep->rankedencoding_list[0]];\n    Encoding enc1 = kMapToEncoding[destatep->rankedencoding_list[1]];\n    Encoding enc2 = kMapToEncoding[destatep->rankedencoding_list[2]];\n    Encoding base0 = kMapEncToBaseEncoding[enc0];\n    Encoding base1 = kMapEncToBaseEncoding[enc1];\n    Encoding base2 = kMapEncToBaseEncoding[enc2];\n\n    if ((base0 == base1) && (base0 == base2)) {\n      if (destatep->prune_count >= 3) {\n        destatep->reliable = true;\n        destatep->done = true;\n        return;\n      }\n    }\n  }\n\n}\n\n\n// Find current top two rankedencoding probabilities\nvoid FindTop2(DetectEncodingState* destatep,\n              int* first_renc, int* second_renc,\n              int* first_prob, int* second_prob) {\n  *first_prob = -1;\n  *second_prob = -1;\n  *first_renc = 0;\n  *second_renc = 0;\n  for (int j = 0; j < destatep->rankedencoding_list_len; j++) {\n    int rankedencoding = destatep->rankedencoding_list[j];\n    if (*first_prob < destatep->enc_prob[rankedencoding]) {\n      *second_prob = *first_prob;             // old top to second\n      *second_renc = *first_renc;   // old top to second\n      *first_prob = destatep->enc_prob[rankedencoding];\n      *first_renc = rankedencoding;\n    } else if (*second_prob < destatep->enc_prob[rankedencoding]) {\n      *second_prob = destatep->enc_prob[rankedencoding];\n      *second_renc = rankedencoding;\n    }\n  }\n}\n\n\nvoid PrintRankedEncodingList(DetectEncodingState* destatep, const char* str) {\n  printf(\"Current ranked encoding list %s\\n\", str);\n  for (int j = 0; j < destatep->rankedencoding_list_len; j++) {\n    int rankedencoding = destatep->rankedencoding_list[j];\n    if ((rankedencoding < 0) || (rankedencoding > NUM_RANKEDENCODING)) {\n      printf(\" [%d] BOGUS rankedencoding = %d\\n\", j, rankedencoding);\n    } else {\n      printf(\" [%d] rankedencoding = %d %-12.12s enc_prob = %d\\n\",\n             j, rankedencoding, MyRankedEncName(rankedencoding),\n             destatep->enc_prob[rankedencoding]);\n    }\n  }\n  printf(\"End current ranked encoding list\\n\\n\");\n}\n\n\n\n\n// Map unencoded bytes down to five bits, largely preserving letters\n// This design struggles to put 33 values into 5 bits.\n#define XX 0    // Punctuation (00-7F range)\n#define HA 27   // High vowel a in Latin1/2/sometimes7\n#define HE 28   // High vowel e\n#define HI 29   // High vowel i\n#define HO 30   // High vowel o\n#define HU 30   // High vowel u on top of HO\n#define Hc 31   // High consonant (80-FF range)\nstatic const char kMapToFiveBits[256] = {\n  XX,XX,XX,XX,XX,XX,XX,XX,  XX,XX,XX,XX,XX,XX,XX,XX,\n  XX,XX,XX,XX,XX,XX,XX,XX,  XX,XX,XX,XX,XX,XX,XX,XX,\n  XX,XX,XX,XX,XX,XX,XX,XX,  XX,XX,XX,XX,XX,XX,XX,XX,\n  XX,XX,XX,XX,XX,XX,XX,XX,  XX,XX,XX,XX,XX,XX,XX,XX,\n\n  XX, 1, 2, 3, 4, 5, 6, 7,   8, 9,10,11,12,13,14,15,\n  16,17,18,19,20,21,22,23,  24,25,26,XX,XX,XX,XX,XX,\n  XX, 1, 2, 3, 4, 5, 6, 7,   8, 9,10,11,12,13,14,15,\n  16,17,18,19,20,21,22,23,  24,25,26,XX,XX,XX,XX,XX,\n\n  Hc,HA,Hc,Hc,Hc,Hc,Hc,Hc,  HO,Hc,Hc,Hc,Hc,Hc,Hc,Hc,\n  Hc,HA,Hc,Hc,Hc,Hc,Hc,Hc,  HO,Hc,Hc,Hc,Hc,Hc,Hc,Hc,\n  Hc,HA,Hc,Hc,Hc,Hc,Hc,Hc,  HO,Hc,Hc,Hc,Hc,Hc,Hc,Hc,\n  Hc,HA,Hc,Hc,Hc,Hc,Hc,Hc,  HO,Hc,Hc,Hc,Hc,Hc,Hc,Hc,\n\n  Hc,HA,HA,HA,HA,Hc,Hc,Hc,  Hc,HE,HE,HE,HI,HI,HI,Hc,\n  Hc,Hc,Hc,HO,HO,HO,HO,Hc,  Hc,HU,HU,HU,HU,Hc,Hc,Hc,\n  Hc,HA,HA,HA,HA,Hc,Hc,Hc,  Hc,HE,HE,HE,HI,HI,HI,Hc,\n  Hc,Hc,Hc,HO,HO,HO,HO,Hc,  Hc,HU,HU,HU,HU,Hc,Hc,Hc,\n\n};\n#undef XX\n#undef HA\n#undef HE\n#undef HI\n#undef HO\n#undef HU\n#undef Hc\n\nstatic const int kTriLatin1Likely = 1;\nstatic const int kTriLatin2Likely = 2;\nstatic const int kTriLatin7Likely = 3;\n\n// Each table entry has 32 times two bits, selected by byte[2]\n// Entry subscript is selected by byte[0] and byte[1]\n// Latin1/2/7 boost vector, generated 2007.09.26 by postproc-enc-detect-short.cc\nstatic const uint64 kLatin127Trigrams[1024] = {\n0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL,\n0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL,\n0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL,\n0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL,\n0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL,\n0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL,\n0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL,\n0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000000ULL,\n0x0000000000000000ULL, 0x304080c0402c3330ULL, 0x0008400004000000ULL, 0x082800000c200000ULL,\n0x23a0000420800030ULL, 0x00000000000ccc00ULL, 0x0500100100100000ULL, 0x0388400000200010ULL,\n0x0000000000000c00ULL, 0xd0f0300740f0cf00ULL, 0x2aa0a2a22882a2acULL, 0x081d800000000080ULL,\n0x0c82000020000000ULL, 0x200a03c000a00000ULL, 0x0008400400290000ULL, 0x0400870000000000ULL,\n0x00f040c00000c080ULL, 0x0008004000000410ULL, 0x0020300000000030ULL, 0x00a030002c300000ULL,\n0x0c8030c020a00000ULL, 0x15410030f0f4c000ULL, 0x3000000300a00000ULL, 0xa2880980a0880a88ULL,\n0x0900300000000000ULL, 0x0000040100300000ULL, 0x0888820020a00000ULL, 0xc044002242010000ULL,\n0x000000121d300040ULL, 0x40100040440c0d54ULL, 0x00008423102f8144ULL, 0x0b40808400000280ULL,\n0x0000000000000000ULL, 0x0680a000000c0000ULL, 0x0880008020aa0000ULL, 0x2aaa0141010a4940ULL,\n0xcb80000000010000ULL, 0x2280000000000000ULL, 0x5248000001800000ULL, 0x8000401004040010ULL,\n0x1540010201001010ULL, 0x0080080400000000ULL, 0x5a00044040000108ULL, 0x0288000282080008ULL,\n0x4800008002200000ULL, 0x4a00000000010100ULL, 0x8a88040080000800ULL, 0x0140800000000400ULL,\n0x40010050000c0000ULL, 0x0000008000000000ULL, 0x0028000020140040ULL, 0x8620401401005308ULL,\n0xc082000000000400ULL, 0x05c0b004c0240600ULL, 0x0288000080000000ULL, 0x0000014000000000ULL,\n0x00000000040000c0ULL, 0x8001861008004280ULL, 0x0200000000000300ULL, 0x0000240242288620ULL,\n0x801000c05434c200ULL, 0x9020162040a2d2b4ULL, 0x0021840000240704ULL, 0x2a80280080084908ULL,\n0x0000000000000000ULL, 0x0500004000000040ULL, 0x0080000000040000ULL, 0x0108058104440000ULL,\n0x0900000000040000ULL, 0x00c0000000208008ULL, 0x2000005000000000ULL, 0x0080000000050000ULL,\n0x0808000000001080ULL, 0x9880810100308000ULL, 0x2285480080081a08ULL, 0x8a80000080080000ULL,\n0x1450000000600010ULL, 0x2210000100000000ULL, 0x8a88000100011000ULL, 0x1541804000000010ULL,\n0xc084011140040100ULL, 0x0000000000000800ULL, 0x0400000000000030ULL, 0x2a800000a0890128ULL,\n0x1140a00054000104ULL, 0x1440000101200404ULL, 0x028800400400d800ULL, 0x0000000000000000ULL,\n0x0000000000002330ULL, 0x0020820228a02280ULL, 0xa2888a02aa8008a8ULL, 0xd0040a0044202500ULL,\n0x8000044104a29424ULL, 0xc000100178b2c5b4ULL, 0x0000810100241504ULL, 0xd040030000380008ULL,\n0x0000000000000000ULL, 0x26c08c0000200130ULL, 0x4a08000110080000ULL, 0x2aa0004001080800ULL,\n0x0aac000000004000ULL, 0x2000000000200000ULL, 0x4240000100020000ULL, 0x4100000080000000ULL,\n0x4900040000000000ULL, 0x0800000400300040ULL, 0x6a80000000040800ULL, 0x2a08182000588008ULL,\n0x0a00000c81000008ULL, 0x0a000c0010000000ULL, 0x8a88001080280808ULL, 0x0020000200300600ULL,\n0xaac00000900a0000ULL, 0x0000100004000000ULL, 0x0020081020000000ULL, 0x8220105010084110ULL,\n0x4a80800000004000ULL, 0x050000c0c0200000ULL, 0x288c000084000000ULL, 0xa048082280000000ULL,\n0x0000000000000000ULL, 0x8000900000032080ULL, 0xee889e81b8880820ULL, 0xc2200a8142800424ULL,\n0xc020141543361010ULL, 0x10a000204a801634ULL, 0x3a808800802a00a0ULL, 0x28808b00803d0800ULL,\n0x0000000000000000ULL, 0x0020000000000030ULL, 0x0808400121010040ULL, 0x0c28240100200040ULL,\n0x2008200028800000ULL, 0xc10004c80f30c030ULL, 0x0400440114100000ULL, 0x2208200280a22220ULL,\n0x0600000030c01000ULL, 0x1201001040c00000ULL, 0x0aa02ea22aa22aa0ULL, 0x30008000000200a0ULL,\n0x20c8400400800000ULL, 0x08280b0420800000ULL, 0x0800100000210000ULL, 0x10000300c0100400ULL,\n0xc8c0000420000000ULL, 0x1000000010000000ULL, 0x0420000400000000ULL, 0x0220000500204000ULL,\n0x2200000420000000ULL, 0x0000540400000000ULL, 0x0000000020000000ULL, 0x00080c00a0810080ULL,\n0x1540000000043000ULL, 0x0000000000100000ULL, 0x2e88a22220200a20ULL, 0xc06030e34ea503a0ULL,\n0x0001100204048500ULL, 0x000000e0000c0d54ULL, 0x3000820310a31400ULL, 0x13088c0320e00280ULL,\n0x0000000000000000ULL, 0x0480000000200000ULL, 0x4000200100000000ULL, 0x0000300040040000ULL,\n0x4400000000000000ULL, 0x0401000002240000ULL, 0x0540000000040000ULL, 0x4004010000000000ULL,\n0x4001111001100000ULL, 0x2880000000300040ULL, 0x4040004040002404ULL, 0x0200000000000000ULL,\n0x0140040000100000ULL, 0x4040010040040080ULL, 0x0a00140000041004ULL, 0x0000a00400808000ULL,\n0x1010200000430040ULL, 0x0010000000000000ULL, 0x0540000000104000ULL, 0x1400114005000000ULL,\n0x0000204000440010ULL, 0x0500000000004400ULL, 0x4500000018000400ULL, 0x0000400000000000ULL,\n0x000000300000cc00ULL, 0x0100001011300000ULL, 0x0040000000000000ULL, 0xc0e0000248a00444ULL,\n0x0000040020340144ULL, 0x0000046445105454ULL, 0x32a0a80280880128ULL, 0x0880040000100100ULL,\n0x0000000000000000ULL, 0x14003000030c0004ULL, 0x4a04001100000000ULL, 0x0a00108010000000ULL,\n0x28a8004000200248ULL, 0x0100040000b00000ULL, 0x42000000000008c0ULL, 0x6008044010550010ULL,\n0x0800401000010400ULL, 0x080080040cf80000ULL, 0x5080000001001010ULL, 0x2a80100000000000ULL,\n0xcc8010010d401100ULL, 0x0200000001001000ULL, 0x0480001004001000ULL, 0x8d00800040b40210ULL,\n0x6200800000300000ULL, 0x0000010000000000ULL, 0x0428004100010000ULL, 0x4320105141501100ULL,\n0xe28c0000000c1000ULL, 0xd5c000c3c0e00300ULL, 0x0001000000100200ULL, 0x1004010202400008ULL,\n0x0000000000003000ULL, 0x2aa038a0800aab08ULL, 0x2a88038000000000ULL, 0xc220040242f09720ULL,\n0x8020200200ba0420ULL, 0x0020106105101004ULL, 0x0480800000220400ULL, 0x2280100080000008ULL,\n0x0000000000000000ULL, 0x9000000000200000ULL, 0x0001000000100000ULL, 0x2aa40c0000080800ULL,\n0x0040000040010000ULL, 0x0040000000c01000ULL, 0x4000000040000400ULL, 0x0000001000200000ULL,\n0x0000010000000000ULL, 0x05808004000c0000ULL, 0x50400c0000000400ULL, 0x020040008f000040ULL,\n0x0800000000100000ULL, 0x0000000000000000ULL, 0x0a08440000004000ULL, 0x0064000400008200ULL,\n0x0010010010034170ULL, 0x0000000010000000ULL, 0x0100204021000000ULL, 0x022000d000010100ULL,\n0x0840300000c00000ULL, 0x1400000040204400ULL, 0x09800c0040000000ULL, 0x0209708000000000ULL,\n0x000000000000c040ULL, 0x90000c50204040a0ULL, 0x0000000000000000ULL, 0x00e1500040200004ULL,\n0x8020260540204494ULL, 0x0020026150201054ULL, 0x0281800380105634ULL, 0x0884900481105000ULL,\n0x0000000000000000ULL, 0x84203c00002c0200ULL, 0xc089040000000000ULL, 0xc2a8100040200004ULL,\n0xe00c1c0000000000ULL, 0x0ce1330080200080ULL, 0x0000000000200000ULL, 0xc400110000404010ULL,\n0x0088400000000000ULL, 0x00083cc00c00c00cULL, 0xcac01c00c000580cULL, 0xe300b0f000100000ULL,\n0x0300000000000000ULL, 0xc0000f0000000000ULL, 0xc3c01c0400000000ULL, 0x81008004c0f40000ULL,\n0xc3d8003000000440ULL, 0x0000000000000000ULL, 0xc430000000000000ULL, 0x0060000000001000ULL,\n0x0800000000000000ULL, 0x00c03300f0fc0008ULL, 0x3000000400200010ULL, 0xa2a80892a0880a28ULL,\n0x0500000040000004ULL, 0x0000000000000000ULL, 0xc80032070c200020ULL, 0x0220820060a296a0ULL,\n0x802084021db486a0ULL, 0x00000d60080c0080ULL, 0xb281803313a32428ULL, 0x1808300320300000ULL,\n0x0000000000000000ULL, 0x85208cc0ccac1f20ULL, 0x2081000186100808ULL, 0x22a80880000a0808ULL,\n0xaaa8086880000000ULL, 0x802084800a2e9200ULL, 0xa280000000002008ULL, 0xa000000080080400ULL,\n0x2080010000000008ULL, 0x802020c00c028c80ULL, 0x2080000000140810ULL, 0x2a80086080080008ULL,\n0x2a800000a8000800ULL, 0xaa881800a2080800ULL, 0xaa98004080280808ULL, 0x004483d0c0300000ULL,\n0xa280002080080000ULL, 0x0000000000300000ULL, 0x22a1030000000008ULL, 0xa8a0301088880880ULL,\n0xaa80002080222808ULL, 0x85400c03fc030400ULL, 0x8a88000000000008ULL, 0xa008008010080008ULL,\n0x0000000000010000ULL, 0x0040100000301040ULL, 0x28800000a0002008ULL, 0x122482306cbc0eacULL,\n0x8020224222b8c6a0ULL, 0x802002004a82c284ULL, 0x0aa08fc440a41c80ULL, 0x888080d181385098ULL,\n0x0000000000000000ULL, 0x00c0b000000c0080ULL, 0x2208001000000800ULL, 0x0a28000000200000ULL,\n0x0000000300000000ULL, 0x00c1040000200000ULL, 0x0203020000000000ULL, 0x0248000000020000ULL,\n0x0000840000100000ULL, 0x0a808c00c000008cULL, 0x5200040040000004ULL, 0x02000c00000080a0ULL,\n0x0b0c000020000000ULL, 0x0b04000001000000ULL, 0x088c0010002000c0ULL, 0x80e08b00c0030c20ULL,\n0x0280000200014040ULL, 0x0000000000000000ULL, 0x0e20a0a008000020ULL, 0x0e280fd03f00111cULL,\n0x200080c020001000ULL, 0x8cc00c02c02f0400ULL, 0x480c0001000c404cULL, 0x0208014281080808ULL,\n0x000000000000fcfcULL, 0x004403300cf00030ULL, 0x2200000000004400ULL, 0x02202000c08c0c20ULL,\n0x02202022683a80a0ULL, 0x4020228028008c00ULL, 0x32208cc0002c0200ULL, 0x3ec00c0080304008ULL,\n0x0000000000000000ULL, 0x34000c00002c0000ULL, 0x0b00000100100030ULL, 0x0823018000000000ULL,\n0x0e8c001c01e00000ULL, 0x1200800600330000ULL, 0x4000110000000000ULL, 0x0080000300000000ULL,\n0x0800000000000000ULL, 0x08c08c04000c0000ULL, 0x0080400000880000ULL, 0x0a08000080c00008ULL,\n0x0800000304400000ULL, 0x0208000000c00000ULL, 0x2888300080400800ULL, 0x8dc0204400000000ULL,\n0xc0000000c0800000ULL, 0x0000c10000000000ULL, 0x24000c4010c00000ULL, 0x272000541d811000ULL,\n0x0200400000001000ULL, 0x0400000400001004ULL, 0xc08c007004001000ULL, 0x2048004000000000ULL,\n0x000000000003fcfcULL, 0x2aa030000cf8c800ULL, 0xe280000000000000ULL, 0x0a21008142000340ULL,\n0x0021002000b61040ULL, 0x800004064006d444ULL, 0x3aa0800300230008ULL, 0x0b00030000300000ULL,\n0x0000000000000000ULL, 0x01c080000000040cULL, 0x0100000000004000ULL, 0x0aa8018010001000ULL,\n0x0800000000100000ULL, 0x3000000000008c00ULL, 0x5400000013000000ULL, 0x02c0c00004004010ULL,\n0x5241100010000c00ULL, 0x0e00080000000808ULL, 0x5281000000000800ULL, 0x0a08108020000800ULL,\n0x0a80000000005210ULL, 0x0100000041000000ULL, 0x2a88000002080110ULL, 0x8520800000c00080ULL,\n0x01000010108c0100ULL, 0x0000000000000000ULL, 0x42a0420080000000ULL, 0x0020001004010010ULL,\n0xc4000000000c0000ULL, 0x01000c00c0200400ULL, 0x4600000100000000ULL, 0x0000000000000000ULL,\n0x0010001000000010ULL, 0x910400900820d030ULL, 0x2280000000000000ULL, 0xc2212004400040e4ULL,\n0x8001000000b61420ULL, 0xa00002a248e810b4ULL, 0x32008000002c0008ULL, 0x0c010034803c5010ULL,\n0x0000000000000000ULL, 0x85008002002c0000ULL, 0x0204001000004010ULL, 0x0120008000200000ULL,\n0x000010000c2000c0ULL, 0xccc0000000200000ULL, 0x0400000c00100040ULL, 0x0003300100004100ULL,\n0x4000551040000004ULL, 0x0e0080000c820808ULL, 0xc000000000080800ULL, 0xc803000000000000ULL,\n0x0a4000c000200000ULL, 0x0040000000c00000ULL, 0x0918145000405000ULL, 0x81400000c0300400ULL,\n0x0050000000000000ULL, 0xd000045000000000ULL, 0x0400004000400000ULL, 0x0420104010000110ULL,\n0x0700000000203000ULL, 0x34800300c0e00704ULL, 0x4440100044000400ULL, 0x0040000040000000ULL,\n0x0030000044000000ULL, 0xeaaca0008808c880ULL, 0x0a01000000200000ULL, 0x1220a300403ccf20ULL,\n0x002024c200b61044ULL, 0x802014346aa2d434ULL, 0x30008c00c0820c44ULL, 0x0a000000000c4800ULL,\n0x0000000000000000ULL, 0x0000404000340c90ULL, 0x08a8a10820800280ULL, 0x8128009022201000ULL,\n0x0020808228a000a0ULL, 0x0020400100410000ULL, 0x0400000110000000ULL, 0xa609000000200000ULL,\n0x8008330000d00000ULL, 0x8060100040404010ULL, 0xeaa00ea0ea00808cULL, 0x200c8020a0000020ULL,\n0x0408800020200000ULL, 0x0189001403200000ULL, 0xc00800000000c000ULL, 0x200430c00c300000ULL,\n0x0100300100004000ULL, 0x0000040000000000ULL, 0x2420000400001000ULL, 0x89a1200400000000ULL,\n0x20c8a000208c0000ULL, 0x8080000000000000ULL, 0x28a0108020210080ULL, 0xa2a84800a0880988ULL,\n0x258008000400c000ULL, 0x0140000000100000ULL, 0xa028a222a0aa0228ULL, 0xc060012054044040ULL,\n0x0010010400000000ULL, 0x00000050150c0114ULL, 0x0000008010c20010ULL, 0xaa088000a0200880ULL,\n0x0000000000000000ULL, 0x0700b0c0000c0000ULL, 0x2200040000080030ULL, 0x2aa8808040240800ULL,\n0x08b0500000000100ULL, 0x1000830400200000ULL, 0x4204000010000000ULL, 0x40c2200050040050ULL,\n0x0104404001010000ULL, 0x1a808c8103c00030ULL, 0x30900010c0000b00ULL, 0x200812b283000008ULL,\n0x000c000020e00000ULL, 0x2140000000400000ULL, 0x0288000080200000ULL, 0x8060a200c8a20280ULL,\n0x0400114010215000ULL, 0x0000000000000000ULL, 0x082b200002000010ULL, 0x22a0030000031000ULL,\n0x008100001000000cULL, 0x05400c00c0230400ULL, 0xca3000003c080100ULL, 0x0000000020000004ULL,\n0x0000000100000000ULL, 0x8004320813f5c000ULL, 0xa280080200000800ULL, 0xc22000044e334c20ULL,\n0x000004146e361024ULL, 0x800126806aa0d584ULL, 0xb000a0040023c41cULL, 0x0a083000803053d8ULL,\n0x0000000000000000ULL, 0x0000100000020000ULL, 0x0000000010000010ULL, 0x0000000045040004ULL,\n0x0000000000100000ULL, 0x0000020400000010ULL, 0x0003015000000000ULL, 0x0400000000000000ULL,\n0x0000000400000000ULL, 0x0100000000000800ULL, 0x0000001000000000ULL, 0x0000000000000000ULL,\n0x0000000040000000ULL, 0x0000000000000000ULL, 0x0004001000000000ULL, 0x0008001000000000ULL,\n0x0010000000000004ULL, 0x0000010100001000ULL, 0x0004000000000004ULL, 0x0000014040050014ULL,\n0x0014000000000040ULL, 0x5540000000041000ULL, 0x0000000000000000ULL, 0x0000040000000d00ULL,\n0x0000000000000000ULL, 0x0000000000100000ULL, 0x0001000000000000ULL, 0x0000000000000000ULL,\n0x0000000000000000ULL, 0x0000000000000000ULL, 0x4500000000040400ULL, 0x0000800000000400ULL,\n0x0000000000000000ULL, 0x13e080000020000cULL, 0xcf00001005100000ULL, 0x04a8008000200300ULL,\n0x00280100100000c0ULL, 0x1c8c000040200000ULL, 0x0600005000100000ULL, 0x050800000c104000ULL,\n0x4c10101000110000ULL, 0x0c00000000300000ULL, 0x22040c00100000c0ULL, 0x0800700010100000ULL,\n0x0000000000001000ULL, 0x0a08000010000040ULL, 0x0800034004210010ULL, 0x04e0000400000000ULL,\n0x0800030020000000ULL, 0x0000005000000000ULL, 0x0400110101304110ULL, 0x0428000010a01000ULL,\n0x060b000000800010ULL, 0x35810c00c020c000ULL, 0x00800c4321800000ULL, 0x4208088020000080ULL,\n0x040000111003ff00ULL, 0x0020900020202080ULL, 0x22888180a8000888ULL, 0x0225200542005420ULL,\n0x2020040400340020ULL, 0x10300424500cc444ULL, 0x3081a00400e00200ULL, 0x33001300c0300000ULL,\n0x0000000000000000ULL, 0x04003c0000000000ULL, 0x0a04001000100100ULL, 0x1408000001000000ULL,\n0x1800000044100000ULL, 0x3400040400000300ULL, 0x5000040801000040ULL, 0x4088401040000040ULL,\n0x1010110130100000ULL, 0xca800c3000300000ULL, 0x5a01000000080100ULL, 0x020280000cd01300ULL,\n0x0302000410200010ULL, 0x0000102000300000ULL, 0x0b09000000000000ULL, 0x20008004c4800004ULL,\n0x28c0410010000000ULL, 0x0004015041000050ULL, 0x0a01006000200200ULL, 0x0020d00000100040ULL,\n0x0010a00100900000ULL, 0x3500bf00c0030300ULL, 0x080c010000200d00ULL, 0x2248000004020010ULL,\n0x0000c00000000000ULL, 0x8044b00200e08000ULL, 0xaaa82aa2aa8a2aa8ULL, 0x0220002241c08604ULL,\n0x4200260440328444ULL, 0x68001226103008b4ULL, 0x3a0080c0b0000400ULL, 0x2a804804803c4008ULL,\n0x0000000000000000ULL, 0x04008c0300000400ULL, 0x008000c0000c0000ULL, 0x088001000000001cULL,\n0x0840000001000010ULL, 0x0400000000200c00ULL, 0x4244000101040000ULL, 0x4238007011100000ULL,\n0x1000d00100000010ULL, 0x1d00800400300000ULL, 0x4204080c00000000ULL, 0x2a88080080000008ULL,\n0x08001c0200001000ULL, 0x0a00000400000000ULL, 0x8a88003080080000ULL, 0x0521800400300000ULL,\n0x3200051000201000ULL, 0x0000000000000000ULL, 0x0020801404000000ULL, 0x322010401c0c101cULL,\n0x0c01100013000000ULL, 0x04003000c0204000ULL, 0x088c0020a0cc0000ULL, 0x2200000080000018ULL,\n0x0404000044000000ULL, 0x82a0b000008820b0ULL, 0x0000040020440000ULL, 0xc2650004403f1420ULL,\n0x0021340241b64464ULL, 0x8020040242c2d474ULL, 0x32018c0480288000ULL, 0x00800b0080300000ULL,\n0x0000000000000000ULL, 0x05008c0000040130ULL, 0xc0d8000000800000ULL, 0x0020000020200200ULL,\n0x23a2000120204000ULL, 0x5052100550104150ULL, 0x1000101100040000ULL, 0xc40001c301000000ULL,\n0x8288000000c00000ULL, 0x5150040144d01404ULL, 0xea8c0ea028ae088cULL, 0xc31010c000000c80ULL,\n0x0002000060000000ULL, 0xc80800f030000000ULL, 0x0000000400300000ULL, 0xc00080c00ff0c344ULL,\n0x00080001200c0000ULL, 0x0000050080000000ULL, 0x0328000300300000ULL, 0x082030000cc01040ULL,\n0xeb08800100004000ULL, 0x8030003300c80f00ULL, 0xfb0d0000e4ac0000ULL, 0x0020006080000008ULL,\n0x0500100100040000ULL, 0x1140000000000000ULL, 0xcb883330a0e00000ULL, 0xc000010050000080ULL,\n0x0010104005b54150ULL, 0x40111d5155001554ULL, 0x80000070140f0004ULL, 0x0b0830c3a0003380ULL,\n0x0000000000000000ULL, 0x04c13000000f830cULL, 0x2808000000000000ULL, 0x2810000000000800ULL,\n0x08c0080004400000ULL, 0x04c0240300801c20ULL, 0x4040000080000004ULL, 0x0000400100100010ULL,\n0x020001008000c0c0ULL, 0x1d008c000c3c0000ULL, 0x0080003000000800ULL, 0x2288080080000008ULL,\n0x0a84004020220000ULL, 0x0800080000100000ULL, 0xaa80004080400008ULL, 0x8024000400c01660ULL,\n0x80841c2001000104ULL, 0x0001000000000000ULL, 0x0020028020020280ULL, 0x0860404011900100ULL,\n0xec80080200000000ULL, 0x010103c100200400ULL, 0x0200004000000000ULL, 0x0000000000400400ULL,\n0x000010000003fcfcULL, 0x8040083238c20000ULL, 0x08800220a0920a00ULL, 0x08210004483c0c24ULL,\n0xc020240740b0a200ULL, 0x802006014a201494ULL, 0x3201233070ac0e00ULL, 0x08002806033a48a0ULL,\n0x0000000000000000ULL, 0x8020820028a00680ULL, 0x2000002000000104ULL, 0x22a80801100a0808ULL,\n0xa2a8002080000000ULL, 0xa000800008a08000ULL, 0x0000100000400000ULL, 0x8000002100000000ULL,\n0x0000010000004404ULL, 0xa2a0088080000888ULL, 0x0000000010400800ULL, 0xa280082080080008ULL,\n0x2280000080010008ULL, 0x2000000000000000ULL, 0x228800008c080808ULL, 0x8021828002a98200ULL,\n0xa200002000080000ULL, 0x0000040000000000ULL, 0x22a0000080000000ULL, 0x202882c200800080ULL,\n0xa000000001004000ULL, 0x000000c808a00600ULL, 0x0000000010000000ULL, 0x000001000000040cULL,\n0x0000000000000000ULL, 0x802002a2a8aa82a0ULL, 0x20000024a8088228ULL, 0x8020820001000000ULL,\n0x8020000000808280ULL, 0x8000000000000000ULL, 0x0020800000200280ULL, 0x2080082280a00888ULL,\n0x0000000000000000ULL, 0x0000015000000040ULL, 0x0000040000040000ULL, 0x0100010010001000ULL,\n0x0000003210008000ULL, 0x0000000404000000ULL, 0x0000000000000400ULL, 0x0200000000000000ULL,\n0x0000000000000100ULL, 0x5180014400004050ULL, 0x1000000014000000ULL, 0x4200000000000000ULL,\n0x0040200000000000ULL, 0x0201004000000000ULL, 0x0a00000000000010ULL, 0x0040200000800000ULL,\n0x0040051000000500ULL, 0x0000000100800400ULL, 0x6000000000000000ULL, 0x0000000000000000ULL,\n0x280000c1400040ccULL, 0x4180001000000000ULL, 0x00000000c1000104ULL, 0x0000000000000000ULL,\n0x0000000000000000ULL, 0x0000000000000000ULL, 0x0080000000c00000ULL, 0x0004006066004000ULL,\n0x0000005000040440ULL, 0x0000106005804044ULL, 0x0000a10511004440ULL, 0x0000000000000110ULL,\n0x0000000000000000ULL, 0x0000000000080000ULL, 0xeb0808a020800080ULL, 0x29a80081002a1800ULL,\n0x0b2c000202100100ULL, 0x0001000000888000ULL, 0x2280102010000000ULL, 0x020000602a004110ULL,\n0x8a800160a6108100ULL, 0x0280000000000020ULL, 0x8a8000a0a8808208ULL, 0x0280882080500308ULL,\n0x0b18010020804100ULL, 0xeb080000c0080080ULL, 0x2b08000000810130ULL, 0x0000000008040020ULL,\n0xaa0a08e082894140ULL, 0x0000000000000000ULL, 0x202081409010001cULL, 0x8aa8805082806000ULL,\n0xeb082900289c0000ULL, 0x0000000000008000ULL, 0xf80c2e20002e0000ULL, 0xa288080420880888ULL,\n0x0000010000000000ULL, 0x0000000000102000ULL, 0x22880000a8a80808ULL, 0x022022a22aa880a0ULL,\n0x0000222222aa0620ULL, 0x0000022002800000ULL, 0x208080004028a000ULL, 0x2b888800801c0828ULL,\n0x0000000000000000ULL, 0x22e0828280a08028ULL, 0xaa88002082080308ULL, 0x0ea80080410a0040ULL,\n0x2a28222000a00000ULL, 0x8aa2808028a0a2a0ULL, 0x0200001000000000ULL, 0x82080000a0000000ULL,\n0x8800000082000808ULL, 0x2a008a0000300888ULL, 0x0a80080080080808ULL, 0xaa882800840b0808ULL,\n0x0a80000080000040ULL, 0xea080820a0000000ULL, 0xaa88080080080808ULL, 0x8040a2800a8024a0ULL,\n0xaa800020a0080808ULL, 0x0000040000000000ULL, 0x2a280a0080080880ULL, 0x2a20081080008a00ULL,\n0x2a88882088aa0008ULL, 0x81800202c0a01480ULL, 0xea88082082200000ULL, 0xaa88002080080008ULL,\n0x0000100000000000ULL, 0x802082a22aa0a2a0ULL, 0x2e80000000000000ULL, 0x0220a2a26aa0a2a8ULL,\n0x800022a2228a22a0ULL, 0x880002212e82c0b0ULL, 0x02a0aa0002a82228ULL, 0x2d808b0080380008ULL,\n0x0000000000000000ULL, 0x000407551c154244ULL, 0x2a00208088a02228ULL, 0x12a82182a2402a88ULL,\n0xe32821e020826d00ULL, 0x801130100ccc1330ULL, 0x028010c000841008ULL, 0x88a08002a0a664a0ULL,\n0x0048270080000100ULL, 0x00001f010cd10f30ULL, 0xe2242ce22aaea2a0ULL, 0xc2c00cc20ae22460ULL,\n0xe208003128021c10ULL, 0x2a2021c010821080ULL, 0x2a88202082202020ULL, 0x4010111104941410ULL,\n0xc80c02c182b00080ULL, 0x0000040000000000ULL, 0xe28030068002c300ULL, 0x2aa02024a2a22228ULL,\n0xe20889328aa22080ULL, 0x0000000000210100ULL, 0xaa0028e0a9b221a0ULL, 0x2000008080400000ULL,\n0x0000010041150404ULL, 0x0000105114410100ULL, 0xeaa82aa6aaaaaaa8ULL, 0x000000f44300c434ULL,\n0x0000222222b00020ULL, 0x0000002000000000ULL, 0x0000004014000000ULL, 0x0039b3f73fbcd3fcULL,\n0x0000000000000000ULL, 0x0000104015045040ULL, 0x20a80490a08800a0ULL, 0x40a8258410a909a0ULL,\n0xe0a8a2022aa2e2a0ULL, 0xc111010014000500ULL, 0x2080044041840004ULL, 0x28a8200220a2aba0ULL,\n0x008400a0a2840800ULL, 0x0101015451009464ULL, 0x20000ea0e02c2c2cULL, 0xe2a828a2aca2aaa8ULL,\n0x682020a228a222a0ULL, 0xe8882ae22aa2a2a0ULL, 0xe9a80e6022a24140ULL, 0x0011055005001040ULL,\n0x2aa8208229a0aaa4ULL, 0x0000040000000000ULL, 0x28a0228026a62260ULL, 0xe2a020a422a2a020ULL,\n0xe808a0022aa1a220ULL, 0x0000010014000100ULL, 0x28ac22802aa2a020ULL, 0x0020000000000000ULL,\n0x0100010100040000ULL, 0x0000000000000000ULL, 0x22a822a22a8aaaa0ULL, 0x0000000000000000ULL,\n0x0000102410800100ULL, 0x0000000000000000ULL, 0x0000000002000000ULL, 0x00000fb2a08c0aa8ULL,\n0x0000000000000000ULL, 0x4010005015440140ULL, 0x18c81c00b180001cULL, 0x2800048021820800ULL,\n0x8ab820c06a802580ULL, 0x00100170f4040000ULL, 0x4000144041041404ULL, 0x0ac800d0002e440cULL,\n0x20880820a2000808ULL, 0x400000f03f300c00ULL, 0xaa000ea22aa22aa0ULL, 0xa2880ac0a8942a20ULL,\n0xaa880a81a1804188ULL, 0xeea022a0aaa02080ULL, 0xaaa820a2aaa66120ULL, 0x0000005115800150ULL,\n0x2a880920a0840040ULL, 0x0000040000000000ULL, 0xaea82222aaa22a28ULL, 0x8a28041260055150ULL,\n0xa28824008aa28880ULL, 0x0000025014019000ULL, 0xea882ae02aa200a0ULL, 0x0000000000000000ULL,\n0x0000000040000400ULL, 0x0000000000000000ULL, 0xaaa82aa22aaaaaa0ULL, 0x0000000000000000ULL,\n0x0000000000000000ULL, 0x002003003c80c000ULL, 0x0000020014000000ULL, 0x00200010a0980a20ULL,\n0x0000000000000000ULL, 0x0020001200801240ULL, 0x0a88000089800020ULL, 0xcaa00080a1000000ULL,\n0x0a200c0020a04080ULL, 0x4002034003840880ULL, 0x4690500190000050ULL, 0x2228004000601000ULL,\n0x0a803f00803f400cULL, 0x400033e24dd0cf34ULL, 0xaa80a2a229a220a0ULL, 0x0a224000002c0000ULL,\n0x028000202000008cULL, 0x0a08000070000030ULL, 0x00800c040020000cULL, 0x0000000002850000ULL,\n0x02881cc310200000ULL, 0x0000040004000000ULL, 0xcba8000400000080ULL, 0xcaa02c0680000000ULL,\n0xcc880002008c4080ULL, 0x300000f007f0cf0cULL, 0x0a80001080a00000ULL, 0x820880802a880a80ULL,\n0x0000050001040004ULL, 0x0000011000000000ULL, 0x0a8020a2a0202000ULL, 0x0000022202008000ULL,\n0x0000222212808000ULL, 0x0020226010000000ULL, 0x000033f33ff3c33cULL, 0x00288002a08c02a8ULL,\n0x0000000000000000ULL, 0x04408e0000008200ULL, 0x0808004000900000ULL, 0x0aa8200010ca00c0ULL,\n0x0ba80101005d4010ULL, 0x00018604802c8288ULL, 0x00049400101c0000ULL, 0x000c101110505010ULL,\n0x0000000000100000ULL, 0x30000c00c022000cULL, 0xd0c00dd0d51d431cULL, 0x0008000010100000ULL,\n0x000c1001a0280000ULL, 0x0bc80000c0000000ULL, 0x0a00000080280000ULL, 0x8000a00220308420ULL,\n0x0808000010301000ULL, 0x0000040000000000ULL, 0x0d00031480100000ULL, 0x07200000108c0300ULL,\n0x0bc0a0c000004000ULL, 0x8000b002c0208480ULL, 0x340c0100118c111cULL, 0x8008008020890000ULL,\n0x0000000000040010ULL, 0x0020b00320c1d0b0ULL, 0x00002000000c0000ULL, 0x0020be226e2008a0ULL,\n0x002010c03fb0a6a0ULL, 0x00202e222aaec284ULL, 0x00008f0000208400ULL, 0x0000000000300000ULL,\n};\n// Latin1 6%, Latin2 11%, Latin7 3%\n\n\n\n// Just for debugging. not thread-safe\nstatic char tri_string[4];\nchar* Latin127Str(int trisub) {\n  tri_string[0] = \"_abcdefghijklmnopqrstuvwxyzAEIOC\"[(trisub >> 10) & 0x1f];\n  tri_string[1] = \"_abcdefghijklmnopqrstuvwxyzAEIOC\"[(trisub >> 5) & 0x1f];\n  tri_string[2] = \"_abcdefghijklmnopqrstuvwxyzAEIOC\"[(trisub >> 0) & 0x1f];\n  tri_string[3] = '\\0';\n  return tri_string;\n}\n\n// Returns two bits per three-byte trigram, indicating\n// dont-care, Latin1 likely, Latin2 likely, and Latin7 (ISO-8859-13) likely\nint TrigramValue(const uint8* trisrc) {\n  int byte0_p = kMapToFiveBits[trisrc[0]];\n  int byte1_p = kMapToFiveBits[trisrc[1]];\n  int byte2_p = kMapToFiveBits[trisrc[2]];\n  int subscr = ((byte0_p) << 5) | byte1_p;\n  int temp = static_cast<int>((kLatin127Trigrams[subscr] >> (byte2_p * 2)));\n  //printf(\"%s=%d \", Latin127Str((subscr << 5) | byte2_p), temp & 3);\n  return temp & 3;\n}\n\n\n// Put out trigrams for surrounding 32 bytes for Latin encodings\n// Return true if more Latin2 & 7 than Latin1\nbool BoostLatin127Trigrams(int tri_block_offset,\n                           DetectEncodingState* destatep) {\n  //printf(\"BoostLatin127Trigrams[%06x]\\n\", tri_block_offset);\n  int excess_latin27 = 0;\n  int srclen = destatep->limit_src - destatep->initial_src;\n  int hi_limit = minint(tri_block_offset + 32, srclen - 2);\n  const uint8* trisrc = &destatep->initial_src[tri_block_offset];\n  const uint8* trisrclimit = &destatep->initial_src[hi_limit];\n  while (trisrc < trisrclimit) {\n    // Selectively boost Latin1, Latin2, or Latin7 and friends\n    int trigram_val = TrigramValue(trisrc);\n    if (trigram_val != 0) {\n      if (FLAGS_enc_detect_source) {\n        PsHighlight(trisrc, destatep->initial_src, trigram_val, 1);\n      }\n      if (trigram_val == kTriLatin1Likely) {\n        Boost(destatep, F_Latin1, kTrigramBoost);\n        Boost(destatep, F_CP1252, kTrigramBoost);\n        // We don't want to upset the relative rank of a declared 8859-15\n        Boost(destatep, F_ISO_8859_15, kTrigramBoost);\n        --excess_latin27;\n      } else if (trigram_val == kTriLatin2Likely) {\n        Boost(destatep, F_Latin2, kTrigramBoost);\n        Boost(destatep, F_CP1250, kTrigramBoost);\n        ++excess_latin27;\n      } else if (trigram_val == kTriLatin7Likely) {\n        Boost(destatep, F_ISO_8859_13, kTrigramBoost);\n        Boost(destatep, F_CP1257, kTrigramBoost);\n        // We don't want to upset the relative rank of a declared 8859-4 or -6\n        // for Estonian\n        Boost(destatep, F_Latin4, kTrigramBoost);\n        Boost(destatep, F_Latin6, kTrigramBoost);\n        ++excess_latin27;\n      }\n    }\n\n    ++trisrc;\n  }\n  //printf(\"\\n\");\n\n  return (0 < excess_latin27);\n}\n\n\n\n// Boost any encodings that need extra detection help, then prune\n// src is first unscanned byte\n// slowend means extra pruning when dropping out of initial slow scan\n// final means last call -- no bigram at src\nvoid BoostPrune(const uint8* src, DetectEncodingState* destatep,\n                int prunereason) {\n  int delta_asciipairs = destatep->next_interesting_pair[AsciiPair] -\n    destatep->prior_interesting_pair[AsciiPair];\n  int delta_otherpairs = destatep->next_interesting_pair[OtherPair] -\n    destatep->prior_interesting_pair[OtherPair];\n\n  if (prunereason == PRUNE_FINAL) {\n    // We are about done\n    // If we get here with very little accumulated data, the initial hints\n    // were too strong, so we derate them to n+1 / 12 for n bigrams\n    if (!destatep->hints_derated  &&\n        (destatep->next_interesting_pair[OtherPair] < kDerateHintsBelow)) {\n      int n = destatep->next_interesting_pair[OtherPair];\n\n      // Map N pairs to (N+1)/12 portions of the initial hints, etc.\n      // Floor of 3/12 -- 1/12 and 2/12 are too easy to overcome\n      int m = maxint(3, (n + 1));\n      for (int i = 0; i < NUM_RANKEDENCODING; ++i) {\n        int original_delta = destatep->hint_prob[i];\n        int scaled_delta = (original_delta * m) / kDerateHintsBelow;\n        destatep->enc_prob[i] -= original_delta;\n        destatep->enc_prob[i] += scaled_delta;\n      }\n      destatep->hints_derated = true;\n      if (destatep->debug_data != NULL) {\n        // Show derated-hint result\n        char buff[32];\n        snprintf(buff, sizeof(buff), \"Hints %d/%d\", m, kDerateHintsBelow);\n        SetDetailsEncLabel(destatep, buff);\n      }\n    }\n  }\n\n\n  ++destatep->prune_count;\n\n  if (prunereason != PRUNE_FINAL) {\n    // Early outs\n    if (destatep->rankedencoding_list_len <= 1) {            // nothing to prune\n      destatep->done = true;\n      return;\n    }\n\n    if ((destatep->prune_count > 0) &&\n        (delta_asciipairs + delta_otherpairs) == 0) {\n      // Nothing to do; must have just been called earlier\n      return;\n    }\n  }\n\n\n\n  // INCREMENT\n  // ====================\n  // Accumulate OtherPair probibilities over all active families\n  // AsciiPair probibilities are all done in ActiveSpecialBoostWhack\n  uint8 prior_bad_byte1 = ' ';    // won't match first bad pair\n  uint8 prior_bad_byte2 = ' ';    // won't match first bad pair\n  uint8 or_byte1 = 0;             // Track if any current pair has a high bit\n  int counted_otherpairs = 0;\n  uint8 prior_byte1x2x = 0;\n  for (int i = 0; i < delta_otherpairs; ++i) {\n    int watch1_incr = 0;\n    int watch2_incr = 0;\n    int next_pair = destatep->prior_interesting_pair[OtherPair] + i;\n\n    uint8 byte1 = destatep->interesting_pairs[OtherPair][next_pair * 2 + 0];\n    uint8 byte2 = destatep->interesting_pairs[OtherPair][next_pair * 2 + 1];\n    uint8 byte1x2x = (byte1 & 0xf0) | ((byte2 >> 4) & 0x0f);\n    int weightshift = destatep->interesting_weightshift[OtherPair][next_pair];\n\n    int offset_byte12 = destatep->interesting_offsets[OtherPair][next_pair];\n\n    // To help distinguish some Cyrillic, Arabic, Greek, Hebrew, Thai\n    // Remember if this is a CDEF pair immediately following the previous pair\n    // 8xxx CxCx or CxCx 8xxx\n    bool next_pair_consec_hi = false;\n    if (ConsecutivePair(destatep, next_pair)) {\n      if ((byte1x2x & 0xcc) == 0xcc) {                // 8xxx CxCx\n        next_pair_consec_hi = true;\n      } else if ((prior_byte1x2x & 0xcc) == 0xcc) {   // CxCx 8xxx\n        next_pair_consec_hi = true;\n      }\n    }\n    //printf(\"prior/cur/consec %02x %02x %d\\n\",\n    // prior_byte1x2x, byte1x2x, next_pair_consec_hi);\n    prior_byte1x2x = byte1x2x;\n\n    or_byte1 |= byte1;\n    uint8 byte1f = byte1;\n    // Flip top bit of subscript to better separate quadrant 4 (esp. for Hebrew)\n    byte1f ^= (byte2 & 0x80);\n\n    // If the same bigram occurred recently, don't increment again\n    bool pair_used = false;\n    if (!RepeatedBigram(destatep, byte1, byte2)) {\n      ++counted_otherpairs;\n      pair_used = true;\n      // Boost both charset= declared encodings, so\n      // Nearly-same probability nearby encoding doesn't drift to the top\n      if (!FLAGS_demo_nodefault) {\n        destatep->enc_prob[destatep->declared_enc_1] += kDeclaredEncBoost >> weightshift;\n        destatep->enc_prob[destatep->declared_enc_2] += kDeclaredEncBoost >> weightshift;\n      }\n      bool was_bad_pair = false;\n      for (int j = 0; j < destatep->rankedencoding_list_len; j++) {\n        int incr_shift = 0;\n        int rankedencoding = destatep->rankedencoding_list[j];\n        Encoding enc = kMapToEncoding[rankedencoding];\n\n        // For binary, Skip over repeated marker bytes, such as 02, FF, etc.\n        if ((rankedencoding == F_BINARY) &&\n            RepeatedBinary(destatep, byte1, byte2)) {\n          incr_shift = 2;       // count 1/4 as much if repeated\n        }\n\n        // If byte 1x2x for this encoding is exactly zero, illegal byte pair\n        // Don't increment, but instead penalize\n        const UnigramEntry* ue = &unigram_table[rankedencoding];\n        if (ue->b12[byte1x2x] == 0) {\n          // Don't whack consecutive duplicate bad pairs -- overkill\n          if ((byte1 != prior_bad_byte1) || (byte2 != prior_bad_byte2)) {\n            // Extra whack for illegal pair in this encoding\n            Whack(destatep, rankedencoding, kBadPairWhack >> weightshift);\n            was_bad_pair = true;\n          }\n        } else {\n          // OK to do the real increment\n          int incr = ue->b1[byte1f] + ue->b2[byte2] + ue->b12[byte1x2x];\n          if ((ue->b12[byte1x2x] & 0x01) != 0) {\n            // Use a more-precise table\n            int byte32x32 = ((byte1 & 0x1f) << 5) | (byte2 & 0x1f);\n            int hiressub = (byte2 & 0x60) >> 5;   // select w/bits 5&6 of byte 2\n            DCHECK(ue->hires[hiressub] != NULL);\n            incr += ue->hires[hiressub][byte32x32];\n          } else {\n            // Default final offset\n            incr += ue->so;\n          }\n          incr >>= incr_shift;\n\n          incr >>= weightshift;\n          destatep->enc_prob[rankedencoding] += incr;   // The actual increment\n\n          if (FLAGS_enc_detect_detail2) {\n            if (watch1_rankedenc == rankedencoding) {watch1_incr = incr;}\n            if (watch2_rankedenc == rankedencoding) {watch2_incr = incr;}\n          }\n        }\n\n\n        // If consecutive pair of high bytes, give slight boost to one-byte\n        // encodings that have a full alphabet in the high bytes\n        if (next_pair_consec_hi && HighAlphaEncoding(enc)) {\n          Boost(destatep, rankedencoding, kDeclaredEncBoost >> weightshift);\n        }\n      }     // End for j < rankedencoding_list_len\n\n      if (was_bad_pair) {\n        prior_bad_byte1 = byte1;\n        prior_bad_byte2 = byte2;\n      }\n\n      // Fold in per-bigram most likely encoding for first N bigrams\n      if (next_pair < kBestPairsCount) {\n        int best_enc = kMostLikelyEncoding[(byte1 << 8) + byte2];\n        Boost(destatep, best_enc, kBestEncBoost >> weightshift);\n      }\n\n      // Possibly score 32 trigrams around a bigram to better separate\n      // Latin1 from Latin2 and Latin7. Especially helpful for detecting\n      // mis-labelled Hungarian latin2.\n      // If looking and at bigram 0,8,16,... do full scoring, else just 1 tri\n      if (destatep->do_latin_trigrams ||\n          destatep->looking_for_latin_trigrams) {\n        // If just looking, do full scan every 8 times\n        // Just look up one trigram the other 7 and do full scan if Latin2,7\n        bool scan32 = false;\n        const uint8* trisrc = &destatep->initial_src[offset_byte12 - 1];\n        if (!destatep->do_latin_trigrams) {\n          if ((i & 7) == 0 || trisrc + 3 > destatep->limit_src) {\n            scan32 = true;\n          } else {\n            scan32 = (kTriLatin1Likely < TrigramValue(trisrc));\n          }\n        }\n        if (destatep->do_latin_trigrams || scan32) {\n          // Just score each block of 32 bytes once\n          int tri_block_offset = offset_byte12 & ~0x1f;\n          if (destatep->trigram_highwater_mark <= tri_block_offset) {\n            bool turnon = BoostLatin127Trigrams(tri_block_offset, destatep);\n            if (FLAGS_counts && !destatep->do_latin_trigrams && turnon) {\n              ++doing_used;    // First time\n            }\n            if (FLAGS_enc_detect_source) {\n              if (!destatep->do_latin_trigrams && turnon) {\n                // First time\n                PsHighlight(trisrc, destatep->initial_src, 0, 2);\n              }\n            }\n            destatep->do_latin_trigrams |= turnon;\n            destatep->trigram_highwater_mark = tri_block_offset + 32;\n          }\n        }\n      }\n\n    }       // end if RepeatedBigram()\n\n    // Keep track of initial byte high 3 bits\n    ++destatep->byte32_count[byte1 >> 5];\n\n\n    // TODO: boost subset/superset also\n    // Boost(destatep, kRelatedEncoding[best_enc], kBestEncBoost);\n\n    if (destatep->debug_data != NULL) {\n      // Show detail entry for this bigram\n      char buff[16];\n      snprintf(buff, sizeof(buff), \"%c%02x%02x%c%c\",\n               pair_used ? ' ' : '[',\n               byte1,\n               byte2,\n               pair_used ? ' ' : ']',\n               (weightshift == 0) ? ' ' : '-');\n\n      SetDetailsEncProb(destatep,\n                        destatep->interesting_offsets[OtherPair][next_pair],\n                        kMostLikelyEncoding[(byte1 << 8) + byte2],\n                        buff);\n    }\n    if (FLAGS_enc_detect_detail2) {\n      if ((watch1_incr != 0) || (watch2_incr != 0)) {\n        // Show increment detail for this encoding\n        char buff[32];\n        snprintf(buff, sizeof(buff), \"%c%d %c%d\",\n                 (watch1_incr < 0) ? '-' : '+', watch1_incr,\n                 (watch2_incr < 0) ? '-' : '+', watch2_incr);\n        SetDetailsEncLabel(destatep, buff);\n      }\n    }\n  }       // End for i\n\n\n  // If no high bit on, demote all the two-byte codes\n  // WAS BUG. This was inside the loop above and should be outside\n  if ((counted_otherpairs > 0) && ((or_byte1 & 0x80) == 0)) {\n    // No high bit in this group (just 02xx, etc.). Whack 2-byte codes\n    // This keeps SJS from creeping past Latin1 on illegal C0 bytes\n    for (int j = 0; j < destatep->rankedencoding_list_len; j++) {\n      int rankedencoding = destatep->rankedencoding_list[j];\n      Encoding enc = kMapToEncoding[rankedencoding];\n      if (TwoByteEncoding(enc)) {\n        Whack(destatep, rankedencoding, kGentlePairWhack * counted_otherpairs);\n      }\n    }\n  }\n\n\n  // BOOST\n  // ====================\n  if (AnyActive(destatep)) {\n    ActiveSpecialBoostWhack(src, destatep);\n  }\n\n  // Update for next time\n  destatep->prior_src = src;\n  destatep->prior_interesting_pair[AsciiPair] =\n    destatep->next_interesting_pair[AsciiPair];\n  destatep->prior_interesting_pair[OtherPair] =\n    destatep->next_interesting_pair[OtherPair];\n\n\n  // Do any pre-prune final adjustments\n  // ====================\n  if (prunereason == PRUNE_FINAL) {\n    // If UTF8 not in base state, whack\n    if (destatep->next_utf8_ministate != 0) {\n      Whack(destatep, F_UTF8, kGentlePairWhack * 2 * 1);\n    }\n    // If UTF8UTF8 not in base state, whack\n    if (destatep->next_utf8utf8_ministate != 0) {\n      Whack(destatep, F_UTF8UTF8, kGentlePairWhack * 2 * 1);\n    }\n\n    // If no valid UTF-8 char ever seen, whack\n    if (destatep->utf8_minicount[5] == 0) {\n      Whack(destatep, F_UTF8, kBadPairWhack * 8);           // No sequence\n      Whack(destatep, F_UTF8UTF8, kBadPairWhack * 8);       // No sequence\n    }\n\n    // If no valid UTF8UTF8 char ever seen, whack\n    if (destatep->utf8utf8_minicount[5] == 0) {\n      Whack(destatep, F_UTF8UTF8, kBadPairWhack * 8);       // No sequence\n    }\n\n    // If not all four binary quadrants, whack BINARY;\n    // worth 2 pair if 3 quads, 4 pair if 1 or 2 quads\n    if (destatep->binary_quadrants_count < 4) {\n      if (destatep->binary_quadrants_count == 3) {\n        Whack(destatep, F_BINARY, kBadPairWhack * 2);\n      } else {\n        Whack(destatep, F_BINARY, kBadPairWhack * 4);\n      }\n    }\n\n    // If 1st pair is 1b24, choose between ISO-2022-xx\n    //  <esc> $ ) C ISO-2022-KR   [1b 24 29 43]\n    //  <esc> $ ) A ISO-2022-CN   [1b 24 29 41]\n    //  <esc> $ ) G ISO-2022-CN   [1b 24 29 47]\n    //  <esc> $ * H ISO-2022-CN   [1b 24 2a 48]\n    //  <esc> ( B ISO-2022-JP     [1b 28 42]  to ASCII\n    //  <esc> ( J ISO-2022-JP     [1b 28 4a]  to X0201\n    //  <esc> $ @ ISO-2022-JP     [1b 24 40]  to X0208-78 twobyte\n    //  <esc> $ B ISO-2022-JP     [1b 24 42]  to X0208-83 twobyte\n    if ((destatep->next_interesting_pair[OtherPair] >= 1) &&\n        Iso2022Active(destatep)) {\n      if ((destatep->interesting_pairs[OtherPair][0] == 0x1b) &&\n          (destatep->interesting_pairs[OtherPair][1] == 0x24)) {\n        int offset = destatep->interesting_offsets[OtherPair][0];\n        const uint8* esc_src = destatep->initial_src + offset;\n        if ((destatep->initial_src + offset) < (destatep->limit_src - 3)) {\n          if ((esc_src[2] == ')') && (esc_src[3] == 'C')) {\n            Boost(destatep, F_ISO_2022_KR, kBoostOnePair);\n            Whack(destatep, F_ISO_2022_CN, kBadPairWhack);\n            Whack(destatep, F_JIS, kBadPairWhack);\n          } else if ((esc_src[2] == ')') && ((esc_src[3] == 'A') ||\n                                             (esc_src[3] == 'G'))) {\n            Boost(destatep, F_ISO_2022_CN, kBoostOnePair);\n            Whack(destatep, F_ISO_2022_KR, kBadPairWhack);\n            Whack(destatep, F_JIS, kBadPairWhack);\n          } else if ((esc_src[2] == '@') || (esc_src[2] == 'B')) {\n            Boost(destatep, F_JIS, kBoostOnePair);\n            Whack(destatep, F_ISO_2022_CN, kBadPairWhack);\n            Whack(destatep, F_ISO_2022_KR, kBadPairWhack);\n          }\n        } else {\n          // Incomplete escape sequence. Whack them all\n          Whack(destatep, F_JIS, kBadPairWhack);\n          Whack(destatep, F_ISO_2022_CN, kBadPairWhack);\n          Whack(destatep, F_ISO_2022_KR, kBadPairWhack);\n        }\n      }\n    }\n    if (destatep->debug_data != NULL) {\n      SetDetailsEncLabel(destatep, \"pre-final\");\n    }\n  }\n\n  // PRUNE\n  // ====================\n  // Find current top two rankedencoding probabilities\n  ReRank(destatep);\n\n  if (prunereason == PRUNE_SLOWEND) {\n    if (destatep->debug_data != NULL) {\n      SetDetailsEncLabel(destatep, \"slow-end\");\n    }\n  }\n\n  // Keep every rankedencoding with probablity >= top_prob - prune_difference\n  int prune_diff = destatep->prune_difference;\n  // If the top encoding is BINARY, it might be overstated, and we might\n  // therefore prune away the real encoding. Make the pruning delta\n  // twice as big.\n  if (destatep->top_rankedencoding == F_BINARY) {\n    prune_diff *= 2;\n  }\n  int keep_prob = destatep->top_prob - prune_diff;\n\n  // Tighten pruning difference (we start wide) for next time\n  if (destatep->prune_difference > kFinalPruneDifference) {\n    int decrement = kPruneDiffDecrement;\n    // If only ASCII pairs, small tighten; if some non-ASCII, full tighten\n    if (counted_otherpairs == 0) {\n      decrement >>= 1;\n    }\n    destatep->prune_difference -= decrement;\n  }\n\n  // Prune the list of active encoding families\n  destatep->active_special = 0;\n  int k = 0;\n  for (int j = 0; j < destatep->rankedencoding_list_len; j++) {\n    bool keep = true;\n    int rankedencoding = destatep->rankedencoding_list[j];\n\n    // If count is too low, ditch it\n    if (destatep->enc_prob[rankedencoding] < keep_prob) {\n      keep = false;\n    }\n\n    // If at end of slow section, ditch any 7-bit with zero evidence so far\n    if ((prunereason == PRUNE_SLOWEND) &&\n        SevenBitEncoding(kMapToEncoding[rankedencoding]) &&\n        (destatep->enc_prob[rankedencoding] <= 0) &&\n        (rankedencoding != destatep->top_rankedencoding)) {\n      keep = false;\n    }\n\n    // Keep it. This will always keep at least top_prob rankedencoding\n    if (keep) {\n      destatep->active_special |= kSpecialMask[kMapToEncoding[rankedencoding]];\n      destatep->rankedencoding_list[k++] = rankedencoding;\n    }\n  }\n\n  if (destatep->debug_data != NULL) {\n    char buff[32];\n    snprintf(buff, sizeof(buff), \"%d prune\", prune_diff / XLOG2);\n    SetDetailsEncLabel(destatep, buff);\n  }\n  destatep->rankedencoding_list_len = k;\n\n\n\n  // Force final result in some cases\n  // Do any post-prune final adjustments\n  if (prunereason == PRUNE_FINAL) {\n    // If no high-byte pairs, result is ASCII7, BINARY, UTF7, 2022, or HZ\n    if (destatep->next_interesting_pair[OtherPair] == 0) {\n      if ((destatep->top_rankedencoding != F_BINARY) &&\n          (destatep->top_rankedencoding != F_UTF7) &&\n          (destatep->top_rankedencoding != F_ISO_2022_CN) &&\n          (destatep->top_rankedencoding != F_ISO_2022_KR) &&\n          (destatep->top_rankedencoding != F_JIS) &&\n          (destatep->top_rankedencoding != F_HZ_GB_2312)) {\n        destatep->top_rankedencoding = F_ASCII_7_bit;\n        Boost(destatep, F_ASCII_7_bit, kBoostOnePair * 2);\n      }\n    }\n\n    // If some 89 pairs, not ISO_8859_x  and vice versa\n    if (destatep->byte32_count[4] > 0) {\n      switch (destatep->top_rankedencoding) {\n      case F_ASCII:         // ISO-8859-1\n        destatep->top_rankedencoding = F_CP1252;\n        // Better: destatep->enc_prob[F_ASCII] <==> destatep->enc_prob[F_CP1252]\n        Boost(destatep, F_CP1252, kBoostOnePair * 2);\n        break;\n      case F_Latin2:        // ISO-8859-2\n        // Don't swap back; not superset\n        //destatep->top_rankedencoding = F_CP1250;\n        //Boost(destatep, F_CP1250, kBoostOnePair * 2);\n        break;\n      case F_Arabic:         // ISO-8859-6\n        destatep->top_rankedencoding = F_CP1256;\n        Boost(destatep, F_CP1256, kBoostOnePair * 2);\n        break;\n      case F_Greek:         // ISO-8859-7\n        // Don't swap -- not proper superset\n        // Capital Alpha tonos at 0xB6 in ISO-8859-7, 0xA2 in CP1253\n        //destatep->top_rankedencoding = F_CP1253;\n        //Boost(destatep, F_CP1253, kBoostOnePair * 2);\n        break;\n      case F_Hebrew:        // ISO-8859-8\n        // Don't swap -- visual vs. logical\n        //destatep->top_rankedencoding = F_CP1255;\n        //Boost(destatep, F_CP1255, kBoostOnePair * 2);\n        break;\n      case F_Latin5:        // ISO-8859-9\n        destatep->top_rankedencoding = F_CP1254;\n        Boost(destatep, F_CP1254, kBoostOnePair * 2);\n        break;\n      case F_ISO_8859_11:   // ISO-8859-11\n        destatep->top_rankedencoding = F_CP874;\n        Boost(destatep, F_CP874, kBoostOnePair * 2);\n        break;\n      }\n    } else {\n      switch (destatep->top_rankedencoding) {\n      case F_CP1252:        // ISO-8859-1\n        destatep->top_rankedencoding = F_ASCII;\n        Boost(destatep, F_ASCII, kBoostOnePair * 2);\n        break;\n      case F_CP1250:        // ISO-8859-2\n        // Don't swap back; not superset\n        //destatep->top_rankedencoding = F_Latin2;\n        //Boost(destatep, F_Latin2, kBoostOnePair * 2);\n        break;\n      case F_CP1256:        // ISO-8859-6\n        // Don't swap back -- not proper superset\n        //destatep->top_rankedencoding = F_Arabic;\n        //Boost(destatep, F_Arabic, kBoostOnePair * 2);\n        break;\n      case F_CP1253:        // ISO-8859-7\n        // Don't swap back -- not proper superset\n        //destatep->top_rankedencoding = F_Greek;\n        //Boost(destatep, F_Greek, kBoostOnePair * 2);\n        break;\n      case F_CP1255:        // ISO-8859-8\n        // Don't swap back -- not proper superset\n        //destatep->top_rankedencoding = F_Hebrew;\n        //Boost(destatep, F_Hebrew, kBoostOnePair * 2);\n        break;\n      case F_CP1254:        // ISO-8859-9\n        destatep->top_rankedencoding = F_Latin5;\n        Boost(destatep, F_Latin5, kBoostOnePair * 2);\n        break;\n      case F_CP874:         // ISO-8859-11\n        destatep->top_rankedencoding = F_ISO_8859_11;\n        Boost(destatep, F_ISO_8859_11, kBoostOnePair * 2);\n        break;\n      }\n    }\n\n    if (destatep->debug_data != NULL) {\n      char buff[32];\n      snprintf(buff, sizeof(buff), \"final %d\",\n               static_cast<int>(src - destatep->initial_src));\n      SetDetailsEncLabel(destatep, buff);\n\n      // Show winning encoding and its delta log base2 from 2nd-best\n      // Divide delta by XLOG2 to get log base 2\n      int delta = destatep->top_prob - destatep->second_top_prob;\n      if (delta < (2 * XLOG2)) {\n        delta /= XDECILOG2;\n        snprintf(buff, sizeof(buff), \"+%d.%d %s \",\n                 delta / 10, delta % 10,\n                 MyEncodingName(kMapToEncoding[destatep->top_rankedencoding]));\n      } else if (delta < (50 * XLOG2)) {\n        delta /= XLOG2;\n        snprintf(buff, sizeof(buff), \"+%d %s\",\n                 delta,\n                 MyEncodingName(kMapToEncoding[destatep->top_rankedencoding]));\n      } else {\n        snprintf(buff, sizeof(buff), \"%s\",\n                 MyEncodingName(kMapToEncoding[destatep->top_rankedencoding]));\n      }\n      SetDetailsEncProbCopyOffset(destatep, destatep->top_rankedencoding, buff);\n    }\n  }\n\n\n  // FINISH\n  // ====================\n  // Eventual encoding result is reliable if big difference in top two, or if\n  // only Ascii7 ever encountered\n  // Also reliable if exactly one OtherPair and it's best encoding matches top\n  destatep->reliable = false;\n  if (destatep->next_interesting_pair[OtherPair] == 0) {\n    // Only 7-bit ASCII\n    destatep->reliable = true;\n  }\n  if ((destatep->top_prob - destatep->second_top_prob) >=\n      FLAGS_ced_reliable_difference) {\n    destatep->reliable = true;\n  }\n  if (destatep->next_interesting_pair[OtherPair] == 1) {\n    uint8 byte1 = destatep->interesting_pairs[OtherPair][0];\n    uint8 byte2 = destatep->interesting_pairs[OtherPair][1];\n    int best_enc = kMostLikelyEncoding[(byte1 << 8) + byte2];\n    if (best_enc == destatep->top_rankedencoding) {\n      destatep->reliable = true;\n    }\n  }\n\n  // If we pruned to one encoding, we are done\n  if (destatep->rankedencoding_list_len == 1) {\n    destatep->reliable = true;\n    destatep->done = true;\n  }\n\n  // If we pruned to two or three encodings in the same *superset/subset\n  // rankedencoding*  and enough pairs, we are done. Else keep going\n  if (destatep->rankedencoding_list_len == 2) {\n    Encoding enc0 = kMapToEncoding[destatep->rankedencoding_list[0]];\n    Encoding enc1 = kMapToEncoding[destatep->rankedencoding_list[1]];\n    if (kMapEncToBaseEncoding[enc0] == kMapEncToBaseEncoding[enc1]) {\n      if (destatep->prune_count >= 3) {\n        destatep->reliable = true;\n        destatep->done = true;\n      }\n    }\n  } else if (destatep->rankedencoding_list_len == 3) {\n    Encoding enc0 = kMapToEncoding[destatep->rankedencoding_list[0]];\n    Encoding enc1 = kMapToEncoding[destatep->rankedencoding_list[1]];\n    Encoding enc2 = kMapToEncoding[destatep->rankedencoding_list[2]];\n    Encoding base0 = kMapEncToBaseEncoding[enc0];\n    Encoding base1 = kMapEncToBaseEncoding[enc1];\n    Encoding base2 = kMapEncToBaseEncoding[enc2];\n\n    if ((base0 == base1) && (base0 == base2)) {\n      if (destatep->prune_count >= 3) {\n        destatep->reliable = true;\n        destatep->done = true;\n      }\n    }\n  }\n}\n\n\n// Accumulate aligned byte-pair at src\n// Occasionally, calc boost for some encodings and then prune the active list\n// weightshift is used to give low weight some text, such as inside tags\n// Returns true if pruning occurred\nbool IncrementAndBoostPrune(const uint8* src,\n                            int remaining_length,\n                            DetectEncodingState* destatep,\n                            int weightshift,\n                            int exit_reason) {\n  destatep->last_pair = src;\n  // Pick up byte pair, or very last byte plus 0x20\n  uint8 byte1 = src[0];\n  uint8 byte2 = 0x20;\n  if (1 < remaining_length) {byte2 = src[1];}\n\n  // whatset=0 for Ascii + ~, 1 for all others; see kTestPrintableAsciiTildePlus\n  int whatset = exit_reason - 1;\n  int next_pair = destatep->next_interesting_pair[whatset];\n\n  if (next_pair > 16) {\n    // If not clear by 16 bigrams, stop accumulating + ~ 00\n    if (byte1 == '+') {return false;}\n    if (byte1 == '~') {return false;}\n    if (byte1 == 0x00) {return false;}\n  }\n\n  // Remember pair in appropriate list\n  if (next_pair >= kMaxPairs) {\n    // We have filled up our alloted space for interesting pairs with no\n    // decision. If ASCII pairs full, just skip until end of slow loop; if\n    // non-Ascii pairs full, force done\n    if (whatset == OtherPair) {\n      destatep->done = true;\n    }\n  } else {\n    int offset = static_cast<int>(src - destatep->initial_src);\n    destatep->interesting_pairs[whatset][next_pair * 2 + 0] = byte1;\n    destatep->interesting_pairs[whatset][next_pair * 2 + 1] = byte2;\n    destatep->interesting_offsets[whatset][next_pair] = offset;\n    destatep->interesting_weightshift[whatset][next_pair] = weightshift;\n    ++destatep->next_interesting_pair[whatset];\n    ++next_pair;\n  }\n\n  // Prune now and then , but always if forced to be done\n  if (destatep->done || ((next_pair & kPruneMask) == 0)) {  // Prune every M\n    BoostPrune(src + 2, destatep, PRUNE_NORMAL);  // src+2 first unscanned byte\n                                                  // may be off end of input\n    return true;\n  }\n  return false;\n}\n\nvoid DumpSummary(DetectEncodingState* destatep, int whatset, int n) {\n  printf(\"  %sSummary[%2d]: \", kWhatSetName[whatset],\n         destatep->next_interesting_pair[whatset]);\n  int limit = minint(n, destatep->next_interesting_pair[whatset]);\n  for (int i = 0; i < limit; ++i) {\n    printf(\"%02x%02x \",\n           destatep->interesting_pairs[whatset][i * 2 + 0],\n           destatep->interesting_pairs[whatset][i * 2 + 1]);\n    if ((i & 7) == 7) {printf(\"  \");}\n  }\n  printf(\"\\n\");\n}\n\nvoid BeginDetail(DetectEncodingState* destatep) {\n  fprintf(stderr, \"%d [\", NUM_RANKEDENCODING);\n  for (int e = 0; e < NUM_RANKEDENCODING; ++e) {\n    fprintf(stderr, \"(%s)\",  MyRankedEncName(e));\n    if ((e % 10) == 9) {fprintf(stderr, \"\\n    \");}\n  }\n  fprintf(stderr, \"] size-detail\\n\");\n  destatep->next_detail_entry = 0;\n}\n\n// Single character to represent (printable ASCII) gap between bigrams\nchar DetailOffsetChar(int delta) {\n  if (delta == 0) {return ' ';}\n  if (delta <= 2) {return '=';}\n  if (delta <= 15) {return '_';}\n  if (delta <= 31) {return '+';}\n  {return ' ';}\n}\n\nvoid DumpDetail(DetectEncodingState* destatep) {\n  // Turn all counts into delta from previous entry\n  fprintf(stderr, \"%d count-detail\\n\", destatep->next_detail_entry);\n  // Rewrite, recording deltas\n  for (int z = destatep->next_detail_entry - 1; z > 0; --z) {\n    destatep->debug_data[z].offset -= destatep->debug_data[z - 1].offset;\n    for (int e = 0; e < NUM_RANKEDENCODING; ++e) {\n      destatep->debug_data[z].detail_enc_prob[e] -=\n        destatep->debug_data[z - 1].detail_enc_prob[e];\n    }\n  }\n  // Now print\n  for (int z = 0; z < destatep->next_detail_entry; ++z) {\n    // Highlight some entries ending in '!' with light red underbar\n    int len = destatep->debug_data[z].label.size();\n    if (destatep->debug_data[z].label[len - 1] == '!') {\n      fprintf(stderr, \"1 0.9 0.9 do-flag\\n\");\n    }\n    fprintf(stderr, \"(%c%s) %d [\",\n            DetailOffsetChar(destatep->debug_data[z].offset),\n            destatep->debug_data[z].label.c_str(),\n            destatep->debug_data[z].best_enc);\n    for (int e = 0; e < NUM_RANKEDENCODING; ++e) {\n      fprintf(stderr, \"%d \", destatep->debug_data[z].detail_enc_prob[e]);\n      if ((e % 10) == 9) {fprintf(stderr, \"  \");}\n    }\n    fprintf(stderr, \"] do-detail-e\\n\");\n  }\n  // Get ready for next time,if any\n  destatep->next_detail_entry = 0;\n}\n\nvoid PsRecurse(const char* buff) {\n  fprintf(stderr, \"() end-detail (%s) start-detail\\n\\n\", buff);\n}\n\nvoid DumpReliable(DetectEncodingState* destatep) {\n  printf(\"Not reliable: \");\n\n  // Find center of gravity of OtherPair list\n  int x_sum = 0;\n  int y_sum = 0;\n  int count = destatep->next_interesting_pair[OtherPair];\n  for (int i = 0; i < count; ++i) {\n    uint8 byte1 = destatep->interesting_pairs[OtherPair][i * 2 + 0];\n    uint8 byte2 = destatep->interesting_pairs[OtherPair][i * 2 + 1];\n    x_sum += byte2;\n    y_sum += byte1;\n  }\n  if (count == 0) {count = 1;}    // adoid zdiv\n  int x_bar = x_sum / count;\n  int y_bar = y_sum / count;\n  printf(\"center %02X,%02X\\n\", x_bar, y_bar);\n\n  double closest_dist = 999.0;\n  int closest = 0;\n  for (int j = 0; j < destatep->rankedencoding_list_len; j++) {\n    int rankedencoding = destatep->rankedencoding_list[j];\n    const UnigramEntry* ue = &unigram_table[rankedencoding];\n    printf(\"  %8s = %4d at %02x,%02x +/- %02X,%02X \",\n           MyEncodingName(kMapToEncoding[rankedencoding]),\n           destatep->enc_prob[rankedencoding],\n           ue->x_bar, ue->y_bar,\n           ue->x_stddev, ue->y_stddev);\n    double x_diff = x_bar - ue->x_bar;\n    double y_diff = y_bar - ue->y_bar;\n    double dist = sqrt((x_diff * x_diff) + (y_diff * y_diff));\n    printf(\"(%3.1f)\\n\", dist);\n\n    if (closest_dist > dist) {\n      closest_dist = dist;\n      closest = rankedencoding;\n    }\n  }\n  printf(\"Closest=%s (%3.1f)\\n\",\n         MyEncodingName(kMapToEncoding[closest]), closest_dist);\n\n  for (int i = 0; i < 8; ++i) {\n    // Demote by distance to CG and see if that helps, or just quit\n  }\n}\n\n// Scan short single lines quickly for all printable ASCII\n// Return true if all bytes are in [20..7F], false otherwise\nbool QuickPrintableAsciiScan(const char* text, int text_length) {\n  const uint8* src = reinterpret_cast<const uint8*>(text);\n  const uint8* srclimit = src + text_length;\n  const uint8* srclimit8 = srclimit - 7;\n  while (src < srclimit8) {\n    // Exits on any byte outside [0x20..0x7E] range (HT LF CR exit)\n    uint8 mask = 0;\n    for (int i = 0; i < 8; ++i) mask |= (src[i]-0x20)|(src[i]+0x01);\n    if ((mask & 0x80) != 0) break;\n    src += 8;\n  }\n  while (src < srclimit) {\n    uint8 uc = *src++;\n    if (kIsPrintableAscii[uc] == 0) {return false;}\n  }\n  return true;\n}\n\nstatic const int kMaxScanBack = 192;\n\n// Return true if text is inside a tag or JS comment\nbool TextInsideTag(const uint8* isrc, const uint8* src, const uint8* srclimit) {\n  const uint8* srcbacklimit = src - kMaxScanBack;\n  if (srcbacklimit < isrc) {\n    srcbacklimit = isrc;\n  }\n  const uint8* ss = src - 1;\n  while (srcbacklimit <= ss) {\n    uint8 c = *ss--;\n    if ((c & ~0x02) == '<') {\n      // We found preceding < 3C or > 3E nearby\n      // Even cheaper: if inside a tag, we don't care what tag; return true\n      if (c == '<') {\n        return true;\n      }\n      // See if we are just after <title>...\n      if ((c == '>') && (isrc <= (ss - 5)) &&\n          (ss[-5] == '<') &&\n          ((ss[-4] | 0x20) == 't') &&\n          ((ss[-3] | 0x20) == 'i') &&\n          ((ss[-2] | 0x20) == 't') &&\n          ((ss[-1] | 0x20) == 'l') &&\n          ((ss[-0] | 0x20) == 'e')) {\n        return true;\n      }\n      // See if we are just after <SCRIPT language=javascript>...\n      if ((c == '>') && (isrc <= (ss - 5)) &&\n          (ss[-5] == 's') &&\n          ((ss[-4] | 0x20) == 'c') &&\n          ((ss[-3] | 0x20) == 'r') &&\n          ((ss[-2] | 0x20) == 'i') &&\n          ((ss[-1] | 0x20) == 'p') &&\n          ((ss[-0] | 0x20) == 't')) {\n        return true;\n      }\n      // Not in a tag\n      return false;\n    // See if we are just after JavaScript comment /* ...\n    } else if (c == '/') {\n      if (((ss + 2) < srclimit) && (ss[2] == '*')) {\n        // We backscanned to /*\n        return true;\n      }\n    }\n  }\n\n  return false;\n}\n\nconst uint8* SkipToTagEnd(const uint8* src, const uint8* srclimit) {\n  const uint8* ss = src + 1;\n  while (ss <= srclimit) {\n    uint8 c = *ss++;\n    if ((c == '<') || (c == '>')) {\n      return ss;\n    }\n  }\n  return src + 2;     // Always make progress, Otherwise we get an infinite loop\n}\n\n\n// Take a watch string and map to a ranked encoding. If no match, return -1\nint LookupWatchEnc(const string& watch_str) {\n  int watchval = -1;\n  // Mixed encoding maps to enc=UTF8UTF8\n  if (watch_str == \"UTF8UTF8\") {\n    watchval = F_UTF8UTF8;\n  } else {\n    Encoding enc;\n    if (EncodingFromName(watch_str.c_str(), &enc)) {\n      watchval = CompactEncDet::BackmapEncodingToRankedEncoding(enc);\n    }\n  }\n  return watchval;\n}\n\n// Return true if enc and enc2 are equal or one is a subset of the other\n// or either is UNKNOWN\n// also UTF8UTF8 is compatible with both Latin1 and UTF8\nbool CompatibleEnc(Encoding enc, Encoding enc2) {\n  if (enc < 0) {return false;}\n  if (NUM_ENCODINGS <= enc) {return false;}\n  if (enc2 < 0) {return false;}\n  if (NUM_ENCODINGS <= enc2) {return false;}\n  if (enc == enc2) {return true;}\n  if (kMapEncToBaseEncoding[enc] == kMapEncToBaseEncoding[enc2]) {return true;}\n\n  if (enc == ASCII_7BIT) {return true;}\n  if (enc2 == ASCII_7BIT) {return true;}\n  if (enc == UNKNOWN_ENCODING) {return true;}\n  if (enc2 == UNKNOWN_ENCODING) {return true;}\n  if (enc == UTF8UTF8) {\n    if (enc2 == UTF8) {return true;}\n    if (kMapEncToBaseEncoding[enc2] == ISO_8859_1) {return true;}\n  }\n  if (enc2 == UTF8UTF8) {\n    if (enc == UTF8) {return true;}\n    if (kMapEncToBaseEncoding[enc] == ISO_8859_1) {return true;}\n  }\n\n  return false;\n}\n\n// Return superset of enc and enc2, which must be compatible\nEncoding SupersetEnc(Encoding enc, Encoding enc2) {\n  //printf(\"  SupersetEnc (%s, \", MyEncodingName(enc)); // TEMP\n  //printf(\"%s) \", MyEncodingName(enc2));\n  //printf(\"= %s\\n\",\n  //       MyEncodingName(kMapEncToSuperLevel[enc] >= kMapEncToSuperLevel[enc2] ?\n  //                      enc :enc2));\n  if (kMapEncToSuperLevel[enc] >= kMapEncToSuperLevel[enc2]) {\n    return enc;\n  }\n  return enc2;\n}\n\n\n// If unreliable, try rescoring to separate some encodings\nEncoding Rescore(Encoding enc, const uint8* isrc,\n                 const uint8* srctextlimit, DetectEncodingState* destatep) {\n  if (FLAGS_counts) {++rescore_used;}\n  Encoding new_enc = enc;\n\n  bool rescore_change = false;\n\n  int count = destatep->next_interesting_pair[OtherPair];\n  int text_length = srctextlimit - isrc;\n  for (int i = 0; i < count; ++i) {\n    int bigram_offset = destatep->interesting_offsets[OtherPair][i];\n    uint8 byte0 = (0 < bigram_offset) ?\n        isrc[bigram_offset - 1] : 0x20;\n    uint8 byte1 = isrc[bigram_offset + 0];  // Known to have high bit on\n    uint8 byte2 = ((bigram_offset + 1) < text_length) ?\n        isrc[bigram_offset + 1] : 0x20;\n    uint8 byte3 = ((bigram_offset + 2) < text_length) ?\n        isrc[bigram_offset + 2] : 0x20;\n    int high_hash = ((byte0 & 0xc0) >> 0) |\n                    ((byte1 & 0xc0) >> 1) |\n                    ((byte2 & 0xc0) >> 4) |\n                    ((byte3 & 0xc0) >> 6);    // 00112233\n\n    // Boost HighAccent encodings for Ascii bit patterns\n    //  0x1x  0x0x\n    //  1010  1010\n    //  0010  0000\n    //\n    if ((high_hash & 0xaa) == 0x20) {\n      for (int j = 0; j < destatep->rankedencoding_list_len; j++) {\n        int rankedencoding = destatep->rankedencoding_list[j];\n        if (HighAccentEncoding(kMapToEncoding[rankedencoding])) {\n          // TODO: also want to boost Shift-JIS here if byte1 is Ax..Dx\n          // TEMP\n          //printf(\"  Rescore[%02x] %s +%d\\n\",\n          //       high_hash, MyRankedEncName(rankedencoding), kGentlePairBoost);\n          Boost(destatep, rankedencoding, kGentlePairBoost);\n          rescore_change = true;\n        }\n      }\n    }\n\n    // Whack HighAccent encodings for high bit patterns\n    //  1x1x  1x1x\n    //  1010  1010\n    //  1010  1010\n    //\n    if ((high_hash & 0xaa) == 0xaa) {\n      for (int j = 0; j < destatep->rankedencoding_list_len; j++) {\n        int rankedencoding = destatep->rankedencoding_list[j];\n        if (HighAccentEncoding(kMapToEncoding[rankedencoding])) {\n          // TEMP\n          //printf(\"  Rescore[%02x] %s -%d\\n\",\n          //       high_hash, MyRankedEncName(rankedencoding), kGentlePairBoost);\n          Whack(destatep, rankedencoding, kGentlePairBoost);\n          rescore_change = true;\n        }\n      }\n    }\n\n  }\n\n  if (rescore_change) {\n    ReRank(destatep);\n    new_enc = kMapToEncoding[destatep->top_rankedencoding];\n\n    if (destatep->debug_data != NULL) {\n      char buff[32];\n      snprintf(buff, sizeof(buff), \"=Rescore %s\", MyEncodingName(new_enc));\n      SetDetailsEncProb(destatep,\n                        0,\n                        CompactEncDet::BackmapEncodingToRankedEncoding(new_enc),\n                        buff);\n      //// DumpDetail(destatep);\n    }\n\n    SimplePrune(destatep, kFinalPruneDifference);\n    CalcReliable(destatep);\n  }\n\n  //if (new_enc != enc) {\n  //  // TEMP\n  //  printf(\"  Rescore new top encoding = %s\\n\",\n  //         MyRankedEncName(destatep->top_rankedencoding));\n  //}\n\n  return new_enc;\n}\n\n\n// Given an encoding, add its corresponding ranked encoding to the set\nvoid AddToSet(Encoding enc, int* list_len, int* list) {\n  // TEMP print\n  int item = CompactEncDet::BackmapEncodingToRankedEncoding(enc);\n  for (int i = 0; i < *list_len; ++i) {\n    if (list[i] == item) {\n      return;                 // Already in the set; don't add again\n    }\n  }\n  list[(*list_len)++] = item;\n}\n\n\nstatic const int kMinRobustBigramCount = 1000;\nstatic const int kMinKBToRobustScan =  64;\nstatic const int kMaxKBToRobustScan = 256;\n\n// Scan the first 64K or so, just doing raw bigram increments on given\n// probability list.\n// No fancy duplicate filtering or anything else here.\n// Returns number of bigrams counted\nint RobustScan(const char* text,\n                int text_length,\n                int robust_renc_list_len,\n                int* robust_renc_list,\n                int* robust_renc_probs) {\n  if (FLAGS_counts) {++robust_used;}\n  // Zero all the result probabilities\n  for (int i = 0; i < robust_renc_list_len; ++i) {\n    robust_renc_probs[i] = 0;\n  }\n  int max_fast_len = minint(text_length, (kMaxKBToRobustScan << 10));\n  const uint8* isrc = reinterpret_cast<const uint8*>(text);\n  const uint8* src = isrc;\n  const uint8* srclimitfast2 = isrc + max_fast_len - 1;\n  const uint8* srclimitfast4 = isrc + max_fast_len - 3;\n\n  int min_fast_len = minint(text_length, (kMinKBToRobustScan << 10));\n  const uint8* srclimitmin = isrc + min_fast_len - 1;\n\n  int bigram_count = 0;\n\n  if (FLAGS_enc_detect_source) {\n    PsSourceInit(kPsSourceWidth);\n    fprintf(stderr, \"(RobustScan) do-src\\n\");\n  }\n\n  // Sum over a big chunk of the input\n  // Faster loop, no 7-bit-encodings possible, approx 3000 GB/sec\n  //====================================\n  while (src < srclimitfast2) {\n    // Skip to next interesting bigram\n\n    while (src < srclimitfast4) {\n      if (((src[0] | src[1] | src[2] | src[3]) & 0x80) != 0) break;\n      src += 4;\n    }\n\n    while (src < srclimitfast2) {\n      if ((src[0] & 0x80) != 0) break;\n      src++;\n    }\n\n    if (src < srclimitfast2) {\n      // We found a bigram with high bit on\n      // Next 5 lines commented out so we don't show all the source.\n      //const uint8* srctextlimit = isrc + text_length;\n      //if (FLAGS_enc_detect_source) {\n      //  PsSource(src, isrc, srctextlimit);\n      //  PsMark(src, 2, isrc, 0);\n      //}\n\n      uint8 byte1 = src[0];\n      uint8 byte2 = src[1];\n      uint8 byte1x2x = (byte1 & 0xf0) | ((byte2 >> 4) & 0x0f);\n      uint8 byte1f = byte1;\n      // Flip top bit of subscript to better separate quadrant 4 (esp. for Hebrew)\n      byte1f ^= (byte2 & 0x80);\n\n      // The real increments\n      for (int j = 0; j < robust_renc_list_len; ++j) {\n        int rankedencoding = robust_renc_list[j];\n        const UnigramEntry* ue = &unigram_table[rankedencoding];\n        int incr = ue->b1[byte1f] + ue->b2[byte2] + ue->b12[byte1x2x];\n        if ((ue->b12[byte1x2x] & 0x01) != 0) {\n          // Use a more-precise table\n          int byte32x32 = ((byte1 & 0x1f) << 5) | (byte2 & 0x1f);\n          int hiressub = (byte2 & 0x60) >> 5;   // select w/bits 5&6 of byte 2\n          DCHECK(ue->hires[hiressub] != NULL);\n          incr += ue->hires[hiressub][byte32x32];\n        } else {\n          // Default final offset\n          incr += ue->so;\n        }\n        robust_renc_probs[j] += incr;\n      }\n\n      src += 2;       // Continue after this bigram\n      ++bigram_count;\n\n      // Stop after 1000 bigrams reached, if at least 64KB scanned\n      if ((bigram_count > kMinRobustBigramCount) && (src > srclimitmin)) {\n        break;\n      }\n\n    }\n  }\n\n  if (FLAGS_enc_detect_source) {\n    fprintf(stderr, \"(  bigram_count = %d) do-src\\n\", bigram_count);\n    if (bigram_count == 0) {bigram_count = 1;}    // zdiv\n    for (int i = 0; i < robust_renc_list_len; ++i) {\n      fprintf(stderr, \"(  enc[%-12.12s] = %7d (avg %d)) do-src\\n\",\n              MyRankedEncName(robust_renc_list[i]), robust_renc_probs[i],\n              robust_renc_probs[i] / bigram_count);\n    }\n    PsSourceFinish();\n  }\n\n  return bigram_count;\n}\n\n// If unreliable, rescan middle of document to see if we can get a better\n// answer. Rescan is only worthwhile if there are ~200 bytes or more left,\n// since the detector takes as much as 96 bytes of bigrams to decide.\nEncoding Rescan(Encoding enc,\n                const uint8* isrc,\n                const uint8* src,\n                const uint8* srctextlimit,\n                const char* url_hint,\n                const char* http_charset_hint,\n                const char* meta_charset_hint,\n                const int encoding_hint,\n                const Language language_hint,\n                const CompactEncDet::TextCorpusType corpus_type,\n                bool ignore_7bit_mail_encodings,\n                DetectEncodingState* destatep) {\n  bool enc_is_reliable = destatep->reliable;\n  Encoding new_enc = enc;\n  Encoding second_best_enc =\n    kMapToEncoding[destatep->second_top_rankedencoding];\n\n  if (FLAGS_counts) {++rescan_used;}\n\n  int scanned_bytes = src - isrc;\n  int unscanned_bytes = srctextlimit - src;\n  int text_length = srctextlimit - isrc;\n  bool empty_rescan = true;\n\n  // See if enough bytes left to bother doing rescan\n  if (kMinRescanLength < unscanned_bytes) {\n    const char* text = reinterpret_cast<const char*>(isrc);\n\n    Encoding one_hint = destatep->http_hint;\n    if ((one_hint == UNKNOWN_ENCODING) &&\n        (destatep->meta_hint != UNKNOWN_ENCODING)) {\n      one_hint = destatep->meta_hint;\n    }\n    if ((one_hint == UNKNOWN_ENCODING) &&\n        (destatep->bom_hint != UNKNOWN_ENCODING)) {\n      one_hint = destatep->bom_hint;\n    }\n\n    // Go to an even offset to keep UTF-16 in synch\n    int middle_offset = (scanned_bytes + (unscanned_bytes / 2)) & ~1;\n    CHECK(middle_offset <= text_length);\n\n    // Look back a bit for a low byte to synchronize, else hope for the best.\n    const uint8* srcbacklimit = isrc + middle_offset - kMaxScanBack;\n    if (srcbacklimit < src) {\n      srcbacklimit = src;\n    }\n    const uint8* ss = isrc + middle_offset - 1;\n    while (srcbacklimit <= ss) {\n      if ((*ss & 0x80) == 0) {break;}\n      --ss;\n    }\n    // Leave middle offset unchanged unless we found a low byte\n    if (srcbacklimit <= ss) {\n      // Align to low byte or high byte just after it, whichever is even\n      middle_offset = (ss - isrc + 1) & ~1;     // Even to keep UTF-16 in sync\n    }\n    CHECK(middle_offset <= text_length);\n\n    if (destatep->debug_data != NULL) {\n      SetDetailsEncLabel(destatep, \">> Rescan\");\n      // Print the current chart before recursive call\n      DumpDetail(destatep);\n\n      char buff[32];\n      snprintf(buff, sizeof(buff), \">> Rescan[%d..%d]\",\n               middle_offset, text_length);\n      PsRecurse(buff);\n    }\n\n    int mid_bytes_consumed;\n    bool mid_is_reliable;\n    Encoding mid_second_best_enc;\n    CEDInternalFlags newflags = static_cast<CEDInternalFlags>(\n      kCEDRescanning + kCEDForceTags);\n    // Recursive call for rescan of half of remaining\n    Encoding mid_enc = InternalDetectEncoding(\n                             newflags,\n                             text + middle_offset,\n                             text_length - middle_offset,\n                             url_hint,\n                             http_charset_hint,\n                             meta_charset_hint,\n                             encoding_hint,\n                             language_hint,   // User interface lang\n                             corpus_type,\n                             ignore_7bit_mail_encodings,\n                             &mid_bytes_consumed,\n                             &mid_is_reliable,\n                             &mid_second_best_enc);\n    destatep->reliable = mid_is_reliable;\n\n    empty_rescan = (mid_enc == ASCII_7BIT);\n\n    // Not the right decision if, e.g. enc=Greek, mid=ASCII7, one=KSC\n    // hence the !empty_rescan term\n    if (!empty_rescan && CompatibleEnc(one_hint, mid_enc)) {\n      // Encoding we just found is compatible with the\n      // single hint (if any); return superset\n      new_enc = SupersetEnc(one_hint, mid_enc);\n    }\n\n    // If original and mid are compatible, and both reliable,\n    // return new_enc = SupersetEnc(enc, mid_enc)\n    //\n    // This avoids too much weight on a bogus hint causing a RobustScan\n    // that gets the wrong answer\n    if (!empty_rescan && mid_is_reliable && enc_is_reliable &&\n        CompatibleEnc(enc, mid_enc)) {\n      new_enc = SupersetEnc(enc, mid_enc);\n      return new_enc;\n    }\n\n    // if mid unreliable, robustscan\n    // if mid empty, robustscan\n    // if original and mid not compatible, robustscan\n    // if mid and one_hint not compatible, robustscan\n\n    // If we found conflicting data, drop back and do a robust scan of a big\n    // chunk of the input over a set of candidate encodings\n    //\n    if (!mid_is_reliable ||\n        empty_rescan ||\n        !CompatibleEnc(enc, mid_enc) ||\n        !CompatibleEnc(one_hint, mid_enc)) {\n      int robust_renc_list_len;         // Number of active encodings\n      int robust_renc_list[NUM_RANKEDENCODING];   // List of ranked encodings\n      int robust_renc_probs[NUM_RANKEDENCODING];  // List of matching probs\n\n      robust_renc_list_len = 0;\n      AddToSet(enc, &robust_renc_list_len, robust_renc_list);\n      AddToSet(second_best_enc, &robust_renc_list_len, robust_renc_list);\n      AddToSet(mid_enc, &robust_renc_list_len, robust_renc_list);\n      AddToSet(mid_second_best_enc, &robust_renc_list_len, robust_renc_list);\n      if (destatep->http_hint != UNKNOWN_ENCODING) {\n        AddToSet(destatep->http_hint, &robust_renc_list_len, robust_renc_list);\n      }\n      if (destatep->meta_hint != UNKNOWN_ENCODING) {\n        AddToSet(destatep->meta_hint, &robust_renc_list_len, robust_renc_list);\n      }\n      if (destatep->bom_hint != UNKNOWN_ENCODING) {\n        AddToSet(destatep->bom_hint, &robust_renc_list_len, robust_renc_list);\n      }\n      if (destatep->tld_hint != UNKNOWN_ENCODING) {\n        AddToSet(destatep->tld_hint, &robust_renc_list_len, robust_renc_list);\n      }\n\n      // Separate simple scan\n      // =====================\n      if (destatep->debug_data != NULL) {\n        SetDetailsEncLabel(destatep, \">> RobustScan\");\n        // Print the current chart before recursive call\n        DumpDetail(destatep);\n\n        char buff[32];\n        snprintf(buff, sizeof(buff), \">> RobustScan[0..%d]\", text_length);\n        PsRecurse(buff);\n      }\n\n      int bigram_count = RobustScan(text, text_length,\n                 robust_renc_list_len, robust_renc_list, robust_renc_probs);\n\n      // Default to new_enc and update if something better was found\n      int best_prob = -1;\n      // TEMP print\n      for (int i = 0; i < robust_renc_list_len; ++i) {\n        if (best_prob < robust_renc_probs[i]) {\n          best_prob = robust_renc_probs[i];\n          new_enc = kMapToEncoding[robust_renc_list[i]];\n        }\n      }\n\n      if (destatep->debug_data != NULL) {\n        char buff[32];\n        snprintf(buff, sizeof(buff), \"=Robust[%d] %s\",\n                 bigram_count, MyEncodingName(new_enc));\n        SetDetailsEncProb(destatep,\n                          0,\n                          CompactEncDet::BackmapEncodingToRankedEncoding(new_enc),\n                          buff);\n      }\n    }\n  }     // End if enough bytes\n\n  return new_enc;\n}\n\n// With no hints at all, and perhaps on rescan, we relax our pickiness\n// and go ahead and accept the top multibyte encodings, even though\n// strictly their web pages should have declared an explicit encoding to\n// avoid the HTML standard's default ISO-8859-1.\nbool NoHintsCloseEnoughCompatible(Encoding top_enc) {\n  // First test accepts degenerate cases plus UTF8 and UTF8UTF8\n  if (CompatibleEnc(UTF8, top_enc)) {return true;}\n\n  // The rest look for exact match of base encoding\n  Encoding base_enc = kMapEncToBaseEncoding[top_enc];\n  if (base_enc == JAPANESE_EUC_JP) {return true;}\n  if (base_enc == JAPANESE_SHIFT_JIS) {return true;}\n  if (base_enc == CHINESE_BIG5) {return true;}\n  if (base_enc == CHINESE_GB) {return true;}\n  if (base_enc == KOREAN_EUC_KR) {return true;}\n  return false;\n}\n\n\n\n// Scan raw bytes and detect most likely encoding\n// Design goals:\n//   Skip over big initial stretches of seven-bit ASCII bytes very quickly\n//   Thread safe\n//   Works equally well on\n//    50-byte queries,\n//    5000-byte email and\n//    50000-byte web pages\n// Length 0 input returns ISO_8859_1 (ASCII) encoding\n// Setting ignore_7bit_mail_encodings effectively turns off detection of\n//  UTF-7, HZ, and ISO-2022-xx\nEncoding InternalDetectEncoding(\n    CEDInternalFlags flags, const char* text, int text_length,\n    const char* url_hint, const char* http_charset_hint,\n    const char* meta_charset_hint, const int encoding_hint,\n    const Language language_hint,  // User interface lang\n    const CompactEncDet::TextCorpusType corpus_type,\n    bool ignore_7bit_mail_encodings, int* bytes_consumed, bool* is_reliable,\n    Encoding* second_best_enc) {\n  *bytes_consumed = 0;\n  *is_reliable = false;\n  *second_best_enc = ASCII_7BIT;\n\n  if (text_length == 0) {\n    // Follow the spec. Text might be NULL.\n    *is_reliable = true;\n    return ISO_8859_1;\n  }\n\n  // For very short (20-50 byte) input strings that are highly likely to be\n  // all printable ASCII, our startup overhead might dominate. We have to do the\n  // full detection if the ISO-2022-xx, HZ, or UTF-7 encodings are possible.\n  // Otherwise, we can do a quick scan for printable ASCII.\n  if ((text_length <= 500) && ignore_7bit_mail_encodings &&\n      QuickPrintableAsciiScan(text, text_length)) {\n    *is_reliable = true;\n    return ASCII_7BIT;\n  }\n\n  // Go for the full boat detection\n  DetectEncodingState destate;\n  InitDetectEncodingState(&destate);\n\n  std::unique_ptr<DetailEntry[]> scoped_debug_data;\n  if (FLAGS_enc_detect_detail) {\n    // Allocate max 10 details per bigram\n    scoped_debug_data.reset(new DetailEntry[kMaxPairs * 10]);\n    destate.debug_data = scoped_debug_data.get();\n    // NOTE: destate and scoped_debug_data have exactly the same scope\n    // All other FLAGS_enc_detect_detail tests use destate.debug_data != NULL\n  }\n\n  // Get text length limits\n  // Typically, we scan the first 16KB looking for all encodings, then\n  // scan the rest (up to 256KB) a bit faster by no longer looking for\n  // interesting bytes below 0x80. This allows us to skip over runs of\n  // 7-bit-ASCII much more quickly.\n  int slow_len = minint(text_length, (FLAGS_enc_detect_slow_max_kb << 10));\n  int fast_len = minint(text_length, (FLAGS_enc_detect_fast_max_kb << 10));\n\n  // Initialize pointers.\n  // In general, we do not look at last 3 bytes of input in the fast scan\n  // We do, however want to look at the last byte or so in the slow scan,\n  // especilly in the case of a very short text whose only interesting\n  // information is a 3-byte UTF-8 character in the last three bytes.\n  // If necessary, we fake a last bigram with 0x20 space as a pad byte.\n  const uint8* isrc = reinterpret_cast<const uint8*>(text);\n  const uint8* src = isrc;\n  const uint8* srctextlimit = isrc + text_length;\n  const uint8* srclimitslow2 = isrc + slow_len - 1;\n  const uint8* srclimitfast2 = isrc + fast_len - 1;\n  const uint8* srclimitfast4 = isrc + fast_len - 3;\n  if (srclimitslow2 > srclimitfast2) {\n    srclimitslow2 = srclimitfast2;\n  }\n  destate.initial_src = isrc;\n  destate.limit_src = srclimitfast2 + 1;      // May include last byte\n  destate.prior_src = isrc;\n  destate.last_pair = isrc - 2;\n\n  const char* scan_table = kTestPrintableAsciiTildePlus;\n  if (ignore_7bit_mail_encodings) {\n    // Caller wants to ignore UTF-7, HZ, ISO-2022-xx\n    // Don't stop on + (for UTF-7), nor on ~ (for HZ)\n    scan_table = kTestPrintableAscii;\n  }\n  int exit_reason = 0;\n\n  if (destate.debug_data != NULL) {\n    BeginDetail(&destate);\n    // Take any incoming watch encoding name and backmap to the corresponding\n    // ranked enum value\n    watch1_rankedenc = LookupWatchEnc(FLAGS_enc_detect_watch1);\n    if (watch1_rankedenc >= 0) {\n      fprintf(stderr, \"/track-me %d def\\n\", watch1_rankedenc);\n    }\n\n    watch2_rankedenc = LookupWatchEnc(FLAGS_enc_detect_watch2);\n    if (watch2_rankedenc >= 0) {\n      fprintf(stderr, \"/track-me2 %d def\\n\", watch2_rankedenc);\n    }\n\n    fprintf(stderr, \"%% kDerateHintsBelow = %d\\n\", kDerateHintsBelow);\n  }\n  if (FLAGS_enc_detect_source) {\n    PsSourceInit(kPsSourceWidth);\n    PsSource(src, isrc, srctextlimit);\n    PsMark(src, 4, isrc, 0);\n  }\n\n  // Apply hints, if any, to probabilities\n  // NOTE: Encoding probabilites are all zero at this point\n  ApplyHints(url_hint,\n             http_charset_hint,\n             meta_charset_hint,\n             encoding_hint,\n             language_hint,\n             corpus_type,\n             &destate);\n\n  // NOTE: probabilities up to this point are subject to derating for\n  // small numbers of bigrams.\n  // Probability changes after this point are not derated.\n\n  // Do first 4 bytes to pick off strong markers\n  InitialBytesBoost(isrc, text_length, &destate);\n\n  bool ignored_some_tag_text = false;\n  int tag_text_bigram_count = 0;\n\n  // Slower loop, approx 500 MB/sec (2.8 GHz P4)\n  // ASSERT(srclimitslow2 <= srclimitfast2);\n  //====================================\n DoMoreSlowLoop:\n  while (src < srclimitslow2) {\n    // Skip to next interesting byte (this is the slower part)\n    while (src < srclimitslow2) {\n      uint8 uc = *src++;\n      if (scan_table[uc] != 0) {exit_reason = scan_table[uc]; src--; break;}\n    }\n\n    if (src < srclimitslow2) {\n      if (FLAGS_enc_detect_source) {\n        PsSource(src, isrc, srctextlimit);    // don't mark yet\n      }\n\n      int weightshift = 0;\n      // In the first 16KB, derate new text run inside <title>...</title> and\n      // inside <!-- ... -->\n      if (////((destate.last_pair + 6) <= src) &&             // if beyond last one\n          ////(tag_text_bigram_count < kMaxBigramsTagTitleText) &&\n          (corpus_type == CompactEncDet::WEB_CORPUS) &&   // and web page\n          !CEDFlagForceTags(flags)) {                     // and OK to skip\n        ////if (TextInsideTag(destate.last_pair + 2, src, srclimitslow2)) {\n        if (TextInsideTag(isrc, src, srclimitslow2)) {\n          if (tag_text_bigram_count >= kMaxBigramsTagTitleText) {\n            ignored_some_tag_text = true;\n            src = SkipToTagEnd(src, srclimitslow2);\n            continue;\n          } else {\n            weightshift = kWeightshiftForTagTitleText;\n            ++tag_text_bigram_count;\n          }\n        }\n      }\n      if (FLAGS_enc_detect_source) {\n        PsMark(src, 2, isrc, weightshift);\n      }\n      // Saves byte pair and offset\n      bool pruned = IncrementAndBoostPrune(src, srctextlimit - src,\n                                           &destate, weightshift, exit_reason);\n      // Advance; if inside tag, advance to end of tag\n      if (weightshift == 0) {\n        src += exit_reason;               // 1 Ascii, 2 other\n      } else {\n        src += exit_reason;               // 1 Ascii, 2 other\n        //// src = SkipToTagEnd(src, srclimitslow2);\n      }\n\n      if (pruned) {\n        // Scoring and active encodings have been updated\n        if (destate.done) {break;}\n        // Check if all the reasons for the slow loop have been pruned\n        // If so, go to fast loop\n        if (!SevenBitActive(&destate)) {break;}\n      }\n    }\n  }\n  //====================================\n\n  // We reached the end of a slow scan, possibly because no more SevenBitActive,\n  // or possibly are at end of source.\n  // If we are exactly at the end of the source, make sure we look at the very\n  // last byte.\n  bool very_last_byte_incremented = false;\n  if (src == (srctextlimit - 1)) {\n    exit_reason = scan_table[*src];\n    if (exit_reason != 0) {\n      // The very last byte is an interesting byte\n      // Saves byte pair and offset\n      //printf(\"Interesting very last slow byte = 0x%02x\\n\", *src);\n      IncrementAndBoostPrune(src, srctextlimit - src, &destate, 0, exit_reason);\n      very_last_byte_incremented = true;\n    }\n  }\n\n  if (FLAGS_enc_detect_source) {\n    PsSource(src, isrc, srctextlimit);\n    PsMark(src, 2, isrc, 0);\n  }\n  // Force a pruning based on whatever we have\n  // Delete the seven-bit encodings if there is no evidence of them so far\n  BoostPrune(src, &destate, PRUNE_SLOWEND);\n\n  if (!destate.done) {\n    // If not clear yet on 7-bit-encodings and more bytes, do more slow\n    if (SevenBitActive(&destate) && (src < srclimitfast2)) {\n      // Increment limit by another xxxK\n      slow_len += (FLAGS_enc_detect_slow_max_kb << 10);\n      srclimitslow2 = isrc + slow_len - 1;\n      if (srclimitslow2 > srclimitfast2) {\n        srclimitslow2 = srclimitfast2;\n      }\n      if (!UTF7OrHzActive(&destate)) {\n        // We can switch to table that does not stop on + ~\n        scan_table = kTestPrintableAscii;\n      }\n      goto DoMoreSlowLoop;\n    }\n\n\n    exit_reason = 2;\n    // Faster loop, no 7-bit-encodings possible, approx 3000 GB/sec\n    //====================================\n    while (src < srclimitfast2) {\n      // Skip to next interesting byte (this is the faster part)\n      while (src < srclimitfast4) {\n        if (((src[0] | src[1] | src[2] | src[3]) & 0x80) != 0) break;\n        src += 4;\n      }\n\n      while (src < srclimitfast2) {\n        if ((src[0] & 0x80) != 0) break;\n        src++;\n      }\n\n      if (src < srclimitfast2) {\n        if (FLAGS_enc_detect_source) {\n          PsSource(src, isrc, srctextlimit);\n          PsMark(src, 2, isrc, 0);\n        }\n        // saves byte pair and offset\n        bool pruned = IncrementAndBoostPrune(src, srctextlimit - src,\n                                             &destate, 0, exit_reason);\n        src += exit_reason;               // 1 Ascii, 2 other\n        if (pruned) {\n          // Scoring and active encodings have been updated\n          if (destate.done) {break;}\n        }\n      }\n    }\n    //====================================\n    // We reached the end of fast scan\n\n    // If we are exactly at the end of the source, make sure we look at the very\n    // last byte.\n    if (src == (srctextlimit - 1) && !very_last_byte_incremented) {\n      exit_reason = scan_table[*src];\n      if (exit_reason != 0) {\n        // The very last byte is an interesting byte\n        // Saves byte pair and offset\n        //printf(\"Interesting very last fast byte = 0x%02x\\n\", *src);\n        IncrementAndBoostPrune(src, srctextlimit - src, &destate, 0, exit_reason);\n        very_last_byte_incremented = true;\n      }\n    }\n\n  }     // End if !done\n\n  if (FLAGS_enc_detect_source) {\n    PsSource(src, isrc, srctextlimit);\n    PsMark(src, 2, isrc, 0);\n  }\n  // Force a pruning based on whatever we have\n  BoostPrune(src, &destate, PRUNE_FINAL);\n\n  if (FLAGS_enc_detect_summary) {\n    DumpSummary(&destate, AsciiPair, 32);\n    DumpSummary(&destate, OtherPair, 32);\n  }\n  if (FLAGS_enc_detect_source) {\n    PsSourceFinish();\n  }\n  if (destate.debug_data != NULL) {\n    //// DumpDetail(&destate);\n  }\n\n\n  if (ignored_some_tag_text &&\n      (kMapToEncoding[destate.top_rankedencoding] == ASCII_7BIT)) {\n    // There were some interesting bytes, but only in tag text.\n    // Recursive call to reprocess looking at the tags this time.\n\n    if (destate.debug_data != NULL) {\n      SetDetailsEncLabel(&destate, \">> Recurse/tags\");\n      // Print the current chart before recursive call\n      DumpDetail(&destate);\n\n      char buff[32];\n      snprintf(buff, sizeof(buff), \">> Recurse for tags\");\n      PsRecurse(buff);\n    }\n\n    // Recursive call for high bytes in tags [no longer used, 1/16 tag score]\n    Encoding enc2 = InternalDetectEncoding(\n                             kCEDForceTags,  // force\n                             text,\n                             text_length,\n                             url_hint,\n                             http_charset_hint,\n                             meta_charset_hint,\n                             encoding_hint,\n                             language_hint,\n                             corpus_type,\n                             ignore_7bit_mail_encodings,\n                             bytes_consumed,\n                             is_reliable,\n                             second_best_enc);\n\n    if (destate.debug_data != NULL) {\n      // Show winning encoding and dump PostScript\n      char buff[32];\n      snprintf(buff, sizeof(buff), \"=2 %s\", MyEncodingName(enc2));\n      SetDetailsEncProb(&destate,\n                        0,\n                        CompactEncDet::BackmapEncodingToRankedEncoding(enc2),\n                        buff);\n      DumpDetail(&destate);\n    }\n\n    return enc2;\n  }\n\n\n  // If the detected encoding does not match default/hints, or if the hints\n  // conflict with each other, mark as unreliable. This can be used to trigger\n  // further scoring.\n  // Three buckets of input documents;\n  // ~19% of the web no hints, and top == 7bit, Latin1, or CP1252\n  // ~79% of the web one or more hints, all same encoding X and top == X\n  // ~ 2% of the web one or more hints that are inconsistent\n\n  Encoding top_enc = kMapToEncoding[destate.top_rankedencoding];\n  Encoding one_hint = destate.http_hint;\n  if ((one_hint == UNKNOWN_ENCODING) &&\n      (destate.meta_hint != UNKNOWN_ENCODING)) {\n    one_hint = destate.meta_hint;\n  }\n  if ((one_hint == UNKNOWN_ENCODING) &&\n      (destate.bom_hint != UNKNOWN_ENCODING)) {\n    one_hint = destate.bom_hint;\n  }\n\n  bool found_compatible_encoding = true;\n  if (one_hint == UNKNOWN_ENCODING) {\n    // [~14% of the web] No hints, and top == 7bit, Latin1, or CP1252\n    if (!CompatibleEnc(ISO_8859_1, top_enc)) {\n      found_compatible_encoding = false;\n      // If there is nothing but a TLD hint and its top encoding matches, OK\n      if ((destate.tld_hint != UNKNOWN_ENCODING) &&\n          CompatibleEnc(destate.tld_hint, top_enc)) {\n        found_compatible_encoding = true;\n      }\n    }\n  } else if (CompatibleEnc(one_hint, destate.http_hint) &&\n             CompatibleEnc(one_hint, destate.meta_hint) &&\n             CompatibleEnc(one_hint, destate.bom_hint)) {\n    // [~83% of the web] One or more hints, all same encoding X and top == X\n    if (!CompatibleEnc(one_hint, top_enc)) {\n      // [~ 2% of the web] Oops, not the declared encoding\n      found_compatible_encoding = false;\n    }\n  } else {\n    // [~ 3% of the web] Two or more hints that are inconsistent\n    one_hint = UNKNOWN_ENCODING;\n    found_compatible_encoding = false;\n  }\n\n  // If we turned Latin1 into Latin2 or 7 via trigrams, don't fail it here\n  if (destate.do_latin_trigrams) {\n    if (CompatibleEnc(kMapToEncoding[F_Latin1], top_enc) ||\n        CompatibleEnc(kMapToEncoding[F_Latin2], top_enc) ||\n        CompatibleEnc(kMapToEncoding[F_CP1250], top_enc) ||\n        CompatibleEnc(kMapToEncoding[F_ISO_8859_13], top_enc)) {\n      found_compatible_encoding = true;\n      destate.reliable = true;\n    }\n  }\n\n  // If top encoding is not compatible with the hints, but it is reliably\n  // UTF-8, accept it anyway.\n  // This will perform badly with mixed UTF-8 prefix plus another encoding in\n  // the body if done too early, so we want to be rescanning.\n  if (!found_compatible_encoding &&\n      destate.reliable &&\n      NoHintsCloseEnoughCompatible(top_enc) &&\n      (destate.next_interesting_pair[OtherPair] >= kStrongPairs) &&\n      CEDFlagRescanning(flags)) {\n    found_compatible_encoding = true;\n  }\n\n  // Hold off on this so Rescan() can see if the original encoding was reliable\n  //if (!found_compatible_encoding) {\n  //  destate.reliable = false;\n  //}\n\n  // If unreliable, try rescoring to separate some encodings\n  if (!destate.reliable || !found_compatible_encoding) {\n    top_enc = Rescore(top_enc, isrc, srctextlimit, &destate);\n  }\n\n  *second_best_enc = kMapToEncoding[destate.second_top_rankedencoding];\n\n  // If unreliable, and not already rescanning,\n  // rescan middle of document to see if we can get a better\n  // answer. Rescan is only worthwhile if there are ~200 bytes or more left,\n  // since the detector takes as much as 96 bytes of bigrams to decide.\n  //\n  // CANNOT retry ISO-2022-xx HZ etc. because no declaration escape at the front\n  // or we may land in the middle of some partial state. Skip them all.\n  //\n  if ((!destate.reliable || !found_compatible_encoding) &&\n      !CEDFlagRescanning(flags) &&\n      !SevenBitEncoding(top_enc)) {\n    top_enc = Rescan(top_enc,\n                     isrc,\n                     src,\n                     srctextlimit,\n                     url_hint,\n                     http_charset_hint,\n                     meta_charset_hint,\n                     encoding_hint,\n                     language_hint,\n                     corpus_type,\n                     ignore_7bit_mail_encodings,\n                     &destate);\n  } else {\n    if (!found_compatible_encoding) {\n      destate.reliable = false;\n    }\n  }\n\n  if (destate.debug_data != NULL) {\n    // Dump PostScript\n    DumpDetail(&destate);\n  }\n\n  *bytes_consumed = src - isrc + 1;       // We looked 1 byte beyond src\n  *is_reliable = destate.reliable;\n  return top_enc;\n}\n\nEncoding CompactEncDet::DetectEncoding(\n    const char* text, int text_length, const char* url_hint,\n    const char* http_charset_hint, const char* meta_charset_hint,\n    const int encoding_hint,\n    const Language language_hint,  // User interface lang\n    const TextCorpusType corpus_type, bool ignore_7bit_mail_encodings,\n    int* bytes_consumed, bool* is_reliable) {\n  if (FLAGS_ced_echo_input) {\n    string temp(text, text_length);\n    fprintf(stderr, \"CompactEncDet::DetectEncoding()\\n%s\\n\\n\", temp.c_str());\n  }\n\n  if (FLAGS_counts) {\n    encdet_used = 0;\n    rescore_used = 0;\n    rescan_used = 0;\n    robust_used = 0;\n    looking_used = 0;\n    doing_used = 0;\n    ++encdet_used;\n  }\n  if (FLAGS_dirtsimple) {\n    // Just count first 64KB bigram encoding probabilities for each encoding\n    int robust_renc_list_len;         // Number of active encodings\n    int robust_renc_list[NUM_RANKEDENCODING];   // List of ranked encodings\n    int robust_renc_probs[NUM_RANKEDENCODING];  // List of matching probs\n\n    for (int i = 0; i < NUM_RANKEDENCODING; ++i) {\n      robust_renc_list[i] = i;\n    }\n    robust_renc_list_len = NUM_RANKEDENCODING;\n\n    RobustScan(text, text_length,\n                 robust_renc_list_len, robust_renc_list, robust_renc_probs);\n\n    // Pick off best encoding\n    int best_prob = -1;\n    Encoding enc = UNKNOWN_ENCODING;\n    for (int i = 0; i < robust_renc_list_len; ++i) {\n      if (best_prob < robust_renc_probs[i]) {\n        best_prob = robust_renc_probs[i];\n        enc = kMapToEncoding[robust_renc_list[i]];\n      }\n    }\n\n    *bytes_consumed = minint(text_length, (kMaxKBToRobustScan << 10));\n    *is_reliable = true;\n    if (FLAGS_counts) {\n      printf(\"CEDcounts \");\n      while (encdet_used--) {printf(\"encdet \");}\n      while (rescore_used--) {printf(\"rescore \");}\n      while (rescan_used--) {printf(\"rescan \");}\n      while (robust_used--) {printf(\"robust \");}\n      while (looking_used--) {printf(\"looking \");}\n      while (doing_used--) {printf(\"doing \");}\n      printf(\"\\n\");\n    }\n\n    return enc;\n  }\n\n  Encoding second_best_enc;\n  Encoding enc = InternalDetectEncoding(kCEDNone,\n                           text,\n                           text_length,\n                           url_hint,\n                           http_charset_hint,\n                           meta_charset_hint,\n                           encoding_hint,\n                           language_hint,   // User interface lang\n                           corpus_type,\n                           ignore_7bit_mail_encodings,\n                           bytes_consumed,\n                           is_reliable,\n                           &second_best_enc);\n  if (FLAGS_counts) {\n    printf(\"CEDcounts \");\n    while (encdet_used--) {printf(\"encdet \");}\n    while (rescore_used--) {printf(\"rescore \");}\n    while (rescan_used--) {printf(\"rescan \");}\n    while (robust_used--) {printf(\"robust \");}\n    while (looking_used--) {printf(\"looking \");}\n    while (doing_used--) {printf(\"doing \");}\n    printf(\"\\n\");\n  }\n\n#if defined(HTML5_MODE)\n  // Map all the Shift-JIS variants to Shift-JIS when used in Japanese locale.\n  if (language_hint == JAPANESE && IsShiftJisOrVariant(enc)) {\n    enc = JAPANESE_SHIFT_JIS;\n  }\n\n  // 7-bit encodings (except ISO-2022-JP), and some obscure encodings not\n  // supported in WHATWG encoding standard are marked as ASCII to keep the raw\n  // bytes intact.\n  switch (enc) {\n    case ISO_2022_KR:\n    case ISO_2022_CN:\n    case HZ_GB_2312:\n    case UTF7:\n    case UTF16LE:\n    case UTF16BE:\n\n    case CHINESE_EUC_DEC:\n    case CHINESE_CNS:\n    case CHINESE_BIG5_CP950:\n    case JAPANESE_CP932:\n    case MSFT_CP874:\n    case TSCII:\n    case TAMIL_MONO:\n    case TAMIL_BI:\n    case JAGRAN:\n    case BHASKAR:\n    case HTCHANAKYA:\n    case BINARYENC:\n    case UTF8UTF8:\n    case TAM_ELANGO:\n    case TAM_LTTMBARANI:\n    case TAM_SHREE:\n    case TAM_TBOOMIS:\n    case TAM_TMNEWS:\n    case TAM_WEBTAMIL:\n    case KDDI_SHIFT_JIS:\n    case DOCOMO_SHIFT_JIS:\n    case SOFTBANK_SHIFT_JIS:\n    case KDDI_ISO_2022_JP:\n    case SOFTBANK_ISO_2022_JP:\n      enc = ASCII_7BIT;\n      break;\n    default:\n      break;\n  }\n#endif\n\n  return enc;\n}\n\n\n// Return top encoding hint for given string\nEncoding CompactEncDet::TopEncodingOfLangHint(const char* name) {\n  string normalized_lang = MakeChar8(string(name));\n  int n = HintBinaryLookup8(kLangHintProbs, kLangHintProbsSize,\n                           normalized_lang.c_str());\n  if (n < 0) {return UNKNOWN_ENCODING;}\n\n  // Charset is eight bytes, probability table is eight bytes\n  int toprankenc =\n    TopCompressedProb(&kLangHintProbs[n].key_prob[kMaxLangKey],\n                      kMaxLangVector);\n  return kMapToEncoding[toprankenc];\n}\n\n// Return top encoding hint for given string\nEncoding CompactEncDet::TopEncodingOfTLDHint(const char* name) {\n  string normalized_tld = MakeChar4(string(name));\n  int n = HintBinaryLookup4(kTLDHintProbs, kTLDHintProbsSize,\n                           normalized_tld.c_str());\n  if (n < 0) {return UNKNOWN_ENCODING;}\n\n  // TLD is four bytes, probability table is 12 bytes\n  int toprankenc =\n    TopCompressedProb(&kTLDHintProbs[n].key_prob[kMaxTldKey],\n                      kMaxTldVector);\n  return kMapToEncoding[toprankenc];\n}\n\n// Return top encoding hint for given string\nEncoding CompactEncDet::TopEncodingOfCharsetHint(const char* name) {\n  string normalized_charset = MakeChar44(string(name));\n  int n = HintBinaryLookup8(kCharsetHintProbs, kCharsetHintProbsSize,\n                           normalized_charset.c_str());\n  if (n < 0) {return UNKNOWN_ENCODING;}\n\n  // Charset is eight bytes, probability table is eight bytes\n  int toprankenc =\n    TopCompressedProb(&kCharsetHintProbs[n].key_prob[kMaxCharsetKey],\n                      kMaxCharsetVector);\n  return kMapToEncoding[toprankenc];\n}\n\nconst char* CompactEncDet::Version(void) {\n  return kVersion;\n}\n"
  },
  {
    "path": "third_party/ced/compact_enc_det/compact_enc_det.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef COMPACT_ENC_DET_COMPACT_ENC_DET_H_\n#define COMPACT_ENC_DET_COMPACT_ENC_DET_H_\n\n#include \"util/encodings/encodings.h\"  // for Encoding\n#include \"util/languages/languages.h\"  // for Language\n\n#include <string.h>\n\nnamespace CompactEncDet {\n  // We may want different statistics, depending on whether the text being\n  // identfied is from the web, from email, etc.  This is currently ignored,\n  // except WEB_CORPUS enables ignoring chars inside tags.\n  enum TextCorpusType {\n    WEB_CORPUS,\n    XML_CORPUS,\n    QUERY_CORPUS,       // Use this for vanilla plaintext\n    EMAIL_CORPUS,\n    NUM_CORPA,          // always last\n  };\n\n  // Scan raw bytes and detect most likely encoding\n  // Design goals:\n  //   Skip over big initial stretches of seven-bit ASCII bytes very quickly\n  //   Thread safe\n  //   Works equally well on\n  //    50-byte queries,\n  //    5000-byte email and\n  //    50000-byte web pages\n  // Length 0 input returns ASCII (aka ISO-8859-1 or Latin1)\n  //\n  // Inputs: text and text_length\n  //  web page's url (preferred) or just\n  //    top-level domain name (e.g. \"com\") or NULL as a hint\n  //  web page's HTTPheader charset= string (e.g. \"Latin1\") or NULL as a hint\n  //  web page's <meta> tag charset= string (e.g. \"utf-8\") or NULL as a hint\n  //  an Encoding or UNKNOWN_ENCODING as a hint\n  //  a Language or UNKNOWN_LANGUAGE as a hint\n  //  corpus type from the list above. Currently ignored; may select\n  //    different probability tables in the future\n  //  ignore_7bit if true says to NOT return the pure seven-bit encodings\n  //    ISO-2022-JP (aka JIS), ISO-2022-CN, ISO-2022-KR, HZ, and UTF-7.\n  //    This may save a little scoring time on pure printable ASCII input text\n  // Outputs: bytes_consumed says how much of text_length was actually examined\n  //  is_reliable set true if the returned encoding is at least 2**10 time more\n  //  probable then the second-best encoding\n  // Return value: the most likely encoding for the input text\n  //\n  // Setting ignore_7bit_mail_encodings effectively turns off detection of\n  // UTF-7, HZ, and ISO-2022-xx. It is recommended that this flag be true\n  // when corpus_type is QUERY_CORPUS.\n  Encoding DetectEncoding(\n      const char* text, int text_length, const char* url_hint,\n      const char* http_charset_hint, const char* meta_charset_hint,\n      const int encoding_hint,\n      const Language language_hint,  // User interface lang\n      const TextCorpusType corpus_type, bool ignore_7bit_mail_encodings,\n      int* bytes_consumed, bool* is_reliable);\n\n  // Support functions for unit test program\n  int BackmapEncodingToRankedEncoding(Encoding enc);\n  Encoding TopEncodingOfLangHint(const char* name);\n  Encoding TopEncodingOfTLDHint(const char* name);\n  Encoding TopEncodingOfCharsetHint(const char* name);\n  const char* Version(void);\n}      // End namespace CompactEncDet\n\n#endif  // COMPACT_ENC_DET_COMPACT_ENC_DET_H_\n"
  },
  {
    "path": "third_party/ced/compact_enc_det/compact_enc_det_fuzz_test.cc",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <memory>\n\n#include \"compact_enc_det/compact_enc_det.h\"\n#include \"util/encodings/encodings.h\"\n#include \"util/languages/languages.h\"\n#include \"util/port.h\"\n#include \"gtest/gtest.h\"\n\nnamespace {\n\nclass CompactEncDetFuzzTest : public testing::Test {};\n\nTEST_F(CompactEncDetFuzzTest, TestRandom) {\n  for (size_t i = 0; i < 16384; ++i) {\n    unsigned int seed = i;\n    srand(seed);\n    size_t length = static_cast<size_t>(rand()) % 1024;\n    std::unique_ptr<char[]> text(new char[length]);\n\n    for (size_t j = 0; j < length; ++j) text[j] = rand();\n\n    int bytes_consumed;\n    bool is_reliable;\n\n    CompactEncDet::DetectEncoding(text.get(), length, nullptr,  // URL hint\n                                  nullptr,                      // HTTP hint\n                                  nullptr,                      // Meta hint\n                                  UNKNOWN_ENCODING,\n                                  UNKNOWN_LANGUAGE,\n                                  CompactEncDet::WEB_CORPUS,\n                                  false,  // Include 7-bit encodings?\n                                  &bytes_consumed, &is_reliable);\n  }\n}\n\n}  // namespace\n"
  },
  {
    "path": "third_party/ced/compact_enc_det/compact_enc_det_generated_tables.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef COMPACT_ENC_DET_COMPACT_ENC_DET_GENERATED_TABLES_H_\n#define COMPACT_ENC_DET_COMPACT_ENC_DET_GENERATED_TABLES_H_\n\n#include \"compact_enc_det/compact_enc_det.h\"\n#include \"compact_enc_det/compact_enc_det_generated_tables2.h\"\n#include \"util/basictypes.h\"\n#include \"util/encodings/encodings.pb.h\"\n\nenum RankedEncoding {\n  F_ASCII_7_bit,\t\t// [0] encoding 24\n  F_Latin1,\t\t// [1] encoding 0\n  F_UTF8,\t\t// [2] encoding 22\n  F_GB,\t\t// [3] encoding 14\n  F_CP1252,\t\t// [4] encoding 27\n  F_KSC,\t\t// [5] encoding 16\n  F_SJS,\t\t// [6] encoding 11\n  F_EUC_JP,\t\t// [7] encoding 10\n  F_BIG5,\t\t// [8] encoding 13\n  F_Latin2,\t\t// [9] encoding 1\n  F_CP1251,\t\t// [10] encoding 26\n  F_CP1256,\t\t// [11] encoding 35\n  F_CP1250,\t\t// [12] encoding 29\n  F_Latin5,\t\t// [13] encoding 8\n  F_ISO_8859_11,\t\t// [14] encoding 33\n  F_ISO_8859_15,\t\t// [15] encoding 30\n  F_CP1257,\t\t// [16] encoding 32\n  F_CP1255,\t\t// [17] encoding 36\n  F_KOI8R,\t\t// [18] encoding 25\n  F_GBK,\t\t// [19] encoding 45\n  F_Greek,\t\t// [20] encoding 6\n  F_JIS,\t\t// [21] encoding 12\n  F_CP1254,\t\t// [22] encoding 31\n  F_CP1253,\t\t// [23] encoding 41\n  F_CP932,\t\t// [24] encoding 21\n  F_Hebrew,\t\t// [25] encoding 7\n  F_KOI8U,\t\t// [26] encoding 28\n  F_ISO_8859_5,\t\t// [27] encoding 4\n  F_CP874,\t\t// [28] encoding 34\n  F_ISO_8859_13,\t\t// [29] encoding 43\n  F_Latin4,\t\t// [30] encoding 3\n  F_MACINTOSH,\t\t// [31] encoding 53\n  F_GB18030,\t\t// [32] encoding 46\n  F_CP852,\t\t// [33] encoding 39\n  F_Arabic,\t\t// [34] encoding 5\n  F_BIG5_HKSCS,\t\t// [35] encoding 47\n  F_CP866,\t\t// [36] encoding 42\n  F_UTF_16BE,\t\t// [37] encoding 57\n  F_Latin3,\t\t// [38] encoding 2\n  F_UTF_16LE,\t\t// [39] encoding 58\n  F_HZ_GB_2312,\t\t// [40] encoding 62\n  F_CSN_369103,\t\t// [41] encoding 40\n  F_ISO_2022_KR,\t\t// [42] encoding 44\n  F_Latin6,\t\t// [43] encoding 9\n  F_UTF7,\t\t// [44] encoding 54\n  F_ISO_2022_CN,\t\t// [45] encoding 48\n  F_BIG5_CP950,\t\t// [46] encoding 20\n  F_JAGRAN,\t\t// [47] encoding 52\n  F_BHASKAR,\t\t// [48] encoding 55\n  F_HTCHANAKYA,\t\t// [49] encoding 56\n  F_TSCII,\t\t// [50] encoding 49\n  F_TAM,\t\t// [51] encoding 50\n  F_TAB,\t\t// [52] encoding 51\n  F_EUC_CN,\t\t// [53] encoding 15\n  F_EUC,\t\t// [54] encoding 18\n  F_CNS,\t\t// [55] encoding 19\n  F_UTF_32BE,\t\t// [56] encoding 59\n  F_UTF_32LE,\t\t// [57] encoding 60\n  F_X_BINARYENC,\t\t// [58] encoding 61\n  F_X_UTF8UTF8,\t\t// [59] encoding 63\n  F_X_TAM_ELANGO,\t\t// [60] encoding 64\n  F_X_TAM_LTTMBARANI,\t\t// [61] encoding 65\n  F_X_TAM_SHREE,\t\t// [62] encoding 66\n  F_X_TAM_TBOOMIS,\t\t// [63] encoding 67\n  F_X_TAM_TMNEWS,\t\t// [64] encoding 68\n  F_X_TAM_WEBTAMIL,\t\t// [65] encoding 69\n  F_UTF8CP1252,\t\t// [66] encoding 63\n  NUM_RANKEDENCODING\n};\n\nstatic const Encoding kMapToEncoding[NUM_RANKEDENCODING] = {\n  ASCII_7BIT,\t\t// encoding 24\n  ISO_8859_1,\t\t// encoding 0\n  UTF8,\t\t// encoding 22\n  CHINESE_GB,\t\t// encoding 14\n  MSFT_CP1252,\t\t// encoding 27\n  KOREAN_EUC_KR,\t\t// encoding 16\n  JAPANESE_SHIFT_JIS,\t\t// encoding 11\n  JAPANESE_EUC_JP,\t\t// encoding 10\n  CHINESE_BIG5,\t\t// encoding 13\n  ISO_8859_2,\t\t// encoding 1\n  RUSSIAN_CP1251,\t\t// encoding 26\n  MSFT_CP1256,\t\t// encoding 35\n  MSFT_CP1250,\t\t// encoding 29\n  ISO_8859_9,\t\t// encoding 8\n  ISO_8859_11,\t\t// encoding 33\n  ISO_8859_15,\t\t// encoding 30\n  MSFT_CP1257,\t\t// encoding 32\n  MSFT_CP1255,\t\t// encoding 36\n  RUSSIAN_KOI8_R,\t\t// encoding 25\n  GBK,\t\t// encoding 45\n  ISO_8859_7,\t\t// encoding 6\n  JAPANESE_JIS,\t\t// encoding 12\n  MSFT_CP1254,\t\t// encoding 31\n  MSFT_CP1253,\t\t// encoding 41\n  JAPANESE_CP932,\t\t// encoding 21\n  ISO_8859_8,\t\t// encoding 7\n  RUSSIAN_KOI8_RU,\t\t// encoding 28\n  ISO_8859_5,\t\t// encoding 4\n  MSFT_CP874,\t\t// encoding 34\n  ISO_8859_13,\t\t// encoding 43\n  ISO_8859_4,\t\t// encoding 3\n  MACINTOSH_ROMAN,\t\t// encoding 53\n  GB18030,\t\t// encoding 46\n  CZECH_CP852,\t\t// encoding 39\n  ISO_8859_6,\t\t// encoding 5\n  BIG5_HKSCS,\t\t// encoding 47\n  RUSSIAN_CP866,\t\t// encoding 42\n  UTF16BE,\t\t// encoding 57\n  ISO_8859_3,\t\t// encoding 2\n  UTF16LE,\t\t// encoding 58\n  HZ_GB_2312,\t\t// encoding 62\n  CZECH_CSN_369103,\t\t// encoding 40\n  ISO_2022_KR,\t\t// encoding 44\n  ISO_8859_10,\t\t// encoding 9\n  UTF7,\t\t// encoding 54\n  ISO_2022_CN,\t\t// encoding 48\n  CHINESE_BIG5_CP950,\t\t// encoding 20\n  JAGRAN,\t\t// encoding 52\n  BHASKAR,\t\t// encoding 55\n  HTCHANAKYA,\t\t// encoding 56\n  TSCII,\t\t// encoding 49\n  TAMIL_MONO,\t\t// encoding 50\n  TAMIL_BI,\t\t// encoding 51\n  CHINESE_EUC_CN,\t\t// encoding 15\n  CHINESE_EUC_DEC,\t\t// encoding 18\n  CHINESE_CNS,\t\t// encoding 19\n  UTF32BE,\t\t// encoding 59\n  UTF32LE,\t\t// encoding 60\n  BINARYENC,\t\t// encoding 61\n  UTF8UTF8,\t\t// encoding 63\n  TAM_ELANGO,\t\t// encoding 64\n  TAM_LTTMBARANI,\t\t// encoding 65\n  TAM_SHREE,\t\t// encoding 66\n  TAM_TBOOMIS,\t\t// encoding 67\n  TAM_TMNEWS,\t\t// encoding 68\n  TAM_WEBTAMIL,\t\t// encoding 69\n  UTF8UTF8,\t\t// encoding 63\n};\n\n// Massaged TLD or charset, followed by packed encoding probs\ntypedef struct {\n  char key_prob[20];\n} HintEntry;\n\nstatic const HintEntry kLangHintProbs[] = {\t// MaxRange 192\n  {{(char)0x61,(char)0x62,(char)0x6b,(char)0x68,(char)0x61,(char)0x7a,(char)0x69,(char)0x61, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"abkhazia\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x61,(char)0x66,(char)0x61,(char)0x72,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"afar____\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x61,(char)0x66,(char)0x72,(char)0x69,(char)0x6b,(char)0x61,(char)0x61,(char)0x6e, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"afrikaan\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x61,(char)0x6c,(char)0x62,(char)0x61,(char)0x6e,(char)0x69,(char)0x61,(char)0x6e, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"albanian\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x61,(char)0x6d,(char)0x68,(char)0x61,(char)0x72,(char)0x69,(char)0x63,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"amharic_\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x61,(char)0x72,(char)0x61,(char)0x62,(char)0x69,(char)0x63,(char)0x5f,(char)0x5f, (char)0x03,(char)0x84,(char)0x53,(char)0xa2,(char)0x11,(char)0x3b,(char)0x62,(char)0xbc,(char)0x34,(char)0x10,(char)0x51,(char)0x83,}}, // \"arabic__\"\n      // ASCII-7-bit=132  Latin1=83  UTF8=162  CP1252=59  CP1256=188  CP1250=52  Arabic=131  [top CP1256]\n  {{(char)0x61,(char)0x72,(char)0x6d,(char)0x65,(char)0x6e,(char)0x69,(char)0x61,(char)0x6e, (char)0x01,(char)0x5f,(char)0x11,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"armenian\"\n      // ASCII-7-bit=95  UTF8=190  [top UTF8]\n  {{(char)0x61,(char)0x73,(char)0x73,(char)0x61,(char)0x6d,(char)0x65,(char)0x73,(char)0x65, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"assamese\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x61,(char)0x79,(char)0x6d,(char)0x61,(char)0x72,(char)0x61,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"aymara__\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x61,(char)0x7a,(char)0x65,(char)0x72,(char)0x62,(char)0x61,(char)0x69,(char)0x6a, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"azerbaij\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x62,(char)0x61,(char)0x73,(char)0x68,(char)0x6b,(char)0x69,(char)0x72,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bashkir_\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x62,(char)0x61,(char)0x73,(char)0x71,(char)0x75,(char)0x65,(char)0x5f,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"basque__\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x62,(char)0x65,(char)0x6c,(char)0x61,(char)0x72,(char)0x75,(char)0x73,(char)0x69, (char)0xa1,(char)0xb5,(char)0x71,(char)0xa1,(char)0x72,(char)0x97,(char)0xab,(char)0x81,(char)0x8d,(char)0x00,(char)0x00,(char)0x00,}}, // \"belarusi\"\n      // CP1251=181  KOI8R=161  KOI8U=151  ISO-8859-5=171  CP866=141  [top CP1251]\n  {{(char)0x62,(char)0x65,(char)0x6e,(char)0x67,(char)0x61,(char)0x6c,(char)0x69,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bengali_\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x62,(char)0x69,(char)0x68,(char)0x61,(char)0x72,(char)0x69,(char)0x5f,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bihari__\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x62,(char)0x69,(char)0x73,(char)0x6c,(char)0x61,(char)0x6d,(char)0x61,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bislama_\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x62,(char)0x6f,(char)0x73,(char)0x6e,(char)0x69,(char)0x61,(char)0x6e,(char)0x5f, (char)0x91,(char)0xaf,(char)0x21,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bosnian_\"\n      // Latin2=175  CP1250=185  [top CP1250]\n  {{(char)0x62,(char)0x72,(char)0x65,(char)0x74,(char)0x6f,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x11,(char)0xb5,(char)0x21,(char)0x97,(char)0x81,(char)0xab,(char)0x11,(char)0xa1,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"breton__\"\n      // Latin1=181  CP1252=151  Latin5=171  ISO-8859-15=161  [top Latin1]\n  {{(char)0x62,(char)0x75,(char)0x6c,(char)0x67,(char)0x61,(char)0x72,(char)0x69,(char)0x61, (char)0x03,(char)0x70,(char)0x47,(char)0xad,(char)0x11,(char)0x45,(char)0x51,(char)0xb5,(char)0x71,(char)0x95,(char)0x81,(char)0x9f,}}, // \"bulgaria\"\n      // ASCII-7-bit=112  Latin1=71  UTF8=173  CP1252=69  CP1251=181  KOI8R=149  ISO-8859-5=159  [top CP1251]\n  {{(char)0x62,(char)0x75,(char)0x72,(char)0x6d,(char)0x65,(char)0x73,(char)0x65,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"burmese_\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x63,(char)0x61,(char)0x74,(char)0x61,(char)0x6c,(char)0x61,(char)0x6e,(char)0x5f, (char)0x03,(char)0x8b,(char)0xb8,(char)0xa0,(char)0x11,(char)0xa4,(char)0xa1,(char)0x96,(char)0x10,(char)0x61,(char)0x31,(char)0x00,}}, // \"catalan_\"\n      // ASCII-7-bit=139  Latin1=184  UTF8=160  CP1252=164  ISO-8859-15=150  Latin3=49  [top Latin1]\n  {{(char)0x63,(char)0x68,(char)0x65,(char)0x72,(char)0x6f,(char)0x6b,(char)0x65,(char)0x65, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cherokee\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x63,(char)0x68,(char)0x69,(char)0x6e,(char)0x65,(char)0x73,(char)0x65,(char)0x5f, (char)0x01,(char)0x5c,(char)0x12,(char)0xa8,(char)0xbb,(char)0x11,(char)0x74,(char)0x21,(char)0x6d,(char)0xa1,(char)0x7d,(char)0x00,}}, // \"chinese_\"\n      // ASCII-7-bit=92  UTF8=168  GB=187  KSC=116  BIG5=109  GBK=125  [top GB]\n  {{(char)0x63,(char)0x68,(char)0x69,(char)0x6e,(char)0x65,(char)0x73,(char)0x65,(char)0x74, (char)0x06,(char)0x73,(char)0x5f,(char)0xad,(char)0x59,(char)0x43,(char)0x36,(char)0x21,(char)0xb9,(char)0x10,(char)0xa1,(char)0x38,}}, // \"chineset\"\n      // ASCII-7-bit=115  Latin1=95  UTF8=173  GB=89  CP1252=67  KSC=54  BIG5=185  BIG5_HKSCS=56  [top BIG5]\n  {{(char)0x63,(char)0x6f,(char)0x72,(char)0x73,(char)0x69,(char)0x63,(char)0x61,(char)0x6e, (char)0x12,(char)0xaf,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"corsican\"\n      // Latin1=175  UTF8=185  [top UTF8]\n  {{(char)0x63,(char)0x72,(char)0x65,(char)0x6f,(char)0x6c,(char)0x65,(char)0x73,(char)0x61, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"creolesa\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x63,(char)0x72,(char)0x6f,(char)0x61,(char)0x74,(char)0x69,(char)0x61,(char)0x6e, (char)0x03,(char)0x91,(char)0x7b,(char)0xa6,(char)0x11,(char)0x86,(char)0x41,(char)0xac,(char)0x21,(char)0xb4,(char)0x31,(char)0x4d,}}, // \"croatian\"\n      // ASCII-7-bit=145  Latin1=123  UTF8=166  CP1252=134  Latin2=172  CP1250=180  CP1257=77  [top CP1250]\n  {{(char)0x63,(char)0x7a,(char)0x65,(char)0x63,(char)0x68,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x89,(char)0x11,(char)0xb1,(char)0x61,(char)0x98,(char)0x21,(char)0xb5,(char)0x10,(char)0x41,(char)0x7d,(char)0x00,}}, // \"czech___\"\n      // ASCII-7-bit=137  UTF8=177  Latin2=152  CP1250=181  CP852=125  [top CP1250]\n  {{(char)0x64,(char)0x61,(char)0x6e,(char)0x69,(char)0x73,(char)0x68,(char)0x5f,(char)0x5f, (char)0x03,(char)0x99,(char)0xb8,(char)0xa6,(char)0x11,(char)0x9a,(char)0x41,(char)0x38,(char)0x21,(char)0x32,(char)0x21,(char)0x84,}}, // \"danish__\"\n      // ASCII-7-bit=153  Latin1=184  UTF8=166  CP1252=154  Latin2=56  CP1250=50  ISO-8859-15=132  [top Latin1]\n  {{(char)0x64,(char)0x68,(char)0x69,(char)0x76,(char)0x65,(char)0x68,(char)0x69,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"dhivehi_\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x64,(char)0x75,(char)0x74,(char)0x63,(char)0x68,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb1,(char)0xae,(char)0xa3,(char)0x11,(char)0xa1,(char)0x41,(char)0x41,(char)0x21,(char)0x44,(char)0x21,(char)0x7f,}}, // \"dutch___\"\n      // ASCII-7-bit=177  Latin1=174  UTF8=163  CP1252=161  Latin2=65  CP1250=68  ISO-8859-15=127  [top ASCII-7-bit]\n  {{(char)0x64,(char)0x7a,(char)0x6f,(char)0x6e,(char)0x67,(char)0x6b,(char)0x68,(char)0x61, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"dzongkha\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x65,(char)0x6e,(char)0x67,(char)0x6c,(char)0x69,(char)0x73,(char)0x68,(char)0x5f, (char)0x06,(char)0xb9,(char)0xa0,(char)0xa2,(char)0x5d,(char)0x94,(char)0x55,(char)0x21,(char)0x56,(char)0x61,(char)0x69,(char)0x00,}}, // \"english_\"\n      // ASCII-7-bit=185  Latin1=160  UTF8=162  GB=93  CP1252=148  KSC=85  BIG5=86  ISO-8859-15=105  [top ASCII-7-bit]\n  {{(char)0x65,(char)0x73,(char)0x70,(char)0x65,(char)0x72,(char)0x61,(char)0x6e,(char)0x74, (char)0x03,(char)0x89,(char)0xb4,(char)0xa2,(char)0x12,(char)0xaa,(char)0x45,(char)0x61,(char)0x4c,(char)0x21,(char)0xa0,(char)0x00,}}, // \"esperant\"\n      // ASCII-7-bit=137  Latin1=180  UTF8=162  CP1252=170  KSC=69  CP1250=76  ISO-8859-15=160  [top Latin1]\n  {{(char)0x65,(char)0x73,(char)0x74,(char)0x6f,(char)0x6e,(char)0x69,(char)0x61,(char)0x6e, (char)0x03,(char)0x90,(char)0xab,(char)0xb1,(char)0x11,(char)0x91,(char)0xa2,(char)0x7e,(char)0xa3,(char)0xc2,(char)0x8e,(char)0x98,}}, // \"estonian\"\n      // ASCII-7-bit=144  Latin1=171  UTF8=177  CP1252=145  ISO-8859-15=126  CP1257=163  ISO-8859-13=142  Latin4=152  [top UTF8]\n  {{(char)0x66,(char)0x61,(char)0x72,(char)0x6f,(char)0x65,(char)0x73,(char)0x65,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"faroese_\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x66,(char)0x69,(char)0x6a,(char)0x69,(char)0x61,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"fijian__\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x66,(char)0x69,(char)0x6e,(char)0x6e,(char)0x69,(char)0x73,(char)0x68,(char)0x5f, (char)0x03,(char)0x96,(char)0xb7,(char)0xa9,(char)0x11,(char)0x9c,(char)0x71,(char)0x42,(char)0x22,(char)0x8b,(char)0x39,(char)0x00,}}, // \"finnish_\"\n      // ASCII-7-bit=150  Latin1=183  UTF8=169  CP1252=156  CP1250=66  ISO-8859-15=139  CP1257=57  [top Latin1]\n  {{(char)0x66,(char)0x72,(char)0x65,(char)0x6e,(char)0x63,(char)0x68,(char)0x5f,(char)0x5f, (char)0x03,(char)0x99,(char)0xb6,(char)0xaa,(char)0x11,(char)0xa0,(char)0x62,(char)0x4f,(char)0x46,(char)0x21,(char)0x86,(char)0x00,}}, // \"french__\"\n      // ASCII-7-bit=153  Latin1=182  UTF8=170  CP1252=160  CP1256=79  CP1250=70  ISO-8859-15=134  [top Latin1]\n  {{(char)0x66,(char)0x72,(char)0x69,(char)0x73,(char)0x69,(char)0x61,(char)0x6e,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"frisian_\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x67,(char)0x61,(char)0x6c,(char)0x69,(char)0x63,(char)0x69,(char)0x61,(char)0x6e, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"galician\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x67,(char)0x61,(char)0x6e,(char)0x64,(char)0x61,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ganda___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x67,(char)0x65,(char)0x6f,(char)0x72,(char)0x67,(char)0x69,(char)0x61,(char)0x6e, (char)0x01,(char)0x6c,(char)0x11,(char)0xbe,(char)0x11,(char)0x1c,(char)0x10,(char)0x21,(char)0x1c,(char)0x00,(char)0x00,(char)0x00,}}, // \"georgian\"\n      // ASCII-7-bit=108  UTF8=190  CP1252=28  CP1253=28  [top UTF8]\n  {{(char)0x67,(char)0x65,(char)0x72,(char)0x6d,(char)0x61,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa2,(char)0xb7,(char)0xa6,(char)0x11,(char)0x9b,(char)0x41,(char)0x56,(char)0x21,(char)0x5d,(char)0x21,(char)0x7c,}}, // \"german__\"\n      // ASCII-7-bit=162  Latin1=183  UTF8=166  CP1252=155  Latin2=86  CP1250=93  ISO-8859-15=124  [top Latin1]\n  {{(char)0x67,(char)0x72,(char)0x65,(char)0x65,(char)0x6b,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x03,(char)0x81,(char)0x54,(char)0xad,(char)0x11,(char)0x52,(char)0xd1,(char)0x31,(char)0x11,(char)0xb4,(char)0x21,(char)0xa6,}}, // \"greek___\"\n      // ASCII-7-bit=129  Latin1=84  UTF8=173  CP1252=82  KOI8R=49  Greek=180  CP1253=166  [top Greek]\n  {{(char)0x67,(char)0x72,(char)0x65,(char)0x65,(char)0x6e,(char)0x6c,(char)0x61,(char)0x6e, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"greenlan\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x67,(char)0x75,(char)0x61,(char)0x72,(char)0x61,(char)0x6e,(char)0x69,(char)0x5f, (char)0x11,(char)0xb9,(char)0x20,(char)0x91,(char)0xaf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"guarani_\"\n      // Latin1=185  Latin6=175  [top Latin1]\n  {{(char)0x67,(char)0x75,(char)0x6a,(char)0x61,(char)0x72,(char)0x61,(char)0x74,(char)0x69, (char)0x03,(char)0x79,(char)0xb6,(char)0x76,(char)0x11,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gujarati\"\n      // ASCII-7-bit=121  Latin1=182  UTF8=118  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x68,(char)0x61,(char)0x69,(char)0x74,(char)0x69,(char)0x61,(char)0x6e,(char)0x63, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"haitianc\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x68,(char)0x61,(char)0x75,(char)0x73,(char)0x61,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"hausa___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x68,(char)0x65,(char)0x62,(char)0x72,(char)0x65,(char)0x77,(char)0x5f,(char)0x5f, (char)0x03,(char)0x76,(char)0x46,(char)0xab,(char)0x11,(char)0x3b,(char)0x51,(char)0x32,(char)0x61,(char)0xb8,(char)0x71,(char)0x9f,}}, // \"hebrew__\"\n      // ASCII-7-bit=118  Latin1=70  UTF8=171  CP1252=59  CP1251=50  CP1255=184  Hebrew=159  [top CP1255]\n  {{(char)0x68,(char)0x69,(char)0x6e,(char)0x64,(char)0x69,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x11,(char)0xb5,(char)0x21,(char)0xab,(char)0xa1,(char)0xa1,(char)0x10,(char)0xf3,(char)0x97,(char)0x8d,(char)0x83,(char)0x00,}}, // \"hindi___\"\n      // Latin1=181  CP1252=171  ISO-8859-15=161  JAGRAN=151  BHASKAR=141  HTCHANAKYA=131  [top Latin1]\n  {{(char)0x68,(char)0x75,(char)0x6e,(char)0x67,(char)0x61,(char)0x72,(char)0x69,(char)0x61, (char)0x03,(char)0x93,(char)0x9f,(char)0xad,(char)0x11,(char)0x6f,(char)0x41,(char)0xae,(char)0x21,(char)0xa9,(char)0x21,(char)0x40,}}, // \"hungaria\"\n      // ASCII-7-bit=147  Latin1=159  UTF8=173  CP1252=111  Latin2=174  CP1250=169  ISO-8859-15=64  [top Latin2]\n  {{(char)0x69,(char)0x63,(char)0x65,(char)0x6c,(char)0x61,(char)0x6e,(char)0x64,(char)0x69, (char)0x03,(char)0x7f,(char)0xb8,(char)0x9c,(char)0x11,(char)0xa4,(char)0x11,(char)0x1d,(char)0x51,(char)0x2f,(char)0x21,(char)0x99,}}, // \"icelandi\"\n      // ASCII-7-bit=127  Latin1=184  UTF8=156  CP1252=164  SJS=29  CP1250=47  ISO-8859-15=153  [top Latin1]\n  {{(char)0x69,(char)0x6e,(char)0x64,(char)0x6f,(char)0x6e,(char)0x65,(char)0x73,(char)0x69, (char)0x03,(char)0xb2,(char)0xae,(char)0x99,(char)0x11,(char)0xa2,(char)0x11,(char)0x5b,(char)0x41,(char)0x70,(char)0x31,(char)0x91,}}, // \"indonesi\"\n      // ASCII-7-bit=178  Latin1=174  UTF8=153  CP1252=162  SJS=91  CP1256=112  ISO-8859-15=145  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x6e,(char)0x74,(char)0x65,(char)0x72,(char)0x6c,(char)0x69,(char)0x6e, (char)0x12,(char)0xb0,(char)0xb0,(char)0x11,(char)0xa6,(char)0xa1,(char)0x9c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"interlin\"\n      // Latin1=176  UTF8=176  CP1252=166  ISO-8859-15=156  [top Latin1]\n  {{(char)0x69,(char)0x6e,(char)0x75,(char)0x6b,(char)0x74,(char)0x69,(char)0x74,(char)0x75, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"inuktitu\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x69,(char)0x6e,(char)0x75,(char)0x70,(char)0x69,(char)0x61,(char)0x6b,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"inupiak_\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x69,(char)0x72,(char)0x69,(char)0x73,(char)0x68,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"irish___\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x69,(char)0x74,(char)0x61,(char)0x6c,(char)0x69,(char)0x61,(char)0x6e,(char)0x5f, (char)0x03,(char)0xa7,(char)0xb4,(char)0xa4,(char)0x11,(char)0xa4,(char)0x41,(char)0x4d,(char)0x21,(char)0x55,(char)0x21,(char)0x78,}}, // \"italian_\"\n      // ASCII-7-bit=167  Latin1=180  UTF8=164  CP1252=164  Latin2=77  CP1250=85  ISO-8859-15=120  [top Latin1]\n  {{(char)0x6a,(char)0x61,(char)0x70,(char)0x61,(char)0x6e,(char)0x65,(char)0x73,(char)0x65, (char)0x01,(char)0x68,(char)0x11,(char)0xa7,(char)0x32,(char)0xb4,(char)0xad,(char)0xd1,(char)0x78,(char)0x21,(char)0x62,(char)0x00,}}, // \"japanese\"\n      // ASCII-7-bit=104  UTF8=167  SJS=180  EUC-JP=173  JIS=120  CP932=98  [top SJS]\n  {{(char)0x6a,(char)0x61,(char)0x76,(char)0x61,(char)0x6e,(char)0x65,(char)0x73,(char)0x65, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"javanese\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x6b,(char)0x61,(char)0x6e,(char)0x6e,(char)0x61,(char)0x64,(char)0x61,(char)0x5f, (char)0x03,(char)0x65,(char)0xb6,(char)0x81,(char)0x11,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"kannada_\"\n      // ASCII-7-bit=101  Latin1=182  UTF8=129  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x6b,(char)0x61,(char)0x73,(char)0x68,(char)0x6d,(char)0x69,(char)0x72,(char)0x69, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"kashmiri\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x6b,(char)0x61,(char)0x7a,(char)0x61,(char)0x6b,(char)0x68,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"kazakh__\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x6b,(char)0x68,(char)0x61,(char)0x73,(char)0x69,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"khasi___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x6b,(char)0x68,(char)0x6d,(char)0x65,(char)0x72,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"khmer___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x6b,(char)0x69,(char)0x6e,(char)0x79,(char)0x61,(char)0x72,(char)0x77,(char)0x61, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"kinyarwa\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x6b,(char)0x6f,(char)0x72,(char)0x65,(char)0x61,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x06,(char)0x5d,(char)0x34,(char)0x9d,(char)0x20,(char)0x1a,(char)0xbd,(char)0x11,(char)0x0c,(char)0x20,(char)0x21,(char)0x76,}}, // \"korean__\"\n      // ASCII-7-bit=93  Latin1=52  UTF8=157  GB=32  CP1252=26  KSC=189  EUC-JP=12  ISO-2022-KR=118  [top KSC]\n  {{(char)0x6b,(char)0x75,(char)0x72,(char)0x64,(char)0x69,(char)0x73,(char)0x68,(char)0x5f, (char)0xb1,(char)0xb9,(char)0x10,(char)0x61,(char)0xaf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"kurdish_\"\n      // CP1256=185  Arabic=175  [top CP1256]\n  {{(char)0x6b,(char)0x79,(char)0x72,(char)0x67,(char)0x79,(char)0x7a,(char)0x5f,(char)0x5f, (char)0x10,(char)0x61,(char)0xaf,(char)0x41,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"kyrgyz__\"\n      // CP1254=175  ISO-8859-5=185  [top ISO-8859-5]\n  {{(char)0x6c,(char)0x61,(char)0x6f,(char)0x74,(char)0x68,(char)0x69,(char)0x61,(char)0x6e, (char)0x01,(char)0x40,(char)0x11,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"laothian\"\n      // ASCII-7-bit=64  UTF8=190  [top UTF8]\n  {{(char)0x6c,(char)0x61,(char)0x74,(char)0x69,(char)0x6e,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"latin___\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x6c,(char)0x61,(char)0x74,(char)0x76,(char)0x69,(char)0x61,(char)0x6e,(char)0x5f, (char)0x03,(char)0x80,(char)0x55,(char)0xac,(char)0x11,(char)0x64,(char)0xb1,(char)0xb4,(char)0xc2,(char)0x99,(char)0xa3,(char)0x00,}}, // \"latvian_\"\n      // ASCII-7-bit=128  Latin1=85  UTF8=172  CP1252=100  CP1257=180  ISO-8859-13=153  Latin4=163  [top CP1257]\n  {{(char)0x6c,(char)0x69,(char)0x6d,(char)0x62,(char)0x75,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"limbu___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x6c,(char)0x69,(char)0x6e,(char)0x67,(char)0x61,(char)0x6c,(char)0x61,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"lingala_\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x6c,(char)0x69,(char)0x74,(char)0x68,(char)0x75,(char)0x61,(char)0x6e,(char)0x69, (char)0x03,(char)0x7c,(char)0x5d,(char)0xaa,(char)0x11,(char)0x73,(char)0xb1,(char)0xb7,(char)0xc2,(char)0x94,(char)0x9d,(char)0x00,}}, // \"lithuani\"\n      // ASCII-7-bit=124  Latin1=93  UTF8=170  CP1252=115  CP1257=183  ISO-8859-13=148  Latin4=157  [top CP1257]\n  {{(char)0x6c,(char)0x75,(char)0x78,(char)0x65,(char)0x6d,(char)0x62,(char)0x6f,(char)0x75, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"luxembou\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x6d,(char)0x61,(char)0x63,(char)0x65,(char)0x64,(char)0x6f,(char)0x6e,(char)0x69, (char)0x03,(char)0x7a,(char)0x54,(char)0xa9,(char)0x11,(char)0x4b,(char)0x51,(char)0xb3,(char)0x71,(char)0x9e,(char)0x81,(char)0xa8,}}, // \"macedoni\"\n      // ASCII-7-bit=122  Latin1=84  UTF8=169  CP1252=75  CP1251=179  KOI8R=158  ISO-8859-5=168  [top CP1251]\n  {{(char)0x6d,(char)0x61,(char)0x6c,(char)0x61,(char)0x67,(char)0x61,(char)0x73,(char)0x79, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"malagasy\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x6d,(char)0x61,(char)0x6c,(char)0x61,(char)0x79,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"malay___\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x6d,(char)0x61,(char)0x6c,(char)0x61,(char)0x79,(char)0x61,(char)0x6c,(char)0x61, (char)0x03,(char)0x48,(char)0xb6,(char)0x81,(char)0x11,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"malayala\"\n      // ASCII-7-bit=72  Latin1=182  UTF8=129  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x6d,(char)0x61,(char)0x6c,(char)0x74,(char)0x65,(char)0x73,(char)0x65,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"maltese_\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x6d,(char)0x61,(char)0x6e,(char)0x78,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"manx____\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x6d,(char)0x61,(char)0x6f,(char)0x72,(char)0x69,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"maori___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x6d,(char)0x61,(char)0x72,(char)0x61,(char)0x74,(char)0x68,(char)0x69,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"marathi_\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x6d,(char)0x6f,(char)0x6c,(char)0x64,(char)0x61,(char)0x76,(char)0x69,(char)0x61, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"moldavia\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x6d,(char)0x6f,(char)0x6e,(char)0x67,(char)0x6f,(char)0x6c,(char)0x69,(char)0x61, (char)0xa1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mongolia\"\n      // CP1251=191  [top CP1251]\n  {{(char)0x6e,(char)0x61,(char)0x75,(char)0x72,(char)0x75,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"nauru___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x6e,(char)0x65,(char)0x70,(char)0x61,(char)0x6c,(char)0x69,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"nepali__\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x6e,(char)0x6f,(char)0x72,(char)0x77,(char)0x65,(char)0x67,(char)0x69,(char)0x61, (char)0x03,(char)0x92,(char)0xb8,(char)0xa8,(char)0x11,(char)0x9c,(char)0x41,(char)0x30,(char)0x31,(char)0x24,(char)0x11,(char)0x8e,}}, // \"norwegia\"\n      // ASCII-7-bit=146  Latin1=184  UTF8=168  CP1252=156  Latin2=48  Latin5=36  ISO-8859-15=142  [top Latin1]\n  {{(char)0x6f,(char)0x63,(char)0x63,(char)0x69,(char)0x74,(char)0x61,(char)0x6e,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"occitan_\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x6f,(char)0x72,(char)0x69,(char)0x79,(char)0x61,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"oriya___\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x6f,(char)0x72,(char)0x6f,(char)0x6d,(char)0x6f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"oromo___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x70,(char)0x61,(char)0x73,(char)0x68,(char)0x74,(char)0x6f,(char)0x5f,(char)0x5f, (char)0xb1,(char)0xb9,(char)0x10,(char)0x61,(char)0xaf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"pashto__\"\n      // CP1256=185  Arabic=175  [top CP1256]\n  {{(char)0x70,(char)0x65,(char)0x72,(char)0x73,(char)0x69,(char)0x61,(char)0x6e,(char)0x5f, (char)0x12,(char)0x44,(char)0xb6,(char)0x11,(char)0x33,(char)0x62,(char)0xae,(char)0x19,(char)0x10,(char)0x51,(char)0x9f,(char)0x00,}}, // \"persian_\"\n      // Latin1=68  UTF8=182  CP1252=51  CP1256=174  CP1250=25  Arabic=159  [top UTF8]\n  {{(char)0x70,(char)0x6f,(char)0x6c,(char)0x69,(char)0x73,(char)0x68,(char)0x5f,(char)0x5f, (char)0x05,(char)0x85,(char)0x6c,(char)0xa8,(char)0x26,(char)0x57,(char)0x41,(char)0xb9,(char)0x21,(char)0x99,(char)0x31,(char)0x23,}}, // \"polish__\"\n      // ASCII-7-bit=133  Latin1=108  UTF8=168  GB=38  CP1252=87  Latin2=185  CP1250=153  CP1257=35  [top Latin2]\n  {{(char)0x70,(char)0x6f,(char)0x72,(char)0x74,(char)0x75,(char)0x67,(char)0x75,(char)0x65, (char)0x03,(char)0x96,(char)0xb9,(char)0xa6,(char)0x11,(char)0x9a,(char)0x11,(char)0x30,(char)0x51,(char)0x36,(char)0x21,(char)0x86,}}, // \"portugue\"\n      // ASCII-7-bit=150  Latin1=185  UTF8=166  CP1252=154  SJS=48  CP1250=54  ISO-8859-15=134  [top Latin1]\n  {{(char)0x70,(char)0x75,(char)0x6e,(char)0x6a,(char)0x61,(char)0x62,(char)0x69,(char)0x5f, (char)0x03,(char)0x42,(char)0xb6,(char)0x7b,(char)0x11,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"punjabi_\"\n      // ASCII-7-bit=66  Latin1=182  UTF8=123  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x71,(char)0x75,(char)0x65,(char)0x63,(char)0x68,(char)0x75,(char)0x61,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"quechua_\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x72,(char)0x68,(char)0x61,(char)0x65,(char)0x74,(char)0x6f,(char)0x72,(char)0x6f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"rhaetoro\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x72,(char)0x6f,(char)0x6d,(char)0x61,(char)0x6e,(char)0x69,(char)0x61,(char)0x6e, (char)0x03,(char)0xb2,(char)0x9d,(char)0xa5,(char)0x11,(char)0x92,(char)0x42,(char)0xa7,(char)0x51,(char)0x11,(char)0x99,(char)0x00,}}, // \"romanian\"\n      // ASCII-7-bit=178  Latin1=157  UTF8=165  CP1252=146  Latin2=167  CP1251=81  CP1250=153  [top ASCII-7-bit]\n  {{(char)0x72,(char)0x75,(char)0x6e,(char)0x64,(char)0x69,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"rundi___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x72,(char)0x75,(char)0x73,(char)0x73,(char)0x69,(char)0x61,(char)0x6e,(char)0x5f, (char)0x01,(char)0x74,(char)0x11,(char)0xa9,(char)0x71,(char)0xb9,(char)0x71,(char)0x99,(char)0x81,(char)0x82,(char)0x81,(char)0x6d,}}, // \"russian_\"\n      // ASCII-7-bit=116  UTF8=169  CP1251=185  KOI8R=153  ISO-8859-5=130  CP866=109  [top CP1251]\n  {{(char)0x73,(char)0x61,(char)0x6d,(char)0x6f,(char)0x61,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"samoan__\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x73,(char)0x61,(char)0x6e,(char)0x67,(char)0x6f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sango___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x73,(char)0x61,(char)0x6e,(char)0x73,(char)0x6b,(char)0x72,(char)0x69,(char)0x74, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sanskrit\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x73,(char)0x63,(char)0x6f,(char)0x74,(char)0x73,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"scots___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x73,(char)0x63,(char)0x6f,(char)0x74,(char)0x73,(char)0x67,(char)0x61,(char)0x65, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"scotsgae\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x73,(char)0x65,(char)0x72,(char)0x62,(char)0x69,(char)0x61,(char)0x6e,(char)0x5f, (char)0x03,(char)0x93,(char)0x77,(char)0xad,(char)0x11,(char)0x85,(char)0x42,(char)0xad,(char)0x52,(char)0x12,(char)0xae,(char)0x4a,}}, // \"serbian_\"\n      // ASCII-7-bit=147  Latin1=119  UTF8=173  CP1252=133  Latin2=173  CP1251=82  CP1250=174  Latin5=74  [top CP1250]\n  {{(char)0x73,(char)0x65,(char)0x72,(char)0x62,(char)0x6f,(char)0x63,(char)0x72,(char)0x6f, (char)0x91,(char)0xaf,(char)0x21,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"serbocro\"\n      // Latin2=175  CP1250=185  [top CP1250]\n  {{(char)0x73,(char)0x65,(char)0x73,(char)0x6f,(char)0x74,(char)0x68,(char)0x6f,(char)0x5f, (char)0x11,(char)0xb9,(char)0x21,(char)0xaf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sesotho_\"\n      // Latin1=185  CP1252=175  [top Latin1]\n  {{(char)0x73,(char)0x68,(char)0x6f,(char)0x6e,(char)0x61,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"shona___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x73,(char)0x69,(char)0x6e,(char)0x64,(char)0x68,(char)0x69,(char)0x5f,(char)0x5f, (char)0xb1,(char)0xb9,(char)0x10,(char)0x61,(char)0xaf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sindhi__\"\n      // CP1256=185  Arabic=175  [top CP1256]\n  {{(char)0x73,(char)0x69,(char)0x6e,(char)0x68,(char)0x61,(char)0x6c,(char)0x65,(char)0x73, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sinhales\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x73,(char)0x69,(char)0x73,(char)0x77,(char)0x61,(char)0x6e,(char)0x74,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"siswant_\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x73,(char)0x6c,(char)0x6f,(char)0x76,(char)0x61,(char)0x6b,(char)0x5f,(char)0x5f, (char)0x03,(char)0x88,(char)0x6e,(char)0xaf,(char)0x11,(char)0x67,(char)0x41,(char)0xa5,(char)0x21,(char)0xb3,(char)0x00,(char)0x00,}}, // \"slovak__\"\n      // ASCII-7-bit=136  Latin1=110  UTF8=175  CP1252=103  Latin2=165  CP1250=179  [top CP1250]\n  {{(char)0x73,(char)0x6c,(char)0x6f,(char)0x76,(char)0x65,(char)0x6e,(char)0x69,(char)0x61, (char)0x03,(char)0x8e,(char)0x71,(char)0xb2,(char)0x11,(char)0x80,(char)0x42,(char)0xaa,(char)0x39,(char)0x11,(char)0xad,(char)0x00,}}, // \"slovenia\"\n      // ASCII-7-bit=142  Latin1=113  UTF8=178  CP1252=128  Latin2=170  CP1251=57  CP1250=173  [top UTF8]\n  {{(char)0x73,(char)0x6f,(char)0x6d,(char)0x61,(char)0x6c,(char)0x69,(char)0x5f,(char)0x5f, (char)0x11,(char)0xb9,(char)0x21,(char)0xaf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"somali__\"\n      // Latin1=185  CP1252=175  [top Latin1]\n  {{(char)0x73,(char)0x70,(char)0x61,(char)0x6e,(char)0x69,(char)0x73,(char)0x68,(char)0x5f, (char)0x03,(char)0x9b,(char)0xb8,(char)0xa7,(char)0x11,(char)0x98,(char)0x41,(char)0x45,(char)0x21,(char)0x45,(char)0x21,(char)0x77,}}, // \"spanish_\"\n      // ASCII-7-bit=155  Latin1=184  UTF8=167  CP1252=152  Latin2=69  CP1250=69  ISO-8859-15=119  [top Latin1]\n  {{(char)0x73,(char)0x75,(char)0x6e,(char)0x64,(char)0x61,(char)0x6e,(char)0x65,(char)0x73, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sundanes\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x73,(char)0x77,(char)0x61,(char)0x68,(char)0x69,(char)0x6c,(char)0x69,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"swahili_\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x73,(char)0x77,(char)0x65,(char)0x64,(char)0x69,(char)0x73,(char)0x68,(char)0x5f, (char)0x03,(char)0x90,(char)0xba,(char)0xa4,(char)0x11,(char)0x8d,(char)0x41,(char)0x2c,(char)0x21,(char)0x2c,(char)0x21,(char)0x7a,}}, // \"swedish_\"\n      // ASCII-7-bit=144  Latin1=186  UTF8=164  CP1252=141  Latin2=44  CP1250=44  ISO-8859-15=122  [top Latin1]\n  {{(char)0x73,(char)0x79,(char)0x72,(char)0x69,(char)0x61,(char)0x63,(char)0x5f,(char)0x5f, (char)0x01,(char)0x6a,(char)0x11,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"syriac__\"\n      // ASCII-7-bit=106  UTF8=190  [top UTF8]\n  {{(char)0x74,(char)0x61,(char)0x67,(char)0x61,(char)0x6c,(char)0x6f,(char)0x67,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tagalog_\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x74,(char)0x61,(char)0x6a,(char)0x69,(char)0x6b,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tajik___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x74,(char)0x61,(char)0x6d,(char)0x69,(char)0x6c,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x12,(char)0xb4,(char)0x8e,(char)0x11,(char)0xaa,(char)0xa1,(char)0xa0,(char)0x20,(char)0x23,(char)0x96,(char)0x8c,(char)0x82,}}, // \"tamil___\"\n      // Latin1=180  UTF8=142  CP1252=170  ISO-8859-15=160  TSCII=150  TAM=140  TAB=130  [top Latin1]\n  {{(char)0x74,(char)0x61,(char)0x74,(char)0x61,(char)0x72,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tatar___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x74,(char)0x65,(char)0x6c,(char)0x75,(char)0x67,(char)0x75,(char)0x5f,(char)0x5f, (char)0x03,(char)0x66,(char)0xb6,(char)0x90,(char)0x11,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"telugu__\"\n      // ASCII-7-bit=102  Latin1=182  UTF8=144  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x74,(char)0x68,(char)0x61,(char)0x69,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x05,(char)0x7a,(char)0x53,(char)0xa2,(char)0x24,(char)0x46,(char)0x91,(char)0xba,(char)0xd1,(char)0x9e,(char)0x21,(char)0x29,}}, // \"thai____\"\n      // ASCII-7-bit=122  Latin1=83  UTF8=162  GB=36  CP1252=70  ISO-8859-11=186  CP874=158  MACINTOSH=41  [top ISO-8859-11]\n  {{(char)0x74,(char)0x69,(char)0x62,(char)0x65,(char)0x74,(char)0x61,(char)0x6e,(char)0x5f, (char)0x01,(char)0x42,(char)0x11,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tibetan_\"\n      // ASCII-7-bit=66  UTF8=190  [top UTF8]\n  {{(char)0x74,(char)0x69,(char)0x67,(char)0x72,(char)0x69,(char)0x6e,(char)0x79,(char)0x61, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tigrinya\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x74,(char)0x6f,(char)0x6e,(char)0x67,(char)0x61,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tonga___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x74,(char)0x73,(char)0x6f,(char)0x6e,(char)0x67,(char)0x61,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tsonga__\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x74,(char)0x73,(char)0x77,(char)0x61,(char)0x6e,(char)0x61,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tswana__\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x74,(char)0x75,(char)0x72,(char)0x6b,(char)0x69,(char)0x73,(char)0x68,(char)0x5f, (char)0x03,(char)0x81,(char)0x7f,(char)0xa5,(char)0x11,(char)0x6e,(char)0x81,(char)0xba,(char)0x11,(char)0x3d,(char)0x61,(char)0x95,}}, // \"turkish_\"\n      // ASCII-7-bit=129  Latin1=127  UTF8=165  CP1252=110  Latin5=186  ISO-8859-15=61  CP1254=149  [top Latin5]\n  {{(char)0x74,(char)0x75,(char)0x72,(char)0x6b,(char)0x6d,(char)0x65,(char)0x6e,(char)0x5f, (char)0x91,(char)0xb9,(char)0x21,(char)0xaf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"turkmen_\"\n      // Latin2=185  CP1250=175  [top Latin2]\n  {{(char)0x74,(char)0x77,(char)0x69,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x11,(char)0xac,(char)0x21,(char)0xb6,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"twi_____\"\n      // Latin1=172  CP1252=182  ISO-8859-15=162  [top CP1252]\n  {{(char)0x75,(char)0x69,(char)0x67,(char)0x68,(char)0x75,(char)0x72,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"uighur__\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x75,(char)0x6b,(char)0x72,(char)0x61,(char)0x69,(char)0x6e,(char)0x69,(char)0x61, (char)0x21,(char)0xa0,(char)0x71,(char)0xb7,(char)0x71,(char)0x91,(char)0x72,(char)0x98,(char)0xa2,(char)0x81,(char)0x84,(char)0x00,}}, // \"ukrainia\"\n      // UTF8=160  CP1251=183  KOI8R=145  KOI8U=152  ISO-8859-5=162  CP866=132  [top CP1251]\n  {{(char)0x75,(char)0x72,(char)0x64,(char)0x75,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0xb1,(char)0xb9,(char)0x10,(char)0x61,(char)0xaf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"urdu____\"\n      // CP1256=185  Arabic=175  [top CP1256]\n  {{(char)0x75,(char)0x7a,(char)0x62,(char)0x65,(char)0x6b,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"uzbek___\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x76,(char)0x69,(char)0x65,(char)0x74,(char)0x6e,(char)0x61,(char)0x6d,(char)0x65, (char)0x03,(char)0x81,(char)0xa8,(char)0xb7,(char)0x11,(char)0x9e,(char)0xa1,(char)0x94,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"vietname\"\n      // ASCII-7-bit=129  Latin1=168  UTF8=183  CP1252=158  ISO-8859-15=148  [top UTF8]\n  {{(char)0x76,(char)0x6f,(char)0x6c,(char)0x61,(char)0x70,(char)0x75,(char)0x6b,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"volapuk_\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x77,(char)0x65,(char)0x6c,(char)0x73,(char)0x68,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"welsh___\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x77,(char)0x6f,(char)0x6c,(char)0x6f,(char)0x66,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wolof___\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x78,(char)0x68,(char)0x6f,(char)0x73,(char)0x61,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"xhosa___\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n  {{(char)0x79,(char)0x69,(char)0x64,(char)0x64,(char)0x69,(char)0x73,(char)0x68,(char)0x5f, (char)0x10,(char)0x11,(char)0xb9,(char)0x71,(char)0xaf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"yiddish_\"\n      // CP1255=185  Hebrew=175  [top CP1255]\n  {{(char)0x79,(char)0x6f,(char)0x72,(char)0x75,(char)0x62,(char)0x61,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"yoruba__\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x7a,(char)0x68,(char)0x75,(char)0x61,(char)0x6e,(char)0x67,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"zhuang__\"\n      // UTF8=191  [top UTF8]\n  {{(char)0x7a,(char)0x75,(char)0x6c,(char)0x75,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x11,(char)0xb6,(char)0x21,(char)0xac,(char)0xa1,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"zulu____\"\n      // Latin1=182  CP1252=172  ISO-8859-15=162  [top Latin1]\n};\n\nstatic const int kLangHintProbsSize = 151;\n\nstatic const HintEntry kTLDHintProbs[] = {\t// MaxRange 192\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x0f,(char)0xa8,(char)0xa1,(char)0xa3,(char)0xa0,(char)0x8e,(char)0x8e,(char)0x8a,(char)0x7e,(char)0xa8,(char)0x77,(char)0x7b,(char)0x8b,(char)0x75,(char)0x79,(char)0x7e,}}, // \"____\"\n        // ASCII-7-bit=168  Latin1=161  UTF8=163  GB=160  CP1252=142  KSC=142  SJS=138  EUC-JP=126  BIG5=168  Latin2=119  CP1251=123  CP1256=139  CP1250=117  Latin5=121  ISO-8859-11=126  [top ASCII-7-bit]\n  {{(char)0x61,(char)0x63,(char)0x5f,(char)0x5f, (char)0x08,(char)0xa0,(char)0x9a,(char)0xa1,(char)0x65,(char)0x92,(char)0x8f,(char)0xb1,(char)0xa2,(char)0x22,(char)0x56,(char)0x8a,(char)0x21,(char)0x56,(char)0x61,(char)0x87,}}, // \"ac__\"\n        // ASCII-7-bit=160  Latin1=154  UTF8=161  GB=101  CP1252=146  KSC=143  SJS=177  EUC-JP=162  CP1251=86  CP1256=138  ISO-8859-11=86  JIS=135  [top SJS]\n  {{(char)0x61,(char)0x64,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa6,(char)0xb6,(char)0x93,(char)0x11,(char)0xa8,(char)0x11,(char)0x74,(char)0x81,(char)0x5d,(char)0x81,(char)0x5d,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ad__\"\n        // ASCII-7-bit=166  Latin1=182  UTF8=147  CP1252=168  SJS=116  ISO-8859-15=93  CP932=93  [top Latin1]\n  {{(char)0x61,(char)0x65,(char)0x5f,(char)0x5f, (char)0x05,(char)0xa4,(char)0x81,(char)0xac,(char)0x42,(char)0x86,(char)0x11,(char)0x5b,(char)0x25,(char)0x4f,(char)0x4a,(char)0xb5,(char)0x3b,(char)0x52,(char)0x00,(char)0x00,}}, // \"ae__\"\n        // ASCII-7-bit=164  Latin1=129  UTF8=172  GB=66  CP1252=134  SJS=91  Latin2=79  CP1251=74  CP1256=181  CP1250=59  Latin5=82  [top CP1256]\n  {{(char)0x61,(char)0x65,(char)0x72,(char)0x6f, (char)0x03,(char)0xaf,(char)0xab,(char)0xab,(char)0x12,(char)0x98,(char)0x6a,(char)0x11,(char)0x6a,(char)0x21,(char)0x96,(char)0x21,(char)0x6a,(char)0x00,(char)0x00,(char)0x00,}}, // \"aero\"\n        // ASCII-7-bit=175  Latin1=171  UTF8=171  CP1252=152  KSC=106  EUC-JP=106  CP1251=150  Latin5=106  [top ASCII-7-bit]\n  {{(char)0x61,(char)0x66,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb6,(char)0x95,(char)0xaf,(char)0x11,(char)0x8c,(char)0x61,(char)0x80,(char)0x11,(char)0x62,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"af__\"\n        // ASCII-7-bit=182  Latin1=149  UTF8=175  CP1252=140  CP1256=128  Latin5=98  [top ASCII-7-bit]\n  {{(char)0x61,(char)0x67,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa8,(char)0xb4,(char)0xa2,(char)0x11,(char)0x9a,(char)0x12,(char)0x95,(char)0x86,(char)0x21,(char)0x60,(char)0x41,(char)0x7a,(char)0x00,(char)0x00,(char)0x00,}}, // \"ag__\"\n        // ASCII-7-bit=168  Latin1=180  UTF8=162  CP1252=154  SJS=149  EUC-JP=134  CP1251=96  ISO-8859-15=122  [top Latin1]\n  {{(char)0x61,(char)0x69,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb8,(char)0x8f,(char)0x9b,(char)0x11,(char)0x9d,(char)0x12,(char)0x8c,(char)0x97,(char)0x11,(char)0x90,(char)0xb1,(char)0x67,(char)0x00,(char)0x00,(char)0x00,}}, // \"ai__\"\n        // ASCII-7-bit=184  Latin1=143  UTF8=155  CP1252=157  SJS=140  EUC-JP=151  Latin2=144  JIS=103  [top ASCII-7-bit]\n  {{(char)0x61,(char)0x6c,(char)0x5f,(char)0x5f, (char)0x03,(char)0xac,(char)0x99,(char)0xae,(char)0x11,(char)0xa1,(char)0x31,(char)0x57,(char)0x41,(char)0x57,(char)0x21,(char)0xa7,(char)0x31,(char)0x57,(char)0x00,(char)0x00,}}, // \"al__\"\n        // ASCII-7-bit=172  Latin1=153  UTF8=174  CP1252=161  BIG5=87  Latin5=87  CP1257=167  Greek=87  [top UTF8]\n  {{(char)0x61,(char)0x6d,(char)0x5f,(char)0x5f, (char)0x08,(char)0xac,(char)0x9a,(char)0xab,(char)0x68,(char)0x9d,(char)0x58,(char)0x82,(char)0x56,(char)0x22,(char)0xac,(char)0x5a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"am__\"\n        // ASCII-7-bit=172  Latin1=154  UTF8=171  GB=104  CP1252=157  KSC=88  SJS=130  EUC-JP=86  CP1251=172  CP1256=90  [top ASCII-7-bit]\n  {{(char)0x61,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb6,(char)0xad,(char)0x94,(char)0x11,(char)0x99,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"an__\"\n        // ASCII-7-bit=182  Latin1=173  UTF8=148  CP1252=153  [top ASCII-7-bit]\n  {{(char)0x61,(char)0x6f,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9f,(char)0xb5,(char)0xab,(char)0x11,(char)0x9f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ao__\"\n        // ASCII-7-bit=159  Latin1=181  UTF8=171  CP1252=159  [top Latin1]\n  {{(char)0x61,(char)0x71,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb7,(char)0xa9,(char)0x9c,(char)0x11,(char)0x8a,(char)0x51,(char)0x97,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"aq__\"\n        // ASCII-7-bit=183  Latin1=169  UTF8=156  CP1252=138  CP1251=151  [top ASCII-7-bit]\n  {{(char)0x61,(char)0x72,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa0,(char)0xb9,(char)0x9e,(char)0x13,(char)0x98,(char)0x55,(char)0x2c,(char)0x13,(char)0x28,(char)0x26,(char)0x27,(char)0x11,(char)0x2e,(char)0x21,(char)0x42,}}, // \"ar__\"\n        // ASCII-7-bit=160  Latin1=185  UTF8=158  CP1252=152  KSC=85  SJS=44  BIG5=40  Latin2=38  CP1251=39  CP1250=46  ISO-8859-15=66  [top Latin1]\n  {{(char)0x61,(char)0x73,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa9,(char)0xb7,(char)0x9f,(char)0x11,(char)0x94,(char)0x11,(char)0x52,(char)0x22,(char)0x64,(char)0x52,(char)0x12,(char)0x7d,(char)0x74,(char)0x21,(char)0x52,}}, // \"as__\"\n        // ASCII-7-bit=169  Latin1=183  UTF8=159  CP1252=148  SJS=82  Latin2=100  CP1251=82  CP1250=125  Latin5=116  CP1257=82  [top Latin1]\n  {{(char)0x61,(char)0x74,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa1,(char)0xb8,(char)0xa5,(char)0x11,(char)0x9a,(char)0x11,(char)0x48,(char)0x21,(char)0x51,(char)0x13,(char)0x45,(char)0x53,(char)0x4a,(char)0x11,(char)0x62,}}, // \"at__\"\n        // ASCII-7-bit=161  Latin1=184  UTF8=165  CP1252=154  SJS=72  Latin2=81  CP1256=69  CP1250=83  Latin5=74  ISO-8859-15=98  [top Latin1]\n  {{(char)0x61,(char)0x75,(char)0x5f,(char)0x5f, (char)0x09,(char)0xb8,(char)0xa3,(char)0x9f,(char)0x4e,(char)0x9a,(char)0x55,(char)0x54,(char)0x3e,(char)0x5e,(char)0x22,(char)0x30,(char)0x3d,(char)0x21,(char)0x36,(char)0x00,}}, // \"au__\"\n        // ASCII-7-bit=184  Latin1=163  UTF8=159  GB=78  CP1252=154  KSC=85  SJS=84  EUC-JP=62  BIG5=94  CP1256=48  CP1250=61  ISO-8859-15=54  [top ASCII-7-bit]\n  {{(char)0x61,(char)0x77,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb6,(char)0xa2,(char)0xaa,(char)0x11,(char)0x99,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"aw__\"\n        // ASCII-7-bit=182  Latin1=162  UTF8=170  CP1252=153  [top ASCII-7-bit]\n  {{(char)0x61,(char)0x78,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9d,(char)0xba,(char)0xa2,(char)0x11,(char)0x90,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ax__\"\n        // ASCII-7-bit=157  Latin1=186  UTF8=162  CP1252=144  [top Latin1]\n  {{(char)0x61,(char)0x7a,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9a,(char)0x7d,(char)0xb8,(char)0x11,(char)0x86,(char)0x54,(char)0xa8,(char)0x54,(char)0x54,(char)0x91,(char)0x41,(char)0x4c,(char)0x31,(char)0x6c,(char)0x00,}}, // \"az__\"\n        // ASCII-7-bit=154  Latin1=125  UTF8=184  CP1252=134  CP1251=168  CP1256=84  CP1250=84  Latin5=145  KOI8R=76  CP1254=108  [top UTF8]\n  {{(char)0x62,(char)0x61,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa0,(char)0x7e,(char)0xb2,(char)0x11,(char)0x78,(char)0x44,(char)0x89,(char)0x66,(char)0x49,(char)0xb1,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ba__\"\n        // ASCII-7-bit=160  Latin1=126  UTF8=178  CP1252=120  Latin2=137  CP1251=102  CP1256=73  CP1250=177  [top UTF8]\n  {{(char)0x62,(char)0x62,(char)0x5f,(char)0x5f, (char)0x03,(char)0xba,(char)0xa0,(char)0x7f,(char)0x11,(char)0xa0,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bb__\"\n        // ASCII-7-bit=186  Latin1=160  UTF8=127  CP1252=160  [top ASCII-7-bit]\n  {{(char)0x62,(char)0x64,(char)0x5f,(char)0x5f, (char)0x03,(char)0xbd,(char)0x94,(char)0x8c,(char)0x11,(char)0x8a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bd__\"\n        // ASCII-7-bit=189  Latin1=148  UTF8=140  CP1252=138  [top ASCII-7-bit]\n  {{(char)0x62,(char)0x65,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb1,(char)0xb0,(char)0xa1,(char)0x11,(char)0x9d,(char)0x11,(char)0x5f,(char)0x22,(char)0x4e,(char)0x50,(char)0x12,(char)0x4d,(char)0x59,(char)0x11,(char)0x5f,}}, // \"be__\"\n        // ASCII-7-bit=177  Latin1=176  UTF8=161  CP1252=157  SJS=95  Latin2=78  CP1251=80  CP1250=77  Latin5=89  ISO-8859-15=95  [top ASCII-7-bit]\n  {{(char)0x62,(char)0x66,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9f,(char)0xb9,(char)0x63,(char)0x11,(char)0xa6,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bf__\"\n        // ASCII-7-bit=159  Latin1=185  UTF8=99  CP1252=166  [top Latin1]\n  {{(char)0x62,(char)0x67,(char)0x5f,(char)0x5f, (char)0x05,(char)0x96,(char)0x70,(char)0xab,(char)0x4a,(char)0x74,(char)0x51,(char)0xb9,(char)0x11,(char)0x4f,(char)0x51,(char)0x44,(char)0x31,(char)0x45,(char)0x41,(char)0x54,}}, // \"bg__\"\n        // ASCII-7-bit=150  Latin1=112  UTF8=171  GB=74  CP1252=116  CP1251=185  CP1250=79  KOI8R=68  CP1254=69  ISO-8859-5=84  [top CP1251]\n  {{(char)0x62,(char)0x68,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9f,(char)0x94,(char)0xa5,(char)0x11,(char)0x84,(char)0x11,(char)0x53,(char)0x41,(char)0xb8,(char)0x10,(char)0x61,(char)0x70,(char)0x00,(char)0x00,(char)0x00,}}, // \"bh__\"\n        // ASCII-7-bit=159  Latin1=148  UTF8=165  CP1252=132  SJS=83  CP1256=184  Arabic=112  [top CP1256]\n  {{(char)0x62,(char)0x69,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa4,(char)0xa5,(char)0xb8,(char)0x12,(char)0x82,(char)0x65,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bi__\"\n        // ASCII-7-bit=164  Latin1=165  UTF8=184  CP1252=130  KSC=101  [top UTF8]\n  {{(char)0x62,(char)0x69,(char)0x7a,(char)0x5f, (char)0x0e,(char)0xae,(char)0xa5,(char)0xa1,(char)0x77,(char)0x96,(char)0x7f,(char)0x95,(char)0x9c,(char)0x7a,(char)0x8e,(char)0x8b,(char)0x80,(char)0x80,(char)0x92,(char)0x00,}}, // \"biz_\"\n        // ASCII-7-bit=174  Latin1=165  UTF8=161  GB=119  CP1252=150  KSC=127  SJS=149  EUC-JP=156  BIG5=122  Latin2=142  CP1251=139  CP1256=128  CP1250=128  Latin5=146  [top ASCII-7-bit]\n  {{(char)0x62,(char)0x6a,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9b,(char)0xb6,(char)0x8a,(char)0x11,(char)0xaf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bj__\"\n        // ASCII-7-bit=155  Latin1=182  UTF8=138  CP1252=175  [top Latin1]\n  {{(char)0x62,(char)0x6d,(char)0x5f,(char)0x5f, (char)0x05,(char)0xbb,(char)0x95,(char)0xa0,(char)0x5a,(char)0x95,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bm__\"\n        // ASCII-7-bit=187  Latin1=149  UTF8=160  GB=90  CP1252=149  [top ASCII-7-bit]\n  {{(char)0x62,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x05,(char)0xb8,(char)0x98,(char)0xa6,(char)0x6d,(char)0xa0,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bn__\"\n        // ASCII-7-bit=184  Latin1=152  UTF8=166  GB=109  CP1252=160  [top ASCII-7-bit]\n  {{(char)0x62,(char)0x6f,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9a,(char)0xba,(char)0x9f,(char)0x11,(char)0x9c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bo__\"\n        // ASCII-7-bit=154  Latin1=186  UTF8=159  CP1252=156  [top Latin1]\n  {{(char)0x62,(char)0x72,(char)0x5f,(char)0x5f, (char)0x07,(char)0x9c,(char)0xba,(char)0x9c,(char)0x1f,(char)0x95,(char)0x21,(char)0x43,(char)0x15,(char)0x1c,(char)0x20,(char)0x17,(char)0x0e,(char)0x2b,(char)0x21,(char)0x5a,}}, // \"br__\"\n        // ASCII-7-bit=156  Latin1=186  UTF8=156  GB=31  CP1252=149  KSC=33  SJS=67  BIG5=28  Latin2=32  CP1251=23  CP1256=14  CP1250=43  ISO-8859-15=90  [top Latin1]\n  {{(char)0x62,(char)0x73,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb2,(char)0xb4,(char)0x9c,(char)0x11,(char)0x76,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bs__\"\n        // ASCII-7-bit=178  Latin1=180  UTF8=156  CP1252=118  [top Latin1]\n  {{(char)0x62,(char)0x74,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb9,(char)0x96,(char)0xa7,(char)0x11,(char)0x94,(char)0x11,(char)0x6f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bt__\"\n        // ASCII-7-bit=185  Latin1=150  UTF8=167  CP1252=148  SJS=111  [top ASCII-7-bit]\n  {{(char)0x62,(char)0x77,(char)0x5f,(char)0x5f, (char)0x03,(char)0xbb,(char)0x9b,(char)0x88,(char)0x11,(char)0x9d,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bw__\"\n        // ASCII-7-bit=187  Latin1=155  UTF8=136  CP1252=157  [top ASCII-7-bit]\n  {{(char)0x62,(char)0x79,(char)0x5f,(char)0x5f, (char)0x03,(char)0x8a,(char)0x7b,(char)0xa4,(char)0x11,(char)0x74,(char)0x42,(char)0x5d,(char)0xb6,(char)0x11,(char)0x4b,(char)0x21,(char)0x5f,(char)0x21,(char)0xa9,(char)0x00,}}, // \"by__\"\n        // ASCII-7-bit=138  Latin1=123  UTF8=164  CP1252=116  Latin2=93  CP1251=182  CP1250=75  ISO-8859-15=95  KOI8R=169  [top CP1251]\n  {{(char)0x62,(char)0x7a,(char)0x5f,(char)0x5f, (char)0x03,(char)0xaf,(char)0x9f,(char)0xa1,(char)0x19,(char)0x90,(char)0x89,(char)0xa4,(char)0x9e,(char)0x8c,(char)0x65,(char)0x8d,(char)0x64,(char)0x70,(char)0x51,(char)0x7e,}}, // \"bz__\"\n        // ASCII-7-bit=175  Latin1=159  UTF8=161  CP1252=144  KSC=137  SJS=164  EUC-JP=158  BIG5=140  Latin2=101  CP1251=141  CP1256=100  CP1250=112  KOI8R=126  [top ASCII-7-bit]\n  {{(char)0x63,(char)0x61,(char)0x5f,(char)0x5f, (char)0x07,(char)0xb3,(char)0xac,(char)0xa0,(char)0x5b,(char)0x9b,(char)0x5f,(char)0x49,(char)0x15,(char)0x56,(char)0x3c,(char)0x5d,(char)0x48,(char)0x42,(char)0x21,(char)0x94,}}, // \"ca__\"\n        // ASCII-7-bit=179  Latin1=172  UTF8=160  GB=91  CP1252=155  KSC=95  SJS=73  BIG5=86  Latin2=60  CP1251=93  CP1256=72  CP1250=66  ISO-8859-15=148  [top ASCII-7-bit]\n  {{(char)0x63,(char)0x61,(char)0x74,(char)0x5f, (char)0x03,(char)0x9a,(char)0xb4,(char)0xad,(char)0x11,(char)0x9f,(char)0x11,(char)0x30,(char)0x31,(char)0x30,(char)0x32,(char)0x30,(char)0x6e,(char)0x00,(char)0x00,(char)0x00,}}, // \"cat_\"\n        // ASCII-7-bit=154  Latin1=180  UTF8=173  CP1252=159  SJS=48  CP1251=48  ISO-8859-11=48  ISO-8859-15=110  [top Latin1]\n  {{(char)0x63,(char)0x63,(char)0x5f,(char)0x5f, (char)0x09,(char)0x9d,(char)0xab,(char)0xad,(char)0x9b,(char)0x86,(char)0x80,(char)0x90,(char)0x9e,(char)0x92,(char)0x21,(char)0x8a,(char)0x11,(char)0x7a,(char)0x51,(char)0x75,}}, // \"cc__\"\n        // ASCII-7-bit=157  Latin1=171  UTF8=173  GB=155  CP1252=134  KSC=128  SJS=144  EUC-JP=158  BIG5=146  CP1256=138  Latin5=122  GBK=117  [top UTF8]\n  {{(char)0x63,(char)0x64,(char)0x5f,(char)0x5f, (char)0x09,(char)0xae,(char)0xa2,(char)0xb2,(char)0x5a,(char)0x95,(char)0x5a,(char)0x8f,(char)0x64,(char)0x5a,(char)0x11,(char)0x7d,(char)0x11,(char)0x74,(char)0x11,(char)0x5a,}}, // \"cd__\"\n        // ASCII-7-bit=174  Latin1=162  UTF8=178  GB=90  CP1252=149  KSC=90  SJS=143  EUC-JP=100  BIG5=90  CP1251=125  CP1250=116  ISO-8859-11=90  [top UTF8]\n  {{(char)0x63,(char)0x67,(char)0x5f,(char)0x5f, (char)0x03,(char)0x83,(char)0x8d,(char)0xbe,(char)0x11,(char)0x83,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cg__\"\n        // ASCII-7-bit=131  Latin1=141  UTF8=190  CP1252=131  [top UTF8]\n  {{(char)0x63,(char)0x68,(char)0x5f,(char)0x5f, (char)0x05,(char)0xaa,(char)0xb6,(char)0xa1,(char)0x4c,(char)0x9a,(char)0x11,(char)0x46,(char)0x25,(char)0x49,(char)0x3e,(char)0x41,(char)0x44,(char)0x43,(char)0x11,(char)0x66,}}, // \"ch__\"\n        // ASCII-7-bit=170  Latin1=182  UTF8=161  GB=76  CP1252=154  SJS=70  Latin2=73  CP1251=62  CP1256=65  CP1250=68  Latin5=67  ISO-8859-15=102  [top Latin1]\n  {{(char)0x63,(char)0x69,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9c,(char)0xae,(char)0xb3,(char)0x11,(char)0xa1,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ci__\"\n        // ASCII-7-bit=156  Latin1=174  UTF8=179  CP1252=161  [top UTF8]\n  {{(char)0x63,(char)0x6b,(char)0x5f,(char)0x5f, (char)0x03,(char)0xba,(char)0x9c,(char)0x9e,(char)0x11,(char)0x9a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ck__\"\n        // ASCII-7-bit=186  Latin1=156  UTF8=158  CP1252=154  [top ASCII-7-bit]\n  {{(char)0x63,(char)0x6c,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa4,(char)0xb9,(char)0x9c,(char)0x11,(char)0x97,(char)0x11,(char)0x3e,(char)0x27,(char)0x1b,(char)0x1b,(char)0x2d,(char)0x34,(char)0x2b,(char)0x21,(char)0x3b,}}, // \"cl__\"\n        // ASCII-7-bit=164  Latin1=185  UTF8=156  CP1252=151  SJS=62  Latin2=27  CP1251=27  CP1256=45  CP1250=52  Latin5=43  ISO-8859-11=33  ISO-8859-15=59  [top Latin1]\n  {{(char)0x63,(char)0x6d,(char)0x5f,(char)0x5f, (char)0x03,(char)0x93,(char)0xbd,(char)0x64,(char)0x11,(char)0x97,(char)0xa1,(char)0x6c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cm__\"\n        // ASCII-7-bit=147  Latin1=189  UTF8=100  CP1252=151  ISO-8859-15=108  [top Latin1]\n  {{(char)0x63,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x09,(char)0x8c,(char)0x5c,(char)0xa7,(char)0xba,(char)0x4f,(char)0x48,(char)0x57,(char)0x3c,(char)0x8d,(char)0x12,(char)0x4e,(char)0x4f,(char)0x71,(char)0x64,(char)0x00,}}, // \"cn__\"\n        // ASCII-7-bit=140  Latin1=92  UTF8=167  GB=186  CP1252=79  KSC=72  SJS=87  EUC-JP=60  BIG5=141  CP1251=78  CP1256=79  GBK=100  [top GB]\n  {{(char)0x63,(char)0x6f,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa8,(char)0xb7,(char)0xa3,(char)0x12,(char)0x91,(char)0x27,(char)0x31,(char)0x3f,(char)0x13,(char)0x2f,(char)0x2a,(char)0x2a,(char)0x61,(char)0x27,(char)0x00,}}, // \"co__\"\n        // ASCII-7-bit=168  Latin1=183  UTF8=163  CP1252=145  KSC=39  Latin2=63  CP1256=47  CP1250=42  Latin5=42  Greek=39  [top Latin1]\n  {{(char)0x63,(char)0x6f,(char)0x6d,(char)0x5f, (char)0x09,(char)0xb2,(char)0xa5,(char)0xa7,(char)0x94,(char)0x94,(char)0x87,(char)0x87,(char)0x7d,(char)0x82,(char)0x12,(char)0x6e,(char)0x89,(char)0x12,(char)0x7f,(char)0x70,}}, // \"com_\"\n        // ASCII-7-bit=178  Latin1=165  UTF8=167  GB=148  CP1252=148  KSC=135  SJS=135  EUC-JP=125  BIG5=130  CP1251=110  CP1256=137  Latin5=127  ISO-8859-11=112  [top ASCII-7-bit]\n  {{(char)0x63,(char)0x6f,(char)0x6f,(char)0x70, (char)0x03,(char)0xaf,(char)0xa8,(char)0xa0,(char)0x14,(char)0x9c,(char)0x75,(char)0xa7,(char)0x86,(char)0x71,(char)0x78,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"coop\"\n        // ASCII-7-bit=175  Latin1=168  UTF8=160  CP1252=156  KSC=117  SJS=167  EUC-JP=134  ISO-8859-15=120  [top ASCII-7-bit]\n  {{(char)0x63,(char)0x72,(char)0x5f,(char)0x5f, (char)0x03,(char)0x99,(char)0xb7,(char)0xad,(char)0x11,(char)0x84,(char)0x81,(char)0x28,(char)0x11,(char)0x28,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cr__\"\n        // ASCII-7-bit=153  Latin1=183  UTF8=173  CP1252=132  Latin5=40  ISO-8859-15=40  [top Latin1]\n  {{(char)0x63,(char)0x75,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa0,(char)0xb7,(char)0x9f,(char)0x11,(char)0xa6,(char)0x53,(char)0x31,(char)0x45,(char)0x45,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cu__\"\n        // ASCII-7-bit=160  Latin1=183  UTF8=159  CP1252=166  CP1251=49  CP1256=69  CP1250=69  [top Latin1]\n  {{(char)0x63,(char)0x76,(char)0x5f,(char)0x5f, (char)0x03,(char)0x90,(char)0xbc,(char)0x8f,(char)0x11,(char)0x98,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cv__\"\n        // ASCII-7-bit=144  Latin1=188  UTF8=143  CP1252=152  [top Latin1]\n  {{(char)0x63,(char)0x78,(char)0x5f,(char)0x5f, (char)0x03,(char)0xae,(char)0xa2,(char)0xa5,(char)0x15,(char)0x87,(char)0x76,(char)0x9f,(char)0x9a,(char)0x83,(char)0x41,(char)0x85,(char)0x11,(char)0x7e,(char)0x51,(char)0x99,}}, // \"cx__\"\n        // ASCII-7-bit=174  Latin1=162  UTF8=165  CP1252=135  KSC=118  SJS=159  EUC-JP=154  BIG5=131  Latin5=133  ISO-8859-15=126  JIS=153  [top ASCII-7-bit]\n  {{(char)0x63,(char)0x79,(char)0x5f,(char)0x5f, (char)0x03,(char)0xaa,(char)0x88,(char)0xac,(char)0x11,(char)0x86,(char)0x51,(char)0x63,(char)0x21,(char)0x5c,(char)0x61,(char)0x9e,(char)0x12,(char)0x52,(char)0xae,(char)0x00,}}, // \"cy__\"\n        // ASCII-7-bit=170  Latin1=136  UTF8=172  CP1252=134  CP1251=99  Latin5=92  Greek=158  CP1254=82  CP1253=174  [top CP1253]\n  {{(char)0x63,(char)0x7a,(char)0x5f,(char)0x5f, (char)0x03,(char)0x8f,(char)0x74,(char)0xb2,(char)0x11,(char)0x56,(char)0x42,(char)0x8c,(char)0x4a,(char)0x11,(char)0xb5,(char)0x10,(char)0x21,(char)0x3f,(char)0x11,(char)0x41,}}, // \"cz__\"\n        // ASCII-7-bit=143  Latin1=116  UTF8=178  CP1252=86  Latin2=140  CP1251=74  CP1250=181  MACINTOSH=63  CP852=65  [top CP1250]\n  {{(char)0x64,(char)0x65,(char)0x5f,(char)0x5f, (char)0x06,(char)0xa4,(char)0xb7,(char)0xa4,(char)0x40,(char)0x9a,(char)0x36,(char)0x35,(char)0x4b,(char)0x4d,(char)0x43,(char)0x4d,(char)0x4f,(char)0x11,(char)0x79,(char)0x00,}}, // \"de__\"\n        // ASCII-7-bit=164  Latin1=183  UTF8=164  GB=64  CP1252=154  KSC=54  Latin2=75  CP1251=77  CP1256=67  CP1250=77  Latin5=79  ISO-8859-15=121  [top Latin1]\n  {{(char)0x64,(char)0x6a,(char)0x5f,(char)0x5f, (char)0x08,(char)0xa3,(char)0xad,(char)0xa9,(char)0x90,(char)0xa2,(char)0x7d,(char)0x7a,(char)0x68,(char)0x21,(char)0xa0,(char)0x11,(char)0x5e,(char)0xb1,(char)0x5e,(char)0x00,}}, // \"dj__\"\n        // ASCII-7-bit=163  Latin1=173  UTF8=169  GB=144  CP1252=162  KSC=125  SJS=122  EUC-JP=104  CP1251=160  CP1250=94  CP932=94  [top Latin1]\n  {{(char)0x64,(char)0x6b,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9d,(char)0xb8,(char)0xa7,(char)0x11,(char)0x93,(char)0x11,(char)0x39,(char)0x25,(char)0x38,(char)0x34,(char)0x57,(char)0x43,(char)0x3d,(char)0x11,(char)0x54,}}, // \"dk__\"\n        // ASCII-7-bit=157  Latin1=184  UTF8=167  CP1252=147  SJS=57  Latin2=56  CP1251=52  CP1256=87  CP1250=67  Latin5=61  ISO-8859-15=84  [top Latin1]\n  {{(char)0x64,(char)0x6d,(char)0x5f,(char)0x5f, (char)0x03,(char)0xbc,(char)0x76,(char)0xa3,(char)0x11,(char)0x83,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"dm__\"\n        // ASCII-7-bit=188  Latin1=118  UTF8=163  CP1252=131  [top ASCII-7-bit]\n  {{(char)0x64,(char)0x6f,(char)0x5f,(char)0x5f, (char)0x05,(char)0xa4,(char)0xb6,(char)0xa9,(char)0x6b,(char)0x93,(char)0x31,(char)0x43,(char)0x61,(char)0x57,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"do__\"\n        // ASCII-7-bit=164  Latin1=182  UTF8=169  GB=107  CP1252=147  BIG5=67  ISO-8859-15=87  [top Latin1]\n  {{(char)0x64,(char)0x7a,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9e,(char)0xb6,(char)0x8d,(char)0x11,(char)0xa1,(char)0x62,(char)0xa6,(char)0x4e,(char)0x10,(char)0x51,(char)0x58,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"dz__\"\n        // ASCII-7-bit=158  Latin1=182  UTF8=141  CP1252=161  CP1256=166  CP1250=78  Arabic=88  [top Latin1]\n  {{(char)0x65,(char)0x63,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa2,(char)0xba,(char)0x9c,(char)0x11,(char)0x96,(char)0x35,(char)0x3c,(char)0x32,(char)0x5a,(char)0x32,(char)0x3c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ec__\"\n        // ASCII-7-bit=162  Latin1=186  UTF8=156  CP1252=150  BIG5=60  Latin2=50  CP1251=90  CP1256=50  CP1250=60  [top Latin1]\n  {{(char)0x65,(char)0x64,(char)0x75,(char)0x5f, (char)0x07,(char)0xbb,(char)0x97,(char)0x99,(char)0x51,(char)0x94,(char)0x6b,(char)0x49,(char)0x11,(char)0x4e,(char)0x21,(char)0x4f,(char)0x13,(char)0x4c,(char)0x41,(char)0x44,}}, // \"edu_\"\n        // ASCII-7-bit=187  Latin1=151  UTF8=153  GB=81  CP1252=148  KSC=107  SJS=73  BIG5=78  CP1256=79  Latin5=76  ISO-8859-11=65  ISO-8859-15=68  [top ASCII-7-bit]\n  {{(char)0x65,(char)0x65,(char)0x5f,(char)0x5f, (char)0x03,(char)0x97,(char)0xaf,(char)0xb4,(char)0x11,(char)0x95,(char)0x42,(char)0x6f,(char)0x78,(char)0x42,(char)0x82,(char)0x87,(char)0xc2,(char)0x5e,(char)0x65,(char)0x00,}}, // \"ee__\"\n        // ASCII-7-bit=151  Latin1=175  UTF8=180  CP1252=149  Latin2=111  CP1251=120  ISO-8859-15=130  CP1257=135  ISO-8859-13=94  Latin4=101  [top UTF8]\n  {{(char)0x65,(char)0x67,(char)0x5f,(char)0x5f, (char)0x05,(char)0x9f,(char)0x7a,(char)0xa7,(char)0x55,(char)0x7d,(char)0x61,(char)0xb9,(char)0x32,(char)0x28,(char)0x28,(char)0x61,(char)0x28,(char)0x00,(char)0x00,(char)0x00,}}, // \"eg__\"\n        // ASCII-7-bit=159  Latin1=122  UTF8=167  GB=85  CP1252=125  CP1256=185  ISO-8859-15=40  CP1257=40  CP1253=40  [top CP1256]\n  {{(char)0x65,(char)0x73,(char)0x5f,(char)0x5f, (char)0x05,(char)0x9f,(char)0xb8,(char)0xa8,(char)0x22,(char)0x91,(char)0x11,(char)0x2b,(char)0x15,(char)0x18,(char)0x33,(char)0x4d,(char)0x31,(char)0x23,(char)0x21,(char)0x6c,}}, // \"es__\"\n        // ASCII-7-bit=159  Latin1=184  UTF8=168  GB=34  CP1252=145  SJS=43  BIG5=24  Latin2=51  CP1251=77  CP1256=49  CP1250=35  ISO-8859-15=108  [top Latin1]\n  {{(char)0x65,(char)0x74,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb5,(char)0x9a,(char)0xa8,(char)0x11,(char)0xa6,(char)0x11,(char)0x7e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"et__\"\n        // ASCII-7-bit=181  Latin1=154  UTF8=168  CP1252=166  SJS=126  [top ASCII-7-bit]\n  {{(char)0x65,(char)0x75,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa8,(char)0xa4,(char)0xb5,(char)0x11,(char)0x91,(char)0x42,(char)0x8d,(char)0x69,(char)0x12,(char)0x8b,(char)0x6a,(char)0x11,(char)0x78,(char)0x41,(char)0x78,}}, // \"eu__\"\n        // ASCII-7-bit=168  Latin1=164  UTF8=181  CP1252=145  Latin2=141  CP1251=105  CP1250=139  Latin5=106  ISO-8859-15=120  Greek=120  [top UTF8]\n  {{(char)0x66,(char)0x69,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9e,(char)0xb7,(char)0xaa,(char)0x11,(char)0x96,(char)0x51,(char)0x46,(char)0x11,(char)0x31,(char)0x22,(char)0x69,(char)0x31,(char)0x00,(char)0x00,(char)0x00,}}, // \"fi__\"\n        // ASCII-7-bit=158  Latin1=183  UTF8=170  CP1252=150  CP1251=70  CP1250=49  ISO-8859-15=105  CP1257=49  [top Latin1]\n  {{(char)0x66,(char)0x6a,(char)0x5f,(char)0x5f, (char)0x05,(char)0xba,(char)0x8b,(char)0x9f,(char)0x59,(char)0xa0,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"fj__\"\n        // ASCII-7-bit=186  Latin1=139  UTF8=159  GB=89  CP1252=160  [top ASCII-7-bit]\n  {{(char)0x66,(char)0x6b,(char)0x5f,(char)0x5f, (char)0x02,(char)0xba,(char)0xa6,(char)0x21,(char)0x96,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"fk__\"\n        // ASCII-7-bit=186  Latin1=166  CP1252=150  [top ASCII-7-bit]\n  {{(char)0x66,(char)0x6d,(char)0x5f,(char)0x5f, (char)0x03,(char)0x91,(char)0x92,(char)0xbc,(char)0x11,(char)0x82,(char)0x12,(char)0x7d,(char)0x6d,(char)0x12,(char)0x86,(char)0x6a,(char)0x51,(char)0x67,(char)0x00,(char)0x00,}}, // \"fm__\"\n        // ASCII-7-bit=145  Latin1=146  UTF8=188  CP1252=130  SJS=125  EUC-JP=109  Latin2=134  CP1251=106  CP1257=103  [top UTF8]\n  {{(char)0x66,(char)0x6f,(char)0x5f,(char)0x5f, (char)0x03,(char)0x93,(char)0xbc,(char)0x9c,(char)0x11,(char)0x8c,(char)0x71,(char)0x57,(char)0x21,(char)0x51,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"fo__\"\n        // ASCII-7-bit=147  Latin1=188  UTF8=156  CP1252=140  CP1250=87  ISO-8859-15=81  [top Latin1]\n  {{(char)0x66,(char)0x72,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9f,(char)0xb3,(char)0xaf,(char)0x11,(char)0x99,(char)0x17,(char)0x37,(char)0x32,(char)0x32,(char)0x35,(char)0x41,(char)0x4f,(char)0x35,(char)0x21,(char)0x77,}}, // \"fr__\"\n        // ASCII-7-bit=159  Latin1=179  UTF8=175  CP1252=153  SJS=55  EUC-JP=50  BIG5=50  Latin2=53  CP1251=65  CP1256=79  CP1250=53  ISO-8859-15=119  [top Latin1]\n  {{(char)0x67,(char)0x61,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa8,(char)0xb6,(char)0xa5,(char)0x11,(char)0x95,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ga__\"\n        // ASCII-7-bit=168  Latin1=182  UTF8=165  CP1252=149  [top Latin1]\n  {{(char)0x67,(char)0x64,(char)0x5f,(char)0x5f, (char)0x05,(char)0xb5,(char)0xac,(char)0x9a,(char)0x80,(char)0x8a,(char)0x81,(char)0x97,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gd__\"\n        // ASCII-7-bit=181  Latin1=172  UTF8=154  GB=128  CP1252=138  Latin5=151  [top ASCII-7-bit]\n  {{(char)0x67,(char)0x65,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa5,(char)0x7d,(char)0xba,(char)0x11,(char)0x8d,(char)0x21,(char)0x58,(char)0x21,(char)0x8b,(char)0x11,(char)0x71,(char)0x21,(char)0x4f,(char)0xb1,(char)0x4c,}}, // \"ge__\"\n        // ASCII-7-bit=165  Latin1=125  UTF8=186  CP1252=141  EUC-JP=88  CP1251=139  CP1250=113  ISO-8859-15=79  ISO-8859-5=76  [top UTF8]\n  {{(char)0x67,(char)0x67,(char)0x5f,(char)0x5f, (char)0x03,(char)0xad,(char)0xa9,(char)0xb0,(char)0x11,(char)0x95,(char)0x11,(char)0x60,(char)0x81,(char)0x93,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gg__\"\n        // ASCII-7-bit=173  Latin1=169  UTF8=176  CP1252=149  SJS=96  ISO-8859-15=147  [top UTF8]\n  {{(char)0x67,(char)0x68,(char)0x5f,(char)0x5f, (char)0x03,(char)0xac,(char)0xb3,(char)0x99,(char)0x11,(char)0xa6,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gh__\"\n        // ASCII-7-bit=172  Latin1=179  UTF8=153  CP1252=166  [top Latin1]\n  {{(char)0x67,(char)0x69,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb3,(char)0xa1,(char)0xa1,(char)0x11,(char)0x9c,(char)0xa1,(char)0xa8,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gi__\"\n        // ASCII-7-bit=179  Latin1=161  UTF8=161  CP1252=156  ISO-8859-15=168  [top ASCII-7-bit]\n  {{(char)0x67,(char)0x6c,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa7,(char)0xb2,(char)0xaa,(char)0x11,(char)0xa1,(char)0x11,(char)0x43,(char)0x11,(char)0x4d,(char)0x61,(char)0x70,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gl__\"\n        // ASCII-7-bit=167  Latin1=178  UTF8=170  CP1252=161  SJS=67  BIG5=77  ISO-8859-15=112  [top Latin1]\n  {{(char)0x67,(char)0x6d,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb8,(char)0x89,(char)0xa0,(char)0x11,(char)0xa7,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gm__\"\n        // ASCII-7-bit=184  Latin1=137  UTF8=160  CP1252=167  [top ASCII-7-bit]\n  {{(char)0x67,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x03,(char)0xaa,(char)0xb8,(char)0x89,(char)0x11,(char)0x9d,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gn__\"\n        // ASCII-7-bit=170  Latin1=184  UTF8=137  CP1252=157  [top Latin1]\n  {{(char)0x67,(char)0x6f,(char)0x76,(char)0x5f, (char)0x05,(char)0xbd,(char)0x92,(char)0x94,(char)0x22,(char)0x87,(char)0x11,(char)0x2e,(char)0x33,(char)0x36,(char)0x15,(char)0x2e,(char)0x13,(char)0x14,(char)0x1f,(char)0x0e,}}, // \"gov_\"\n        // ASCII-7-bit=189  Latin1=146  UTF8=148  GB=34  CP1252=135  SJS=46  CP1251=54  CP1256=21  CP1250=46  ISO-8859-11=20  ISO-8859-15=31  CP1257=14  [top ASCII-7-bit]\n  {{(char)0x67,(char)0x70,(char)0x5f,(char)0x5f, (char)0x03,(char)0x98,(char)0x9f,(char)0xbb,(char)0x11,(char)0x83,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gp__\"\n        // ASCII-7-bit=152  Latin1=159  UTF8=187  CP1252=131  [top UTF8]\n  {{(char)0x67,(char)0x72,(char)0x5f,(char)0x5f, (char)0x05,(char)0xa1,(char)0x7f,(char)0xa8,(char)0x45,(char)0x80,(char)0x42,(char)0x49,(char)0x54,(char)0x12,(char)0x44,(char)0x45,(char)0x61,(char)0xb5,(char)0x21,(char)0x9e,}}, // \"gr__\"\n        // ASCII-7-bit=161  Latin1=127  UTF8=168  GB=69  CP1252=128  Latin2=73  CP1251=84  CP1250=68  Latin5=69  Greek=181  CP1253=158  [top Greek]\n  {{(char)0x67,(char)0x73,(char)0x5f,(char)0x5f, (char)0x05,(char)0xb0,(char)0x93,(char)0x98,(char)0x68,(char)0x88,(char)0x13,(char)0xa2,(char)0xa7,(char)0x75,(char)0x42,(char)0x99,(char)0x98,(char)0x91,(char)0x66,(char)0x00,}}, // \"gs__\"\n        // ASCII-7-bit=176  Latin1=147  UTF8=152  GB=104  CP1252=136  SJS=162  EUC-JP=167  BIG5=117  Latin5=153  ISO-8859-11=152  CP932=102  [top ASCII-7-bit]\n  {{(char)0x67,(char)0x74,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa3,(char)0xb6,(char)0xa9,(char)0x12,(char)0x95,(char)0x3d,(char)0x91,(char)0x3d,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gt__\"\n        // ASCII-7-bit=163  Latin1=182  UTF8=169  CP1252=149  KSC=61  ISO-8859-15=61  [top Latin1]\n  {{(char)0x67,(char)0x75,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb9,(char)0xa0,(char)0x7d,(char)0x11,(char)0xa5,(char)0x11,(char)0x7d,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gu__\"\n        // ASCII-7-bit=185  Latin1=160  UTF8=125  CP1252=165  SJS=125  [top ASCII-7-bit]\n  {{(char)0x67,(char)0x79,(char)0x5f,(char)0x5f, (char)0x03,(char)0xbc,(char)0x82,(char)0xa2,(char)0x11,(char)0x87,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gy__\"\n        // ASCII-7-bit=188  Latin1=130  UTF8=162  CP1252=135  [top ASCII-7-bit]\n  {{(char)0x68,(char)0x6b,(char)0x5f,(char)0x5f, (char)0x07,(char)0xa6,(char)0x6c,(char)0xa3,(char)0xa0,(char)0x6b,(char)0x38,(char)0x53,(char)0x11,(char)0xb5,(char)0xa1,(char)0x73,(char)0xc1,(char)0x3d,(char)0x21,(char)0x49,}}, // \"hk__\"\n        // ASCII-7-bit=166  Latin1=108  UTF8=163  GB=160  CP1252=107  KSC=56  SJS=83  BIG5=181  GBK=115  GB18030=61  BIG5_HKSCS=73  [top BIG5]\n  {{(char)0x68,(char)0x6d,(char)0x5f,(char)0x5f, (char)0x05,(char)0xa8,(char)0x9e,(char)0xaa,(char)0x67,(char)0x67,(char)0x13,(char)0xac,(char)0x9f,(char)0x95,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"hm__\"\n        // ASCII-7-bit=168  Latin1=158  UTF8=170  GB=103  CP1252=103  SJS=172  EUC-JP=159  BIG5=149  [top SJS]\n  {{(char)0x68,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa1,(char)0xb7,(char)0xa6,(char)0x11,(char)0x9c,(char)0x51,(char)0x4d,(char)0x31,(char)0x4d,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"hn__\"\n        // ASCII-7-bit=161  Latin1=183  UTF8=166  CP1252=156  CP1251=77  ISO-8859-11=77  [top Latin1]\n  {{(char)0x68,(char)0x72,(char)0x5f,(char)0x5f, (char)0x03,(char)0x99,(char)0x67,(char)0xa7,(char)0x11,(char)0x67,(char)0x42,(char)0x9d,(char)0x20,(char)0x11,(char)0xb8,(char)0x10,(char)0x21,(char)0x26,(char)0x11,(char)0x32,}}, // \"hr__\"\n        // ASCII-7-bit=153  Latin1=103  UTF8=167  CP1252=103  Latin2=157  CP1251=32  CP1250=184  MACINTOSH=38  CP852=50  [top CP1250]\n  {{(char)0x68,(char)0x74,(char)0x5f,(char)0x5f, (char)0x03,(char)0x95,(char)0x97,(char)0xbc,(char)0x11,(char)0x92,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ht__\"\n        // ASCII-7-bit=149  Latin1=151  UTF8=188  CP1252=146  [top UTF8]\n  {{(char)0x68,(char)0x75,(char)0x5f,(char)0x5f, (char)0x05,(char)0xa2,(char)0xa4,(char)0xad,(char)0x33,(char)0x76,(char)0x11,(char)0x3d,(char)0x25,(char)0xa7,(char)0x4a,(char)0x40,(char)0xa7,(char)0x35,(char)0x11,(char)0x3a,}}, // \"hu__\"\n        // ASCII-7-bit=162  Latin1=164  UTF8=173  GB=51  CP1252=118  SJS=61  Latin2=167  CP1251=74  CP1256=64  CP1250=167  Latin5=53  ISO-8859-15=58  [top UTF8]\n  {{(char)0x69,(char)0x64,(char)0x5f,(char)0x5f, (char)0x07,(char)0xb8,(char)0xab,(char)0x8c,(char)0x24,(char)0x97,(char)0x33,(char)0x46,(char)0x14,(char)0x2c,(char)0x1f,(char)0x1f,(char)0x7b,(char)0x22,(char)0x29,(char)0x4b,}}, // \"id__\"\n        // ASCII-7-bit=184  Latin1=171  UTF8=140  GB=36  CP1252=151  KSC=51  SJS=70  BIG5=44  Latin2=31  CP1251=31  CP1256=123  ISO-8859-11=41  ISO-8859-15=75  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x65,(char)0x5f,(char)0x5f, (char)0x05,(char)0xb3,(char)0xa6,(char)0xa0,(char)0x45,(char)0x9d,(char)0x11,(char)0x46,(char)0x21,(char)0x67,(char)0x12,(char)0x32,(char)0x4a,(char)0x22,(char)0xa3,(char)0x36,}}, // \"ie__\"\n        // ASCII-7-bit=179  Latin1=166  UTF8=160  GB=69  CP1252=157  SJS=70  Latin2=103  CP1256=50  CP1250=74  ISO-8859-15=163  CP1257=54  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x6c,(char)0x5f,(char)0x5f, (char)0x03,(char)0x94,(char)0x74,(char)0xa9,(char)0x11,(char)0x6e,(char)0x21,(char)0x3b,(char)0x23,(char)0x79,(char)0x83,(char)0x3d,(char)0x41,(char)0xb8,(char)0x71,(char)0x90,}}, // \"il__\"\n        // ASCII-7-bit=148  Latin1=116  UTF8=169  CP1252=110  EUC-JP=59  CP1251=121  CP1256=131  CP1250=61  CP1255=184  Hebrew=144  [top CP1255]\n  {{(char)0x69,(char)0x6d,(char)0x5f,(char)0x5f, (char)0x05,(char)0xb7,(char)0x8e,(char)0xaf,(char)0x89,(char)0x7e,(char)0x51,(char)0x48,(char)0x21,(char)0x71,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"im__\"\n        // ASCII-7-bit=183  Latin1=142  UTF8=175  GB=137  CP1252=126  CP1251=72  Latin5=113  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x08,(char)0xbb,(char)0x95,(char)0x9c,(char)0x5e,(char)0x99,(char)0x61,(char)0x6f,(char)0x67,(char)0x21,(char)0x60,(char)0x22,(char)0x69,(char)0x4d,(char)0x11,(char)0x4c,}}, // \"in__\"\n        // ASCII-7-bit=187  Latin1=149  UTF8=156  GB=94  CP1252=153  KSC=97  SJS=111  EUC-JP=103  CP1251=96  Latin5=105  ISO-8859-11=77  CP1257=76  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x6e,(char)0x66,(char)0x6f, (char)0x05,(char)0xac,(char)0xa7,(char)0xa7,(char)0x76,(char)0x94,(char)0x18,(char)0x93,(char)0x82,(char)0x70,(char)0x90,(char)0x91,(char)0x82,(char)0x9c,(char)0x78,(char)0x00,}}, // \"info\"\n        // ASCII-7-bit=172  Latin1=167  UTF8=167  GB=118  CP1252=148  SJS=147  EUC-JP=130  BIG5=112  Latin2=144  CP1251=145  CP1256=130  CP1250=156  Latin5=120  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x6e,(char)0x74,(char)0x5f, (char)0x05,(char)0xb2,(char)0xa7,(char)0xb0,(char)0x3a,(char)0x84,(char)0x53,(char)0x62,(char)0x55,(char)0x54,(char)0x71,(char)0x45,(char)0x21,(char)0x39,(char)0x31,(char)0x50,}}, // \"int_\"\n        // ASCII-7-bit=178  Latin1=167  UTF8=176  GB=58  CP1252=132  CP1251=98  CP1256=85  CP1250=84  Greek=69  CP1253=57  ISO-8859-5=80  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x6f,(char)0x5f,(char)0x5f, (char)0x09,(char)0xaf,(char)0x98,(char)0xac,(char)0xa8,(char)0x85,(char)0x77,(char)0x83,(char)0x7b,(char)0x67,(char)0x12,(char)0x88,(char)0x71,(char)0x22,(char)0x77,(char)0x67,}}, // \"io__\"\n        // ASCII-7-bit=175  Latin1=152  UTF8=172  GB=168  CP1252=133  KSC=119  SJS=131  EUC-JP=123  BIG5=103  CP1251=136  CP1256=113  ISO-8859-11=119  ISO-8859-15=103  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x72,(char)0x5f,(char)0x5f, (char)0x07,(char)0x9e,(char)0x8c,(char)0xb5,(char)0x55,(char)0x7e,(char)0x22,(char)0x3c,(char)0x25,(char)0x32,(char)0x32,(char)0xae,(char)0x36,(char)0x3e,(char)0x81,(char)0x52,}}, // \"ir__\"\n        // ASCII-7-bit=158  Latin1=140  UTF8=181  GB=85  CP1252=126  KSC=34  SJS=60  Latin2=50  CP1251=50  CP1256=174  CP1250=54  Latin5=62  CP1254=82  [top UTF8]\n  {{(char)0x69,(char)0x73,(char)0x5f,(char)0x5f, (char)0x05,(char)0x8f,(char)0xbc,(char)0xa0,(char)0x1b,(char)0x84,(char)0x15,(char)0x3b,(char)0x1b,(char)0x2f,(char)0x1b,(char)0x25,(char)0x11,(char)0x32,(char)0x21,(char)0x1b,}}, // \"is__\"\n        // ASCII-7-bit=143  Latin1=188  UTF8=160  GB=27  CP1252=132  SJS=59  EUC-JP=27  BIG5=47  Latin2=27  CP1251=37  CP1250=50  ISO-8859-15=27  [top Latin1]\n  {{(char)0x69,(char)0x74,(char)0x5f,(char)0x5f, (char)0x03,(char)0xac,(char)0xb4,(char)0x9e,(char)0x11,(char)0xa2,(char)0x11,(char)0x35,(char)0x21,(char)0x44,(char)0x21,(char)0x3e,(char)0x21,(char)0x60,(char)0x51,(char)0x55,}}, // \"it__\"\n        // ASCII-7-bit=172  Latin1=180  UTF8=158  CP1252=162  SJS=53  Latin2=68  CP1250=62  ISO-8859-15=96  JIS=85  [top Latin1]\n  {{(char)0x6a,(char)0x65,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb7,(char)0x8e,(char)0xab,(char)0x11,(char)0x9e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"je__\"\n        // ASCII-7-bit=183  Latin1=142  UTF8=171  CP1252=158  [top ASCII-7-bit]\n  {{(char)0x6a,(char)0x6d,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb8,(char)0xa6,(char)0x93,(char)0x11,(char)0xa0,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"jm__\"\n        // ASCII-7-bit=184  Latin1=166  UTF8=147  CP1252=160  [top ASCII-7-bit]\n  {{(char)0x6a,(char)0x6f,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa5,(char)0x73,(char)0xb0,(char)0x11,(char)0x82,(char)0x52,(char)0x3c,(char)0xb2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"jo__\"\n        // ASCII-7-bit=165  Latin1=115  UTF8=176  CP1252=130  CP1251=60  CP1256=178  [top CP1256]\n  {{(char)0x6a,(char)0x6f,(char)0x62,(char)0x73, (char)0x03,(char)0xb7,(char)0xa1,(char)0xa5,(char)0x11,(char)0xa0,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"jobs\"\n        // ASCII-7-bit=183  Latin1=161  UTF8=165  CP1252=160  [top ASCII-7-bit]\n  {{(char)0x6a,(char)0x70,(char)0x5f,(char)0x5f, (char)0x09,(char)0x9b,(char)0x48,(char)0xa4,(char)0x45,(char)0x42,(char)0x4b,(char)0xb3,(char)0xad,(char)0x48,(char)0x51,(char)0x1e,(char)0x61,(char)0x73,(char)0x21,(char)0x63,}}, // \"jp__\"\n        // ASCII-7-bit=155  Latin1=72  UTF8=164  GB=69  CP1252=66  KSC=75  SJS=179  EUC-JP=173  BIG5=72  ISO-8859-11=30  JIS=115  CP932=99  [top SJS]\n  {{(char)0x6b,(char)0x65,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb9,(char)0x9a,(char)0xa1,(char)0x13,(char)0x9e,(char)0x4b,(char)0x5b,(char)0x11,(char)0x4b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ke__\"\n        // ASCII-7-bit=185  Latin1=154  UTF8=161  CP1252=158  KSC=75  SJS=91  BIG5=75  [top ASCII-7-bit]\n  {{(char)0x6b,(char)0x67,(char)0x5f,(char)0x5f, (char)0x05,(char)0x94,(char)0x71,(char)0x9f,(char)0x67,(char)0x83,(char)0x11,(char)0xa8,(char)0x31,(char)0xb7,(char)0x12,(char)0x57,(char)0x57,(char)0x41,(char)0x6f,(char)0x00,}}, // \"kg__\"\n        // ASCII-7-bit=148  Latin1=113  UTF8=159  GB=103  CP1252=131  SJS=168  CP1251=183  CP1250=87  Latin5=87  KOI8R=111  [top CP1251]\n  {{(char)0x6b,(char)0x68,(char)0x5f,(char)0x5f, (char)0x05,(char)0xb6,(char)0xa1,(char)0xa1,(char)0x53,(char)0xa5,(char)0x12,(char)0x74,(char)0x73,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"kh__\"\n        // ASCII-7-bit=182  Latin1=161  UTF8=161  GB=83  CP1252=165  SJS=116  EUC-JP=115  [top ASCII-7-bit]\n  {{(char)0x6b,(char)0x69,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb8,(char)0xac,(char)0x98,(char)0x11,(char)0x82,(char)0x81,(char)0x61,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ki__\"\n        // ASCII-7-bit=184  Latin1=172  UTF8=152  CP1252=130  Latin5=97  [top ASCII-7-bit]\n  {{(char)0x6b,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x01,(char)0xba,(char)0x11,(char)0x89,(char)0x11,(char)0xaa,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"kn__\"\n        // ASCII-7-bit=186  UTF8=137  CP1252=170  [top ASCII-7-bit]\n  {{(char)0x6b,(char)0x72,(char)0x5f,(char)0x5f, (char)0x09,(char)0x80,(char)0x39,(char)0x92,(char)0x43,(char)0x2e,(char)0xbe,(char)0x5f,(char)0x3a,(char)0x3d,(char)0x31,(char)0x0c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"kr__\"\n        // ASCII-7-bit=128  Latin1=57  UTF8=146  GB=67  CP1252=46  KSC=190  SJS=95  EUC-JP=58  BIG5=61  CP1250=12  [top KSC]\n  {{(char)0x6b,(char)0x77,(char)0x5f,(char)0x5f, (char)0x03,(char)0x91,(char)0x69,(char)0xb2,(char)0x11,(char)0x71,(char)0x61,(char)0xb5,(char)0x11,(char)0x40,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"kw__\"\n        // ASCII-7-bit=145  Latin1=105  UTF8=178  CP1252=113  CP1256=181  Latin5=64  [top CP1256]\n  {{(char)0x6b,(char)0x79,(char)0x5f,(char)0x5f, (char)0x03,(char)0xab,(char)0x9d,(char)0xb6,(char)0x11,(char)0x9a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ky__\"\n        // ASCII-7-bit=171  Latin1=157  UTF8=182  CP1252=154  [top UTF8]\n  {{(char)0x6b,(char)0x7a,(char)0x5f,(char)0x5f, (char)0x03,(char)0x8d,(char)0x7b,(char)0xb1,(char)0x12,(char)0x74,(char)0x3d,(char)0x41,(char)0xb5,(char)0x21,(char)0x4a,(char)0x41,(char)0x8b,(char)0x81,(char)0x4a,(char)0x00,}}, // \"kz__\"\n        // ASCII-7-bit=141  Latin1=123  UTF8=177  CP1252=116  KSC=61  CP1251=181  Latin5=74  KOI8R=139  ISO-8859-5=74  [top CP1251]\n  {{(char)0x6c,(char)0x61,(char)0x5f,(char)0x5f, (char)0x05,(char)0xa8,(char)0x8e,(char)0xab,(char)0xab,(char)0x71,(char)0x13,(char)0x9f,(char)0x6a,(char)0x99,(char)0x41,(char)0x77,(char)0x51,(char)0x64,(char)0x41,(char)0x7e,}}, // \"la__\"\n        // ASCII-7-bit=168  Latin1=142  UTF8=171  GB=171  CP1252=113  SJS=159  EUC-JP=106  BIG5=153  Latin5=119  GBK=100  CP932=126  [top UTF8]\n  {{(char)0x6c,(char)0x62,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb3,(char)0x95,(char)0xaf,(char)0x11,(char)0x90,(char)0x11,(char)0x35,(char)0x41,(char)0x9f,(char)0x10,(char)0x61,(char)0x3f,(char)0x00,(char)0x00,(char)0x00,}}, // \"lb__\"\n        // ASCII-7-bit=179  Latin1=149  UTF8=175  CP1252=144  SJS=53  CP1256=159  Arabic=63  [top ASCII-7-bit]\n  {{(char)0x6c,(char)0x63,(char)0x5f,(char)0x5f, (char)0x02,(char)0xab,(char)0xa8,(char)0x21,(char)0xb5,(char)0x11,(char)0x7f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"lc__\"\n        // ASCII-7-bit=171  Latin1=168  CP1252=181  SJS=127  [top CP1252]\n  {{(char)0x6c,(char)0x69,(char)0x5f,(char)0x5f, (char)0x05,(char)0xad,(char)0xb5,(char)0x9d,(char)0x72,(char)0x93,(char)0x12,(char)0x5f,(char)0x53,(char)0x22,(char)0x89,(char)0x64,(char)0x11,(char)0x5f,(char)0x51,(char)0x53,}}, // \"li__\"\n        // ASCII-7-bit=173  Latin1=181  UTF8=157  GB=114  CP1252=147  SJS=95  EUC-JP=83  CP1251=137  CP1256=100  Latin5=95  GBK=83  [top Latin1]\n  {{(char)0x6c,(char)0x6b,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb9,(char)0x9e,(char)0x9d,(char)0x11,(char)0xa1,(char)0x12,(char)0x47,(char)0x47,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"lk__\"\n        // ASCII-7-bit=185  Latin1=158  UTF8=157  CP1252=161  SJS=71  EUC-JP=71  [top ASCII-7-bit]\n  {{(char)0x6c,(char)0x72,(char)0x5f,(char)0x5f, (char)0x03,(char)0xad,(char)0xac,(char)0x8a,(char)0x11,(char)0xb1,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"lr__\"\n        // ASCII-7-bit=173  Latin1=172  UTF8=138  CP1252=177  [top CP1252]\n  {{(char)0x6c,(char)0x73,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb7,(char)0xa3,(char)0x97,(char)0x11,(char)0xa8,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ls__\"\n        // ASCII-7-bit=183  Latin1=163  UTF8=151  CP1252=168  [top ASCII-7-bit]\n  {{(char)0x6c,(char)0x74,(char)0x5f,(char)0x5f, (char)0x06,(char)0x8c,(char)0x64,(char)0xae,(char)0x3b,(char)0x6d,(char)0x5d,(char)0x32,(char)0x48,(char)0x71,(char)0x11,(char)0x55,(char)0x31,(char)0xb8,(char)0xc1,(char)0x6e,}}, // \"lt__\"\n        // ASCII-7-bit=140  Latin1=100  UTF8=174  GB=59  CP1252=109  KSC=93  Latin2=72  CP1251=113  CP1250=85  CP1257=184  ISO-8859-13=110  [top CP1257]\n  {{(char)0x6c,(char)0x75,(char)0x5f,(char)0x5f, (char)0x05,(char)0xa6,(char)0xb2,(char)0xad,(char)0x47,(char)0x9f,(char)0x41,(char)0x42,(char)0x22,(char)0x54,(char)0x3f,(char)0x11,(char)0x53,(char)0x10,(char)0x51,(char)0x3b,}}, // \"lu__\"\n        // ASCII-7-bit=166  Latin1=178  UTF8=173  GB=71  CP1252=159  Latin2=66  CP1250=84  Latin5=63  ISO-8859-15=83  UTF-16BE=59  [top Latin1]\n  {{(char)0x6c,(char)0x76,(char)0x5f,(char)0x5f, (char)0x03,(char)0x97,(char)0x6d,(char)0xb5,(char)0x11,(char)0x6b,(char)0x51,(char)0x92,(char)0x51,(char)0xb0,(char)0x11,(char)0x4e,(char)0xa2,(char)0x5f,(char)0x52,(char)0x00,}}, // \"lv__\"\n        // ASCII-7-bit=151  Latin1=109  UTF8=181  CP1252=107  CP1251=146  CP1257=176  KOI8R=78  ISO-8859-13=95  Latin4=82  [top UTF8]\n  {{(char)0x6c,(char)0x79,(char)0x5f,(char)0x5f, (char)0x07,(char)0xa4,(char)0x77,(char)0xb0,(char)0x59,(char)0x8c,(char)0x92,(char)0x59,(char)0x32,(char)0x59,(char)0xb1,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ly__\"\n        // ASCII-7-bit=164  Latin1=119  UTF8=176  GB=89  CP1252=140  KSC=146  SJS=89  CP1251=89  CP1256=177  [top CP1256]\n  {{(char)0x6d,(char)0x61,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa2,(char)0xb3,(char)0xa6,(char)0x11,(char)0xa0,(char)0x62,(char)0x9e,(char)0x5d,(char)0x22,(char)0x7d,(char)0x4b,(char)0x10,(char)0x11,(char)0x47,(char)0x00,}}, // \"ma__\"\n        // ASCII-7-bit=162  Latin1=179  UTF8=166  CP1252=160  CP1256=158  CP1250=93  ISO-8859-15=125  CP1257=75  Arabic=71  [top Latin1]\n  {{(char)0x6d,(char)0x63,(char)0x5f,(char)0x5f, (char)0x03,(char)0x87,(char)0xbe,(char)0x73,(char)0x11,(char)0x89,(char)0xa1,(char)0x47,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mc__\"\n        // ASCII-7-bit=135  Latin1=190  UTF8=115  CP1252=137  ISO-8859-15=71  [top Latin1]\n  {{(char)0x6d,(char)0x64,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa4,(char)0x82,(char)0xad,(char)0x11,(char)0x86,(char)0x11,(char)0x61,(char)0x15,(char)0x61,(char)0x74,(char)0xae,(char)0x6e,(char)0x99,(char)0x51,(char)0x9d,}}, // \"md__\"\n        // ASCII-7-bit=164  Latin1=130  UTF8=173  CP1252=134  SJS=97  BIG5=97  Latin2=116  CP1251=174  CP1256=110  CP1250=153  KOI8R=157  [top CP1251]\n  {{(char)0x6d,(char)0x67,(char)0x5f,(char)0x5f, (char)0x03,(char)0x99,(char)0xba,(char)0x85,(char)0x11,(char)0xa6,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mg__\"\n        // ASCII-7-bit=153  Latin1=186  UTF8=133  CP1252=166  [top Latin1]\n  {{(char)0x6d,(char)0x69,(char)0x6c,(char)0x5f, (char)0x03,(char)0xba,(char)0x9a,(char)0x9a,(char)0x13,(char)0x9a,(char)0x44,(char)0x50,(char)0x11,(char)0x24,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mil_\"\n        // ASCII-7-bit=186  Latin1=154  UTF8=154  CP1252=154  KSC=68  SJS=80  BIG5=36  [top ASCII-7-bit]\n  {{(char)0x6d,(char)0x6b,(char)0x5f,(char)0x5f, (char)0x03,(char)0x95,(char)0x72,(char)0xab,(char)0x11,(char)0x73,(char)0x42,(char)0x3f,(char)0xa0,(char)0x11,(char)0x66,(char)0x51,(char)0xb6,(char)0x81,(char)0x56,(char)0x00,}}, // \"mk__\"\n        // ASCII-7-bit=149  Latin1=114  UTF8=171  CP1252=115  Latin2=63  CP1251=160  CP1250=102  KOI8R=182  ISO-8859-5=86  [top KOI8R]\n  {{(char)0x6d,(char)0x6c,(char)0x5f,(char)0x5f, (char)0x03,(char)0x85,(char)0xbd,(char)0x85,(char)0x11,(char)0x96,(char)0x81,(char)0x59,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ml__\"\n        // ASCII-7-bit=133  Latin1=189  UTF8=133  CP1252=150  Latin5=89  [top Latin1]\n  {{(char)0x6d,(char)0x6d,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb5,(char)0xa1,(char)0x7d,(char)0x11,(char)0xaf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mm__\"\n        // ASCII-7-bit=181  Latin1=161  UTF8=125  CP1252=175  [top ASCII-7-bit]\n  {{(char)0x6d,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x07,(char)0x9f,(char)0x7f,(char)0xb8,(char)0x79,(char)0x7d,(char)0x4f,(char)0x5f,(char)0x11,(char)0x56,(char)0x11,(char)0xa7,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mn__\"\n        // ASCII-7-bit=159  Latin1=127  UTF8=184  GB=121  CP1252=125  KSC=79  SJS=95  BIG5=86  CP1251=167  [top UTF8]\n  {{(char)0x6d,(char)0x6f,(char)0x5f,(char)0x5f, (char)0x05,(char)0xa0,(char)0x9e,(char)0xaa,(char)0x9e,(char)0x86,(char)0x11,(char)0x4a,(char)0x11,(char)0xb2,(char)0xa1,(char)0x59,(char)0xc1,(char)0x36,(char)0x00,(char)0x00,}}, // \"mo__\"\n        // ASCII-7-bit=160  Latin1=158  UTF8=170  GB=158  CP1252=134  SJS=74  BIG5=178  GBK=89  GB18030=54  [top BIG5]\n  {{(char)0x6d,(char)0x6f,(char)0x62,(char)0x69, (char)0x08,(char)0xb6,(char)0x95,(char)0xaa,(char)0x7f,(char)0x7d,(char)0x53,(char)0xa0,(char)0x71,(char)0x13,(char)0x65,(char)0x6d,(char)0x78,(char)0xc1,(char)0x73,(char)0x00,}}, // \"mobi\"\n        // ASCII-7-bit=182  Latin1=149  UTF8=170  GB=127  CP1252=125  KSC=83  SJS=160  EUC-JP=113  Latin2=101  CP1251=109  CP1256=120  CP932=115  [top ASCII-7-bit]\n  {{(char)0x6d,(char)0x70,(char)0x5f,(char)0x5f, (char)0x03,(char)0xbe,(char)0x5a,(char)0x54,(char)0x11,(char)0x5c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mp__\"\n        // ASCII-7-bit=190  Latin1=90  UTF8=84  CP1252=92  [top ASCII-7-bit]\n  {{(char)0x6d,(char)0x71,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa3,(char)0xb8,(char)0x95,(char)0x11,(char)0xa5,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mq__\"\n        // ASCII-7-bit=163  Latin1=184  UTF8=149  CP1252=165  [top Latin1]\n  {{(char)0x6d,(char)0x72,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9b,(char)0xab,(char)0x8d,(char)0x11,(char)0x96,(char)0x61,(char)0xb6,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mr__\"\n        // ASCII-7-bit=155  Latin1=171  UTF8=141  CP1252=150  CP1256=182  [top CP1256]\n  {{(char)0x6d,(char)0x73,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb4,(char)0xae,(char)0x9c,(char)0x18,(char)0x8a,(char)0x73,(char)0x86,(char)0x6f,(char)0x53,(char)0x56,(char)0x6c,(char)0x75,(char)0x11,(char)0x85,(char)0x00,}}, // \"ms__\"\n        // ASCII-7-bit=180  Latin1=174  UTF8=156  CP1252=138  KSC=115  SJS=134  EUC-JP=111  BIG5=83  Latin2=86  CP1251=108  CP1256=117  Latin5=133  [top ASCII-7-bit]\n  {{(char)0x6d,(char)0x74,(char)0x5f,(char)0x5f, (char)0x05,(char)0xbc,(char)0x87,(char)0x9b,(char)0x5c,(char)0x8b,(char)0x42,(char)0x2c,(char)0x40,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mt__\"\n        // ASCII-7-bit=188  Latin1=135  UTF8=155  GB=92  CP1252=139  Latin2=44  CP1251=64  [top ASCII-7-bit]\n  {{(char)0x6d,(char)0x75,(char)0x5f,(char)0x5f, (char)0x09,(char)0xb4,(char)0xa4,(char)0xa9,(char)0x57,(char)0x9f,(char)0x4d,(char)0x7e,(char)0x70,(char)0x4d,(char)0x11,(char)0x4d,(char)0x21,(char)0x57,(char)0x11,(char)0x4d,}}, // \"mu__\"\n        // ASCII-7-bit=180  Latin1=164  UTF8=169  GB=87  CP1252=159  KSC=77  SJS=126  EUC-JP=112  BIG5=77  CP1251=77  Latin5=87  ISO-8859-15=77  [top ASCII-7-bit]\n  {{(char)0x6d,(char)0x75,(char)0x73,(char)0x65, (char)0x07,(char)0xb3,(char)0xa9,(char)0xa6,(char)0x76,(char)0x90,(char)0x56,(char)0x88,(char)0x13,(char)0x8e,(char)0x6a,(char)0x7a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"muse\"\n        // ASCII-7-bit=179  Latin1=169  UTF8=166  GB=118  CP1252=144  KSC=86  SJS=136  BIG5=142  Latin2=106  CP1251=122  [top ASCII-7-bit]\n  {{(char)0x6d,(char)0x76,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb6,(char)0x98,(char)0xab,(char)0x11,(char)0x9f,(char)0x61,(char)0x53,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mv__\"\n        // ASCII-7-bit=182  Latin1=152  UTF8=171  CP1252=159  CP1256=83  [top ASCII-7-bit]\n  {{(char)0x6d,(char)0x77,(char)0x5f,(char)0x5f, (char)0x05,(char)0xb7,(char)0xa3,(char)0xa8,(char)0x7f,(char)0x8d,(char)0x11,(char)0x7f,(char)0xc1,(char)0x6b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mw__\"\n        // ASCII-7-bit=183  Latin1=163  UTF8=168  GB=127  CP1252=141  SJS=127  GBK=107  [top ASCII-7-bit]\n  {{(char)0x6d,(char)0x78,(char)0x5f,(char)0x5f, (char)0x05,(char)0xa7,(char)0xba,(char)0x94,(char)0x45,(char)0x93,(char)0x11,(char)0x1d,(char)0x12,(char)0x25,(char)0x29,(char)0x21,(char)0x27,(char)0x21,(char)0x3c,(char)0x00,}}, // \"mx__\"\n        // ASCII-7-bit=167  Latin1=186  UTF8=148  GB=69  CP1252=147  SJS=29  BIG5=37  Latin2=41  CP1250=39  ISO-8859-15=60  [top Latin1]\n  {{(char)0x6d,(char)0x79,(char)0x5f,(char)0x5f, (char)0x05,(char)0xb3,(char)0xb3,(char)0x8d,(char)0x6b,(char)0x8f,(char)0x13,(char)0x4d,(char)0x50,(char)0x7f,(char)0x12,(char)0x3f,(char)0x6b,(char)0x12,(char)0x4b,(char)0x3e,}}, // \"my__\"\n        // ASCII-7-bit=179  Latin1=179  UTF8=141  GB=107  CP1252=143  SJS=77  EUC-JP=80  BIG5=127  CP1251=63  CP1256=107  Latin5=75  ISO-8859-11=62  [top ASCII-7-bit]\n  {{(char)0x6d,(char)0x7a,(char)0x5f,(char)0x5f, (char)0x03,(char)0x8e,(char)0xaf,(char)0xb7,(char)0x11,(char)0x8f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mz__\"\n        // ASCII-7-bit=142  Latin1=175  UTF8=183  CP1252=143  [top UTF8]\n  {{(char)0x6e,(char)0x61,(char)0x5f,(char)0x5f, (char)0x03,(char)0xba,(char)0xa1,(char)0x97,(char)0x11,(char)0x9c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"na__\"\n        // ASCII-7-bit=186  Latin1=161  UTF8=151  CP1252=156  [top ASCII-7-bit]\n  {{(char)0x6e,(char)0x61,(char)0x6d,(char)0x65, (char)0x08,(char)0xb2,(char)0xa4,(char)0xa9,(char)0x8a,(char)0x90,(char)0x7d,(char)0x7c,(char)0x6b,(char)0x15,(char)0x80,(char)0x94,(char)0x6b,(char)0x8b,(char)0x77,(char)0x00,}}, // \"name\"\n        // ASCII-7-bit=178  Latin1=164  UTF8=169  GB=138  CP1252=144  KSC=125  SJS=124  EUC-JP=107  Latin2=128  CP1251=148  CP1256=107  CP1250=139  Latin5=119  [top ASCII-7-bit]\n  {{(char)0x6e,(char)0x63,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa7,(char)0xb9,(char)0x8c,(char)0x11,(char)0x9e,(char)0x11,(char)0x72,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"nc__\"\n        // ASCII-7-bit=167  Latin1=185  UTF8=140  CP1252=158  SJS=114  [top Latin1]\n  {{(char)0x6e,(char)0x65,(char)0x5f,(char)0x5f, (char)0x03,(char)0xad,(char)0xb9,(char)0x80,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ne__\"\n        // ASCII-7-bit=173  Latin1=185  UTF8=128  [top Latin1]\n  {{(char)0x6e,(char)0x65,(char)0x74,(char)0x5f, (char)0x0f,(char)0xac,(char)0xa6,(char)0xa4,(char)0x93,(char)0x93,(char)0x94,(char)0x97,(char)0x83,(char)0x86,(char)0x7e,(char)0x80,(char)0x96,(char)0x7a,(char)0x89,(char)0x73,}}, // \"net_\"\n        // ASCII-7-bit=172  Latin1=166  UTF8=164  GB=147  CP1252=147  KSC=148  SJS=151  EUC-JP=131  BIG5=134  Latin2=126  CP1251=128  CP1256=150  CP1250=122  Latin5=137  ISO-8859-11=115  [top ASCII-7-bit]\n  {{(char)0x6e,(char)0x66,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb5,(char)0xa9,(char)0xa8,(char)0x11,(char)0x87,(char)0xa1,(char)0x77,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"nf__\"\n        // ASCII-7-bit=181  Latin1=169  UTF8=168  CP1252=135  ISO-8859-15=119  [top ASCII-7-bit]\n  {{(char)0x6e,(char)0x67,(char)0x5f,(char)0x5f, (char)0x03,(char)0xbd,(char)0x95,(char)0x89,(char)0x11,(char)0x92,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ng__\"\n        // ASCII-7-bit=189  Latin1=149  UTF8=137  CP1252=146  [top ASCII-7-bit]\n  {{(char)0x6e,(char)0x69,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9d,(char)0xb3,(char)0xa9,(char)0x11,(char)0xa8,(char)0x81,(char)0x40,(char)0x11,(char)0x36,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ni__\"\n        // ASCII-7-bit=157  Latin1=179  UTF8=169  CP1252=168  Latin5=64  ISO-8859-15=54  [top Latin1]\n  {{(char)0x6e,(char)0x6c,(char)0x5f,(char)0x5f, (char)0x05,(char)0xb2,(char)0xae,(char)0xa0,(char)0x32,(char)0xa1,(char)0x36,(char)0x31,(char)0x42,(char)0x39,(char)0x3b,(char)0x33,(char)0x45,(char)0x11,(char)0x6f,(char)0x00,}}, // \"nl__\"\n        // ASCII-7-bit=178  Latin1=174  UTF8=160  GB=50  CP1252=161  BIG5=49  Latin2=66  CP1251=57  CP1256=59  CP1250=51  Latin5=69  ISO-8859-15=111  [top ASCII-7-bit]\n  {{(char)0x6e,(char)0x6f,(char)0x5f,(char)0x5f, (char)0x05,(char)0x99,(char)0xb8,(char)0xaa,(char)0x47,(char)0x8d,(char)0x11,(char)0x31,(char)0x22,(char)0x34,(char)0x3e,(char)0x42,(char)0x70,(char)0x33,(char)0x00,(char)0x00,}}, // \"no__\"\n        // ASCII-7-bit=153  Latin1=184  UTF8=170  GB=71  CP1252=141  SJS=49  Latin2=52  CP1251=62  ISO-8859-15=112  CP1257=51  [top Latin1]\n  {{(char)0x6e,(char)0x70,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb2,(char)0x9f,(char)0xa5,(char)0x11,(char)0xac,(char)0x11,(char)0x61,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"np__\"\n        // ASCII-7-bit=178  Latin1=159  UTF8=165  CP1252=172  SJS=97  [top ASCII-7-bit]\n  {{(char)0x6e,(char)0x72,(char)0x5f,(char)0x5f, (char)0x03,(char)0xbe,(char)0x77,(char)0x7a,(char)0x11,(char)0x62,(char)0x71,(char)0x44,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"nr__\"\n        // ASCII-7-bit=190  Latin1=119  UTF8=122  CP1252=98  CP1250=68  [top ASCII-7-bit]\n  {{(char)0x6e,(char)0x75,(char)0x5f,(char)0x5f, (char)0x03,(char)0xae,(char)0xb4,(char)0x9e,(char)0x11,(char)0x96,(char)0x12,(char)0x7c,(char)0x76,(char)0x22,(char)0x75,(char)0x62,(char)0xa1,(char)0x65,(char)0x00,(char)0x00,}}, // \"nu__\"\n        // ASCII-7-bit=174  Latin1=180  UTF8=158  CP1252=150  SJS=124  EUC-JP=118  CP1251=117  CP1256=98  CP1254=101  [top Latin1]\n  {{(char)0x6e,(char)0x7a,(char)0x5f,(char)0x5f, (char)0x0d,(char)0xba,(char)0x97,(char)0xa2,(char)0x5f,(char)0x97,(char)0x5c,(char)0x5a,(char)0x4b,(char)0x4a,(char)0x30,(char)0x47,(char)0x36,(char)0x34,(char)0x21,(char)0x2b,}}, // \"nz__\"\n        // ASCII-7-bit=186  Latin1=151  UTF8=162  GB=95  CP1252=151  KSC=92  SJS=90  EUC-JP=75  BIG5=74  Latin2=48  CP1251=71  CP1256=54  CP1250=52  ISO-8859-15=43  [top ASCII-7-bit]\n  {{(char)0x6f,(char)0x6d,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9a,(char)0x8a,(char)0x89,(char)0x11,(char)0x87,(char)0x61,(char)0xbc,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"om__\"\n        // ASCII-7-bit=154  Latin1=138  UTF8=137  CP1252=135  CP1256=188  [top CP1256]\n  {{(char)0x6f,(char)0x72,(char)0x67,(char)0x5f, (char)0x0e,(char)0xb5,(char)0x9f,(char)0xac,(char)0x76,(char)0x90,(char)0x7e,(char)0x6e,(char)0x69,(char)0x71,(char)0x6d,(char)0x6a,(char)0x78,(char)0x60,(char)0x73,(char)0x00,}}, // \"org_\"\n        // ASCII-7-bit=181  Latin1=159  UTF8=172  GB=118  CP1252=144  KSC=126  SJS=110  EUC-JP=105  BIG5=113  Latin2=109  CP1251=106  CP1256=120  CP1250=96  Latin5=115  [top ASCII-7-bit]\n  {{(char)0x70,(char)0x61,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa3,(char)0xb8,(char)0xa7,(char)0x11,(char)0x87,(char)0x71,(char)0x31,(char)0x21,(char)0x41,(char)0x21,(char)0x31,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"pa__\"\n        // ASCII-7-bit=163  Latin1=184  UTF8=167  CP1252=135  CP1250=49  ISO-8859-15=65  KOI8R=49  [top Latin1]\n  {{(char)0x70,(char)0x65,(char)0x5f,(char)0x5f, (char)0x05,(char)0xa8,(char)0xb8,(char)0x9d,(char)0x3a,(char)0x99,(char)0x11,(char)0x2e,(char)0x13,(char)0x2e,(char)0x1e,(char)0x1e,(char)0x11,(char)0x32,(char)0x00,(char)0x00,}}, // \"pe__\"\n        // ASCII-7-bit=168  Latin1=184  UTF8=157  GB=58  CP1252=153  SJS=46  BIG5=46  Latin2=30  CP1251=30  CP1250=50  [top Latin1]\n  {{(char)0x70,(char)0x66,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa2,(char)0xb5,(char)0xa3,(char)0x11,(char)0xa7,(char)0x11,(char)0x63,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"pf__\"\n        // ASCII-7-bit=162  Latin1=181  UTF8=163  CP1252=167  SJS=99  [top Latin1]\n  {{(char)0x70,(char)0x67,(char)0x5f,(char)0x5f, (char)0x05,(char)0xb8,(char)0xa6,(char)0x81,(char)0x6a,(char)0xa5,(char)0x11,(char)0x70,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"pg__\"\n        // ASCII-7-bit=184  Latin1=166  UTF8=129  GB=106  CP1252=165  SJS=112  [top ASCII-7-bit]\n  {{(char)0x70,(char)0x68,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb5,(char)0x9e,(char)0x99,(char)0x15,(char)0xac,(char)0x57,(char)0x65,(char)0x4f,(char)0x51,(char)0x31,(char)0x31,(char)0x11,(char)0x4b,(char)0xd1,(char)0x29,}}, // \"ph__\"\n        // ASCII-7-bit=181  Latin1=158  UTF8=153  CP1252=172  KSC=87  SJS=101  EUC-JP=79  BIG5=81  CP1250=49  ISO-8859-11=75  CP874=41  [top ASCII-7-bit]\n  {{(char)0x70,(char)0x6b,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb9,(char)0x9b,(char)0x8c,(char)0x11,(char)0xa3,(char)0x11,(char)0x33,(char)0x11,(char)0x99,(char)0x21,(char)0x29,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"pk__\"\n        // ASCII-7-bit=185  Latin1=155  UTF8=140  CP1252=163  SJS=51  BIG5=153  CP1256=41  [top ASCII-7-bit]\n  {{(char)0x70,(char)0x6c,(char)0x5f,(char)0x5f, (char)0x03,(char)0x89,(char)0x62,(char)0xa8,(char)0x11,(char)0x4b,(char)0x42,(char)0xba,(char)0x40,(char)0x11,(char)0x92,(char)0xe1,(char)0x3e,(char)0x00,(char)0x00,(char)0x00,}}, // \"pl__\"\n        // ASCII-7-bit=137  Latin1=98  UTF8=168  CP1252=75  Latin2=186  CP1251=64  CP1250=146  ISO-8859-5=62  [top Latin2]\n  {{(char)0x70,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x06,(char)0xbb,(char)0xa1,(char)0x99,(char)0x66,(char)0x66,(char)0x66,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"pn__\"\n        // ASCII-7-bit=187  Latin1=161  UTF8=153  GB=102  CP1252=102  KSC=102  [top ASCII-7-bit]\n  {{(char)0x70,(char)0x72,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9b,(char)0xb5,(char)0xaf,(char)0x11,(char)0x94,(char)0x41,(char)0x65,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"pr__\"\n        // ASCII-7-bit=155  Latin1=181  UTF8=175  CP1252=148  Latin2=101  [top Latin1]\n  {{(char)0x70,(char)0x72,(char)0x6f,(char)0x5f, (char)0x03,(char)0xb3,(char)0x9e,(char)0xad,(char)0x11,(char)0x87,(char)0x13,(char)0x65,(char)0x6f,(char)0x65,(char)0x11,(char)0x9f,(char)0x21,(char)0x79,(char)0x00,(char)0x00,}}, // \"pro_\"\n        // ASCII-7-bit=179  Latin1=158  UTF8=173  CP1252=135  SJS=101  EUC-JP=111  BIG5=101  CP1251=159  Latin5=121  [top ASCII-7-bit]\n  {{(char)0x70,(char)0x73,(char)0x5f,(char)0x5f, (char)0x03,(char)0x99,(char)0x8f,(char)0x9d,(char)0x11,(char)0x9f,(char)0x61,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ps__\"\n        // ASCII-7-bit=153  Latin1=143  UTF8=157  CP1252=159  CP1256=185  [top CP1256]\n  {{(char)0x70,(char)0x74,(char)0x5f,(char)0x5f, (char)0x05,(char)0x99,(char)0xb5,(char)0xad,(char)0x1d,(char)0x95,(char)0x11,(char)0x21,(char)0x52,(char)0x36,(char)0x40,(char)0x12,(char)0x90,(char)0x23,(char)0x51,(char)0x1d,}}, // \"pt__\"\n        // ASCII-7-bit=153  Latin1=181  UTF8=173  GB=29  CP1252=149  SJS=33  CP1250=54  Latin5=64  ISO-8859-15=144  CP1257=35  CP1254=29  [top Latin1]\n  {{(char)0x70,(char)0x79,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9f,(char)0xbb,(char)0x90,(char)0x13,(char)0x97,(char)0x49,(char)0x35,(char)0x21,(char)0x35,(char)0x51,(char)0x5a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"py__\"\n        // ASCII-7-bit=159  Latin1=187  UTF8=144  CP1252=151  KSC=73  SJS=53  Latin2=53  ISO-8859-15=90  [top Latin1]\n  {{(char)0x71,(char)0x61,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9a,(char)0x89,(char)0xb0,(char)0x11,(char)0x82,(char)0x61,(char)0xb5,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"qa__\"\n        // ASCII-7-bit=154  Latin1=137  UTF8=176  CP1252=130  CP1256=181  [top CP1256]\n  {{(char)0x72,(char)0x65,(char)0x5f,(char)0x5f, (char)0x03,(char)0x8a,(char)0xb4,(char)0xb1,(char)0x11,(char)0x97,(char)0xa1,(char)0x8a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"re__\"\n        // ASCII-7-bit=138  Latin1=180  UTF8=177  CP1252=151  ISO-8859-15=138  [top Latin1]\n  {{(char)0x72,(char)0x6f,(char)0x5f,(char)0x5f, (char)0x08,(char)0xb4,(char)0xa0,(char)0xa4,(char)0x3c,(char)0x94,(char)0x57,(char)0x2e,(char)0x29,(char)0x14,(char)0xa2,(char)0x3a,(char)0x33,(char)0x8b,(char)0x21,(char)0x37,}}, // \"ro__\"\n        // ASCII-7-bit=180  Latin1=160  UTF8=164  GB=60  CP1252=148  KSC=87  SJS=46  EUC-JP=41  Latin2=162  CP1251=58  CP1256=51  CP1250=139  ISO-8859-15=55  [top ASCII-7-bit]\n  {{(char)0x72,(char)0x75,(char)0x5f,(char)0x5f, (char)0x05,(char)0x8d,(char)0x6d,(char)0xa1,(char)0x56,(char)0x67,(char)0x31,(char)0x43,(char)0x12,(char)0xba,(char)0x46,(char)0x61,(char)0x9b,(char)0x72,(char)0x46,(char)0x48,}}, // \"ru__\"\n        // ASCII-7-bit=141  Latin1=109  UTF8=161  GB=86  CP1252=103  BIG5=67  CP1251=186  CP1256=70  KOI8R=155  KOI8U=70  ISO-8859-5=72  [top CP1251]\n  {{(char)0x72,(char)0x77,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb7,(char)0xa2,(char)0xa4,(char)0x11,(char)0xa0,(char)0x61,(char)0x5e,(char)0x31,(char)0x6e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"rw__\"\n        // ASCII-7-bit=183  Latin1=162  UTF8=164  CP1252=160  CP1256=94  ISO-8859-15=110  [top ASCII-7-bit]\n  {{(char)0x73,(char)0x61,(char)0x5f,(char)0x5f, (char)0x05,(char)0x91,(char)0x5b,(char)0xac,(char)0x3f,(char)0x69,(char)0x11,(char)0x1f,(char)0x41,(char)0xb9,(char)0x11,(char)0x1f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sa__\"\n        // ASCII-7-bit=145  Latin1=91  UTF8=172  GB=63  CP1252=105  SJS=31  CP1256=185  Latin5=31  [top CP1256]\n  {{(char)0x73,(char)0x62,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb8,(char)0x8a,(char)0xad,(char)0x11,(char)0x8b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sb__\"\n        // ASCII-7-bit=184  Latin1=138  UTF8=173  CP1252=139  [top ASCII-7-bit]\n  {{(char)0x73,(char)0x63,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb5,(char)0x9e,(char)0xad,(char)0x11,(char)0x85,(char)0x12,(char)0x8d,(char)0x88,(char)0x23,(char)0x57,(char)0x4d,(char)0x5c,(char)0x00,(char)0x00,(char)0x00,}}, // \"sc__\"\n        // ASCII-7-bit=181  Latin1=158  UTF8=173  CP1252=133  SJS=141  EUC-JP=136  CP1251=87  CP1256=77  CP1250=92  [top ASCII-7-bit]\n  {{(char)0x73,(char)0x64,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9b,(char)0x77,(char)0x8a,(char)0x11,(char)0x6d,(char)0x61,(char)0xbd,(char)0x10,(char)0x61,(char)0x73,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sd__\"\n        // ASCII-7-bit=155  Latin1=119  UTF8=138  CP1252=109  CP1256=189  Arabic=115  [top CP1256]\n  {{(char)0x73,(char)0x65,(char)0x5f,(char)0x5f, (char)0x05,(char)0x96,(char)0xbb,(char)0xa0,(char)0x23,(char)0x82,(char)0x36,(char)0x23,(char)0x2e,(char)0x25,(char)0x3b,(char)0x43,(char)0x22,(char)0x11,(char)0x4c,(char)0x00,}}, // \"se__\"\n        // ASCII-7-bit=150  Latin1=187  UTF8=160  GB=35  CP1252=130  BIG5=35  Latin2=46  CP1251=37  CP1256=59  CP1250=67  Latin5=34  ISO-8859-15=76  [top Latin1]\n  {{(char)0x73,(char)0x67,(char)0x5f,(char)0x5f, (char)0x09,(char)0xb8,(char)0x9c,(char)0xa6,(char)0x84,(char)0x94,(char)0x4c,(char)0x6e,(char)0x50,(char)0x71,(char)0x31,(char)0x41,(char)0x11,(char)0x48,(char)0xd1,(char)0x3a,}}, // \"sg__\"\n        // ASCII-7-bit=184  Latin1=156  UTF8=166  GB=132  CP1252=148  KSC=76  SJS=110  EUC-JP=80  BIG5=113  CP1250=65  ISO-8859-11=72  CP874=58  [top ASCII-7-bit]\n  {{(char)0x73,(char)0x68,(char)0x5f,(char)0x5f, (char)0x0a,(char)0xaa,(char)0x9b,(char)0xa1,(char)0xa9,(char)0x84,(char)0x77,(char)0xa1,(char)0x98,(char)0x9b,(char)0x5d,(char)0x51,(char)0x6d,(char)0x31,(char)0x6f,(char)0x00,}}, // \"sh__\"\n        // ASCII-7-bit=170  Latin1=155  UTF8=161  GB=169  CP1252=132  KSC=119  SJS=161  EUC-JP=152  BIG5=155  Latin2=93  ISO-8859-15=109  GBK=111  [top ASCII-7-bit]\n  {{(char)0x73,(char)0x69,(char)0x5f,(char)0x5f, (char)0x03,(char)0x95,(char)0x6b,(char)0xb7,(char)0x11,(char)0x6e,(char)0x42,(char)0x9f,(char)0x3d,(char)0x11,(char)0xa9,(char)0x21,(char)0x17,(char)0x10,(char)0x11,(char)0x24,}}, // \"si__\"\n        // ASCII-7-bit=149  Latin1=107  UTF8=183  CP1252=110  Latin2=159  CP1251=61  CP1250=169  ISO-8859-15=23  CP852=36  [top UTF8]\n  {{(char)0x73,(char)0x6b,(char)0x5f,(char)0x5f, (char)0x03,(char)0x95,(char)0x74,(char)0xb0,(char)0x11,(char)0x60,(char)0x36,(char)0x53,(char)0x92,(char)0x55,(char)0x47,(char)0xb5,(char)0x3f,(char)0x10,(char)0x11,(char)0x3a,}}, // \"sk__\"\n        // ASCII-7-bit=149  Latin1=116  UTF8=176  CP1252=96  BIG5=83  Latin2=146  CP1251=85  CP1256=71  CP1250=181  Latin5=63  MACINTOSH=58  [top CP1250]\n  {{(char)0x73,(char)0x6c,(char)0x5f,(char)0x5f, (char)0x03,(char)0xac,(char)0x85,(char)0x8f,(char)0x11,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sl__\"\n        // ASCII-7-bit=172  Latin1=133  UTF8=143  CP1252=185  [top CP1252]\n  {{(char)0x73,(char)0x6d,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa8,(char)0xa7,(char)0xb1,(char)0x11,(char)0xa8,(char)0x91,(char)0x6f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sm__\"\n        // ASCII-7-bit=168  Latin1=167  UTF8=177  CP1252=168  ISO-8859-11=111  [top UTF8]\n  {{(char)0x73,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9d,(char)0xb8,(char)0x9f,(char)0x11,(char)0xa2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sn__\"\n        // ASCII-7-bit=157  Latin1=184  UTF8=159  CP1252=162  [top Latin1]\n  {{(char)0x73,(char)0x72,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa6,(char)0xad,(char)0xb2,(char)0x12,(char)0x9d,(char)0x6a,(char)0x61,(char)0x84,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sr__\"\n        // ASCII-7-bit=166  Latin1=173  UTF8=178  CP1252=157  KSC=106  CP1250=132  [top UTF8]\n  {{(char)0x73,(char)0x74,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb4,(char)0xab,(char)0x9d,(char)0x15,(char)0x88,(char)0x79,(char)0x99,(char)0x94,(char)0x7e,(char)0x31,(char)0x61,(char)0x81,(char)0x4e,(char)0x21,(char)0x6d,}}, // \"st__\"\n        // ASCII-7-bit=180  Latin1=171  UTF8=157  CP1252=136  KSC=121  SJS=153  EUC-JP=148  BIG5=126  CP1250=97  JIS=78  CP932=109  [top ASCII-7-bit]\n  {{(char)0x73,(char)0x75,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa4,(char)0x6f,(char)0xa0,(char)0x11,(char)0x70,(char)0x51,(char)0xb9,(char)0x71,(char)0x94,(char)0x71,(char)0x44,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"su__\"\n        // ASCII-7-bit=164  Latin1=111  UTF8=160  CP1252=112  CP1251=185  KOI8R=148  KOI8U=68  [top CP1251]\n  {{(char)0x73,(char)0x76,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9d,(char)0xb9,(char)0xa5,(char)0x11,(char)0x8f,(char)0x41,(char)0x3c,(char)0x51,(char)0x3c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sv__\"\n        // ASCII-7-bit=157  Latin1=185  UTF8=165  CP1252=143  Latin2=60  ISO-8859-15=60  [top Latin1]\n  {{(char)0x73,(char)0x79,(char)0x5f,(char)0x5f, (char)0x03,(char)0x82,(char)0x5e,(char)0x90,(char)0x11,(char)0x5d,(char)0x61,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sy__\"\n        // ASCII-7-bit=130  Latin1=94  UTF8=144  CP1252=93  CP1256=190  [top CP1256]\n  {{(char)0x73,(char)0x7a,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb7,(char)0xac,(char)0x6c,(char)0x11,(char)0xa1,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sz__\"\n        // ASCII-7-bit=183  Latin1=172  UTF8=108  CP1252=161  [top ASCII-7-bit]\n  {{(char)0x74,(char)0x63,(char)0x5f,(char)0x5f, (char)0x08,(char)0xa9,(char)0xaa,(char)0x9b,(char)0x62,(char)0x74,(char)0x8d,(char)0x8f,(char)0x7a,(char)0x21,(char)0x67,(char)0x22,(char)0xab,(char)0x9b,(char)0x41,(char)0x70,}}, // \"tc__\"\n        // ASCII-7-bit=169  Latin1=170  UTF8=155  GB=98  CP1252=116  KSC=141  SJS=143  EUC-JP=122  CP1251=103  Latin5=171  ISO-8859-11=155  GBK=112  [top Latin5]\n  {{(char)0x74,(char)0x66,(char)0x5f,(char)0x5f, (char)0x02,(char)0xa3,(char)0xbc,(char)0x21,(char)0x71,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tf__\"\n        // ASCII-7-bit=163  Latin1=188  CP1252=113  [top Latin1]\n  {{(char)0x74,(char)0x67,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb0,(char)0xb3,(char)0x7e,(char)0x11,(char)0xa5,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tg__\"\n        // ASCII-7-bit=176  Latin1=179  UTF8=126  CP1252=165  [top Latin1]\n  {{(char)0x74,(char)0x68,(char)0x5f,(char)0x5f, (char)0x09,(char)0x96,(char)0x61,(char)0x93,(char)0x3e,(char)0x67,(char)0x2f,(char)0x52,(char)0x38,(char)0x23,(char)0x11,(char)0x35,(char)0x31,(char)0xbd,(char)0xd1,(char)0x76,}}, // \"th__\"\n        // ASCII-7-bit=150  Latin1=97  UTF8=147  GB=62  CP1252=103  KSC=47  SJS=82  EUC-JP=56  BIG5=35  CP1251=53  ISO-8859-11=189  CP874=118  [top ISO-8859-11]\n  {{(char)0x74,(char)0x6a,(char)0x5f,(char)0x5f, (char)0x03,(char)0xab,(char)0x74,(char)0xb1,(char)0x11,(char)0x67,(char)0x51,(char)0xae,(char)0x71,(char)0x84,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tj__\"\n        // ASCII-7-bit=171  Latin1=116  UTF8=177  CP1252=103  CP1251=174  KOI8R=132  [top UTF8]\n  {{(char)0x74,(char)0x6b,(char)0x5f,(char)0x5f, (char)0x03,(char)0xbc,(char)0x94,(char)0x9d,(char)0x11,(char)0x6b,(char)0x12,(char)0x74,(char)0x6b,(char)0x12,(char)0x53,(char)0x46,(char)0x12,(char)0x74,(char)0x6d,(char)0x00,}}, // \"tk__\"\n        // ASCII-7-bit=188  Latin1=148  UTF8=157  CP1252=107  SJS=116  EUC-JP=107  Latin2=83  CP1251=70  CP1250=116  Latin5=109  [top ASCII-7-bit]\n  {{(char)0x74,(char)0x6c,(char)0x5f,(char)0x5f, (char)0x05,(char)0xb1,(char)0xb0,(char)0x88,(char)0x61,(char)0x83,(char)0xa1,(char)0xa8,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tl__\"\n        // ASCII-7-bit=177  Latin1=176  UTF8=136  GB=97  CP1252=131  ISO-8859-15=168  [top ASCII-7-bit]\n  {{(char)0x74,(char)0x6d,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb4,(char)0x84,(char)0xad,(char)0x11,(char)0x82,(char)0x42,(char)0x5a,(char)0xa4,(char)0x12,(char)0x5a,(char)0x5a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tm__\"\n        // ASCII-7-bit=180  Latin1=132  UTF8=173  CP1252=130  Latin2=90  CP1251=164  CP1250=90  Latin5=90  [top ASCII-7-bit]\n  {{(char)0x74,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9f,(char)0xa2,(char)0xac,(char)0x11,(char)0x9d,(char)0x11,(char)0x4b,(char)0x21,(char)0x3b,(char)0x11,(char)0xb0,(char)0x10,(char)0x61,(char)0x3b,(char)0x00,}}, // \"tn__\"\n        // ASCII-7-bit=159  Latin1=162  UTF8=172  CP1252=157  SJS=75  Latin2=59  CP1256=176  Arabic=59  [top CP1256]\n  {{(char)0x74,(char)0x6f,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa5,(char)0xa2,(char)0xa5,(char)0x15,(char)0x89,(char)0x8a,(char)0xac,(char)0x99,(char)0x9b,(char)0x31,(char)0x70,(char)0x21,(char)0x87,(char)0x51,(char)0x6c,}}, // \"to__\"\n        // ASCII-7-bit=165  Latin1=162  UTF8=165  CP1252=137  KSC=138  SJS=172  EUC-JP=153  BIG5=155  CP1250=112  ISO-8859-15=135  JIS=108  [top SJS]\n  {{(char)0x74,(char)0x70,(char)0x5f,(char)0x5f, (char)0x03,(char)0x95,(char)0x9e,(char)0xad,(char)0x11,(char)0x67,(char)0x12,(char)0xb3,(char)0x99,(char)0xd1,(char)0x67,(char)0x21,(char)0x67,(char)0x00,(char)0x00,(char)0x00,}}, // \"tp__\"\n        // ASCII-7-bit=149  Latin1=158  UTF8=173  CP1252=103  SJS=179  EUC-JP=153  JIS=103  CP932=103  [top SJS]\n  {{(char)0x74,(char)0x72,(char)0x5f,(char)0x5f, (char)0x03,(char)0x8d,(char)0x6c,(char)0xa6,(char)0x11,(char)0x61,(char)0x11,(char)0x3c,(char)0x32,(char)0x3c,(char)0x4a,(char)0x11,(char)0xba,(char)0x81,(char)0x91,(char)0x00,}}, // \"tr__\"\n        // ASCII-7-bit=141  Latin1=108  UTF8=166  CP1252=97  SJS=60  CP1251=60  CP1256=74  Latin5=186  CP1254=145  [top Latin5]\n  {{(char)0x74,(char)0x72,(char)0x61,(char)0x76, (char)0x05,(char)0xa9,(char)0xa3,(char)0xa7,(char)0x97,(char)0x95,(char)0x11,(char)0xac,(char)0x13,(char)0x74,(char)0x7f,(char)0x6b,(char)0x11,(char)0x63,(char)0x00,(char)0x00,}}, // \"trav\"\n        // ASCII-7-bit=169  Latin1=163  UTF8=167  GB=151  CP1252=149  SJS=172  BIG5=116  Latin2=127  CP1251=107  CP1250=99  [top SJS]\n  {{(char)0x74,(char)0x74,(char)0x5f,(char)0x5f, (char)0x07,(char)0xb5,(char)0xaf,(char)0x9a,(char)0x49,(char)0x92,(char)0x59,(char)0x49,(char)0x61,(char)0x75,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tt__\"\n        // ASCII-7-bit=181  Latin1=175  UTF8=154  GB=73  CP1252=146  KSC=89  SJS=73  Latin5=117  [top ASCII-7-bit]\n  {{(char)0x74,(char)0x76,(char)0x5f,(char)0x5f, (char)0x0e,(char)0xa7,(char)0xa6,(char)0xad,(char)0x89,(char)0x94,(char)0x85,(char)0x9e,(char)0x8d,(char)0x7b,(char)0x74,(char)0x7c,(char)0x88,(char)0x7b,(char)0x81,(char)0x00,}}, // \"tv__\"\n        // ASCII-7-bit=167  Latin1=166  UTF8=173  GB=137  CP1252=148  KSC=133  SJS=158  EUC-JP=141  BIG5=123  Latin2=116  CP1251=124  CP1256=136  CP1250=123  Latin5=129  [top UTF8]\n  {{(char)0x74,(char)0x77,(char)0x5f,(char)0x5f, (char)0x05,(char)0x85,(char)0x52,(char)0xab,(char)0x5d,(char)0x57,(char)0x13,(char)0x50,(char)0x2e,(char)0xba,(char)0x31,(char)0x23,(char)0x61,(char)0x2e,(char)0xf1,(char)0x21,}}, // \"tw__\"\n        // ASCII-7-bit=133  Latin1=82  UTF8=171  GB=93  CP1252=87  SJS=80  EUC-JP=46  BIG5=186  CP1250=35  GBK=46  BIG5_HKSCS=33  [top BIG5]\n  {{(char)0x74,(char)0x7a,(char)0x5f,(char)0x5f, (char)0x03,(char)0xae,(char)0xb5,(char)0x8b,(char)0x13,(char)0xa0,(char)0x4c,(char)0x4c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tz__\"\n        // ASCII-7-bit=174  Latin1=181  UTF8=139  CP1252=160  KSC=76  SJS=76  [top Latin1]\n  {{(char)0x75,(char)0x61,(char)0x5f,(char)0x5f, (char)0x03,(char)0x87,(char)0x61,(char)0xa2,(char)0x11,(char)0x57,(char)0x44,(char)0x4d,(char)0xbb,(char)0x35,(char)0x48,(char)0x51,(char)0x80,(char)0x72,(char)0x8c,(char)0x3d,}}, // \"ua__\"\n        // ASCII-7-bit=135  Latin1=97  UTF8=162  CP1252=87  Latin2=77  CP1251=187  CP1256=53  CP1250=72  KOI8R=128  KOI8U=140  ISO-8859-5=61  [top CP1251]\n  {{(char)0x75,(char)0x67,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb8,(char)0x9a,(char)0xa0,(char)0x11,(char)0xa6,(char)0x11,(char)0x68,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ug__\"\n        // ASCII-7-bit=184  Latin1=154  UTF8=160  CP1252=166  SJS=104  [top ASCII-7-bit]\n  {{(char)0x75,(char)0x6b,(char)0x5f,(char)0x5f, (char)0x05,(char)0xb7,(char)0xa7,(char)0x9e,(char)0x62,(char)0x97,(char)0x27,(char)0x58,(char)0x62,(char)0x51,(char)0x53,(char)0x62,(char)0x64,(char)0x54,(char)0x11,(char)0x6f,}}, // \"uk__\"\n        // ASCII-7-bit=183  Latin1=167  UTF8=158  GB=98  CP1252=151  EUC-JP=88  BIG5=98  Latin2=81  CP1251=83  CP1256=98  CP1250=100  Latin5=84  ISO-8859-15=111  [top ASCII-7-bit]\n  {{(char)0x75,(char)0x73,(char)0x5f,(char)0x5f, (char)0x06,(char)0xba,(char)0x94,(char)0xa5,(char)0x45,(char)0x92,(char)0x48,(char)0x24,(char)0x54,(char)0x47,(char)0x5a,(char)0x56,(char)0x11,(char)0x66,(char)0x11,(char)0x40,}}, // \"us__\"\n        // ASCII-7-bit=186  Latin1=148  UTF8=165  GB=69  CP1252=146  KSC=72  BIG5=84  Latin2=71  CP1251=90  CP1256=86  Latin5=102  ISO-8859-15=64  [top ASCII-7-bit]\n  {{(char)0x75,(char)0x79,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa2,(char)0xba,(char)0x96,(char)0x11,(char)0x9a,(char)0x72,(char)0x2c,(char)0x2c,(char)0x11,(char)0x52,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"uy__\"\n        // ASCII-7-bit=162  Latin1=186  UTF8=150  CP1252=154  CP1250=44  Latin5=44  ISO-8859-15=82  [top Latin1]\n  {{(char)0x75,(char)0x7a,(char)0x5f,(char)0x5f, (char)0x05,(char)0x91,(char)0x68,(char)0xb1,(char)0x39,(char)0x88,(char)0x54,(char)0xb5,(char)0x43,(char)0x39,(char)0x6e,(char)0x41,(char)0x7c,(char)0x00,(char)0x00,(char)0x00,}}, // \"uz__\"\n        // ASCII-7-bit=145  Latin1=104  UTF8=177  GB=57  CP1252=136  CP1251=181  CP1256=67  CP1250=57  Latin5=110  KOI8R=124  [top CP1251]\n  {{(char)0x76,(char)0x61,(char)0x5f,(char)0x5f, (char)0x03,(char)0xae,(char)0xb3,(char)0x8f,(char)0x11,(char)0xa7,(char)0xb1,(char)0x4a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"va__\"\n        // ASCII-7-bit=174  Latin1=179  UTF8=143  CP1252=167  CP1257=74  [top Latin1]\n  {{(char)0x76,(char)0x63,(char)0x5f,(char)0x5f, (char)0x08,(char)0xba,(char)0x7a,(char)0x9a,(char)0x5e,(char)0x79,(char)0x4a,(char)0x9a,(char)0x95,(char)0x12,(char)0x54,(char)0x7f,(char)0x81,(char)0x4a,(char)0x00,(char)0x00,}}, // \"vc__\"\n        // ASCII-7-bit=186  Latin1=122  UTF8=154  GB=94  CP1252=121  KSC=74  SJS=154  EUC-JP=149  Latin2=84  CP1251=127  GBK=74  [top ASCII-7-bit]\n  {{(char)0x76,(char)0x65,(char)0x5f,(char)0x5f, (char)0x05,(char)0x97,(char)0xbc,(char)0x8c,(char)0x14,(char)0x9b,(char)0x11,(char)0x14,(char)0x11,(char)0x1e,(char)0x31,(char)0x42,(char)0x21,(char)0x55,(char)0x31,(char)0x24,}}, // \"ve__\"\n        // ASCII-7-bit=151  Latin1=188  UTF8=140  GB=20  CP1252=155  SJS=20  BIG5=30  CP1250=66  ISO-8859-15=85  GBK=36  [top Latin1]\n  {{(char)0x76,(char)0x67,(char)0x5f,(char)0x5f, (char)0x05,(char)0xac,(char)0xb2,(char)0x9e,(char)0x6d,(char)0x97,(char)0x13,(char)0x95,(char)0x81,(char)0x95,(char)0x11,(char)0x69,(char)0x21,(char)0x63,(char)0x61,(char)0x59,}}, // \"vg__\"\n        // ASCII-7-bit=172  Latin1=178  UTF8=158  GB=109  CP1252=151  SJS=149  EUC-JP=129  BIG5=149  CP1251=105  Latin5=99  Greek=89  [top Latin1]\n  {{(char)0x76,(char)0x69,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb9,(char)0x90,(char)0xaa,(char)0x11,(char)0x93,(char)0x11,(char)0x68,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"vi__\"\n        // ASCII-7-bit=185  Latin1=144  UTF8=170  CP1252=147  SJS=104  [top ASCII-7-bit]\n  {{(char)0x76,(char)0x6e,(char)0x5f,(char)0x5f, (char)0x03,(char)0x94,(char)0x92,(char)0xbd,(char)0x12,(char)0x83,(char)0x22,(char)0x21,(char)0x2c,(char)0x32,(char)0x26,(char)0x2e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"vn__\"\n        // ASCII-7-bit=148  Latin1=146  UTF8=189  CP1252=131  KSC=34  BIG5=44  CP1250=38  Latin5=46  [top UTF8]\n  {{(char)0x76,(char)0x75,(char)0x5f,(char)0x5f, (char)0x03,(char)0xae,(char)0xb6,(char)0x97,(char)0x11,(char)0x7b,(char)0x11,(char)0x5b,(char)0x31,(char)0x6a,(char)0x41,(char)0x4e,(char)0x71,(char)0x90,(char)0x00,(char)0x00,}}, // \"vu__\"\n        // ASCII-7-bit=174  Latin1=182  UTF8=151  CP1252=123  SJS=91  CP1251=106  ISO-8859-15=78  CP1253=144  [top Latin1]\n  {{(char)0x77,(char)0x73,(char)0x5f,(char)0x5f, (char)0x05,(char)0xae,(char)0xaa,(char)0xa6,(char)0x6c,(char)0x91,(char)0x18,(char)0x76,(char)0x69,(char)0x7c,(char)0x78,(char)0x99,(char)0x9d,(char)0x7d,(char)0x70,(char)0x00,}}, // \"ws__\"\n        // ASCII-7-bit=174  Latin1=170  UTF8=166  GB=108  CP1252=145  SJS=118  EUC-JP=105  BIG5=124  Latin2=120  CP1251=153  CP1256=157  CP1250=125  Latin5=112  [top ASCII-7-bit]\n  {{(char)0x79,(char)0x65,(char)0x5f,(char)0x5f, (char)0x03,(char)0x9e,(char)0x94,(char)0xab,(char)0x11,(char)0x8b,(char)0x61,(char)0xb6,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ye__\"\n        // ASCII-7-bit=158  Latin1=148  UTF8=171  CP1252=139  CP1256=182  [top CP1256]\n  {{(char)0x79,(char)0x75,(char)0x5f,(char)0x5f, (char)0x03,(char)0xa4,(char)0x7f,(char)0xaf,(char)0x11,(char)0x78,(char)0x42,(char)0x87,(char)0x80,(char)0x12,(char)0xb3,(char)0x2c,(char)0xd1,(char)0x60,(char)0x00,(char)0x00,}}, // \"yu__\"\n        // ASCII-7-bit=164  Latin1=127  UTF8=175  CP1252=120  Latin2=135  CP1251=128  CP1250=179  Latin5=44  ISO-8859-5=96  [top CP1250]\n  {{(char)0x7a,(char)0x61,(char)0x5f,(char)0x5f, (char)0x05,(char)0xb8,(char)0xa3,(char)0x97,(char)0x42,(char)0xa1,(char)0x11,(char)0x30,(char)0x11,(char)0x4e,(char)0x13,(char)0x3a,(char)0x4f,(char)0x41,(char)0x21,(char)0x42,}}, // \"za__\"\n        // ASCII-7-bit=184  Latin1=163  UTF8=151  GB=66  CP1252=161  SJS=48  BIG5=78  CP1251=58  CP1256=79  CP1250=65  ISO-8859-15=66  [top ASCII-7-bit]\n  {{(char)0x7a,(char)0x6d,(char)0x5f,(char)0x5f, (char)0x03,(char)0xb8,(char)0x8e,(char)0x9c,(char)0x11,(char)0xa9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"zm__\"\n        // ASCII-7-bit=184  Latin1=142  UTF8=156  CP1252=169  [top ASCII-7-bit]\n  {{(char)0x7a,(char)0x77,(char)0x5f,(char)0x5f, (char)0x05,(char)0xbb,(char)0x95,(char)0x9b,(char)0x59,(char)0x9a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"zw__\"\n        // ASCII-7-bit=187  Latin1=149  UTF8=155  GB=89  CP1252=154  [top ASCII-7-bit]\n};\n\nstatic const int kTLDHintProbsSize = 247;\n\nstatic const HintEntry kCharsetHintProbs[] = {\t// MaxRange 192\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x30,(char)0x36,(char)0x34,(char)0x36, (char)0x02,(char)0xbd,(char)0x7f,(char)0x21,(char)0x95,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____0646\"\n        // ASCII-7-bit=189  Latin1=127  CP1252=149  [top ASCII-7-bit]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0x01,(char)0x96,(char)0xb1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____1250\"\n        // ASCII-7-bit=150  CP1250=190  [top CP1250]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0x01,(char)0x7a,(char)0x91,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____1251\"\n        // ASCII-7-bit=122  CP1251=190  [top CP1251]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x32, (char)0x02,(char)0x99,(char)0x9d,(char)0x21,(char)0xbc,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____1252\"\n        // ASCII-7-bit=153  Latin1=157  CP1252=188  [top CP1252]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x33, (char)0x01,(char)0x79,(char)0x10,(char)0x61,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____1253\"\n        // ASCII-7-bit=121  CP1253=190  [top CP1253]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x34, (char)0x01,(char)0x71,(char)0xc1,(char)0xaf,(char)0x81,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____1254\"\n        // ASCII-7-bit=113  Latin5=175  CP1254=185  [top CP1254]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x35, (char)0x01,(char)0x86,(char)0x10,(char)0x01,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____1255\"\n        // ASCII-7-bit=134  CP1255=190  [top CP1255]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x36, (char)0x01,(char)0x78,(char)0xa1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____1256\"\n        // ASCII-7-bit=120  CP1256=190  [top CP1256]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x37, (char)0x01,(char)0x79,(char)0xf1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____1257\"\n        // ASCII-7-bit=121  CP1257=190  [top CP1257]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x31,(char)0x38,(char)0x30,(char)0x30, (char)0x10,(char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____1800\"\n        // KOI8R=191  [top KOI8R]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x33,(char)0x36,(char)0x30,(char)0x30, (char)0xc1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____3600\"\n        // CP1250=191  [top CP1250]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x33,(char)0x36,(char)0x39,(char)0x39, (char)0x01,(char)0xad,(char)0x11,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____3699\"\n        // ASCII-7-bit=173  UTF8=185  [top UTF8]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x34,(char)0x34,(char)0x30,(char)0x30, (char)0x02,(char)0xbc,(char)0x87,(char)0x21,(char)0xa4,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____4400\"\n        // ASCII-7-bit=188  Latin1=135  CP1252=164  [top ASCII-7-bit]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x35,(char)0x30,(char)0x30,(char)0x31, (char)0x01,(char)0x9a,(char)0x11,(char)0xbd,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____5001\"\n        // ASCII-7-bit=154  UTF8=189  [top UTF8]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0x02,(char)0xa8,(char)0xa6,(char)0x21,(char)0xa7,(char)0xa1,(char)0xb2,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____5915\"\n        // ASCII-7-bit=168  Latin1=166  CP1252=167  ISO-8859-15=178  [top ISO-8859-15]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x36,(char)0x34,(char)0x36,(char)0x5f, (char)0x02,(char)0xbe,(char)0x8e,(char)0x21,(char)0x81,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____646_\"\n        // ASCII-7-bit=190  Latin1=142  CP1252=129  [top ASCII-7-bit]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0xae,(char)0xb8,(char)0x21,(char)0x94,(char)0xa1,(char)0x2f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____8591\"\n        // ASCII-7-bit=174  Latin1=184  CP1252=148  ISO-8859-15=47  [top Latin1]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x32, (char)0x01,(char)0x8c,(char)0x81,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____8592\"\n        // ASCII-7-bit=140  Latin2=190  [top Latin2]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x34, (char)0x10,(char)0xe1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____8594\"\n        // Latin4=191  [top Latin4]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x35, (char)0x01,(char)0x6f,(char)0x10,(char)0xa1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____8595\"\n        // ASCII-7-bit=111  ISO-8859-5=190  [top ISO-8859-5]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x37, (char)0x10,(char)0x41,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____8597\"\n        // Greek=191  [top Greek]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x39, (char)0x01,(char)0x72,(char)0xc1,(char)0xbe,(char)0x81,(char)0x7b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____8599\"\n        // ASCII-7-bit=114  Latin5=190  CP1254=123  [top Latin5]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x38,(char)0x38,(char)0x36,(char)0x31, (char)0x91,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____8861\"\n        // Latin2=191  [top Latin2]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x38,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x03,(char)0x98,(char)0x5d,(char)0xbd,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"____8___\"\n        // ASCII-7-bit=152  Latin1=93  UTF8=189  [top UTF8]\n  {{(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x07,(char)0xb1,(char)0xaa,(char)0x9c,(char)0x95,(char)0x96,(char)0x8e,(char)0x8c,(char)0x11,(char)0x82,(char)0x00,(char)0x00,}}, // \"________\"\n        // ASCII-7-bit=177  Latin1=170  UTF8=156  GB=149  CP1252=150  KSC=142  SJS=140  BIG5=130  [top ASCII-7-bit]\n  {{(char)0x61,(char)0x6e,(char)0x73,(char)0x69,(char)0x33,(char)0x34,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbe,(char)0x6e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ansi34__\"\n        // ASCII-7-bit=190  Latin1=110  [top ASCII-7-bit]\n  {{(char)0x61,(char)0x6e,(char)0x73,(char)0x69,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xa2,(char)0xb9,(char)0x21,(char)0xa4,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ansi____\"\n        // ASCII-7-bit=162  Latin1=185  CP1252=164  [top Latin1]\n  {{(char)0x61,(char)0x72,(char)0x72,(char)0x61,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x90,(char)0xa1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"arra____\"\n        // ASCII-7-bit=144  CP1256=190  [top CP1256]\n  {{(char)0x61,(char)0x73,(char)0x63,(char)0x69,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbe,(char)0x72,(char)0x21,(char)0x71,(char)0xa1,(char)0x53,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"asci____\"\n        // ASCII-7-bit=190  Latin1=114  CP1252=113  ISO-8859-15=83  [top ASCII-7-bit]\n  {{(char)0x61,(char)0x75,(char)0x74,(char)0x6f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x9b,(char)0x51,(char)0xbd,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"auto____\"\n        // ASCII-7-bit=155  SJS=189  [top SJS]\n  {{(char)0x62,(char)0x67,(char)0x5f,(char)0x5f,(char)0x32,(char)0x33,(char)0x31,(char)0x32, (char)0x01,(char)0x93,(char)0x21,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bg__2312\"\n        // ASCII-7-bit=147  GB=190  [top GB]\n  {{(char)0x62,(char)0x68,(char)0x61,(char)0x73,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x30,(char)0x01,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bhas____\"\n        // BHASKAR=191  [top BHASKAR]\n  {{(char)0x62,(char)0x69,(char)0x67,(char)0x5f,(char)0x35,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x84,(char)0x71,(char)0xbe,(char)0x10,(char)0xa1,(char)0x2f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"big_5___\"\n        // ASCII-7-bit=132  BIG5=190  BIG5_HKSCS=47  [top BIG5]\n  {{(char)0x62,(char)0x69,(char)0x67,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"big_8591\"\n        // Latin1=191  [top Latin1]\n  {{(char)0x62,(char)0x69,(char)0x67,(char)0x68,(char)0x35,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x88,(char)0x71,(char)0xae,(char)0x10,(char)0xa1,(char)0xb8,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bigh5___\"\n        // ASCII-7-bit=136  BIG5=174  BIG5_HKSCS=184  [top BIG5_HKSCS]\n  {{(char)0x62,(char)0x69,(char)0x6e,(char)0x61,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x30,(char)0xa1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bina____\"\n        // X-BINARYENC=191  [top X-BINARYENC]\n  {{(char)0x62,(char)0x6f,(char)0x74,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0xd1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bot_____\"\n        // Latin5=191  [top Latin5]\n  {{(char)0x62,(char)0x73,(char)0x5f,(char)0x5f,(char)0x34,(char)0x37,(char)0x33,(char)0x30, (char)0x02,(char)0xb8,(char)0xa8,(char)0x21,(char)0xa3,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"bs__4730\"\n        // ASCII-7-bit=184  Latin1=168  CP1252=163  [top ASCII-7-bit]\n  {{(char)0x63,(char)0x68,(char)0x61,(char)0x72,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xa5,(char)0xbb,(char)0x21,(char)0x91,(char)0xa1,(char)0x28,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"char____\"\n        // ASCII-7-bit=165  Latin1=187  CP1252=145  ISO-8859-15=40  [top Latin1]\n  {{(char)0x63,(char)0x6e,(char)0x73,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x30,(char)0x71,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cns_____\"\n        // CNS=191  [top CNS]\n  {{(char)0x63,(char)0x6f,(char)0x6e,(char)0x66,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x9f,(char)0x11,(char)0xbd,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"conf____\"\n        // ASCII-7-bit=159  UTF8=189  [top UTF8]\n  {{(char)0x63,(char)0x6f,(char)0x6e,(char)0x74,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0xa4,(char)0x11,(char)0xbc,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cont____\"\n        // ASCII-7-bit=164  UTF8=188  [top UTF8]\n  {{(char)0x63,(char)0x70,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0x01,(char)0x97,(char)0xb1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cp__1250\"\n        // ASCII-7-bit=151  CP1250=190  [top CP1250]\n  {{(char)0x63,(char)0x70,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0x01,(char)0x7c,(char)0x91,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cp__1251\"\n        // ASCII-7-bit=124  CP1251=190  [top CP1251]\n  {{(char)0x63,(char)0x70,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x32, (char)0x02,(char)0xab,(char)0xa9,(char)0x21,(char)0xb5,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cp__1252\"\n        // ASCII-7-bit=171  Latin1=169  CP1252=181  [top CP1252]\n  {{(char)0x63,(char)0x70,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x33, (char)0x01,(char)0x79,(char)0x10,(char)0x31,(char)0x7f,(char)0x21,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cp__1253\"\n        // ASCII-7-bit=121  Greek=127  CP1253=190  [top CP1253]\n  {{(char)0x63,(char)0x70,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x34, (char)0x01,(char)0x5b,(char)0xc1,(char)0xaf,(char)0x81,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cp__1254\"\n        // ASCII-7-bit=91  Latin5=175  CP1254=185  [top CP1254]\n  {{(char)0x63,(char)0x70,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x35, (char)0x01,(char)0x86,(char)0x10,(char)0x01,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cp__1255\"\n        // ASCII-7-bit=134  CP1255=190  [top CP1255]\n  {{(char)0x63,(char)0x70,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x36, (char)0x01,(char)0x5e,(char)0xa1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cp__1256\"\n        // ASCII-7-bit=94  CP1256=190  [top CP1256]\n  {{(char)0x63,(char)0x70,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x37, (char)0x01,(char)0xa8,(char)0xf1,(char)0xbb,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cp__1257\"\n        // ASCII-7-bit=168  CP1257=187  [top CP1257]\n  {{(char)0x63,(char)0x70,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x30,(char)0x5f, (char)0x02,(char)0x97,(char)0x98,(char)0x21,(char)0x8c,(char)0xa1,(char)0xbc,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cp__850_\"\n        // ASCII-7-bit=151  Latin1=152  CP1252=140  ISO-8859-15=188  [top ISO-8859-15]\n  {{(char)0x63,(char)0x70,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x32,(char)0x5f, (char)0x01,(char)0x8f,(char)0x20,(char)0x01,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cp__852_\"\n        // ASCII-7-bit=143  CP852=190  [top CP852]\n  {{(char)0x63,(char)0x70,(char)0x5f,(char)0x5f,(char)0x38,(char)0x36,(char)0x36,(char)0x5f, (char)0x01,(char)0xa2,(char)0x20,(char)0x31,(char)0xbc,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cp__866_\"\n        // ASCII-7-bit=162  CP866=188  [top CP866]\n  {{(char)0x63,(char)0x70,(char)0x63,(char)0x5f,(char)0x39,(char)0x34,(char)0x33,(char)0x5f, (char)0x01,(char)0x26,(char)0x51,(char)0xbe,(char)0x10,(char)0x11,(char)0x68,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cpc_943_\"\n        // ASCII-7-bit=38  SJS=190  CP932=104  [top SJS]\n  {{(char)0x63,(char)0x70,(char)0x63,(char)0x7a,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0xc1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cpcz1250\"\n        // CP1250=191  [top CP1250]\n  {{(char)0x63,(char)0x73,(char)0x69,(char)0x73,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x9c,(char)0x10,(char)0x01,(char)0xbd,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"csis____\"\n        // ASCII-7-bit=156  CP1255=189  [top CP1255]\n  {{(char)0x63,(char)0x73,(char)0x6e,(char)0x5f,(char)0x39,(char)0x31,(char)0x30,(char)0x33, (char)0x20,(char)0x91,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"csn_9103\"\n        // CSN_369103=191  [top CSN_369103]\n  {{(char)0x63,(char)0x73,(char)0x73,(char)0x68,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x7f,(char)0x51,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cssh____\"\n        // ASCII-7-bit=127  SJS=190  [top SJS]\n  {{(char)0x63,(char)0x73,(char)0x77,(char)0x69,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0xc1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cswi1250\"\n        // CP1250=191  [top CP1250]\n  {{(char)0x63,(char)0x73,(char)0x77,(char)0x69,(char)0x33,(char)0x31,(char)0x5f,(char)0x5f, (char)0x61,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"cswi31__\"\n        // SJS=191  [top SJS]\n  {{(char)0x63,(char)0x7a,(char)0x77,(char)0x69,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0xc1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"czwi1250\"\n        // CP1250=191  [top CP1250]\n  {{(char)0x64,(char)0x61,(char)0x64,(char)0x6b,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbe,(char)0x21,(char)0x7d,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"dadk8591\"\n        // Latin1=190  CP1252=125  [top Latin1]\n  {{(char)0x64,(char)0x61,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x21,(char)0x6f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"dais8591\"\n        // ASCII-7-bit=111  Latin1=190  CP1252=111  [top Latin1]\n  {{(char)0x64,(char)0x65,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0x9d,(char)0xbc,(char)0x21,(char)0x95,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"de______\"\n        // ASCII-7-bit=157  Latin1=188  CP1252=149  [top Latin1]\n  {{(char)0x64,(char)0x65,(char)0x61,(char)0x73,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0x8f,(char)0xbd,(char)0x21,(char)0x92,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"deas____\"\n        // ASCII-7-bit=143  Latin1=189  CP1252=146  [top Latin1]\n  {{(char)0x64,(char)0x65,(char)0x64,(char)0x65,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x92,(char)0xbe,(char)0x21,(char)0x87,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"dede8591\"\n        // ASCII-7-bit=146  Latin1=190  CP1252=135  [top Latin1]\n  {{(char)0x64,(char)0x65,(char)0x66,(char)0x61,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbc,(char)0x9f,(char)0x21,(char)0x89,(char)0xa1,(char)0x6b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"defa____\"\n        // ASCII-7-bit=188  Latin1=159  CP1252=137  ISO-8859-15=107  [top ASCII-7-bit]\n  {{(char)0x64,(char)0x65,(char)0x69,(char)0x73,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0x11,(char)0x83,(char)0xd1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"deis5915\"\n        // Latin1=131  ISO-8859-15=190  [top ISO-8859-15]\n  {{(char)0x64,(char)0x65,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x92,(char)0xbd,(char)0x21,(char)0x89,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"deis8591\"\n        // ASCII-7-bit=146  Latin1=189  CP1252=137  [top Latin1]\n  {{(char)0x64,(char)0x65,(char)0x6c,(char)0x65,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xa9,(char)0xba,(char)0x21,(char)0x92,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"dele____\"\n        // ASCII-7-bit=169  Latin1=186  CP1252=146  [top Latin1]\n  {{(char)0x64,(char)0x65,(char)0x75,(char)0x74,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0x74,(char)0xb8,(char)0x21,(char)0xaf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"deut____\"\n        // ASCII-7-bit=116  Latin1=184  CP1252=175  [top Latin1]\n  {{(char)0x64,(char)0x6f,(char)0x6f,(char)0x72,(char)0x31,(char)0x32,(char)0x35,(char)0x32, (char)0x11,(char)0x79,(char)0x21,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"door1252\"\n        // Latin1=121  CP1252=190  [top CP1252]\n  {{(char)0x65,(char)0x63,(char)0x75,(char)0x6a,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x71,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ecuj____\"\n        // EUC-JP=191  [top EUC-JP]\n  {{(char)0x65,(char)0x63,(char)0x75,(char)0x6b,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x71,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ecuk____\"\n        // ASCII-7-bit=113  KSC=190  [top KSC]\n  {{(char)0x65,(char)0x65,(char)0x6d,(char)0x73,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0xc1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"eems1250\"\n        // CP1250=191  [top CP1250]\n  {{(char)0x65,(char)0x6e,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"en__8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x65,(char)0x6e,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbe,(char)0x92,(char)0x21,(char)0x82,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"en______\"\n        // ASCII-7-bit=190  Latin1=146  CP1252=130  [top ASCII-7-bit]\n  {{(char)0x65,(char)0x6e,(char)0x63,(char)0x6f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"enco____\"\n        // ASCII-7-bit=191  [top ASCII-7-bit]\n  {{(char)0x65,(char)0x6e,(char)0x67,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x8b,(char)0x71,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"eng_____\"\n        // ASCII-7-bit=139  BIG5=190  [top BIG5]\n  {{(char)0x65,(char)0x6e,(char)0x67,(char)0x62,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbe,(char)0x7d,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"engb____\"\n        // ASCII-7-bit=190  Latin1=125  [top ASCII-7-bit]\n  {{(char)0x65,(char)0x6e,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x96,(char)0xbc,(char)0x21,(char)0x9a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"enis8591\"\n        // ASCII-7-bit=150  Latin1=188  CP1252=154  [top Latin1]\n  {{(char)0x65,(char)0x6e,(char)0x75,(char)0x6b,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"enuk8591\"\n        // Latin1=191  [top Latin1]\n  {{(char)0x65,(char)0x6e,(char)0x75,(char)0x6b,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x51,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"enuk____\"\n        // KSC=191  [top KSC]\n  {{(char)0x65,(char)0x6e,(char)0x75,(char)0x73,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0x02,(char)0x6f,(char)0x7f,(char)0xd1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"enus5915\"\n        // ASCII-7-bit=111  Latin1=127  ISO-8859-15=190  [top ISO-8859-15]\n  {{(char)0x65,(char)0x6e,(char)0x75,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x9c,(char)0xbc,(char)0x21,(char)0x9b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"enus8591\"\n        // ASCII-7-bit=156  Latin1=188  CP1252=155  [top Latin1]\n  {{(char)0x65,(char)0x6e,(char)0x75,(char)0x73,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbb,(char)0xa1,(char)0x21,(char)0x9e,(char)0xa1,(char)0x68,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"enus____\"\n        // ASCII-7-bit=187  Latin1=161  CP1252=158  ISO-8859-15=104  [top ASCII-7-bit]\n  {{(char)0x65,(char)0x6e,(char)0x75,(char)0x74,(char)0x38,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x81,(char)0xf1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"enut8___\"\n        // ASCII-7-bit=129  CP1257=190  [top CP1257]\n  {{(char)0x65,(char)0x73,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xb4,(char)0xb3,(char)0x21,(char)0x9d,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"es______\"\n        // ASCII-7-bit=180  Latin1=179  CP1252=157  [top ASCII-7-bit]\n  {{(char)0x65,(char)0x73,(char)0x65,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x82,(char)0xbe,(char)0x21,(char)0x6e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"eses8591\"\n        // ASCII-7-bit=130  Latin1=190  CP1252=110  [top Latin1]\n  {{(char)0x65,(char)0x73,(char)0x65,(char)0x73,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xa6,(char)0xba,(char)0x21,(char)0x96,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"eses____\"\n        // ASCII-7-bit=166  Latin1=186  CP1252=150  [top Latin1]\n  {{(char)0x65,(char)0x73,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbe,(char)0x21,(char)0x87,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"esis8591\"\n        // Latin1=190  CP1252=135  [top Latin1]\n  {{(char)0x65,(char)0x74,(char)0x65,(char)0x65,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"etee8591\"\n        // Latin1=191  [top Latin1]\n  {{(char)0x65,(char)0x74,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"etis8591\"\n        // Latin1=191  [top Latin1]\n  {{(char)0x65,(char)0x75,(char)0x63,(char)0x5f,(char)0x32,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0xbe,(char)0x31,(char)0x72,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"euc_2___\"\n        // ASCII-7-bit=190  CP1252=114  [top ASCII-7-bit]\n  {{(char)0x65,(char)0x75,(char)0x63,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x7d,(char)0x61,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"euc_____\"\n        // ASCII-7-bit=125  EUC-JP=190  [top EUC-JP]\n  {{(char)0x65,(char)0x75,(char)0x63,(char)0x63,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x6f,(char)0x30,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"eucc____\"\n        // ASCII-7-bit=111  EUC-CN=190  [top EUC-CN]\n  {{(char)0x65,(char)0x75,(char)0x63,(char)0x64,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x30,(char)0x61,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"eucd____\"\n        // EUC=191  [top EUC]\n  {{(char)0x65,(char)0x75,(char)0x63,(char)0x6a,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x68,(char)0x61,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"eucj____\"\n        // ASCII-7-bit=104  EUC-JP=190  [top EUC-JP]\n  {{(char)0x65,(char)0x75,(char)0x63,(char)0x6b,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x6d,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"euck____\"\n        // ASCII-7-bit=109  KSC=190  [top KSC]\n  {{(char)0x65,(char)0x75,(char)0x63,(char)0x75,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x6d,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"eucu____\"\n        // ASCII-7-bit=109  KSC=190  [top KSC]\n  {{(char)0x65,(char)0x75,(char)0x6b,(char)0x6b,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x51,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"eukk____\"\n        // KSC=191  [top KSC]\n  {{(char)0x65,(char)0x75,(char)0x72,(char)0x6b,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x71,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"eurk____\"\n        // ASCII-7-bit=113  KSC=190  [top KSC]\n  {{(char)0x66,(char)0x65,(char)0x61,(char)0x74,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x41,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"feat____\"\n        // CP1252=191  [top CP1252]\n  {{(char)0x66,(char)0x66,(char)0x5f,(char)0x5f,(char)0x30,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0x9e,(char)0xba,(char)0x21,(char)0xa5,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ff__0___\"\n        // ASCII-7-bit=158  Latin1=186  CP1252=165  [top Latin1]\n  {{(char)0x66,(char)0x69,(char)0x66,(char)0x69,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"fifi8591\"\n        // Latin1=191  [top Latin1]\n  {{(char)0x66,(char)0x72,(char)0x66,(char)0x72,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x79,(char)0xbc,(char)0x21,(char)0xa3,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"frfr8591\"\n        // ASCII-7-bit=121  Latin1=188  CP1252=163  [top Latin1]\n  {{(char)0x66,(char)0x72,(char)0x66,(char)0x72,(char)0x38,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xa6,(char)0xad,(char)0x21,(char)0xb5,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"frfr8___\"\n        // ASCII-7-bit=166  Latin1=173  CP1252=181  [top CP1252]\n  {{(char)0x66,(char)0x72,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x80,(char)0xbd,(char)0x21,(char)0x9e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"fris8591\"\n        // ASCII-7-bit=128  Latin1=189  CP1252=158  [top Latin1]\n  {{(char)0x66,(char)0x72,(char)0x75,(char)0x74,(char)0x38,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0x8c,(char)0xb3,(char)0x21,(char)0xb5,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"frut8___\"\n        // ASCII-7-bit=140  Latin1=179  CP1252=181  [top CP1252]\n  {{(char)0x67,(char)0x62,(char)0x5f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0x01,(char)0x6f,(char)0x91,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gb__1251\"\n        // ASCII-7-bit=111  CP1251=190  [top CP1251]\n  {{(char)0x67,(char)0x62,(char)0x5f,(char)0x5f,(char)0x32,(char)0x31,(char)0x33,(char)0x32, (char)0x01,(char)0x91,(char)0x21,(char)0xbe,(char)0xf1,(char)0x70,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gb__2132\"\n        // ASCII-7-bit=145  GB=190  GBK=112  [top GB]\n  {{(char)0x67,(char)0x62,(char)0x5f,(char)0x5f,(char)0x32,(char)0x33,(char)0x31,(char)0x32, (char)0x01,(char)0x7a,(char)0x21,(char)0xbe,(char)0xf1,(char)0x5c,(char)0xc1,(char)0x37,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gb__2312\"\n        // ASCII-7-bit=122  GB=190  GBK=92  GB18030=55  [top GB]\n  {{(char)0x67,(char)0x62,(char)0x5f,(char)0x5f,(char)0x32,(char)0x33,(char)0x32,(char)0x31, (char)0x01,(char)0x7d,(char)0x21,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gb__2321\"\n        // ASCII-7-bit=125  GB=190  [top GB]\n  {{(char)0x67,(char)0x62,(char)0x5f,(char)0x5f,(char)0x33,(char)0x32,(char)0x31,(char)0x32, (char)0x01,(char)0x92,(char)0x21,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gb__3212\"\n        // ASCII-7-bit=146  GB=190  [top GB]\n  {{(char)0x67,(char)0x62,(char)0x5f,(char)0x5f,(char)0x38,(char)0x30,(char)0x33,(char)0x30, (char)0x01,(char)0x73,(char)0x21,(char)0xaf,(char)0xf1,(char)0x59,(char)0xc1,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gb__8030\"\n        // ASCII-7-bit=115  GB=175  GBK=89  GB18030=185  [top GB18030]\n  {{(char)0x67,(char)0x62,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x7f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gb__8591\"\n        // ASCII-7-bit=127  Latin1=190  [top Latin1]\n  {{(char)0x67,(char)0x62,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x71,(char)0x21,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gb______\"\n        // ASCII-7-bit=113  GB=190  [top GB]\n  {{(char)0x67,(char)0x62,(char)0x6b,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x76,(char)0x21,(char)0xaf,(char)0xf1,(char)0xb9,(char)0xc1,(char)0x13,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gbk_____\"\n        // ASCII-7-bit=118  GB=175  GBK=185  GB18030=19  [top GBK]\n  {{(char)0x67,(char)0x64,(char)0x5f,(char)0x5f,(char)0x32,(char)0x33,(char)0x31,(char)0x32, (char)0x01,(char)0x56,(char)0x21,(char)0xbe,(char)0xf1,(char)0x72,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gd__2312\"\n        // ASCII-7-bit=86  GB=190  GBK=114  [top GB]\n  {{(char)0x67,(char)0x65,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x79,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"geis8591\"\n        // ASCII-7-bit=121  Latin1=190  [top Latin1]\n  {{(char)0x67,(char)0x65,(char)0x6e,(char)0x65,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0xa1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gene1251\"\n        // CP1251=191  [top CP1251]\n  {{(char)0x67,(char)0x69,(char)0x73,(char)0x6f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbe,(char)0x21,(char)0x6f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"giso8591\"\n        // Latin1=190  CP1252=111  [top Latin1]\n  {{(char)0x67,(char)0x72,(char)0x65,(char)0x65,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x90,(char)0x10,(char)0x31,(char)0xbe,(char)0x21,(char)0x86,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"gree____\"\n        // ASCII-7-bit=144  Greek=190  CP1253=134  [top Greek]\n  {{(char)0x68,(char)0x72,(char)0x77,(char)0x69,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0xc1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"hrwi1250\"\n        // CP1250=191  [top CP1250]\n  {{(char)0x68,(char)0x74,(char)0x63,(char)0x68,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x30,(char)0x11,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"htch____\"\n        // HTCHANAKYA=191  [top HTCHANAKYA]\n  {{(char)0x68,(char)0x74,(char)0x6d,(char)0x6c,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"html____\"\n        // ASCII-7-bit=191  [top ASCII-7-bit]\n  {{(char)0x68,(char)0x74,(char)0x74,(char)0x70,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbb,(char)0xa4,(char)0x21,(char)0x8d,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"http____\"\n        // ASCII-7-bit=187  Latin1=164  CP1252=141  [top ASCII-7-bit]\n  {{(char)0x68,(char)0x7a,(char)0x67,(char)0x62,(char)0x32,(char)0x33,(char)0x31,(char)0x32, (char)0x01,(char)0x85,(char)0x20,(char)0x71,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"hzgb2312\"\n        // ASCII-7-bit=133  HZ-GB-2312=190  [top HZ-GB-2312]\n  {{(char)0x69,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x79,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"i___8591\"\n        // ASCII-7-bit=121  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x61,(char)0x6e,(char)0x6f,(char)0x35,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbe,(char)0x61,(char)0x21,(char)0x54,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iano5___\"\n        // ASCII-7-bit=190  Latin1=97  CP1252=84  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x62,(char)0x6d,(char)0x5f,(char)0x38,(char)0x35,(char)0x32,(char)0x5f, (char)0x01,(char)0xac,(char)0x20,(char)0x01,(char)0xba,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ibm_852_\"\n        // ASCII-7-bit=172  CP852=186  [top CP852]\n  {{(char)0x69,(char)0x62,(char)0x6d,(char)0x5f,(char)0x38,(char)0x36,(char)0x36,(char)0x5f, (char)0x01,(char)0x84,(char)0x20,(char)0x31,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ibm_866_\"\n        // ASCII-7-bit=132  CP866=190  [top CP866]\n  {{(char)0x69,(char)0x62,(char)0x6d,(char)0x5f,(char)0x39,(char)0x34,(char)0x32,(char)0x5f, (char)0x61,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ibm_942_\"\n        // SJS=191  [top SJS]\n  {{(char)0x69,(char)0x63,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x79,(char)0xbb,(char)0x21,(char)0xa9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ico_8591\"\n        // ASCII-7-bit=121  Latin1=187  CP1252=169  [top Latin1]\n  {{(char)0x69,(char)0x6e,(char)0x64,(char)0x6f,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0xa1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"indo1251\"\n        // CP1251=191  [top CP1251]\n  {{(char)0x69,(char)0x6e,(char)0x73,(char)0x6f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"inso8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x6f,(char)0x73,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x97,(char)0xbd,(char)0x21,(char)0x6e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ios_8591\"\n        // ASCII-7-bit=151  Latin1=189  CP1252=110  [top Latin1]\n  {{(char)0x69,(char)0x6f,(char)0x73,(char)0x6f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbe,(char)0x21,(char)0x79,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ioso8591\"\n        // Latin1=190  CP1252=121  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x5f,(char)0x5f,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0x11,(char)0x7f,(char)0xd1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"is__5915\"\n        // Latin1=127  ISO-8859-15=190  [top ISO-8859-15]\n  {{(char)0x69,(char)0x73,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0xad,(char)0xb7,(char)0x21,(char)0x9f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"is__8591\"\n        // ASCII-7-bit=173  Latin1=183  CP1252=159  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x32, (char)0x01,(char)0x78,(char)0x81,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"is__8592\"\n        // ASCII-7-bit=120  Latin2=190  [top Latin2]\n  {{(char)0x69,(char)0x73,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x37, (char)0x10,(char)0x41,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"is__8597\"\n        // Greek=191  [top Greek]\n  {{(char)0x69,(char)0x73,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x38, (char)0x01,(char)0x6f,(char)0x10,(char)0x81,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"is__8598\"\n        // ASCII-7-bit=111  Hebrew=190  [top Hebrew]\n  {{(char)0x69,(char)0x73,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x39, (char)0xd1,(char)0xbe,(char)0x81,(char)0x88,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"is__8599\"\n        // Latin5=190  CP1254=136  [top Latin5]\n  {{(char)0x69,(char)0x73,(char)0x61,(char)0x5f,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0x02,(char)0x86,(char)0x89,(char)0xd1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isa_5915\"\n        // ASCII-7-bit=134  Latin1=137  ISO-8859-15=190  [top ISO-8859-15]\n  {{(char)0x69,(char)0x73,(char)0x64,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x79,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isd_8591\"\n        // ASCII-7-bit=121  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x64,(char)0x6f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isdo8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6e,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isn_8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x30,(char)0x36,(char)0x34,(char)0x36, (char)0x02,(char)0xb8,(char)0xaa,(char)0x21,(char)0xa3,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_0646\"\n        // ASCII-7-bit=184  Latin1=170  CP1252=163  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x31,(char)0x30,(char)0x34,(char)0x30, (char)0x02,(char)0x98,(char)0xb2,(char)0x21,(char)0xb4,(char)0xa1,(char)0x5e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_1040\"\n        // ASCII-7-bit=152  Latin1=178  CP1252=180  ISO-8859-15=94  [top CP1252]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0x01,(char)0x90,(char)0xb1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_1250\"\n        // ASCII-7-bit=144  CP1250=190  [top CP1250]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0x01,(char)0x78,(char)0x91,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_1251\"\n        // ASCII-7-bit=120  CP1251=190  [top CP1251]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x32, (char)0x02,(char)0xad,(char)0x9e,(char)0x21,(char)0xb7,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_1252\"\n        // ASCII-7-bit=173  Latin1=158  CP1252=183  [top CP1252]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x33, (char)0x10,(char)0x41,(char)0x83,(char)0x21,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_1253\"\n        // Greek=131  CP1253=190  [top CP1253]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x34, (char)0xd1,(char)0x9b,(char)0x81,(char)0xbd,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_1254\"\n        // Latin5=155  CP1254=189  [top CP1254]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x35, (char)0x01,(char)0x79,(char)0x10,(char)0x01,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_1255\"\n        // ASCII-7-bit=121  CP1255=190  [top CP1255]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x36, (char)0x01,(char)0x6f,(char)0xa1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_1256\"\n        // ASCII-7-bit=111  CP1256=190  [top CP1256]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x37, (char)0x01,(char)0x7f,(char)0xf1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_1257\"\n        // ASCII-7-bit=127  CP1257=190  [top CP1257]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x31,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0x85,(char)0xb5,(char)0x21,(char)0xb3,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_1___\"\n        // ASCII-7-bit=133  Latin1=181  CP1252=179  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x32,(char)0x30,(char)0x32,(char)0x32, (char)0x01,(char)0x97,(char)0x51,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_2022\"\n        // ASCII-7-bit=151  SJS=190  [top SJS]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x35,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0xa9,(char)0xb8,(char)0x21,(char)0xa4,(char)0xa1,(char)0x3c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_5591\"\n        // ASCII-7-bit=169  Latin1=184  CP1252=164  ISO-8859-15=60  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x35,(char)0x35,(char)0x39,(char)0x32, (char)0x02,(char)0x9a,(char)0xbd,(char)0x21,(char)0x92,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_5592\"\n        // ASCII-7-bit=154  Latin1=189  CP1252=146  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x35,(char)0x38,(char)0x39,(char)0x31, (char)0x02,(char)0xa1,(char)0xbc,(char)0x21,(char)0x8b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_5891\"\n        // ASCII-7-bit=161  Latin1=188  CP1252=139  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x35,(char)0x39,(char)0x31,(char)0x30, (char)0x01,(char)0xaa,(char)0x20,(char)0xa1,(char)0xba,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_5910\"\n        // ASCII-7-bit=170  Latin6=186  [top Latin6]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x35,(char)0x39,(char)0x31,(char)0x31, (char)0x01,(char)0x86,(char)0xd1,(char)0xbe,(char)0xd1,(char)0x66,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_5911\"\n        // ASCII-7-bit=134  ISO-8859-11=190  CP874=102  [top ISO-8859-11]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x35,(char)0x39,(char)0x31,(char)0x33, (char)0x01,(char)0x9c,(char)0xf1,(char)0xa1,(char)0xc1,(char)0xbb,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_5913\"\n        // ASCII-7-bit=156  CP1257=161  ISO-8859-13=187  [top ISO-8859-13]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x35,(char)0x39,(char)0x31,(char)0x34, (char)0x02,(char)0x93,(char)0xbd,(char)0x21,(char)0x95,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_5914\"\n        // ASCII-7-bit=147  Latin1=189  CP1252=149  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0x02,(char)0x98,(char)0xad,(char)0x21,(char)0x81,(char)0xa1,(char)0xb7,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_5915\"\n        // ASCII-7-bit=152  Latin1=173  CP1252=129  ISO-8859-15=183  [top ISO-8859-15]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x35,(char)0x39,(char)0x31,(char)0x36, (char)0x01,(char)0xae,(char)0xb1,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_5916\"\n        // ASCII-7-bit=174  CP1250=185  [top CP1250]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x35,(char)0x39,(char)0x32,(char)0x32, (char)0x01,(char)0xa7,(char)0x81,(char)0xbb,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_5922\"\n        // ASCII-7-bit=167  Latin2=187  [top Latin2]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x36,(char)0x33,(char)0x39,(char)0x32, (char)0x02,(char)0x7e,(char)0xbe,(char)0x21,(char)0x82,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_6392\"\n        // ASCII-7-bit=126  Latin1=190  CP1252=130  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x36,(char)0x33,(char)0x39,(char)0x5f, (char)0x01,(char)0xa6,(char)0xa1,(char)0xbc,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_639_\"\n        // ASCII-7-bit=166  CP1256=188  [top CP1256]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x36,(char)0x34,(char)0x36,(char)0x31, (char)0x02,(char)0x7d,(char)0xbe,(char)0x21,(char)0x68,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_6461\"\n        // ASCII-7-bit=125  Latin1=190  CP1252=104  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x31,(char)0x31, (char)0x02,(char)0xb0,(char)0xb7,(char)0x21,(char)0x92,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8511\"\n        // ASCII-7-bit=176  Latin1=183  CP1252=146  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x36,(char)0x31, (char)0x02,(char)0x9f,(char)0xba,(char)0x21,(char)0xa5,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8561\"\n        // ASCII-7-bit=159  Latin1=186  CP1252=165  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x38,(char)0x31, (char)0x01,(char)0x8d,(char)0x51,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8581\"\n        // ASCII-7-bit=141  SJS=190  [top SJS]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x30, (char)0x02,(char)0x99,(char)0xbc,(char)0x21,(char)0x9c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8590\"\n        // ASCII-7-bit=153  Latin1=188  CP1252=156  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0xae,(char)0xb8,(char)0x21,(char)0x99,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8591\"\n        // ASCII-7-bit=174  Latin1=184  CP1252=153  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x32, (char)0x01,(char)0x95,(char)0x81,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8592\"\n        // ASCII-7-bit=149  Latin2=190  [top Latin2]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x33, (char)0x01,(char)0x9f,(char)0x20,(char)0x51,(char)0xbd,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8593\"\n        // ASCII-7-bit=159  Latin3=189  [top Latin3]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x34, (char)0x01,(char)0xac,(char)0x10,(char)0xd1,(char)0xba,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8594\"\n        // ASCII-7-bit=172  Latin4=186  [top Latin4]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x35, (char)0x01,(char)0xa6,(char)0x10,(char)0xa1,(char)0xbc,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8595\"\n        // ASCII-7-bit=166  ISO-8859-5=188  [top ISO-8859-5]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x36, (char)0x01,(char)0xae,(char)0x20,(char)0x11,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8596\"\n        // ASCII-7-bit=174  Arabic=185  [top Arabic]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x37, (char)0x01,(char)0x96,(char)0x10,(char)0x31,(char)0xbd,(char)0x21,(char)0x8f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8597\"\n        // ASCII-7-bit=150  Greek=189  CP1253=143  [top Greek]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x38, (char)0x01,(char)0x9b,(char)0x10,(char)0x81,(char)0xbd,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8598\"\n        // ASCII-7-bit=155  Hebrew=189  [top Hebrew]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x39, (char)0x01,(char)0x7a,(char)0xc1,(char)0xbe,(char)0x81,(char)0x7e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8599\"\n        // ASCII-7-bit=122  Latin5=190  CP1254=126  [top Latin5]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x36,(char)0x30,(char)0x31, (char)0x02,(char)0xba,(char)0x94,(char)0x21,(char)0xa6,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8601\"\n        // ASCII-7-bit=186  Latin1=148  CP1252=166  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x36,(char)0x39,(char)0x31, (char)0x02,(char)0xad,(char)0xb9,(char)0x21,(char)0x83,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8691\"\n        // ASCII-7-bit=173  Latin1=185  CP1252=131  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x36,(char)0x39,(char)0x32, (char)0x91,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8692\"\n        // Latin2=191  [top Latin2]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x38,(char)0x35,(char)0x31, (char)0x02,(char)0xac,(char)0xb7,(char)0x21,(char)0x9f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8851\"\n        // ASCII-7-bit=172  Latin1=183  CP1252=159  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x38,(char)0x35,(char)0x39, (char)0x02,(char)0xaa,(char)0xba,(char)0x21,(char)0x80,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8859\"\n        // ASCII-7-bit=170  Latin1=186  CP1252=128  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x38,(char)0x39,(char)0x39, (char)0xd1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8899\"\n        // Latin5=191  [top Latin5]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x39,(char)0x31,(char)0x31, (char)0x02,(char)0x8c,(char)0xbd,(char)0x21,(char)0x9a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8911\"\n        // ASCII-7-bit=140  Latin1=189  CP1252=154  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x39,(char)0x31,(char)0x5f, (char)0x01,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_891_\"\n        // ASCII-7-bit=191  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x39,(char)0x35,(char)0x31, (char)0x02,(char)0xa3,(char)0xbc,(char)0x21,(char)0x91,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_8951\"\n        // ASCII-7-bit=163  Latin1=188  CP1252=145  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x39,(char)0x30,(char)0x30,(char)0x31, (char)0x02,(char)0x75,(char)0xa7,(char)0x21,(char)0x85,(char)0xa1,(char)0xbb,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_9001\"\n        // ASCII-7-bit=117  Latin1=167  CP1252=133  ISO-8859-15=187  [top ISO-8859-15]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x39,(char)0x35,(char)0x35,(char)0x31, (char)0x01,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_9551\"\n        // ASCII-7-bit=191  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x39,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x72,(char)0xbe,(char)0x21,(char)0x7b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_9591\"\n        // ASCII-7-bit=114  Latin1=190  CP1252=123  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x39,(char)0x35,(char)0x39,(char)0x32, (char)0x01,(char)0x7f,(char)0x81,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_9592\"\n        // ASCII-7-bit=127  Latin2=190  [top Latin2]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x39,(char)0x35,(char)0x39,(char)0x39, (char)0x01,(char)0x84,(char)0xc1,(char)0xbb,(char)0x81,(char)0xa6,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_9599\"\n        // ASCII-7-bit=132  Latin5=187  CP1254=166  [top Latin5]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0x99,(char)0xbc,(char)0x21,(char)0x96,(char)0xa1,(char)0x2e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iso_____\"\n        // ASCII-7-bit=153  Latin1=188  CP1252=150  ISO-8859-15=46  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x61,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x9a,(char)0xbd,(char)0x21,(char)0x8a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoa8591\"\n        // ASCII-7-bit=154  Latin1=189  CP1252=138  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x62,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x86,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isob8591\"\n        // ASCII-7-bit=134  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x63,(char)0x32,(char)0x30,(char)0x32,(char)0x32, (char)0x20,(char)0xd1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoc2022\"\n        // ISO_2022_CN=191  [top ISO_2022_CN]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x63,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x79,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoc8591\"\n        // ASCII-7-bit=121  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x63,(char)0x38,(char)0x35,(char)0x39,(char)0x32, (char)0x91,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoc8592\"\n        // Latin2=191  [top Latin2]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x64,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isod8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x65,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x93,(char)0xbd,(char)0x21,(char)0x8b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoe8591\"\n        // ASCII-7-bit=147  Latin1=189  CP1252=139  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x66,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0x11,(char)0x6f,(char)0xd1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isof5915\"\n        // Latin1=111  ISO-8859-15=190  [top ISO-8859-15]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x68,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x79,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoh8591\"\n        // ASCII-7-bit=121  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x69,(char)0x36,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbe,(char)0x92,(char)0x21,(char)0x7f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoi6___\"\n        // ASCII-7-bit=190  Latin1=146  CP1252=127  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x69,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0xa2,(char)0xbc,(char)0x21,(char)0x8c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoi8591\"\n        // ASCII-7-bit=162  Latin1=188  CP1252=140  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x69,(char)0x38,(char)0x35,(char)0x39,(char)0x32, (char)0x91,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoi8592\"\n        // Latin2=191  [top Latin2]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x69,(char)0x38,(char)0x35,(char)0x39,(char)0x35, (char)0x01,(char)0xa4,(char)0x10,(char)0xa1,(char)0xbc,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoi8595\"\n        // ASCII-7-bit=164  ISO-8859-5=188  [top ISO-8859-5]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x69,(char)0x38,(char)0x35,(char)0x39,(char)0x36, (char)0x01,(char)0x79,(char)0x20,(char)0x11,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoi8596\"\n        // ASCII-7-bit=121  Arabic=190  [top Arabic]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x69,(char)0x38,(char)0x35,(char)0x39,(char)0x38, (char)0x01,(char)0x83,(char)0x10,(char)0x01,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoi8598\"\n        // ASCII-7-bit=131  CP1255=190  [top CP1255]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x69,(char)0x38,(char)0x35,(char)0x39,(char)0x39, (char)0xd1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoi8599\"\n        // Latin5=191  [top Latin5]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x69,(char)0x38,(char)0x38,(char)0x35,(char)0x39, (char)0x02,(char)0xae,(char)0xb7,(char)0x21,(char)0x9a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoi8859\"\n        // ASCII-7-bit=174  Latin1=183  CP1252=154  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x69,(char)0x38,(char)0x39,(char)0x5f,(char)0x5f, (char)0xb1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoi89__\"\n        // CP1256=191  [top CP1256]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x6a,(char)0x32,(char)0x30,(char)0x30,(char)0x32, (char)0x71,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoj2002\"\n        // EUC-JP=191  [top EUC-JP]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x6a,(char)0x32,(char)0x30,(char)0x32,(char)0x32, (char)0x01,(char)0x44,(char)0x10,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoj2022\"\n        // ASCII-7-bit=68  JIS=190  [top JIS]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x6a,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x79,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoj8591\"\n        // ASCII-7-bit=121  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x6b,(char)0x32,(char)0x30,(char)0x30,(char)0x32, (char)0x01,(char)0x7a,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isok2002\"\n        // ASCII-7-bit=122  KSC=190  [top KSC]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x6b,(char)0x32,(char)0x30,(char)0x32,(char)0x32, (char)0x20,(char)0xa1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isok2022\"\n        // ISO-2022-KR=191  [top ISO-2022-KR]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x6c,(char)0x31,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0xa6,(char)0x11,(char)0xbc,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isol1___\"\n        // ASCII-7-bit=166  UTF8=188  [top UTF8]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x6c,(char)0x35,(char)0x39,(char)0x31,(char)0x31, (char)0x01,(char)0x83,(char)0xd1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isol5911\"\n        // ASCII-7-bit=131  ISO-8859-11=190  [top ISO-8859-11]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x6c,(char)0x37,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xa4,(char)0xb8,(char)0x21,(char)0xa7,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isol7___\"\n        // ASCII-7-bit=164  Latin1=184  CP1252=167  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x6c,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x79,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isol8591\"\n        // ASCII-7-bit=121  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x6d,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isom8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x6e,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x79,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ison8591\"\n        // ASCII-7-bit=121  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x6f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6e,(char)0xbe,(char)0x21,(char)0x6e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoo8591\"\n        // ASCII-7-bit=110  Latin1=190  CP1252=110  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x70,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0xf1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isop5915\"\n        // ISO-8859-15=191  [top ISO-8859-15]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x70,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x91,(char)0xbe,(char)0x21,(char)0x6f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isop8591\"\n        // ASCII-7-bit=145  Latin1=190  CP1252=111  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x84,(char)0xbe,(char)0x21,(char)0x8d,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isos8591\"\n        // ASCII-7-bit=132  Latin1=190  CP1252=141  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x75,(char)0x36,(char)0x34,(char)0x36,(char)0x31, (char)0x02,(char)0xa6,(char)0xb9,(char)0x21,(char)0xa1,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isou6461\"\n        // ASCII-7-bit=166  Latin1=185  CP1252=161  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x75,(char)0x36,(char)0x34,(char)0x36,(char)0x5f, (char)0x01,(char)0xbe,(char)0x31,(char)0x8e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isou646_\"\n        // ASCII-7-bit=190  CP1252=142  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x75,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isou8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x75,(char)0x38,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xa2,(char)0xbc,(char)0x21,(char)0x8c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isou8___\"\n        // ASCII-7-bit=162  Latin1=188  CP1252=140  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x77,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0x01,(char)0x6e,(char)0xb1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isow1250\"\n        // ASCII-7-bit=110  CP1250=190  [top CP1250]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x77,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0xa1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isow1251\"\n        // CP1251=191  [top CP1251]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x77,(char)0x31,(char)0x32,(char)0x35,(char)0x33, (char)0x01,(char)0x6f,(char)0x10,(char)0x61,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isow1253\"\n        // ASCII-7-bit=111  CP1253=190  [top CP1253]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x77,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x89,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isow8591\"\n        // ASCII-7-bit=137  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x78,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isox8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x6f,(char)0x7a,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x8b,(char)0xbe,(char)0x21,(char)0x79,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isoz8591\"\n        // ASCII-7-bit=139  Latin1=190  CP1252=121  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x70,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x86,(char)0xbe,(char)0x21,(char)0x6f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isp_8591\"\n        // ASCII-7-bit=134  Latin1=190  CP1252=111  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x73,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x79,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iss_8591\"\n        // ASCII-7-bit=121  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x73,(char)0x6f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isso8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x73,(char)0x74,(char)0x5f,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0x01,(char)0x79,(char)0xe1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ist_5915\"\n        // ASCII-7-bit=121  ISO-8859-15=190  [top ISO-8859-15]\n  {{(char)0x69,(char)0x73,(char)0x74,(char)0x6f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbe,(char)0x21,(char)0x6f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"isto8591\"\n        // Latin1=190  CP1252=111  [top Latin1]\n  {{(char)0x69,(char)0x74,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x21,(char)0x86,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"itis8591\"\n        // ASCII-7-bit=111  Latin1=190  CP1252=134  [top Latin1]\n  {{(char)0x69,(char)0x74,(char)0x69,(char)0x74,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0x41,(char)0x79,(char)0xa1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"itit5915\"\n        // CP1252=121  ISO-8859-15=190  [top ISO-8859-15]\n  {{(char)0x69,(char)0x74,(char)0x69,(char)0x74,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbe,(char)0x21,(char)0x8f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"itit8591\"\n        // Latin1=190  CP1252=143  [top Latin1]\n  {{(char)0x69,(char)0x74,(char)0x69,(char)0x74,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xb7,(char)0xab,(char)0x21,(char)0xa4,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"itit____\"\n        // ASCII-7-bit=183  Latin1=171  CP1252=164  [top ASCII-7-bit]\n  {{(char)0x69,(char)0x75,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iu__8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x69,(char)0x77,(char)0x69,(char)0x6e,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0xc1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iwin1250\"\n        // CP1250=191  [top CP1250]\n  {{(char)0x69,(char)0x77,(char)0x69,(char)0x6e,(char)0x31,(char)0x32,(char)0x35,(char)0x37, (char)0x10,(char)0x01,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iwin1257\"\n        // CP1257=191  [top CP1257]\n  {{(char)0x69,(char)0x79,(char)0x73,(char)0x6f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x79,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"iyso8591\"\n        // ASCII-7-bit=121  Latin1=190  [top Latin1]\n  {{(char)0x6a,(char)0x61,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x78,(char)0x51,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ja______\"\n        // ASCII-7-bit=120  SJS=190  [top SJS]\n  {{(char)0x6a,(char)0x61,(char)0x67,(char)0x72,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x20,(char)0xf1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"jagr____\"\n        // JAGRAN=191  [top JAGRAN]\n  {{(char)0x6a,(char)0x69,(char)0x73,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x81,(char)0x10,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"jis_____\"\n        // ASCII-7-bit=129  JIS=190  [top JIS]\n  {{(char)0x6b,(char)0x61,(char)0x6d,(char)0x63,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x20,(char)0x11,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"kamc____\"\n        // CP852=191  [top CP852]\n  {{(char)0x6b,(char)0x6f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x7c,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ko______\"\n        // ASCII-7-bit=124  KSC=190  [top KSC]\n  {{(char)0x6b,(char)0x6f,(char)0x69,(char)0x5f,(char)0x37,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0xbe,(char)0x31,(char)0x6b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"koi_7___\"\n        // ASCII-7-bit=190  CP1252=107  [top ASCII-7-bit]\n  {{(char)0x6b,(char)0x6f,(char)0x69,(char)0x72,(char)0x38,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x8b,(char)0x10,(char)0x11,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"koir8___\"\n        // ASCII-7-bit=139  KOI8R=190  [top KOI8R]\n  {{(char)0x6b,(char)0x6f,(char)0x69,(char)0x75,(char)0x38,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x77,(char)0x10,(char)0x91,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"koiu8___\"\n        // ASCII-7-bit=119  KOI8U=190  [top KOI8U]\n  {{(char)0x6b,(char)0x6f,(char)0x6b,(char)0x72,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x4b,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"kokr____\"\n        // ASCII-7-bit=75  KSC=190  [top KSC]\n  {{(char)0x6b,(char)0x6f,(char)0x6b,(char)0x73,(char)0x35,(char)0x36,(char)0x30,(char)0x31, (char)0x01,(char)0x75,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"koks5601\"\n        // ASCII-7-bit=117  KSC=190  [top KSC]\n  {{(char)0x6b,(char)0x6f,(char)0x72,(char)0x65,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x4e,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"kore____\"\n        // ASCII-7-bit=78  KSC=190  [top KSC]\n  {{(char)0x6b,(char)0x72,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x74,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"kr______\"\n        // ASCII-7-bit=116  KSC=190  [top KSC]\n  {{(char)0x6b,(char)0x72,(char)0x63,(char)0x5f,(char)0x35,(char)0x36,(char)0x30,(char)0x31, (char)0x01,(char)0x74,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"krc_5601\"\n        // ASCII-7-bit=116  KSC=190  [top KSC]\n  {{(char)0x6b,(char)0x73,(char)0x63,(char)0x5f,(char)0x35,(char)0x35,(char)0x30,(char)0x31, (char)0x51,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ksc_5501\"\n        // KSC=191  [top KSC]\n  {{(char)0x6b,(char)0x73,(char)0x63,(char)0x5f,(char)0x35,(char)0x36,(char)0x30,(char)0x31, (char)0x01,(char)0x62,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ksc_5601\"\n        // ASCII-7-bit=98  KSC=190  [top KSC]\n  {{(char)0x6b,(char)0x73,(char)0x63,(char)0x5f,(char)0x36,(char)0x30,(char)0x30,(char)0x31, (char)0x51,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ksc_6001\"\n        // KSC=191  [top KSC]\n  {{(char)0x6c,(char)0x61,(char)0x73,(char)0x74,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xb7,(char)0xaf,(char)0x21,(char)0x90,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"last____\"\n        // ASCII-7-bit=183  Latin1=175  CP1252=144  [top ASCII-7-bit]\n  {{(char)0x6c,(char)0x61,(char)0x74,(char)0x69,(char)0x31,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xa3,(char)0xbb,(char)0x21,(char)0x9b,(char)0xa1,(char)0x73,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"lati1___\"\n        // ASCII-7-bit=163  Latin1=187  CP1252=155  ISO-8859-15=115  [top Latin1]\n  {{(char)0x6c,(char)0x61,(char)0x74,(char)0x69,(char)0x32,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x94,(char)0x81,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"lati2___\"\n        // ASCII-7-bit=148  Latin2=190  [top Latin2]\n  {{(char)0x6c,(char)0x61,(char)0x74,(char)0x69,(char)0x35,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x7c,(char)0xc1,(char)0xbe,(char)0x81,(char)0x87,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"lati5___\"\n        // ASCII-7-bit=124  Latin5=190  CP1254=135  [top Latin5]\n  {{(char)0x6c,(char)0x61,(char)0x74,(char)0x69,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"lati8591\"\n        // Latin1=191  [top Latin1]\n  {{(char)0x6c,(char)0x61,(char)0x74,(char)0x69,(char)0x38,(char)0x38,(char)0x35,(char)0x39, (char)0x91,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"lati8859\"\n        // Latin2=191  [top Latin2]\n  {{(char)0x6c,(char)0x69,(char)0x6e,(char)0x75,(char)0x31,(char)0x32,(char)0x35,(char)0x32, (char)0x11,(char)0x79,(char)0x21,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"linu1252\"\n        // Latin1=121  CP1252=190  [top CP1252]\n  {{(char)0x6c,(char)0x6f,(char)0x67,(char)0x69,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x88,(char)0x11,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"logi____\"\n        // ASCII-7-bit=136  UTF8=190  [top UTF8]\n  {{(char)0x6c,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"lso_8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x6c,(char)0x74,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"lto_8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x6c,(char)0x74,(char)0x77,(char)0x69,(char)0x31,(char)0x32,(char)0x35,(char)0x37, (char)0x10,(char)0x01,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ltwi1257\"\n        // CP1257=191  [top CP1257]\n  {{(char)0x6d,(char)0x61,(char)0x63,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x82,(char)0x91,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mac_____\"\n        // ASCII-7-bit=130  CP1251=190  [top CP1251]\n  {{(char)0x6d,(char)0x61,(char)0x63,(char)0x63,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x94,(char)0x10,(char)0xe1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"macc____\"\n        // ASCII-7-bit=148  MACINTOSH=190  [top MACINTOSH]\n  {{(char)0x6d,(char)0x61,(char)0x63,(char)0x69,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbd,(char)0x93,(char)0x21,(char)0x8b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"maci____\"\n        // ASCII-7-bit=189  Latin1=147  CP1252=139  [top ASCII-7-bit]\n  {{(char)0x6d,(char)0x61,(char)0x63,(char)0x72,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0xaf,(char)0x10,(char)0xe1,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"macr____\"\n        // ASCII-7-bit=175  MACINTOSH=185  [top MACINTOSH]\n  {{(char)0x6d,(char)0x73,(char)0x5f,(char)0x5f,(char)0x38,(char)0x37,(char)0x34,(char)0x5f, (char)0x01,(char)0x80,(char)0xd1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ms__874_\"\n        // ASCII-7-bit=128  ISO-8859-11=190  [top ISO-8859-11]\n  {{(char)0x6d,(char)0x73,(char)0x5f,(char)0x5f,(char)0x39,(char)0x33,(char)0x32,(char)0x5f, (char)0x01,(char)0x91,(char)0x51,(char)0xbe,(char)0x10,(char)0x11,(char)0x82,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ms__932_\"\n        // ASCII-7-bit=145  SJS=190  CP932=130  [top SJS]\n  {{(char)0x6d,(char)0x73,(char)0x5f,(char)0x5f,(char)0x39,(char)0x34,(char)0x39,(char)0x5f, (char)0x01,(char)0x49,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ms__949_\"\n        // ASCII-7-bit=73  KSC=190  [top KSC]\n  {{(char)0x6d,(char)0x73,(char)0x5f,(char)0x5f,(char)0x39,(char)0x35,(char)0x30,(char)0x5f, (char)0x01,(char)0x75,(char)0x71,(char)0xbe,(char)0x10,(char)0xa1,(char)0x43,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ms__950_\"\n        // ASCII-7-bit=117  BIG5=190  BIG5_HKSCS=67  [top BIG5]\n  {{(char)0x6d,(char)0x73,(char)0x63,(char)0x70,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0xc1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mscp1250\"\n        // CP1250=191  [top CP1250]\n  {{(char)0x6d,(char)0x73,(char)0x68,(char)0x6b,(char)0x39,(char)0x35,(char)0x30,(char)0x5f, (char)0x01,(char)0x82,(char)0x71,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mshk950_\"\n        // ASCII-7-bit=130  BIG5=190  [top BIG5]\n  {{(char)0x6d,(char)0x73,(char)0x77,(char)0x69,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0xc1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mswi1250\"\n        // CP1250=191  [top CP1250]\n  {{(char)0x6d,(char)0x73,(char)0x77,(char)0x69,(char)0x31,(char)0x32,(char)0x35,(char)0x33, (char)0x10,(char)0x41,(char)0x8f,(char)0x21,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mswi1253\"\n        // Greek=143  CP1253=190  [top CP1253]\n  {{(char)0x6d,(char)0x78,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"mx______\"\n        // UTF8=191  [top UTF8]\n  {{(char)0x6e,(char)0x65,(char)0x77,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xab,(char)0xb2,(char)0x21,(char)0xaf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"new_____\"\n        // ASCII-7-bit=171  Latin1=178  CP1252=175  [top Latin1]\n  {{(char)0x6e,(char)0x66,(char)0x7a,(char)0x5f,(char)0x32,(char)0x30,(char)0x31,(char)0x30, (char)0x02,(char)0x80,(char)0xbc,(char)0x21,(char)0xa3,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"nfz_2010\"\n        // ASCII-7-bit=128  Latin1=188  CP1252=163  [top Latin1]\n  {{(char)0x6e,(char)0x69,(char)0x73,(char)0x6f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"niso8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x6e,(char)0x6c,(char)0x61,(char)0x69,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"nlai8591\"\n        // Latin1=191  [top Latin1]\n  {{(char)0x6e,(char)0x6c,(char)0x6e,(char)0x6c,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbe,(char)0x21,(char)0x6f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"nlnl8591\"\n        // Latin1=190  CP1252=111  [top Latin1]\n  {{(char)0x6e,(char)0x6f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0xa4,(char)0x71,(char)0xbc,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"no______\"\n        // ASCII-7-bit=164  BIG5=188  [top BIG5]\n  {{(char)0x6e,(char)0x6f,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"nois8591\"\n        // Latin1=191  [top Latin1]\n  {{(char)0x6e,(char)0x6f,(char)0x6e,(char)0x65,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x9b,(char)0x51,(char)0xbd,(char)0x10,(char)0x11,(char)0x70,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"none____\"\n        // ASCII-7-bit=155  SJS=189  CP932=112  [top SJS]\n  {{(char)0x6e,(char)0x75,(char)0x6c,(char)0x6c,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x92,(char)0x71,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"null____\"\n        // ASCII-7-bit=146  BIG5=190  [top BIG5]\n  {{(char)0x6f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"o___8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x6f,(char)0x6e,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"on______\"\n        // UTF8=191  [top UTF8]\n  {{(char)0x6f,(char)0x73,(char)0x69,(char)0x5f,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0x01,(char)0x6f,(char)0xe1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"osi_5915\"\n        // ASCII-7-bit=111  ISO-8859-15=190  [top ISO-8859-15]\n  {{(char)0x6f,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"oso_8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x6f,(char)0x73,(char)0x70,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x38, (char)0x01,(char)0x6f,(char)0x10,(char)0x81,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"osp_8598\"\n        // ASCII-7-bit=111  Hebrew=190  [top Hebrew]\n  {{(char)0x6f,(char)0x77,(char)0x69,(char)0x6e,(char)0x31,(char)0x32,(char)0x35,(char)0x36, (char)0xb1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"owin1256\"\n        // CP1256=191  [top CP1256]\n  {{(char)0x70,(char)0x61,(char)0x72,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0x6e,(char)0xb8,(char)0x21,(char)0xaf,(char)0xa1,(char)0x64,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"par_____\"\n        // ASCII-7-bit=110  Latin1=184  CP1252=175  ISO-8859-15=100  [top Latin1]\n  {{(char)0x70,(char)0x63,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"pc______\"\n        // UTF8=191  [top UTF8]\n  {{(char)0x70,(char)0x6c,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x32, (char)0x91,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"plis8592\"\n        // Latin2=191  [top Latin2]\n  {{(char)0x70,(char)0x6c,(char)0x70,(char)0x6c,(char)0x38,(char)0x35,(char)0x39,(char)0x32, (char)0x91,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"plpl8592\"\n        // Latin2=191  [top Latin2]\n  {{(char)0x70,(char)0x72,(char)0x65,(char)0x64,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xb4,(char)0xa3,(char)0x21,(char)0xb1,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"pred____\"\n        // ASCII-7-bit=180  Latin1=163  CP1252=177  [top ASCII-7-bit]\n  {{(char)0x70,(char)0x74,(char)0x62,(char)0x72,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6e,(char)0xbd,(char)0x21,(char)0x9a,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ptbr8591\"\n        // ASCII-7-bit=110  Latin1=189  CP1252=154  [top Latin1]\n  {{(char)0x70,(char)0x74,(char)0x62,(char)0x72,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x79,(char)0x11,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ptbr____\"\n        // ASCII-7-bit=121  UTF8=190  [top UTF8]\n  {{(char)0x70,(char)0x74,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbe,(char)0x21,(char)0x7e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ptis8591\"\n        // Latin1=190  CP1252=126  [top Latin1]\n  {{(char)0x70,(char)0x74,(char)0x70,(char)0x74,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0x11,(char)0x89,(char)0x21,(char)0x6f,(char)0xa1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ptpt5915\"\n        // Latin1=137  CP1252=111  ISO-8859-15=190  [top ISO-8859-15]\n  {{(char)0x72,(char)0x66,(char)0x63,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x87,(char)0x11,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"rfc_____\"\n        // ASCII-7-bit=135  UTF8=190  [top UTF8]\n  {{(char)0x72,(char)0x6f,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x83,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"rois8591\"\n        // ASCII-7-bit=131  Latin1=190  [top Latin1]\n  {{(char)0x72,(char)0x6f,(char)0x72,(char)0x6f,(char)0x38,(char)0x35,(char)0x39,(char)0x32, (char)0x01,(char)0x99,(char)0x81,(char)0xbd,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"roro8592\"\n        // ASCII-7-bit=153  Latin2=189  [top Latin2]\n  {{(char)0x72,(char)0x75,(char)0x72,(char)0x75,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0xa1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ruru1251\"\n        // CP1251=191  [top CP1251]\n  {{(char)0x72,(char)0x75,(char)0x77,(char)0x69,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0x01,(char)0x6f,(char)0x91,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ruwi1251\"\n        // ASCII-7-bit=111  CP1251=190  [top CP1251]\n  {{(char)0x73,(char)0x65,(char)0x65,(char)0x6d,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"seem8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x73,(char)0x65,(char)0x74,(char)0x63,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"setc____\"\n        // ASCII-7-bit=191  [top ASCII-7-bit]\n  {{(char)0x73,(char)0x68,(char)0x69,(char)0x66,(char)0x31,(char)0x32,(char)0x35,(char)0x32, (char)0x02,(char)0x86,(char)0x6f,(char)0x21,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"shif1252\"\n        // ASCII-7-bit=134  Latin1=111  CP1252=190  [top CP1252]\n  {{(char)0x73,(char)0x68,(char)0x69,(char)0x66,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x6e,(char)0x51,(char)0xbe,(char)0x10,(char)0x11,(char)0x6b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"shif____\"\n        // ASCII-7-bit=110  SJS=190  CP932=107  [top SJS]\n  {{(char)0x73,(char)0x69,(char)0x66,(char)0x74,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x72,(char)0x51,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sift____\"\n        // ASCII-7-bit=114  SJS=190  [top SJS]\n  {{(char)0x73,(char)0x6a,(char)0x69,(char)0x73,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x79,(char)0x51,(char)0xbe,(char)0x10,(char)0x11,(char)0x5d,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"sjis____\"\n        // ASCII-7-bit=121  SJS=190  CP932=93  [top SJS]\n  {{(char)0x73,(char)0x6b,(char)0x77,(char)0x69,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0xc1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"skwi1250\"\n        // CP1250=191  [top CP1250]\n  {{(char)0x73,(char)0x6f,(char)0x5f,(char)0x5f,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0x02,(char)0x86,(char)0x6f,(char)0xd1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"so__5915\"\n        // ASCII-7-bit=134  Latin1=111  ISO-8859-15=190  [top ISO-8859-15]\n  {{(char)0x73,(char)0x6f,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x9a,(char)0xbd,(char)0x21,(char)0x8b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"so__8591\"\n        // ASCII-7-bit=154  Latin1=189  CP1252=139  [top Latin1]\n  {{(char)0x73,(char)0x6f,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x32, (char)0x91,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"so__8592\"\n        // Latin2=191  [top Latin2]\n  {{(char)0x73,(char)0x76,(char)0x73,(char)0x65,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"svse8591\"\n        // Latin1=191  [top Latin1]\n  {{(char)0x74,(char)0x61,(char)0x62,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x30,(char)0x41,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tab_____\"\n        // TAB=191  [top TAB]\n  {{(char)0x74,(char)0x61,(char)0x6d,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x30,(char)0x31,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tam_____\"\n        // TAM=191  [top TAM]\n  {{(char)0x74,(char)0x65,(char)0x78,(char)0x74,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xac,(char)0xb7,(char)0x21,(char)0xa0,(char)0xa1,(char)0x49,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"text____\"\n        // ASCII-7-bit=172  Latin1=183  CP1252=160  ISO-8859-15=73  [top Latin1]\n  {{(char)0x74,(char)0x69,(char)0x73,(char)0x5f,(char)0x36,(char)0x31,(char)0x38,(char)0x5f, (char)0x01,(char)0x75,(char)0xd1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tis_618_\"\n        // ASCII-7-bit=117  ISO-8859-11=190  [top ISO-8859-11]\n  {{(char)0x74,(char)0x69,(char)0x73,(char)0x5f,(char)0x36,(char)0x32,(char)0x30,(char)0x5f, (char)0x01,(char)0x82,(char)0xd1,(char)0xbe,(char)0xd1,(char)0x7b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tis_620_\"\n        // ASCII-7-bit=130  ISO-8859-11=190  CP874=123  [top ISO-8859-11]\n  {{(char)0x74,(char)0x72,(char)0x5f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x39, (char)0xd1,(char)0xbe,(char)0x81,(char)0x6f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tr__8599\"\n        // Latin5=190  CP1254=111  [top Latin5]\n  {{(char)0x74,(char)0x72,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0xd1,(char)0xbe,(char)0x81,(char)0x5f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tr______\"\n        // Latin5=190  CP1254=95  [top Latin5]\n  {{(char)0x74,(char)0x72,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x39, (char)0xd1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tris8599\"\n        // Latin5=191  [top Latin5]\n  {{(char)0x74,(char)0x73,(char)0x63,(char)0x69,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x30,(char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"tsci____\"\n        // TSCII=191  [top TSCII]\n  {{(char)0x75,(char)0x63,(char)0x73,(char)0x5f,(char)0x32,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xb8,(char)0xa7,(char)0x21,(char)0xa3,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"ucs_2___\"\n        // ASCII-7-bit=184  Latin1=167  CP1252=163  [top ASCII-7-bit]\n  {{(char)0x75,(char)0x66,(char)0x74,(char)0x5f,(char)0x38,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0xb0,(char)0x11,(char)0xb8,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"uft_8___\"\n        // ASCII-7-bit=176  UTF8=184  [top UTF8]\n  {{(char)0x75,(char)0x69,(char)0x73,(char)0x6f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"uiso8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n  {{(char)0x75,(char)0x6e,(char)0x69,(char)0x63,(char)0x31,(char)0x31,(char)0x5f,(char)0x5f, (char)0x01,(char)0xa7,(char)0x11,(char)0xbb,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"unic11__\"\n        // ASCII-7-bit=167  UTF8=187  [top UTF8]\n  {{(char)0x75,(char)0x6e,(char)0x69,(char)0x63,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbe,(char)0x90,(char)0x21,(char)0x85,(char)0xa1,(char)0x45,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"unic____\"\n        // ASCII-7-bit=190  Latin1=144  CP1252=133  ISO-8859-15=69  [top ASCII-7-bit]\n  {{(char)0x75,(char)0x6e,(char)0x6b,(char)0x6e,(char)0x38,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xa2,(char)0xbb,(char)0x21,(char)0x95,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"unkn8___\"\n        // ASCII-7-bit=162  Latin1=187  CP1252=149  [top Latin1]\n  {{(char)0x75,(char)0x6e,(char)0x6b,(char)0x6e,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x9c,(char)0x51,(char)0xbd,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"unkn____\"\n        // ASCII-7-bit=156  SJS=189  [top SJS]\n  {{(char)0x75,(char)0x70,(char)0x66,(char)0x5f,(char)0x38,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x21,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"upf_8___\"\n        // UTF8=191  [top UTF8]\n  {{(char)0x75,(char)0x73,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbe,(char)0x7d,(char)0x21,(char)0x7d,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"us______\"\n        // ASCII-7-bit=190  Latin1=125  CP1252=125  [top ASCII-7-bit]\n  {{(char)0x75,(char)0x73,(char)0x61,(char)0x73,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbe,(char)0x83,(char)0x21,(char)0x6a,(char)0xa1,(char)0x38,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"usas____\"\n        // ASCII-7-bit=190  Latin1=131  CP1252=106  ISO-8859-15=56  [top ASCII-7-bit]\n  {{(char)0x75,(char)0x73,(char)0x65,(char)0x6e,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xb8,(char)0x94,(char)0x21,(char)0xad,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"usen____\"\n        // ASCII-7-bit=184  Latin1=148  CP1252=173  [top ASCII-7-bit]\n  {{(char)0x75,(char)0x73,(char)0x65,(char)0x72,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xb9,(char)0x9e,(char)0x21,(char)0xa7,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"user____\"\n        // ASCII-7-bit=185  Latin1=158  CP1252=167  [top ASCII-7-bit]\n  {{(char)0x75,(char)0x73,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x78,(char)0xbe,(char)0x21,(char)0x78,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"usis8591\"\n        // ASCII-7-bit=120  Latin1=190  CP1252=120  [top Latin1]\n  {{(char)0x75,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x79,(char)0xbc,(char)0x21,(char)0xa5,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"uso_8591\"\n        // ASCII-7-bit=121  Latin1=188  CP1252=165  [top Latin1]\n  {{(char)0x75,(char)0x74,(char)0x66,(char)0x5f,(char)0x31,(char)0x36,(char)0x5f,(char)0x5f, (char)0x01,(char)0xb0,(char)0x11,(char)0xb8,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"utf_16__\"\n        // ASCII-7-bit=176  UTF8=184  [top UTF8]\n  {{(char)0x75,(char)0x74,(char)0x66,(char)0x5f,(char)0x33,(char)0x32,(char)0x5f,(char)0x5f, (char)0x02,(char)0xb5,(char)0xa9,(char)0x21,(char)0x9f,(char)0xa1,(char)0xa1,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"utf_32__\"\n        // ASCII-7-bit=181  Latin1=169  CP1252=159  ISO-8859-15=161  [top ASCII-7-bit]\n  {{(char)0x75,(char)0x74,(char)0x66,(char)0x5f,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0x11,(char)0x90,(char)0xd1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"utf_5915\"\n        // Latin1=144  ISO-8859-15=190  [top ISO-8859-15]\n  {{(char)0x75,(char)0x74,(char)0x66,(char)0x5f,(char)0x37,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x88,(char)0x20,(char)0xb1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"utf_7___\"\n        // ASCII-7-bit=136  UTF7=190  [top UTF7]\n  {{(char)0x75,(char)0x74,(char)0x66,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x95,(char)0xbd,(char)0x21,(char)0x8c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"utf_8591\"\n        // ASCII-7-bit=149  Latin1=189  CP1252=140  [top Latin1]\n  {{(char)0x75,(char)0x74,(char)0x66,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x39, (char)0xd1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"utf_8599\"\n        // Latin5=191  [top Latin5]\n  {{(char)0x75,(char)0x74,(char)0x66,(char)0x5f,(char)0x38,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0xae,(char)0x11,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"utf_8___\"\n        // ASCII-7-bit=174  UTF8=185  [top UTF8]\n  {{(char)0x75,(char)0x74,(char)0x66,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbe,(char)0x8a,(char)0x21,(char)0x74,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"utf_____\"\n        // ASCII-7-bit=190  Latin1=138  CP1252=116  [top ASCII-7-bit]\n  {{(char)0x75,(char)0x74,(char)0x66,(char)0x62,(char)0x31,(char)0x36,(char)0x5f,(char)0x5f, (char)0x01,(char)0xa5,(char)0x20,(char)0x41,(char)0xbc,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"utfb16__\"\n        // ASCII-7-bit=165  UTF-16BE=188  [top UTF-16BE]\n  {{(char)0x75,(char)0x74,(char)0x66,(char)0x62,(char)0x33,(char)0x32,(char)0x5f,(char)0x5f, (char)0x30,(char)0x81,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"utfb32__\"\n        // UTF-32BE=191  [top UTF-32BE]\n  {{(char)0x75,(char)0x74,(char)0x66,(char)0x69,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x99,(char)0xbd,(char)0x21,(char)0x87,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"utfi8591\"\n        // ASCII-7-bit=153  Latin1=189  CP1252=135  [top Latin1]\n  {{(char)0x75,(char)0x74,(char)0x66,(char)0x6c,(char)0x31,(char)0x36,(char)0x5f,(char)0x5f, (char)0x20,(char)0x71,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"utfl16__\"\n        // UTF-16LE=191  [top UTF-16LE]\n  {{(char)0x75,(char)0x74,(char)0x66,(char)0x6c,(char)0x33,(char)0x32,(char)0x5f,(char)0x5f, (char)0x30,(char)0x91,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"utfl32__\"\n        // UTF-32LE=191  [top UTF-32LE]\n  {{(char)0x75,(char)0x74,(char)0x66,(char)0x75,(char)0x38,(char)0x38,(char)0x5f,(char)0x5f, (char)0x30,(char)0xb1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"utfu88__\"\n        // X-UTF8UTF8=191  [top X-UTF8UTF8]\n  {{(char)0x76,(char)0x61,(char)0x6c,(char)0x75,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x11,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"valu____\"\n        // Latin1=191  [top Latin1]\n  {{(char)0x76,(char)0x69,(char)0x73,(char)0x75,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x84,(char)0x10,(char)0x81,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"visu____\"\n        // ASCII-7-bit=132  Hebrew=190  [top Hebrew]\n  {{(char)0x77,(char)0x61,(char)0x69,(char)0x6e,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0xc1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wain1250\"\n        // CP1250=191  [top CP1250]\n  {{(char)0x77,(char)0x65,(char)0x69,(char)0x73,(char)0x35,(char)0x39,(char)0x31,(char)0x35, (char)0x02,(char)0x9f,(char)0x7d,(char)0x21,(char)0x84,(char)0xa1,(char)0xbc,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"weis5915\"\n        // ASCII-7-bit=159  Latin1=125  CP1252=132  ISO-8859-15=188  [top ISO-8859-15]\n  {{(char)0x77,(char)0x65,(char)0x69,(char)0x73,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbe,(char)0x21,(char)0x7e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"weis8591\"\n        // Latin1=190  CP1252=126  [top Latin1]\n  {{(char)0x77,(char)0x65,(char)0x73,(char)0x74,(char)0x31,(char)0x32,(char)0x35,(char)0x32, (char)0x01,(char)0x6f,(char)0x31,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"west1252\"\n        // ASCII-7-bit=111  CP1252=190  [top CP1252]\n  {{(char)0x77,(char)0x65,(char)0x73,(char)0x74,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x79,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"west8591\"\n        // ASCII-7-bit=121  Latin1=190  [top Latin1]\n  {{(char)0x77,(char)0x65,(char)0x73,(char)0x74,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xa9,(char)0x9d,(char)0x21,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"west____\"\n        // ASCII-7-bit=169  Latin1=157  CP1252=185  [top CP1252]\n  {{(char)0x77,(char)0x69,(char)0x64,(char)0x6e,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0xc1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"widn1250\"\n        // CP1250=191  [top CP1250]\n  {{(char)0x77,(char)0x69,(char)0x64,(char)0x6f,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0x01,(char)0x7c,(char)0xb1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wido1250\"\n        // ASCII-7-bit=124  CP1250=190  [top CP1250]\n  {{(char)0x77,(char)0x69,(char)0x64,(char)0x6f,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0xa1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wido1251\"\n        // CP1251=191  [top CP1251]\n  {{(char)0x77,(char)0x69,(char)0x64,(char)0x6f,(char)0x31,(char)0x32,(char)0x35,(char)0x32, (char)0x11,(char)0xa9,(char)0x21,(char)0xbb,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wido1252\"\n        // Latin1=169  CP1252=187  [top CP1252]\n  {{(char)0x77,(char)0x69,(char)0x64,(char)0x6f,(char)0x31,(char)0x32,(char)0x35,(char)0x36, (char)0xb1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wido1256\"\n        // CP1256=191  [top CP1256]\n  {{(char)0x77,(char)0x69,(char)0x6d,(char)0x64,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0xa1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wimd1251\"\n        // CP1251=191  [top CP1251]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0x01,(char)0x8d,(char)0xb1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"win_1250\"\n        // ASCII-7-bit=141  CP1250=190  [top CP1250]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0x01,(char)0x8f,(char)0x91,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"win_1251\"\n        // ASCII-7-bit=143  CP1251=190  [top CP1251]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x32, (char)0x02,(char)0xac,(char)0xa4,(char)0x21,(char)0xb6,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"win_1252\"\n        // ASCII-7-bit=172  Latin1=164  CP1252=182  [top CP1252]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x33, (char)0x10,(char)0x41,(char)0x85,(char)0x21,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"win_1253\"\n        // Greek=133  CP1253=190  [top CP1253]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x34, (char)0x01,(char)0x6f,(char)0xc1,(char)0xaf,(char)0x81,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"win_1254\"\n        // ASCII-7-bit=111  Latin5=175  CP1254=185  [top CP1254]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x35, (char)0x10,(char)0x11,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"win_1255\"\n        // CP1255=191  [top CP1255]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x36, (char)0x01,(char)0x7f,(char)0xa1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"win_1256\"\n        // ASCII-7-bit=127  CP1256=190  [top CP1256]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x5f,(char)0x31,(char)0x32,(char)0x35,(char)0x37, (char)0x01,(char)0x8c,(char)0xf1,(char)0xbe,(char)0xc1,(char)0x77,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"win_1257\"\n        // ASCII-7-bit=140  CP1257=190  ISO-8859-13=119  [top CP1257]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x5f,(char)0x38,(char)0x37,(char)0x34,(char)0x5f, (char)0x01,(char)0x56,(char)0xd1,(char)0xaf,(char)0xd1,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"win_874_\"\n        // ASCII-7-bit=86  ISO-8859-11=175  CP874=185  [top CP874]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x9a,(char)0x91,(char)0xbd,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"win_____\"\n        // ASCII-7-bit=154  CP1251=189  [top CP1251]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x63,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0xc1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"winc1250\"\n        // CP1250=191  [top CP1250]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x63,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0xa1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"winc1251\"\n        // CP1251=191  [top CP1251]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x31,(char)0x32,(char)0x33,(char)0x34, (char)0xb1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind1234\"\n        // CP1256=191  [top CP1256]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0x01,(char)0x88,(char)0xb1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind1250\"\n        // ASCII-7-bit=136  CP1250=190  [top CP1250]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0x01,(char)0x8b,(char)0x91,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind1251\"\n        // ASCII-7-bit=139  CP1251=190  [top CP1251]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x31,(char)0x32,(char)0x35,(char)0x32, (char)0x02,(char)0xa5,(char)0xac,(char)0x21,(char)0xb6,(char)0xa1,(char)0x4f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind1252\"\n        // ASCII-7-bit=165  Latin1=172  CP1252=182  ISO-8859-15=79  [top CP1252]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x31,(char)0x32,(char)0x35,(char)0x33, (char)0x01,(char)0x94,(char)0x10,(char)0x31,(char)0xae,(char)0x21,(char)0xb8,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind1253\"\n        // ASCII-7-bit=148  Greek=174  CP1253=184  [top CP1253]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x31,(char)0x32,(char)0x35,(char)0x34, (char)0x01,(char)0x73,(char)0xc1,(char)0xaf,(char)0x81,(char)0xb9,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind1254\"\n        // ASCII-7-bit=115  Latin5=175  CP1254=185  [top CP1254]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x31,(char)0x32,(char)0x35,(char)0x35, (char)0x01,(char)0x86,(char)0x10,(char)0x01,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind1255\"\n        // ASCII-7-bit=134  CP1255=190  [top CP1255]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x31,(char)0x32,(char)0x35,(char)0x36, (char)0x01,(char)0x74,(char)0xa1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind1256\"\n        // ASCII-7-bit=116  CP1256=190  [top CP1256]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x31,(char)0x32,(char)0x35,(char)0x37, (char)0x01,(char)0x87,(char)0xf1,(char)0xbe,(char)0xc1,(char)0x52,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind1257\"\n        // ASCII-7-bit=135  CP1257=190  ISO-8859-13=82  [top CP1257]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x33,(char)0x31,(char)0x5f,(char)0x5f, (char)0x01,(char)0x62,(char)0x51,(char)0xbe,(char)0x10,(char)0x11,(char)0x5e,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind31__\"\n        // ASCII-7-bit=98  SJS=190  CP932=94  [top SJS]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x38,(char)0x34,(char)0x37,(char)0x5f, (char)0xe1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind847_\"\n        // ISO-8859-11=191  [top ISO-8859-11]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x38,(char)0x35,(char)0x32,(char)0x5f, (char)0x01,(char)0x79,(char)0x20,(char)0x01,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind852_\"\n        // ASCII-7-bit=121  CP852=190  [top CP852]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x9a,(char)0xbd,(char)0x21,(char)0x89,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind8591\"\n        // ASCII-7-bit=154  Latin1=189  CP1252=137  [top Latin1]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x38,(char)0x35,(char)0x39,(char)0x32, (char)0x01,(char)0x83,(char)0x81,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind8592\"\n        // ASCII-7-bit=131  Latin2=190  [top Latin2]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x38,(char)0x35,(char)0x39,(char)0x36, (char)0x01,(char)0x6f,(char)0x20,(char)0x11,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind8596\"\n        // ASCII-7-bit=111  Arabic=190  [top Arabic]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x38,(char)0x35,(char)0x39,(char)0x37, (char)0x01,(char)0x6f,(char)0x10,(char)0x31,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind8597\"\n        // ASCII-7-bit=111  Greek=190  [top Greek]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x38,(char)0x35,(char)0x39,(char)0x39, (char)0x01,(char)0x6c,(char)0xc1,(char)0xbe,(char)0x81,(char)0x6c,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind8599\"\n        // ASCII-7-bit=108  Latin5=190  CP1254=108  [top Latin5]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x38,(char)0x36,(char)0x36,(char)0x5f, (char)0x20,(char)0x41,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind866_\"\n        // CP866=191  [top CP866]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x38,(char)0x37,(char)0x34,(char)0x5f, (char)0x01,(char)0x8a,(char)0xd1,(char)0xbe,(char)0xd1,(char)0x7d,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind874_\"\n        // ASCII-7-bit=138  ISO-8859-11=190  CP874=125  [top ISO-8859-11]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x38,(char)0x38,(char)0x35,(char)0x39, (char)0x02,(char)0x97,(char)0xb6,(char)0x21,(char)0xb1,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind8859\"\n        // ASCII-7-bit=151  Latin1=182  CP1252=177  [top Latin1]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x38,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0x93,(char)0x11,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind8___\"\n        // ASCII-7-bit=147  UTF8=190  [top UTF8]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x39,(char)0x33,(char)0x32,(char)0x5f, (char)0x01,(char)0x7d,(char)0x51,(char)0xa4,(char)0x10,(char)0x11,(char)0xbc,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind932_\"\n        // ASCII-7-bit=125  SJS=164  CP932=188  [top CP932]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x39,(char)0x34,(char)0x39,(char)0x5f, (char)0x01,(char)0x7b,(char)0x41,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind949_\"\n        // ASCII-7-bit=123  KSC=190  [top KSC]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x39,(char)0x35,(char)0x30,(char)0x5f, (char)0x01,(char)0x6f,(char)0x71,(char)0x7f,(char)0x20,(char)0x51,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind950_\"\n        // ASCII-7-bit=111  BIG5=127  BIG5-CP950=190  [top BIG5-CP950]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x64,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x01,(char)0xb5,(char)0x11,(char)0xb4,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wind____\"\n        // ASCII-7-bit=181  UTF8=180  [top ASCII-7-bit]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x65,(char)0x31,(char)0x32,(char)0x35,(char)0x32, (char)0x01,(char)0x6f,(char)0x31,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wine1252\"\n        // ASCII-7-bit=111  CP1252=190  [top CP1252]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x6f,(char)0x31,(char)0x32,(char)0x35,(char)0x30, (char)0xc1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wino1250\"\n        // CP1250=191  [top CP1250]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x6f,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0xa1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wino1251\"\n        // CP1251=191  [top CP1251]\n  {{(char)0x77,(char)0x69,(char)0x6e,(char)0x73,(char)0x31,(char)0x32,(char)0x35,(char)0x35, (char)0x10,(char)0x11,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wins1255\"\n        // CP1255=191  [top CP1255]\n  {{(char)0x77,(char)0x69,(char)0x72,(char)0x64,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0xa1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wird1251\"\n        // CP1251=191  [top CP1251]\n  {{(char)0x77,(char)0x69,(char)0x73,(char)0x6f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x11,(char)0xbe,(char)0x21,(char)0x7f,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wiso8591\"\n        // Latin1=190  CP1252=127  [top Latin1]\n  {{(char)0x77,(char)0x6e,(char)0x64,(char)0x6f,(char)0x31,(char)0x32,(char)0x35,(char)0x31, (char)0xa1,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wndo1251\"\n        // CP1251=191  [top CP1251]\n  {{(char)0x77,(char)0x6e,(char)0x64,(char)0x6f,(char)0x31,(char)0x32,(char)0x35,(char)0x36, (char)0x01,(char)0x6e,(char)0xa1,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wndo1256\"\n        // ASCII-7-bit=110  CP1256=190  [top CP1256]\n  {{(char)0x77,(char)0x6f,(char)0x6e,(char)0x64,(char)0x31,(char)0x32,(char)0x35,(char)0x32, (char)0x41,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"wond1252\"\n        // CP1252=191  [top CP1252]\n  {{(char)0x77,(char)0x6f,(char)0x72,(char)0x67,(char)0x31,(char)0x32,(char)0x35,(char)0x32, (char)0x01,(char)0x83,(char)0x31,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"worg1252\"\n        // ASCII-7-bit=131  CP1252=190  [top CP1252]\n  {{(char)0x79,(char)0x65,(char)0x73,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x02,(char)0xbe,(char)0x81,(char)0x21,(char)0x8b,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"yes_____\"\n        // ASCII-7-bit=190  Latin1=129  CP1252=139  [top ASCII-7-bit]\n  {{(char)0x79,(char)0x6b,(char)0x74,(char)0x63,(char)0x5f,(char)0x5f,(char)0x5f,(char)0x5f, (char)0x51,(char)0xbf,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"yktc____\"\n        // KSC=191  [top KSC]\n  {{(char)0x7a,(char)0x73,(char)0x6f,(char)0x5f,(char)0x38,(char)0x35,(char)0x39,(char)0x31, (char)0x02,(char)0x6f,(char)0xbe,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,(char)0x00,}}, // \"zso_8591\"\n        // ASCII-7-bit=111  Latin1=190  [top Latin1]\n};\n\nstatic const int kCharsetHintProbsSize = 438;\n\nstatic const uint8 kDefaultProb[NUM_RANKEDENCODING] = {\t// MaxRange 192\n177, 170, 156, 149, 150, 142, 140, 124,  130, 127, 124, 118, 127, 118, 109, 104,  98, 93, 96, 82, 84, 81, 80, 64,  61, 57, 53, 47, 42, 28, 24, 22,\n  17, 0, 5, 1, 5, 12, 0, 5,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, };\n\nstatic const int kMaxTldKey = 4;\nstatic const int kMaxTldVector = 16;\nstatic const int kMaxCharsetKey = 8;\nstatic const int kMaxCharsetVector = 12;\nstatic const int kMaxLangKey = 8;\nstatic const int kMaxLangVector = 12;\n// Smoothing percentage across encodings with same UTF-8 result: 100%\n\nstatic const UnigramEntry unigram_table[NUM_RANKEDENCODING] = {\n{ // ASCII-7-bit (788.373M chars) [0]\n  {NULL, NULL, NULL, NULL},\n  77, 207, 29, 27, 255,\n    {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189,\n   189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189,\n   189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,189,189,0,0,189,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189,\n   189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189,\n   189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n},\n\n{ // Latin1 (1792.786M chars) [1]\n  {NULL, NULL, ced_hires_13, ced_hires_13, },\n  87, 217, 37, 20, 128,\n    {1,0,1,1,0,0,1,0, 0,9,9,0,1,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   186,137,105,112,140,106,126,145, 132,113,128,124,123,101,126,119, 141,113,107,116,129,113,113,143, 130,105,127,128,103,116,106,128,\n   122,138,132,155,161,129,133,190, 124,152,124,119,117,144,120,121, 127,136,122,132,112,139,144,116, 113,101,117,117,145,120,135,114,\n   121,138,107,125,163,129,131,190, 120,141,112,110,114,143,115,133, 124,135,126,131,118,141,160,110, 114,104,119,99,148,119,129,117,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   195,159,115,166,155,125,133,156, 130,168,156,159,121,135,150,133, 169,125,135,118,150,113,114,173, 126,107,176,178,97,131,103,170,\n   165,209,166,183,211,198,182,194, 193,219,182,153,130,205,161,148, 160,187,142,208,169,167,210,131, 192,122,189,152,212,181,158,185,\n   195,214,155,184,212,208,182,181, 183,213,171,154,161,215,150,137, 175,187,162,210,158,168,208,131, 192,156,189,142,199,193,155,120,\n   },\n  {43,13,19,71,0,0,0,0, 0,145,153,0,0,165,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   226,142,175,92,109,120,168,161, 150,151,135,110,183,159,177,142, 146,163,159,149,146,144,137,136, 133,134,166,128,200,102,117,143,\n   102,197,188,202,195,190,180,196, 185,179,172,189,202,198,215,195, 185,164,216,206,204,172,190,182, 158,170,181,119,107,136,114,132,\n   134,194,189,198,192,189,178,194, 182,176,171,189,201,194,213,194, 181,151,213,203,201,171,189,182, 155,176,182,106,136,85,122,2,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   187,138,112,113,139,107,128,136, 133,137,118,120,118,129,135,123, 139,125,101,126,128,108,123,140, 131,107,125,133,123,119,104,138,\n   133,128,130,187,160,126,123,145, 123,153,122,122,114,136,125,117, 153,141,127,129,107,167,144,114, 113,105,118,118,134,117,122,164,\n   130,132,122,187,161,131,122,139, 122,137,119,120,113,138,123,110, 153,141,127,130,133,167,146,104, 117,105,130,109,131,117,133,119,\n   },\n  {128,0,110,142,142,142,142,140, 0,0,142,142,142,142,142,142, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   22,0,2,2,2,2,2,2, 0,0,2,14,2,2,2,2, 46,0,2,14,2,2,2,2, 0,0,2,18,2,4,2,6,\n   16,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 42,0,2,10,2,2,2,2, 0,0,2,2,2,2,2,2,\n   18,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 38,0,2,6,2,2,2,2, 0,0,2,2,2,2,2,2,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   164,0,136,164,110,108,108,106, 0,0,190,164,136,134,122,152, 158,0,144,156,112,116,106,106, 0,0,166,212,158,164,146,162,\n   90,0,92,96,139,139,94,92, 0,0,148,166,184,176,134,146, 98,0,96,104,139,139,110,110, 0,0,138,172,174,190,154,164,\n   130,0,138,126,38,48,135,135, 0,0,130,156,128,148,186,180, 120,0,126,120,48,56,139,141, 0,0,142,156,140,186,166,188,\n   },\n},\n\n{ // UTF8 (16713.069M chars) [2]\n  {NULL, NULL, NULL, NULL},\n  169, 203, 42, 24, 131,\n    {197,207,201,202,188,181,180,180, 188,183,184,187,188,182,178,183, 181,179,172,178,182,182,183,183, 181,181,183,180,189,181,175,180,\n   182,183,175,177,184,183,183,184, 187,176,181,181,178,186,187,184, 187,177,175,183,184,176,174,177, 196,183,188,186,194,184,180,181,\n   0,0,183,211,189,187,147,104, 65,123,87,102,121,13,187,176, 216,203,118,108,88,134,124,193, 206,202,155,161,58,0,119,0,\n   181,176,180,213,192,206,202,197, 192,187,165,177,183,170,90,182, 71,0,0,13,1,0,0,0, 0,0,0,0,0,0,0,0,\n   119,115,120,96,114,98,104,106, 121,111,96,110,113,105,109,100, 109,107,92,112,112,97,91,102, 110,119,116,99,117,110,104,106,\n   133,132,135,130,132,139,129,131, 133,127,121,126,132,128,121,138, 136,128,120,126,145,114,120,123, 132,124,128,122,138,120,117,132,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,64,\n   },\n  {0,0,0,0,0,0,0,0, 0,109,143,0,0,144,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   189,125,169,73,68,107,151,137, 146,147,111,102,152,138,154,129, 142,152,148,137,131,132,127,127, 123,121,139,118,189,98,96,127,\n   87,124,119,124,117,115,112,111, 114,127,109,102,114,120,120,114, 120,94,118,122,122,113,106,113, 95,99,88,117,109,125,97,107,\n   80,139,113,146,112,126,103,99, 115,147,96,97,118,131,156,123, 132,80,111,140,146,136,107,102, 86,116,85,83,110,84,118,0,\n   204,210,207,204,196,192,190,188, 194,187,191,189,194,188,179,187, 184,183,175,181,186,187,183,187, 184,189,185,186,191,184,178,186,\n   192,196,179,183,192,185,183,198, 192,196,189,182,182,193,189,192, 199,194,188,195,190,194,185,185, 203,191,196,195,200,196,197,188,\n   0,0,121,113,72,69,49,4, 0,0,0,71,0,0,113,107, 113,102,0,0,0,0,19,86, 134,132,91,105,0,0,0,0,\n   174,140,150,207,185,199,194,190, 187,181,160,174,177,157,75,176, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   6,0,2,2,2,6,2,2, 0,0,0,0,50,38,2,128, 4,0,2,2,2,4,2,2, 0,0,0,0,54,40,2,128,\n   4,0,2,2,2,6,2,2, 0,0,0,0,128,128,128,128, 2,0,2,2,2,2,2,2, 0,0,0,0,128,128,128,128,\n   2,0,2,2,2,2,2,2, 0,0,0,0,128,128,128,128, 128,0,118,118,128,128,128,128, 0,0,0,0,128,128,64,128,\n   176,0,168,172,172,172,162,164, 120,126,126,116,126,140,134,128, 168,0,170,166,172,170,174,176, 118,122,118,116,142,116,138,128,\n   168,0,170,168,168,172,176,174, 110,120,114,112,136,142,140,128, 168,0,172,170,160,166,160,164, 120,126,118,116,140,134,136,128,\n   0,0,0,0,0,0,0,0, 116,122,140,128,0,0,0,0, 0,0,0,0,0,0,0,0, 128,120,126,134,0,0,0,0,\n   0,0,0,0,0,0,0,0, 134,132,120,126,0,0,0,0, 0,0,0,0,0,0,0,0, 116,152,138,116,0,0,0,0,\n   },\n},\n\n{ // GB (9061.562M chars) [3]\n  {NULL, ced_hires_3, ced_hires_4, ced_hires_5, },\n  204, 189, 27, 16, 128,\n    {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,66,73, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   70,204,125,202,219,216,120,114, 118,156,113,85,96,78,81,79, 190,196,199,195,195,208,196,199, 196,203,195,200,201,197,193,195,\n   193,195,190,195,195,183,196,191, 201,197,207,197,197,198,201,199, 201,191,203,201,198,196,202,200, 134,116,114,132,122,124,118,115,\n   115,120,116,120,141,121,124,123, 121,120,121,113,125,116,117,110, 117,114,112,113,119,112,124,123, 84,74,83,78,69,83,77,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,93,66,68,84,3,51,0, 116,102,41,61,83,57,66,12, 70,85,73,66,54,64,44,68, 0,3,3,3,54,73,70,54,\n   95,66,54,44,66,78,26,37, 57,41,3,57,13,2,0,0, 54,51,0,41,68,70,70,59, 41,70,41,13,0,64,59,80,\n   12,3,51,12,13,26,41,3, 0,79,47,61,2,19,66,64, 37,37,13,93,54,13,54,51, 51,12,59,73,89,54,54,94,\n   },\n  {101,14,0,0,0,0,0,0, 16,16,0,0,68,49,44,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   81,56,73,0,0,0,64,71, 49,49,0,84,53,69,60,32, 84,60,49,35,15,19,18,1, 2,0,15,0,92,29,0,0,\n   83,69,66,85,103,49,69,51, 56,71,53,83,70,73,65,91, 71,59,61,71,80,77,72,79, 61,69,67,64,66,73,77,73,\n   70,75,71,70,86,62,64,69, 71,66,39,69,73,64,74,75, 79,69,71,70,83,80,53,92, 69,66,59,69,69,85,90,3,\n   94,72,77,73,64,67,62,71, 80,76,76,72,65,74,80,73, 77,93,79,99,84,69,81,94, 51,35,67,74,49,67,84,78,\n   126,196,197,192,196,176,185,184, 195,185,196,194,198,187,184,191, 190,190,180,189,189,194,181,191, 182,191,188,196,189,191,187,192,\n   186,174,192,193,203,190,193,194, 190,188,189,195,181,187,196,191, 200,178,184,186,189,186,192,180, 193,176,195,182,185,179,182,186,\n   185,187,190,185,183,187,185,186, 177,190,189,192,187,187,181,180, 178,185,188,196,172,177,186,192, 192,182,197,186,178,187,185,0,\n   },\n  {128,0,128,128,128,128,128,128, 128,128,104,128,114,124,128,118, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   46,0,46,50,32,40,40,34, 128,128,26,28,26,30,32,32, 42,0,42,44,26,34,34,28, 128,128,46,50,46,52,54,54,\n   44,0,44,46,28,36,36,30, 128,128,48,50,46,52,56,54, 50,0,50,54,34,42,42,38, 128,128,50,52,50,56,58,58,\n   128,0,128,128,128,128,128,128, 128,128,58,62,58,64,70,66, 128,0,128,128,128,128,128,128, 128,128,40,42,40,44,48,46,\n   0,0,0,0,154,180,164,168, 188,176,128,106,122,124,134,92, 0,0,0,0,128,128,128,136, 128,128,132,130,130,132,130,130,\n   0,0,0,0,242,218,218,232, 138,134,137,131,129,117,127,113, 0,0,0,0,202,206,218,216, 110,112,129,127,129,127,127,131,\n   0,0,0,0,202,218,218,206, 114,106,122,126,126,128,130,132, 0,0,0,0,210,214,206,206, 120,114,124,128,126,136,122,126,\n   0,0,0,0,206,208,200,202, 218,236,136,124,124,122,126,126, 230,194,200,214,190,198,194,216, 192,186,128,122,132,128,130,120,\n   },\n},\n\n{ // CP1252 (408.280M chars) [4]\n  {NULL, NULL, ced_hires_13, ced_hires_13, },\n  89, 209, 40, 30, 128,\n    {116,114,130,121,123,133,113,118, 108,96,180,101,111,113,172,102, 63,68,105,82,59,104,73,70, 61,79,141,65,74,59,133,92,\n   184,136,106,111,139,104,125,143, 132,111,126,123,121,100,125,118, 143,111,106,114,127,111,112,142, 128,104,127,127,102,114,106,126,\n   120,172,132,158,159,131,136,188, 123,153,123,119,120,159,118,120, 127,136,121,131,136,137,143,117, 112,109,131,116,143,151,134,114,\n   120,172,130,128,161,130,131,188, 120,143,112,109,119,159,114,131, 122,133,125,130,137,139,158,109, 114,108,131,98,146,151,128,116,\n   169,126,98,99,143,148,118,105, 94,83,203,88,113,99,199,98, 95,134,176,160,158,170,169,143, 114,141,201,118,111,110,201,130,\n   193,157,113,163,153,123,131,154, 127,166,153,157,119,132,148,131, 167,123,133,115,148,111,112,171, 124,105,174,176,96,128,101,168,\n   163,207,164,180,208,196,180,192, 191,217,180,151,128,203,159,146, 158,185,140,206,167,165,207,128, 190,119,187,150,210,179,156,183,\n   193,212,152,182,209,206,180,179, 181,211,168,151,159,213,148,135, 173,185,160,208,156,166,206,129, 190,153,187,139,197,191,153,118,\n   },\n  {128,43,4,69,19,0,0,0, 0,146,153,0,0,165,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   226,141,174,92,108,119,170,160, 148,152,134,110,182,158,177,142, 147,162,157,147,145,143,136,135, 132,133,165,129,200,100,121,143,\n   118,197,187,200,193,200,178,194, 183,191,170,191,201,196,214,194, 184,162,214,205,205,174,188,180, 157,168,179,122,110,135,115,131,\n   133,196,189,196,191,201,176,192, 180,192,169,191,199,192,212,193, 182,149,211,202,203,175,187,180, 153,174,180,105,136,86,122,30,\n   113,107,124,132,114,134,112,118, 113,93,171,97,104,105,166,96, 99,108,124,118,117,133,112,109, 102,129,171,117,112,107,166,135,\n   183,137,111,110,137,105,126,133, 132,134,125,119,116,126,133,122, 144,123,99,123,127,108,120,139, 128,105,124,131,120,117,103,138,\n   130,152,132,184,157,126,125,142, 124,153,120,120,118,183,123,115, 150,138,125,127,107,164,145,111, 111,103,118,117,132,116,120,161,\n   130,157,121,184,158,129,123,136, 124,145,121,118,111,183,121,110, 150,139,124,127,130,164,143,101, 116,102,132,106,129,115,130,117,\n   },\n  {32,0,2,24,2,2,2,2, 22,20,16,36,6,24,6,26, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   24,0,2,2,2,2,2,2, 2,2,2,16,2,2,2,4, 46,0,2,16,2,2,2,2, 6,6,2,20,2,6,2,10,\n   14,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 38,0,2,6,2,2,2,2, 2,2,2,2,2,2,2,2,\n   14,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 34,0,2,4,2,2,2,2, 2,2,2,2,2,2,2,2,\n   130,0,106,124,140,126,112,112, 160,134,134,140,180,136,142,134, 134,0,132,126,86,84,140,128, 118,162,132,166,130,138,180,136,\n   162,0,136,166,110,110,108,106, 118,138,192,162,130,136,116,152, 158,0,144,154,112,118,106,106, 148,164,166,210,152,164,138,164,\n   88,0,92,96,139,141,94,92, 180,136,146,162,174,174,124,144, 98,0,96,104,139,139,110,112, 184,150,134,164,162,186,142,158,\n   128,0,138,128,38,48,135,137, 130,178,128,152,118,146,176,178, 120,0,126,120,48,56,139,141, 136,180,140,150,130,184,156,184,\n   },\n},\n\n{ // KSC (5258.976M chars) [5]\n  {NULL, ced_hires_6, ced_hires_7, ced_hires_8, },\n  203, 186, 27, 9, 128,\n    {71,109,117,106,108,109,104,107, 110,108,108,112,103,104,106,105, 102,108,101,103,104,107,99,103, 104,99,107,103,102,103,107,98,\n   106,206,164,204,164,121,141,122, 146,119,136,130,120,90,91,81, 216,212,164,201,215,207,187,206, 213,208,207,204,210,209,205,216,\n   225,214,178,201,188,198,199,213, 199,93,107,104,116,113,115,113, 108,107,109,113,110,97,99,104, 101,113,115,107,110,108,111,117,\n   110,108,103,116,115,142,146,136, 118,134,125,131,144,112,112,126, 112,117,107,103,107,103,102,104, 101,114,109,104,105,93,0,0,\n   52,0,0,60,0,1,0,0, 0,12,0,0,28,0,18,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,78,41,83,69,52,75,65, 1,50,60,76,0,62,88,58, 79,72,60,68,0,65,54,44, 72,58,78,86,46,82,73,48,\n   57,67,58,67,72,57,60,86, 18,31,65,50,69,65,85,79, 52,57,54,34,54,0,41,38, 0,78,82,58,50,78,1,46,\n   0,57,68,0,72,67,48,65, 48,41,31,107,18,67,63,0, 12,48,0,52,0,28,85,46, 82,67,44,48,48,1,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,44,71,0,0,61,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   117,80,77,0,0,0,66,63, 78,84,0,97,84,72,82,66, 4,74,65,78,51,54,50,9, 24,6,52,5,117,40,0,44,\n   63,9,0,52,36,0,9,0, 0,0,0,24,48,0,51,51, 60,1,55,58,40,0,7,6, 59,8,0,81,54,73,75,73,\n   57,2,57,35,48,28,1,2, 0,42,0,6,50,1,20,8, 38,0,0,32,57,0,4,2, 35,32,36,56,57,50,89,38,\n   66,99,111,102,98,106,96,97, 95,99,98,96,98,104,96,95, 98,97,92,103,92,97,93,96, 95,96,104,97,94,93,92,91,\n   157,208,188,195,195,184,194,180, 174,186,184,181,197,195,200,187, 193,181,186,192,167,192,186,169, 205,187,203,199,192,172,174,185,\n   186,179,196,199,181,187,182,201, 179,175,184,177,204,183,204,207, 190,189,185,176,191,179,192,189, 182,200,194,190,178,181,182,187,\n   177,176,199,166,189,187,186,198, 184,182,174,196,175,194,193,169, 178,186,174,191,161,176,204,191, 198,180,187,178,193,181,149,9,\n   },\n  {128,0,128,128,128,128,128,128, 128,128,80,86,78,94,92,92, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   92,0,42,48,90,68,96,74, 128,128,44,44,42,48,48,50, 58,0,10,16,56,36,58,40, 128,128,42,44,40,46,48,48,\n   66,0,18,26,66,44,66,50, 128,128,42,44,42,48,48,50, 128,0,128,128,128,128,128,128, 128,128,50,52,48,58,58,58,\n   128,0,108,108,128,128,128,128, 128,128,40,40,38,44,44,46, 128,0,128,128,128,128,128,128, 128,128,54,56,50,60,58,60,\n   0,0,0,0,186,204,190,182, 244,244,124,124,72,82,142,64, 0,0,0,0,164,206,174,184, 240,238,122,124,78,80,144,52,\n   0,0,0,0,186,200,180,188, 142,140,147,131,99,107,101,91, 0,0,0,0,174,196,184,194, 112,114,125,127,127,125,133,129,\n   0,0,0,0,196,204,194,204, 120,108,124,126,130,132,116,128, 0,0,0,0,0,0,0,0, 0,0,124,130,122,130,126,126,\n   0,0,0,0,0,0,0,0, 0,0,144,130,102,108,110,110, 0,0,0,0,0,0,0,0, 0,0,126,130,124,124,130,126,\n   },\n},\n\n{ // SJS (6339.756M chars) [6]\n  {NULL, NULL, NULL, NULL},\n  151, 136, 55, 16, 129,\n    {50,188,238,215,160,59,66,108, 192,200,192,194,200,199,202,200, 190,190,186,192,182,192,188,186, 101,96,109,95,94,95,102,113,\n   84,100,117,108,117,135,81,77, 99,97,99,87,94,104,96,118, 120,115,111,101,96,105,108,108, 111,98,126,107,129,116,102,97,\n   121,104,84,106,118,104,105,80, 97,98,110,102,121,108,114,99, 91,90,109,89,86,81,89,103, 106,103,118,100,101,114,121,115,\n   114,112,106,111,106,104,109,112, 108,105,167,179,185,80,87,184, 83,79,20,45,22,55,39,0, 21,0,65,55,62,0,0,0,\n   0,223,195,229,105,32,59,131, 61,180,189,185,180,185,191,185, 177,167,169,174,171,174,169,172, 163,80,84,78,90,80,80,85,\n   59,108,81,89,100,121,105,17, 50,24,63,0,25,17,1,53, 95,61,66,50,0,31,31,81, 122,2,32,1,95,88,0,56,\n   61,50,56,0,94,59,44,0, 38,84,50,0,106,63,0,18, 44,63,28,0,24,0,80,50, 56,88,38,24,1,93,98,91,\n   113,91,95,105,97,102,91,93, 93,99,91,0,23,0,0,44, 0,76,0,0,7,42,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,15,79,0,0,65,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   113,69,98,19,0,8,69,67, 80,86,51,58,73,87,70,67, 54,73,78,62,54,54,44,46, 38,34,67,70,119,41,36,55,\n   200,198,192,189,158,190,180,168, 171,181,178,171,176,161,191,184, 172,169,180,178,178,160,185,181, 191,169,175,200,180,158,184,172,\n   177,159,190,176,163,179,174,191, 178,187,183,159,184,168,174,182, 179,167,178,179,178,180,188,176, 172,175,172,178,169,173,171,37,\n   175,177,171,172,170,176,176,180, 168,182,188,188,179,179,172,172, 155,178,155,196,173,164,176,173, 162,162,164,156,168,174,177,175,\n   179,175,195,159,185,163,180,172, 181,189,191,180,175,184,173,177, 166,185,174,185,165,192,178,192, 167,176,168,178,189,191,180,179,\n   167,183,176,162,191,193,192,176, 191,193,177,160,203,189,170,166, 173,161,169,158,174,146,173,170, 162,160,175,166,189,175,165,174,\n   186,163,175,177,160,176,185,183, 187,191,188,159,174,173,175,176, 193,187,161,164,151,172,158,144, 152,140,181,168,175,37,20,2,\n   },\n  {46,0,6,6,2,2,2,2, 2,2,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   128,0,126,120,8,12,14,18, 34,38,30,30,26,42,32,42, 128,0,128,126,6,10,10,14, 38,42,34,34,30,46,36,46,\n   128,0,128,128,10,14,16,20, 52,56,48,46,42,60,50,60, 128,0,128,128,12,16,18,22, 52,56,48,46,42,60,50,60,\n   94,0,52,54,2,2,2,2, 32,38,28,28,24,40,30,40, 128,0,128,128,46,50,52,58, 82,88,78,78,72,94,80,90,\n   0,0,0,0,140,140,138,138, 132,130,132,130,134,132,132,128, 0,0,0,0,134,142,142,142, 130,136,134,134,124,134,132,142,\n   214,0,248,242,110,114,102,98, 152,140,134,122,120,120,88,72, 182,0,226,234,144,134,80,86, 136,114,134,134,126,154,96,86,\n   178,0,234,228,102,112,100,108, 140,126,126,128,112,160,72,74, 180,0,232,230,100,114,108,110, 138,130,120,146,128,142,50,56,\n   0,0,0,0,134,146,130,142, 138,144,128,148,64,80,66,78, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n},\n\n{ // EUC-JP (4368.914M chars) [7]\n  {NULL, ced_hires_0, ced_hires_1, ced_hires_2, },\n  202, 178, 27, 15, 128,\n    {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,173,100, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,228,186,180,229,225,122,123, 168,7,2,28,62,133,86,74, 195,190,202,195,193,195,191,198, 201,199,199,204,200,197,198,200,\n   200,193,197,196,192,199,202,195, 189,196,201,190,197,197,191,183, 120,107,102,109,112,111,101,113, 107,110,96,107,105,115,111,124,\n   116,109,107,105,105,141,147,137, 110,140,100,120,146,102,103,102, 105,112,105,133,84,0,0,0, 0,54,7,43,73,0,9,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {146,59,0,0,61,22,13,0, 60,71,0,0,80,26,61,28, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   83,27,41,0,46,51,35,0, 49,37,24,68,35,38,32,13, 131,42,28,35,34,12,0,0, 63,21,33,0,74,25,11,68,\n   61,0,0,0,68,11,0,0, 31,1,1,0,39,0,101,78, 61,83,87,94,79,39,85,70, 76,64,19,86,75,87,77,75,\n   72,46,73,78,49,96,75,69, 60,49,27,69,85,65,60,49, 74,36,61,72,76,65,80,67, 67,77,74,64,73,63,88,36,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   164,202,199,199,199,177,202,190, 185,187,195,193,192,191,183,196, 192,181,174,190,182,189,177,195, 190,197,177,183,211,189,184,194,\n   186,192,177,195,187,176,192,194, 198,186,201,196,186,188,198,191, 190,186,182,176,189,182,193,190, 188,181,187,183,189,177,189,189,\n   180,185,188,180,184,187,184,191, 191,188,197,192,194,179,192,186, 182,187,188,200,180,176,184,190, 174,170,179,160,193,182,193,31,\n   },\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,44,8,34,20,28,28, 0,0,0,0,0,0,0,0, 2,0,56,14,40,28,34,34, 0,0,0,0,0,0,0,0,\n   2,0,60,16,42,30,36,38, 0,0,0,0,0,0,0,0, 92,0,128,128,128,128,128,128, 0,0,0,0,0,0,0,0,\n   70,0,128,88,128,128,128,128, 0,0,0,0,0,0,0,0, 102,0,128,120,128,128,128,128, 0,0,0,0,0,0,0,0,\n   0,0,146,186,190,162,182,180, 178,180,134,130,124,136,18,30, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   246,0,174,232,204,218,212,204, 0,0,131,131,129,123,123,117, 250,0,190,230,210,212,216,214, 0,0,125,121,125,131,131,133,\n   250,0,192,232,204,216,202,214, 0,0,120,126,124,128,128,132, 244,0,172,236,206,224,218,216, 0,0,126,128,124,130,124,128,\n   246,0,202,232,208,214,212,210, 0,0,144,110,104,110,108,108, 238,0,210,224,196,224,210,208, 0,0,118,114,104,116,104,152,\n   },\n},\n\n{ // BIG5 (2431.102M chars) [8]\n  {NULL, NULL, NULL, NULL},\n  157, 174, 62, 10, 129,\n    {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,70,70, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,182,164,130,214,207,204,195, 202,198,207,192,194,201,196,187, 202,189,195,196,188,194,190,181, 194,188,192,185,188,188,191,185,\n   184,179,185,186,180,189,110,108, 94,123,111,121,108,113,105,112, 116,103,101,106,110,102,114,99, 88,91,120,98,95,107,108,94,\n   113,93,95,93,94,131,139,129, 121,130,93,111,138,87,98,87, 90,89,97,92,97,92,92,96, 102,147,84,82,84,87,88,107,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,216,162,127,212,204,205,192, 184,187,189,191,193,185,187,179, 188,190,183,192,177,189,189,198, 181,189,172,184,183,180,173,165,\n   177,175,172,174,167,176,167,100, 42,127,129,92,89,80,107,94, 90,84,93,108,107,102,93,84, 105,100,83,90,94,79,92,95,\n   84,84,90,92,77,89,103,113, 89,87,81,74,82,87,92,56, 77,96,70,88,72,107,102,81, 90,70,90,80,91,56,42,19,\n   },\n  {90,0,0,0,0,0,0,0, 0,0,0,0,0,4,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   77,44,72,0,0,0,44,0, 53,54,4,69,21,39,51,1, 78,36,31,5,0,4,0,0, 0,0,5,0,85,0,0,0,\n   200,201,188,193,189,168,184,189, 192,178,176,174,183,184,182,191, 186,180,173,170,180,184,162,188, 182,171,166,172,168,185,178,176,\n   173,183,178,161,180,180,169,177, 177,186,185,178,177,170,187,186, 184,188,165,193,177,186,185,182, 179,178,178,175,185,176,192,2,\n   51,0,0,0,0,0,0,0, 0,0,0,19,0,0,0,14, 52,0,0,0,3,17,19,1, 0,0,0,0,0,0,0,0,\n   157,190,169,191,185,175,165,184, 179,175,174,184,175,175,167,166, 181,177,178,189,170,179,183,169, 182,186,200,181,167,183,169,167,\n   184,179,171,169,182,173,187,181, 182,184,182,175,183,177,188,186, 186,187,182,194,163,176,175,182, 180,172,184,181,179,176,173,180,\n   175,175,178,172,178,181,187,170, 177,191,189,178,186,179,167,176, 165,169,173,182,190,175,181,181, 187,183,185,177,183,178,177,107,\n   },\n  {128,0,128,128,72,86,86,80, 128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   48,0,42,44,2,2,2,2, 80,76,2,2,2,2,2,2, 54,0,52,52,2,2,2,2, 96,96,2,2,2,2,2,2,\n   74,0,76,72,2,2,2,2, 128,128,2,2,2,2,2,2, 128,0,128,128,8,18,18,14, 128,128,28,26,26,26,26,28,\n   128,0,128,128,2,4,4,2, 128,128,34,30,30,30,32,32, 128,0,128,128,4,14,12,10, 128,128,38,34,34,34,36,36,\n   0,0,0,0,160,160,160,166, 0,0,160,122,152,116,140,114, 0,0,0,0,150,150,150,148, 0,0,148,150,150,150,150,148,\n   0,0,0,0,142,138,138,134, 0,0,136,138,134,134,136,134, 0,0,0,0,132,138,142,146, 0,0,136,130,138,138,134,136,\n   0,0,0,0,136,146,134,142, 0,0,126,134,134,130,144,140, 0,0,0,0,136,138,138,144, 0,0,142,144,128,136,130,124,\n   0,0,0,0,144,140,134,134, 0,0,160,126,108,102,108,106, 224,128,202,216,130,148,132,136, 204,204,126,118,114,144,122,150,\n   },\n},\n\n{ // Latin2 (315.882M chars) [9]\n  {NULL, NULL, ced_hires_14, ced_hires_14, },\n  90, 204, 45, 27, 127,\n    {0,0,0,0,0,0,0,0, 0,13,13,0,0,13,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   176,178,79,184,121,96,188,129, 119,153,115,86,132,84,143,152, 125,178,73,182,114,95,188,79, 117,152,115,86,133,93,141,152,\n   89,170,119,130,151,109,85,137, 171,147,170,100,153,155,102,118, 87,92,116,171,110,99,128,101, 181,128,158,80,133,126,117,98,\n   90,170,94,124,153,103,95,127, 169,141,170,94,155,155,99,117, 81,92,116,171,113,99,148,82, 180,129,154,79,137,126,117,81,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   185,202,72,207,144,140,210,145, 119,178,153,122,170,124,172,196, 158,217,79,211,140,141,210,120, 115,176,151,152,187,124,173,200,\n   97,198,155,156,200,127,165,183, 202,208,195,143,194,195,151,143, 149,174,157,197,159,157,199,120, 192,171,178,136,201,170,155,174,\n   102,203,144,173,201,101,197,171, 203,203,208,143,202,204,139,150, 148,188,166,199,147,166,197,121, 192,191,178,144,189,182,155,121,\n   },\n  {65,0,0,0,0,0,0,0, 0,129,154,0,0,162,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   228,154,181,85,87,110,164,158, 144,155,125,102,191,153,189,148, 131,145,140,130,127,125,117,115, 113,114,177,135,201,88,123,155,\n   81,200,180,210,197,203,168,188, 175,191,170,190,200,190,208,194, 182,141,204,199,200,181,182,186, 146,188,181,102,112,126,100,120,\n   110,200,181,209,196,205,167,186, 172,191,169,190,200,189,207,194, 180,135,203,198,199,182,181,191, 143,189,181,91,125,72,102,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   176,176,79,167,122,89,163,118, 119,144,100,124,140,114,142,179, 121,178,71,168,109,88,163,67, 117,144,103,124,140,102,142,179,\n   91,160,116,126,149,84,190,132, 166,138,143,91,83,185,105,126, 81,118,127,168,91,58,130,99, 171,124,126,82,122,95,120,153,\n   93,161,107,127,150,87,190,124, 167,128,145,91,82,185,102,129, 83,119,127,170,121,59,134,85, 172,125,112,80,118,93,120,85,\n   },\n  {132,0,128,156,156,156,156,154, 0,0,156,156,156,156,156,156, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   10,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 14,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   24,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 24,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   24,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 24,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   132,0,98,130,142,136,102,114, 0,0,172,130,168,162,108,142, 130,0,136,132,52,54,136,130, 0,0,108,174,82,90,170,166,\n   98,0,90,98,141,143,100,90, 0,0,164,118,170,178,130,128, 100,0,92,100,139,143,108,110, 0,0,166,92,174,156,128,142,\n   134,0,136,134,36,54,135,135, 0,0,114,168,90,144,168,180, 130,0,130,134,40,56,137,141, 0,0,102,170,80,158,172,156,\n   },\n},\n\n{ // CP1251 (2609.249M chars) [10]\n  {NULL, NULL, ced_hires_10, ced_hires_10, },\n  190, 219, 69, 19, 128,\n    {61,54,71,50,88,0,0,0, 0,0,73,0,84,68,72,51, 56,82,97,103,74,0,0,0, 0,0,69,0,81,63,70,32,\n   175,85,84,108,0,54,0,0, 121,94,119,0,0,89,99,124, 0,0,150,148,47,70,0,0, 121,0,117,0,105,2,0,124,\n   203,190,201,189,197,200,175,191, 205,172,201,198,196,207,207,203, 205,207,204,187,179,172,176,183, 172,169,147,176,170,168,160,171,\n   201,185,197,186,194,200,174,188, 203,172,197,197,192,205,205,197, 203,204,203,185,172,167,174,181, 170,169,147,176,170,161,157,169,\n   31,0,88,0,134,0,0,0, 85,0,28,0,0,0,5,0, 0,100,141,125,124,0,0,0, 1,0,16,0,11,11,33,0,\n   184,2,95,21,0,6,0,0, 87,157,63,0,0,123,138,72, 0,0,102,143,7,102,0,0, 126,0,110,0,84,0,0,130,\n   157,125,161,130,131,135,111,123, 148,122,140,123,137,137,153,133, 131,147,134,135,118,122,118,114, 110,103,83,118,114,116,116,143,\n   193,147,189,166,165,195,131,156, 199,187,178,167,181,169,190,141, 170,175,180,173,120,175,145,137, 140,111,88,180,182,106,164,193,\n   },\n  {0,0,0,0,0,0,0,0, 0,123,152,0,0,158,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   223,147,180,67,83,115,163,151, 135,154,99,111,188,166,187,138, 128,140,138,123,122,123,115,111, 108,109,171,133,198,101,111,143,\n   134,133,114,124,118,126,111,112, 113,129,111,108,118,121,114,117, 124,83,116,126,121,108,110,114, 76,103,91,97,102,121,55,113,\n   81,143,106,111,119,137,102,102, 116,138,96,102,116,118,119,128, 122,71,118,150,131,126,116,96, 72,98,99,47,123,70,85,0,\n   48,44,53,47,0,85,0,0, 0,0,66,0,81,17,64,0, 50,75,98,66,98,71,62,54, 0,60,67,96,81,29,65,16,\n   175,84,89,98,74,0,54,89, 125,68,109,58,57,85,81,121, 74,34,155,158,0,74,29,81, 128,29,110,103,98,0,0,121,\n   210,181,193,178,187,209,169,174, 206,177,192,194,187,202,211,177, 199,195,203,188,160,171,169,173, 162,156,142,188,185,132,168,185,\n   213,184,195,179,188,212,171,176, 208,178,193,197,188,203,215,181, 203,197,205,192,162,172,170,174, 162,157,150,190,185,141,170,186,\n   },\n  {128,0,52,78,128,128,128,128, 128,128,74,82,12,26,10,22, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   42,0,2,6,48,58,46,48, 106,84,22,28,2,2,2,2, 56,0,2,20,64,76,62,64, 128,128,56,64,2,8,2,6,\n   2,0,2,2,2,2,2,2, 128,110,26,34,2,2,2,2, 2,0,2,2,2,6,2,2, 128,128,42,50,2,2,2,2,\n   2,0,2,2,2,2,2,2, 66,44,2,2,2,2,2,2, 2,0,2,2,2,8,2,2, 80,56,2,4,2,2,2,2,\n   130,0,112,138,218,228,196,188, 184,166,182,184,138,132,110,112, 144,0,134,138,190,188,202,204, 196,226,158,170,124,124,124,126,\n   174,0,136,170,182,184,172,174, 168,194,204,146,106,102,84,84, 154,0,152,148,150,166,162,138, 158,178,156,166,124,128,130,130,\n   146,0,152,154,166,162,144,134, 134,86,98,126,139,139,112,110, 148,0,150,162,176,170,154,134, 130,104,96,128,139,141,112,108,\n   150,0,154,148,132,128,120,110, 122,130,92,130,6,4,139,139, 150,0,154,152,96,132,122,106, 124,124,82,130,6,2,139,141,\n   },\n},\n\n{ // CP1256 (4291.965M chars) [11]\n  {NULL, NULL, NULL, NULL},\n  175, 213, 75, 16, 129,\n    {89,120,82,85,70,119,81,87, 78,57,0,61,52,107,87,0, 120,88,122,83,73,125,94,89, 114,96,1,85,34,116,73,0,\n   173,142,76,85,128,71,110,132, 117,107,30,127,106,73,102,99, 133,84,73,90,108,82,96,130, 115,70,110,116,69,78,76,146,\n   37,143,167,196,136,188,168,229, 204,148,208,168,191,193,183,197, 170,203,175,195,189,190,178,101, 181,157,204,175,195,197,193,197,\n   97,209,116,216,198,191,209,110, 85,125,90,85,128,210,82,85, 126,99,116,154,99,137,142,85, 146,71,143,75,117,89,124,44,\n   157,89,85,86,132,136,106,93, 83,69,0,77,102,72,53,0, 66,103,144,128,127,138,137,111, 67,109,0,87,78,86,35,10,\n   182,172,102,152,141,111,120,142, 116,155,25,145,107,121,136,120, 155,111,121,104,137,100,101,159, 112,93,117,165,83,117,88,152,\n   26,167,114,129,77,84,119,189, 178,200,192,163,167,160,159,182, 136,190,152,168,143,156,162,117, 154,133,178,121,152,172,165,172,\n   181,188,141,190,186,184,180,168, 169,200,157,140,190,187,136,123, 149,117,121,139,145,135,137,118, 122,142,125,128,186,100,134,77,\n   },\n  {116,3,1,0,0,0,0,0, 0,134,143,0,0,157,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   228,134,177,78,100,111,160,151, 140,149,130,106,178,144,169,141, 137,152,147,136,134,132,126,124, 121,123,169,107,200,102,108,114,\n   99,132,117,131,120,127,115,113, 116,121,112,109,121,123,118,119, 123,94,122,129,129,117,115,119, 115,108,101,110,97,133,114,122,\n   120,160,152,167,156,164,144,156, 150,149,124,140,162,163,170,153, 151,130,177,173,168,136,148,104, 122,130,139,80,126,96,114,0,\n   97,97,88,86,83,119,83,85, 98,64,79,60,61,80,88,47, 115,91,101,80,93,122,92,91, 105,117,46,102,80,115,80,37,\n   173,163,81,85,125,72,114,122, 119,118,106,104,102,81,117,107, 133,87,73,88,113,82,96,129, 115,78,124,125,69,76,76,152,\n   36,168,139,171,153,157,172,218, 198,200,201,168,187,192,186,204, 174,209,179,200,190,181,185,101, 182,157,199,169,196,190,195,192,\n   104,226,105,204,209,198,208,118, 101,130,101,80,174,214,92,83, 163,120,130,171,118,155,158,79, 156,70,154,80,108,87,119,81,\n   },\n  {90,0,18,44,128,128,54,56, 102,84,40,60,2,2,2,34, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   42,0,2,2,48,48,10,14, 62,48,10,28,2,2,2,2, 62,0,2,22,72,74,30,34, 80,62,22,42,2,2,2,16,\n   2,0,2,2,2,2,2,2, 36,24,2,6,2,2,2,2, 2,0,2,2,2,2,2,2, 48,34,2,16,2,2,2,2,\n   2,0,2,2,2,2,2,2, 30,18,2,2,2,2,2,2, 48,0,2,8,54,56,16,20, 64,52,12,30,2,2,2,4,\n   178,0,138,160,188,202,138,136, 246,218,168,188,116,124,126,114, 160,0,142,144,184,174,160,162, 212,248,162,204,118,126,126,120,\n   168,0,140,164,178,172,140,138, 162,176,200,170,106,100,92,136, 172,0,144,162,174,166,138,138, 212,212,170,220,92,90,90,122,\n   142,0,150,150,92,128,44,72, 114,114,114,108,128,130,134,130, 142,0,150,148,114,142,74,80, 126,116,112,110,134,132,130,132,\n   140,0,148,142,112,124,154,154, 120,132,116,116,134,132,128,132, 140,0,132,132,126,136,172,174, 158,152,148,140,132,130,128,164,\n   },\n},\n\n{ // CP1250 (456.295M chars) [12]\n  {NULL, NULL, ced_hires_15, ced_hires_15, },\n  90, 207, 44, 30, 128,\n    {106,94,109,3,114,124,102,101, 0,71,177,95,143,118,167,98, 48,59,96,73,40,99,64,61, 0,67,141,59,108,83,130,60,\n   178,82,81,175,131,134,115,136, 125,101,117,114,114,90,115,134, 133,104,75,173,117,99,105,135, 120,134,117,119,129,95,129,131,\n   94,177,121,140,156,127,86,139, 173,151,161,106,170,163,105,122, 92,104,118,172,129,101,131,105, 183,159,162,83,135,145,120,103,\n   95,177,123,127,157,116,103,130, 171,145,162,96,170,163,102,121, 83,93,119,172,131,103,150,86, 182,159,158,82,139,145,119,83,\n   162,120,91,35,137,141,111,98, 13,75,196,81,168,151,193,131, 88,128,169,153,152,163,162,136, 10,134,194,112,166,184,194,139,\n   187,92,75,209,146,163,125,147, 121,160,155,150,112,126,141,198, 160,116,81,213,142,104,106,164, 117,176,153,170,170,126,171,202,\n   99,200,157,158,202,129,167,185, 204,210,197,145,196,197,153,145, 151,176,159,199,161,159,201,122, 194,173,180,138,203,172,157,176,\n   104,205,146,175,203,103,199,173, 205,205,211,145,204,206,141,152, 150,191,168,201,150,168,199,123, 194,193,180,146,191,184,157,123,\n   },\n  {122,0,0,0,0,0,0,0, 0,143,154,0,0,165,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   227,153,180,86,97,112,169,159, 147,157,128,106,190,155,189,149, 138,150,147,134,133,129,124,123, 120,121,178,134,203,92,128,154,\n   110,204,183,200,193,208,171,187, 178,196,172,193,197,190,210,197, 183,143,205,201,201,184,184,176, 150,190,178,114,114,132,107,122,\n   115,204,184,198,191,209,169,185, 175,197,172,193,196,187,209,197, 181,137,202,200,201,186,184,176, 145,192,178,94,130,77,114,0,\n   105,89,105,77,114,127,87,104, 65,77,167,87,121,154,174,103, 85,93,106,115,112,126,100,99, 71,123,167,110,121,155,174,104,\n   177,116,81,166,127,131,117,124, 123,122,102,105,107,115,124,164, 136,109,72,166,119,93,103,132, 119,133,104,122,116,103,122,164,\n   93,165,121,130,150,102,158,134, 169,143,144,96,85,190,109,129, 88,98,136,169,98,62,135,101, 172,130,135,83,124,100,121,154,\n   95,167,111,128,151,90,158,126, 170,139,146,91,84,191,105,135, 89,99,137,172,123,63,135,88, 173,130,131,81,120,97,121,86,\n   },\n  {28,0,2,18,2,2,2,2, 14,14,14,22,4,16,2,16, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   22,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 32,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   16,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 18,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   16,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 18,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   130,0,104,120,140,130,110,116, 162,132,114,116,180,146,140,112, 134,0,136,128,84,84,138,128, 108,162,124,148,120,118,180,146,\n   140,0,112,138,140,134,98,104, 108,128,184,142,144,178,120,158, 136,0,132,138,94,84,138,132, 116,142,142,178,124,144,154,188,\n   94,0,90,96,141,143,100,90, 180,114,154,138,170,172,130,124, 96,0,94,98,139,143,108,112, 170,106,170,116,174,152,128,136,\n   130,0,138,132,36,52,135,135, 114,180,122,162,92,140,170,174, 128,0,130,132,40,56,137,141, 94,170,112,180,80,154,172,150,\n   },\n},\n\n{ // Latin5 (322.539M chars) [13]\n  {NULL, NULL, ced_hires_18, ced_hires_18, },\n  96, 232, 51, 21, 128,\n    {20,0,20,20,20,20,20,20, 20,37,37,20,20,16,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   174,125,94,100,128,93,114,133, 120,100,115,113,111,97,114,106, 129,100,95,102,119,100,101,130, 117,91,117,117,87,95,93,116,\n   109,114,123,142,149,117,104,183, 111,140,112,106,104,116,108,107, 147,123,109,109,99,127,169,104, 100,88,100,105,175,189,165,102,\n   108,113,104,109,151,116,97,192, 108,128,102,97,101,120,103,120, 178,123,114,107,105,128,165,98, 101,92,102,87,175,201,186,105,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   183,147,103,153,143,113,121,144, 117,156,143,147,109,122,138,121, 157,113,123,105,138,101,102,161, 114,95,164,166,85,118,91,158,\n   153,197,154,170,198,186,170,182, 181,207,170,141,118,193,149,136, 201,175,130,196,157,155,197,118, 180,109,177,140,200,218,211,173,\n   183,202,142,172,199,196,170,169, 171,201,158,141,149,203,138,125, 202,175,150,198,146,156,196,119, 180,143,177,129,187,238,211,108,\n   },\n  {50,6,11,57,0,0,0,0, 0,144,149,0,0,164,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   226,146,185,81,100,113,168,166, 142,154,126,112,190,161,183,145, 134,151,147,137,134,132,126,124, 121,122,176,137,206,105,128,149,\n   92,194,178,190,185,190,170,185, 176,197,160,189,202,193,206,184, 174,152,207,197,198,181,179,170, 146,175,180,111,108,128,102,138,\n   127,196,180,195,187,192,172,183, 173,199,158,205,212,204,220,183, 177,140,211,202,199,186,178,170, 143,189,200,94,140,80,111,5,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   175,126,100,100,127,94,116,124, 121,125,106,108,106,120,123,111, 127,113,88,113,118,96,111,128, 119,95,113,121,111,107,92,126,\n   118,110,119,175,148,113,108,168, 110,141,110,109,101,124,114,104, 171,129,114,115,94,154,141,101, 100,92,102,106,132,171,177,152,\n   114,115,112,174,149,118,107,171, 109,124,108,108,100,125,114,97, 190,129,114,113,120,155,143,91, 105,92,113,100,137,200,199,107,\n   },\n  {130,0,102,144,144,142,108,138, 0,0,154,154,154,154,154,154, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   36,0,2,2,2,2,2,2, 0,0,14,38,8,2,8,2, 62,0,2,22,2,10,2,4, 0,0,20,44,12,6,12,2,\n   26,0,2,2,2,2,2,2, 0,0,2,4,2,2,2,2, 14,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   20,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 4,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   164,0,136,160,116,116,104,106, 0,0,202,178,144,126,130,118, 160,0,142,150,118,124,102,106, 0,0,180,246,168,156,154,124,\n   90,0,92,92,145,147,90,92, 0,0,156,176,188,168,138,134, 112,0,112,116,141,141,114,116, 0,0,110,138,166,180,166,148,\n   132,0,138,122,44,54,131,135, 0,0,130,156,124,128,182,162, 128,0,132,132,50,60,135,133, 0,0,112,120,100,130,142,168,\n   },\n},\n\n{ // ISO-8859-11 (489.481M chars) [14]\n  {NULL, NULL, NULL, NULL},\n  184, 198, 48, 20, 127,\n    {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   175,209,195,88,202,83,128,203, 192,152,191,169,88,166,132,138, 156,134,149,172,200,200,176,200, 176,211,199,194,179,150,192,164,\n   175,205,201,213,136,199,75,202, 176,173,203,200,140,209,144,123, 197,203,215,179,198,198,169,189, 190,187,93,39,18,43,4,72,\n   210,196,186,186,192,106,151,183, 207,206,151,138,179,120,113,126, 122,127,132,111,120,111,102,99, 96,94,33,88,83,68,64,77,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   184,175,143,82,159,80,91,182, 155,114,141,116,87,135,98,96, 126,88,93,153,172,160,139,156, 134,188,176,156,101,92,163,122,\n   113,183,179,173,84,159,74,169, 155,135,151,108,92,170,98,140, 166,90,180,144,149,166,80,79, 133,137,84,1,4,52,40,119,\n   116,99,97,96,100,92,161,101, 174,168,108,110,179,87,92,109, 117,117,114,109,105,106,99,96, 94,95,20,89,93,21,54,98,\n   },\n  {70,0,0,46,0,0,0,0, 0,136,148,0,0,160,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   207,129,181,82,82,93,164,157, 152,152,114,111,166,150,188,146, 128,141,136,126,124,123,115,111, 109,109,165,100,202,96,118,126,\n   79,118,108,118,109,116,106,106, 104,104,108,101,111,116,105,100, 115,76,111,119,110,92,99,104, 73,98,81,125,114,120,90,106,\n   61,105,100,99,109,106,92,82, 92,104,93,95,95,106,105,107, 114,58,104,111,104,93,100,89, 80,71,96,55,132,63,99,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   175,206,190,91,199,78,140,206, 190,148,188,166,92,168,152,144, 148,139,143,179,199,196,177,200, 172,213,199,192,172,143,191,162,\n   175,208,201,213,153,202,62,203, 176,170,200,196,121,209,145,145, 194,206,218,188,201,202,172,189, 193,191,94,64,59,63,57,74,\n   203,186,178,183,187,119,161,181, 208,206,150,139,187,118,121,123, 127,115,118,111,108,125,108,109, 106,112,71,99,90,69,77,91,\n   },\n  {128,0,148,148,148,148,148,148, 0,0,148,148,148,148,148,148, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,8,8,16,14, 0,0,2,2,2,2,2,36, 2,0,2,2,4,4,14,10, 0,0,2,2,2,2,2,34,\n   2,0,2,2,2,2,8,4, 0,0,2,2,2,2,2,32, 2,0,2,2,4,4,14,10, 0,0,2,2,2,2,2,44,\n   2,0,2,2,6,6,14,10, 0,0,2,2,2,2,2,42, 68,0,20,30,128,126,128,112, 0,0,16,12,6,8,14,128,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   166,0,158,164,182,174,180,178, 0,0,126,118,128,132,130,78, 158,0,162,160,132,152,142,144, 0,0,120,122,126,134,130,92,\n   158,0,162,160,128,160,132,146, 0,0,126,126,124,134,128,90, 166,0,162,160,142,146,146,156, 0,0,134,134,128,68,132,84,\n   162,0,162,160,138,154,148,150, 0,0,130,134,132,114,112,128, 158,0,164,148,196,208,204,216, 0,0,84,76,64,52,134,254,\n   },\n},\n\n{ // ISO-8859-15 (27.581M chars) [15]\n  {NULL, NULL, ced_hires_21, ced_hires_21, },\n  86, 217, 37, 21, 127,\n    {0,0,0,0,0,0,0,0, 0,85,85,0,0,85,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   187,137,107,112,127,105,104,142, 106,111,127,124,123,101,126,118, 133,112,107,116,117,113,113,142, 111,105,127,127,92,89,91,126,\n   121,138,130,159,161,129,133,190, 123,152,123,118,116,144,119,121, 126,135,122,132,111,139,144,115, 113,103,117,117,145,120,135,114,\n   121,137,113,131,163,128,131,190, 121,141,112,111,114,143,115,133, 123,135,125,131,110,140,160,110, 114,105,118,101,148,119,129,118,\n   0,0,0,0,0,0,0,0, 0,34,33,0,0,33,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   195,159,116,166,180,125,125,156, 145,168,155,159,121,135,150,134, 169,125,135,118,145,114,115,173, 125,108,176,178,138,141,110,170,\n   165,209,166,183,211,198,182,194, 193,219,182,153,130,205,161,148, 160,187,142,208,169,167,209,131, 192,122,189,152,212,181,158,185,\n   195,214,155,184,212,208,182,181, 183,213,170,154,161,215,150,137, 175,187,162,210,158,168,208,131, 192,156,189,142,199,193,155,120,\n   },\n  {23,0,0,70,0,0,0,0, 0,145,155,0,0,165,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   226,142,175,96,115,116,169,162, 150,154,125,112,184,159,177,144, 147,165,159,150,148,149,139,138, 134,136,166,128,201,103,116,143,\n   104,197,188,202,195,190,180,196, 185,179,172,189,202,198,215,195, 185,164,216,206,204,173,190,182, 158,170,181,116,107,135,114,133,\n   130,194,189,197,192,189,178,194, 182,176,171,189,201,194,213,194, 181,151,213,203,201,172,189,182, 155,176,182,107,136,90,117,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   187,138,113,113,149,107,108,134, 123,135,117,120,118,129,131,122, 135,125,101,126,120,109,123,140, 113,107,124,133,118,119,101,138,\n   132,128,129,187,160,126,122,145, 123,152,121,121,113,136,125,116, 152,141,127,129,106,167,144,114, 113,104,118,117,134,117,122,164,\n   130,132,121,187,161,130,119,138, 122,137,119,120,112,137,123,109, 153,141,126,130,124,167,145,104, 116,104,130,109,131,116,130,120,\n   },\n  {178,0,128,156,122,126,124,128, 0,0,168,202,168,202,168,202, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   22,0,2,2,2,2,2,2, 0,0,2,14,2,2,2,2, 50,0,2,18,2,2,2,2, 0,0,2,20,2,2,2,6,\n   16,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 42,0,2,8,2,2,2,2, 0,0,2,2,2,2,2,2,\n   16,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 38,0,2,4,2,2,2,2, 0,0,2,2,2,2,2,2,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   160,0,138,164,108,108,102,104, 0,0,190,160,132,134,120,146, 158,0,144,154,112,118,106,110, 0,0,160,218,160,164,148,160,\n   88,0,92,94,139,139,94,92, 0,0,152,166,184,176,134,148, 98,0,96,102,139,139,110,110, 0,0,138,172,174,190,154,164,\n   128,0,138,126,40,48,135,135, 0,0,130,160,128,148,186,180, 120,0,126,120,48,54,139,141, 0,0,136,160,142,188,166,188,\n   },\n},\n\n{ // CP1257 (41.264M chars) [16]\n  {NULL, NULL, ced_hires_20, ced_hires_20, },\n  84, 222, 39, 20, 128,\n    {112,108,100,0,132,119,103,89, 0,78,64,75,0,77,68,67, 11,35,79,71,21,82,53,35, 0,31,45,33,0,0,49,0,\n   173,72,85,94,121,69,110,128, 74,94,81,110,109,101,104,75, 124,97,89,88,110,94,97,129, 74,80,81,113,82,88,85,80,\n   132,139,163,137,149,121,106,164, 124,141,114,153,127,139,154,153, 181,121,165,109,89,101,125,103, 97,82,78,145,112,85,162,98,\n   138,140,163,106,150,118,115,164, 124,135,112,155,125,133,155,153, 179,115,165,109,88,104,145,100, 130,82,79,145,129,84,161,94,\n   157,114,85,13,131,136,105,92, 1,81,72,77,10,83,100,70, 81,122,164,148,146,158,157,131, 0,129,85,106,48,81,114,1,\n   181,85,101,152,141,118,119,142, 101,154,98,145,107,120,136,92, 155,111,121,103,136,99,100,159, 111,92,101,164,84,116,89,89,\n   171,189,211,72,196,184,158,199, 199,205,85,210,168,152,203,176, 211,170,179,194,91,153,195,116, 172,97,91,199,198,89,204,171,\n   205,199,217,92,198,194,183,201, 200,199,104,216,166,147,205,177, 211,185,178,196,93,154,194,117, 220,101,91,199,185,90,202,118,\n   },\n  {116,0,0,0,0,0,0,0, 0,139,155,0,0,164,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   228,153,188,77,92,107,206,155, 138,165,122,102,192,146,189,135, 135,150,145,135,132,131,124,123, 120,121,178,143,202,85,105,154,\n   107,193,189,191,196,191,164,188, 169,204,198,197,197,192,203,181, 177,134,209,211,206,182,187,168, 142,176,171,109,99,129,101,112,\n   100,195,190,187,196,195,162,186, 165,207,198,197,197,192,202,181, 176,126,208,211,206,184,192,168, 136,178,172,83,124,77,109,0,\n   117,90,127,119,115,124,85,99, 57,71,0,89,81,86,68,85, 80,86,101,138,134,121,102,96, 36,92,81,109,21,74,91,19,\n   173,101,111,88,123,70,112,120, 89,109,84,101,109,115,119,115, 133,107,98,98,116,107,100,128, 113,93,107,121,96,107,110,117,\n   136,143,168,99,146,122,112,156, 159,136,103,157,139,159,155,146, 175,101,144,111,83,103,128,97, 149,82,75,140,115,76,159,150,\n   138,144,169,93,147,125,112,157, 159,131,104,158,139,160,159,147, 175,102,144,111,84,103,122,91, 149,83,76,143,108,75,158,101,\n   },\n  {100,0,60,88,62,66,62,66, 128,122,100,126,86,90,84,92, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   38,0,2,2,2,2,2,2, 52,46,20,44,6,12,6,14, 70,0,6,34,6,12,6,12, 64,56,32,54,18,22,16,24,\n   26,0,2,2,2,2,2,2, 4,2,2,2,2,2,2,2, 22,0,2,2,2,2,2,2, 8,4,2,2,2,2,2,2,\n   26,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 24,0,2,2,2,2,2,2, 4,2,2,2,2,2,2,2,\n   168,0,132,156,116,128,102,104, 234,200,166,204,168,184,164,158, 152,0,138,142,110,104,124,126, 210,216,166,230,168,168,172,154,\n   164,0,130,166,110,108,106,106, 148,164,204,170,130,130,130,128, 164,0,140,158,102,98,106,104, 204,214,178,244,158,162,146,152,\n   102,0,88,106,141,141,94,98, 190,154,154,162,178,188,140,126, 102,0,90,98,141,139,114,106, 152,140,118,176,188,174,148,132,\n   132,0,134,134,26,40,135,135, 176,186,144,164,96,138,176,190, 126,0,136,122,28,38,135,133, 140,172,130,130,114,154,186,176,\n   },\n},\n\n{ // CP1255 (313.575M chars) [17]\n  {NULL, NULL, NULL, ced_hires_12, },\n  192, 233, 81, 15, 127,\n    {98,94,106,111,72,121,83,91, 81,65,26,68,0,71,0,69, 81,85,102,93,99,127,102,95, 75,97,17,87,61,82,71,67,\n   175,124,97,90,58,73,104,127, 119,93,86,110,111,82,101,112, 129,87,94,110,112,86,97,132, 116,73,60,114,71,123,75,120,\n   119,65,141,119,118,109,112,113, 121,112,61,74,117,67,73,62, 61,98,78,56,68,54,124,148, 38,49,42,32,35,40,36,27,\n   211,211,193,200,214,221,187,200, 193,220,109,200,214,125,214,131, 205,198,202,108,201,91,192,199, 210,210,202,32,36,81,108,32,\n   159,117,88,89,134,138,108,95, 85,73,57,78,26,89,0,88, 63,104,145,129,128,139,138,112, 83,110,64,88,33,78,35,6,\n   184,147,104,154,150,113,122,144, 118,156,77,147,109,123,138,122, 157,113,123,106,139,101,103,161, 114,95,71,167,86,119,91,159,\n   81,40,33,27,57,50,53,76, 89,84,40,25,97,25,54,51, 36,79,53,49,25,25,27,56, 26,26,27,24,26,39,25,39,\n   181,180,170,178,203,186,155,176, 171,197,173,144,189,203,159,191, 133,169,170,166,142,163,146,172, 192,178,205,35,59,102,136,39,\n   },\n  {118,0,0,0,0,0,0,0, 0,137,146,0,0,165,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   227,155,187,100,97,112,172,178, 136,158,128,132,188,170,183,153, 137,155,149,140,137,135,129,128, 124,127,173,136,203,112,110,154,\n   108,138,122,146,128,136,120,118, 124,127,114,112,126,128,125,124, 133,137,129,135,139,118,124,121, 117,118,103,111,143,128,106,131,\n   142,144,112,120,123,140,110,110, 119,135,106,107,129,123,126,129, 124,108,122,153,134,129,118,103, 84,104,101,80,145,91,116,0,\n   106,72,108,107,84,120,79,80, 98,59,0,68,0,76,0,66, 101,102,115,98,109,128,101,107, 92,118,68,108,103,102,97,114,\n   175,126,108,86,95,75,110,121, 124,112,102,101,106,84,113,116, 133,82,132,131,119,84,97,130, 116,74,64,119,72,123,75,135,\n   128,83,129,119,124,114,117,127, 127,114,43,82,134,59,75,65, 44,112,90,59,50,58,80,109, 50,44,39,43,41,44,40,43,\n   205,205,192,202,209,223,186,199, 192,223,176,195,211,204,206,190, 204,195,200,171,199,162,190,198, 213,203,213,43,41,82,94,46,\n   },\n  {86,0,44,70,130,132,130,122, 110,94,68,88,90,132,2,10, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   36,0,2,2,40,40,40,40, 60,46,16,34,34,72,2,2, 62,0,2,26,74,72,72,70, 70,54,24,42,44,82,2,2,\n   60,0,2,22,70,70,68,68, 128,128,100,128,128,128,26,36, 62,0,2,26,66,66,66,68, 128,128,128,128,128,128,48,62,\n   2,0,2,2,2,2,2,2, 24,10,2,2,2,34,2,2, 2,0,2,2,2,2,2,2, 34,20,2,10,10,46,2,2,\n   170,0,136,156,182,190,170,166, 248,224,180,222,232,172,106,66, 154,0,140,142,176,164,188,188, 214,246,176,224,176,218,104,106,\n   166,0,132,164,178,170,168,166, 160,170,204,170,154,182,76,76, 162,0,140,154,182,180,172,168, 224,230,176,228,214,218,94,74,\n   172,0,148,146,180,182,188,180, 236,188,168,220,190,202,120,120, 158,0,146,158,180,180,180,178, 162,232,182,208,174,184,68,66,\n   146,0,150,148,106,132,122,126, 110,90,74,98,128,90,131,133, 142,0,150,144,92,132,120,128, 78,90,74,72,124,138,133,127,\n   },\n},\n\n{ // KOI8R (315.553M chars) [18]\n  {NULL, NULL, ced_hires_9, ced_hires_9, },\n  189, 220, 69, 17, 128,\n    {17,17,17,17,17,17,17,17, 17,39,39,17,17,39,17,17, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   17,17,17,117,17,17,17,17, 17,17,17,17,17,17,17,17, 17,17,17,118,17,25,17,17, 17,17,17,25,17,17,17,47,\n   155,199,183,172,193,200,169,185, 168,203,166,197,197,191,205,205, 196,169,201,203,201,186,173,196, 170,177,187,171,168,166,181,137,\n   158,201,188,174,195,200,175,189, 171,204,166,200,198,196,207,207, 201,170,204,206,202,187,175,199, 170,177,189,174,172,166,183,137,\n   7,7,7,7,7,7,7,7, 7,39,39,7,7,39,7,7, 7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,\n   7,7,7,123,7,7,7,7, 7,7,7,7,7,7,7,7, 7,7,7,74,7,7,7,7, 7,7,7,7,7,7,7,100,\n   164,191,135,141,166,194,118,163, 175,198,187,177,169,182,165,191, 138,192,164,174,180,171,125,189, 179,178,152,139,98,108,139,73,\n   131,162,130,110,132,145,129,147, 126,158,123,145,139,148,148,152, 142,148,128,154,139,149,108,167, 114,119,123,105,122,90,109,85,\n   },\n  {0,0,0,0,0,0,0,0, 0,111,171,0,0,149,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   223,146,172,30,25,90,164,138, 116,148,90,87,187,167,194,124, 72,106,101,90,90,85,93,77, 75,75,165,131,188,82,114,147,\n   125,92,36,71,49,93,30,0, 64,104,0,30,49,47,61,97, 110,0,62,58,56,11,54,71, 45,83,11,70,85,112,54,106,\n   92,94,57,74,51,94,36,30, 66,106,0,34,57,53,67,98, 113,0,67,61,51,49,56,17, 49,84,41,0,111,57,57,0,\n   47,49,56,30,0,36,0,0, 0,0,0,25,17,0,0,11, 0,36,17,0,0,0,0,0, 0,0,49,0,0,11,0,0,\n   25,0,0,123,0,0,0,0, 0,0,0,0,0,0,0,0, 57,17,45,121,30,57,11,36, 66,11,36,41,36,49,58,53,\n   169,212,182,169,188,212,160,181, 172,207,177,191,196,188,203,214, 181,185,201,197,203,191,170,194, 184,189,174,162,139,157,176,118,\n   167,209,180,168,186,208,159,179, 171,206,177,190,193,187,201,211, 178,185,198,195,202,188,168,192, 184,187,173,162,133,156,176,117,\n   },\n  {130,0,102,154,154,154,154,154, 154,154,154,154,112,154,116,154, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   92,0,38,74,128,128,128,128, 128,128,128,128,22,34,24,36, 92,0,38,74,128,128,128,128, 128,128,128,128,44,54,46,56,\n   2,0,2,2,18,22,26,26, 110,128,40,40,2,2,2,2, 2,0,2,2,22,28,32,30, 128,128,48,50,2,2,2,2,\n   2,0,2,2,16,20,24,24, 128,128,76,80,2,2,2,2, 2,0,2,2,20,24,30,28, 128,128,82,84,2,2,2,2,\n   154,0,128,178,178,178,178,178, 178,178,178,178,128,178,140,178, 154,0,132,178,178,178,178,178, 178,178,178,178,138,178,178,178,\n   146,0,154,136,178,182,180,178, 178,178,180,178,134,146,82,92, 148,0,152,168,180,184,180,178, 178,180,180,180,90,106,136,148,\n   154,0,154,152,154,146,152,150, 134,154,138,86,141,141,6,4, 154,0,154,156,114,150,158,160, 166,172,142,122,139,141,2,12,\n   136,0,154,156,180,184,184,158, 124,140,110,136,112,106,141,139, 140,0,152,158,180,186,178,172, 130,144,112,138,114,110,139,141,\n   },\n},\n\n{ // GBK (106.219M chars) [19]\n  {NULL, NULL, NULL, NULL},\n  203, 189, 27, 17, 128,\n    {80,136,138,128,141,121,130,133, 125,121,114,108,141,130,70,75, 125,127,117,120,119,135,127,109, 133,129,119,130,122,125,128,114,\n   74,204,125,202,219,215,119,114, 118,156,113,86,97,79,82,81, 189,196,199,195,195,208,196,199, 196,203,194,200,201,197,193,195,\n   192,195,189,194,195,183,196,191, 201,197,207,197,197,197,201,199, 201,191,203,201,198,196,202,200, 134,116,114,132,122,124,118,115,\n   115,120,116,120,141,121,124,123, 121,120,121,113,125,116,117,110, 117,114,112,113,119,112,124,123, 85,77,84,80,72,84,79,0,\n   135,112,99,113,112,124,117,103, 124,95,92,89,122,95,0,51, 0,0,0,0,0,0,0,0, 25,1,0,0,0,0,0,0,\n   1,113,69,80,84,69,59,13, 116,104,61,70,84,69,73,47, 74,88,74,72,72,73,61,73, 51,54,54,59,70,77,75,75,\n   96,68,68,66,84,83,47,68, 64,64,44,78,54,61,26,26, 64,64,47,59,70,74,70,66, 64,80,61,44,44,69,66,82,\n   51,57,66,57,64,47,64,54, 18,82,68,66,40,66,70,69, 51,70,40,88,37,37,40,59, 59,40,102,70,73,70,68,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,1,60,0,0,64,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   94,78,82,0,0,0,93,107, 64,60,46,107,76,56,82,44, 29,64,73,39,27,27,18,14, 14,15,18,0,111,60,0,46,\n   104,95,102,121,118,73,105,75, 96,131,74,109,89,100,103,111, 93,108,98,107,126,103,101,125, 113,99,98,90,89,109,120,88,\n   77,85,85,92,91,104,101,109, 101,83,74,90,111,98,98,117, 96,93,127,97,106,100,91,99, 91,102,105,84,114,93,91,17,\n   124,109,99,116,90,100,105,89, 96,95,103,108,93,117,111,110, 98,115,123,116,94,82,112,111, 83,97,106,96,74,105,115,121,\n   126,196,197,192,196,176,185,184, 195,185,196,194,198,187,184,191, 190,190,180,189,189,194,181,191, 181,191,188,196,189,191,187,192,\n   186,174,192,193,202,189,193,194, 190,188,189,195,181,187,196,191, 200,178,184,186,189,186,192,180, 193,176,195,182,185,179,182,186,\n   185,187,190,185,183,187,185,186, 177,190,189,191,187,187,181,180, 178,185,188,196,173,177,186,192, 192,182,197,186,177,187,185,0,\n   },\n  {144,0,168,168,120,122,152,128, 124,116,2,2,2,2,4,4, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   78,0,26,38,2,2,12,8, 128,128,22,22,20,24,26,26, 72,0,20,32,2,2,6,2, 128,128,40,42,40,44,46,46,\n   74,0,22,34,2,2,6,4, 128,128,40,42,38,44,46,46, 80,0,28,40,6,4,14,10, 128,128,44,46,42,50,52,50,\n   128,0,128,128,98,102,124,110, 128,128,46,50,46,54,56,54, 128,0,128,128,128,128,128,128, 128,128,38,40,38,44,46,44,\n   0,0,0,0,236,252,250,242, 230,226,122,106,114,124,130,128, 0,0,0,0,252,238,254,254, 240,234,112,116,106,116,144,130,\n   0,0,0,0,242,220,220,232, 106,108,136,130,128,116,126,114, 0,0,0,0,206,208,218,216, 82,88,128,126,128,126,126,132,\n   0,0,0,0,204,218,220,208, 84,82,122,128,128,128,132,132, 0,0,0,0,212,214,210,210, 92,88,124,128,126,136,120,126,\n   0,0,0,0,208,210,204,206, 200,208,136,124,124,122,126,126, 0,0,0,0,198,202,200,218, 200,196,128,122,132,128,130,120,\n   },\n},\n\n{ // Greek (109.816M chars) [20]\n  {NULL, NULL, ced_hires_11, ced_hires_11, },\n  186, 219, 72, 19, 128,\n    {0,0,0,0,0,0,0,0, 0,24,24,0,0,24,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   174,64,123,80,13,49,101,123, 114,89,0,152,107,83,76,53, 122,81,71,65,105,84,180,126, 183,174,186,111,183,56,165,168,\n   117,206,178,191,194,206,163,186, 183,198,202,195,198,199,165,203, 201,196,56,205,210,185,180,183, 154,177,136,87,180,183,177,186,\n   157,202,171,187,188,204,165,188, 183,199,199,194,197,198,161,202, 194,196,154,201,208,185,175,180, 147,179,136,79,183,166,168,0,\n   0,0,0,0,0,0,0,0, 0,34,34,0,0,34,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   183,58,94,153,91,63,120,143, 117,155,71,146,108,122,78,71, 156,112,122,105,105,84,83,160, 96,97,84,166,98,118,76,75,\n   70,162,129,130,139,152,103,165, 133,144,142,123,130,144,98,158, 139,113,63,159,134,140,122,126, 98,117,81,46,175,143,180,165,\n   64,199,125,122,122,176,111,189, 115,196,146,142,141,197,113,188, 137,142,206,133,145,191,115,124, 78,148,115,74,181,161,152,93,\n   },\n  {98,0,0,0,0,0,0,0, 2,135,160,0,67,161,42,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   225,142,174,72,92,107,173,153, 133,152,109,98,183,147,185,142, 132,150,145,135,133,131,124,123, 119,121,167,138,195,117,108,120,\n   78,122,108,129,112,120,111,107, 109,113,108,105,115,117,111,121, 118,81,119,121,112,95,108,105, 80,100,85,102,97,121,98,109,\n   109,116,101,104,112,116,102,95, 104,115,100,100,121,112,116,124, 116,72,112,117,112,104,110,87, 82,90,98,64,123,66,101,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   174,42,84,78,172,159,104,116, 116,102,153,94,101,82,171,60, 122,76,68,71,118,78,185,127, 180,182,189,143,179,67,177,172,\n   111,207,161,179,175,201,159,197, 167,203,190,188,186,197,160,205, 189,198,0,199,200,190,174,173, 145,183,137,110,188,186,184,191,\n   66,211,163,182,177,206,160,199, 172,206,192,193,189,200,165,208, 196,203,194,200,201,194,176,176, 146,185,138,110,182,181,174,0,\n   },\n  {146,0,130,170,170,170,170,168, 0,0,166,170,136,168,130,154, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   34,0,2,6,52,58,56,62, 0,0,4,2,2,2,2,2, 4,0,2,2,22,28,24,32, 0,0,14,2,2,2,2,2,\n   2,0,2,2,2,2,2,4, 0,0,6,2,2,2,2,2, 2,0,2,2,2,6,2,8, 0,0,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,6, 0,0,2,2,2,2,2,2, 2,0,2,2,2,10,6,12, 0,0,2,2,2,2,2,2,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   166,0,136,172,188,188,186,188, 0,0,186,116,110,106,106,106, 164,0,146,164,180,178,180,174, 0,0,98,100,140,144,98,104,\n   146,0,152,154,164,164,162,156, 0,0,52,142,139,137,118,112, 148,0,152,154,150,144,142,134, 0,0,48,136,139,131,120,126,\n   150,0,152,146,92,128,132,126, 0,0,144,72,30,124,139,139, 150,0,152,150,88,124,136,128, 0,0,66,76,4,118,141,139,\n   },\n},\n\n{ // JIS (138.804M chars) [21]\n  {NULL, NULL, NULL, NULL},\n  37, 154, 2, 1, 129,\n    {0,0,0,0,0,0,0,0, 0,99,99,0,0,99,107,197, 0,0,0,0,0,0,0,0, 0,0,0,254,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {119,0,0,0,0,0,0,0, 0,53,49,0,0,49,0,0, 0,0,0,0,0,0,0,0, 0,0,0,197,0,0,0,0,\n   73,56,65,75,246,65,49,49, 243,61,49,49,49,49,49,49, 49,56,61,49,49,49,49,49, 49,49,56,56,49,49,49,49,\n   49,49,49,49,49,49,49,49, 49,49,49,49,49,56,143,49, 49,49,97,49,75,49,59,49, 49,49,61,49,49,53,56,53,\n   49,98,49,53,49,49,49,94, 49,49,49,49,63,69,74,49, 49,49,53,65,49,49,49,49, 49,49,49,49,49,56,53,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {130,184,30,216,132,172,164,208, 0,0,0,0,0,0,0,0, 128,2,128,38,128,122,124,104, 0,0,0,0,0,0,0,0,\n   128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0, 128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0,\n   128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0, 128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0,\n   128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0, 128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n},\n\n{ // CP1254 (20.130M chars) [22]\n  {NULL, NULL, ced_hires_18, ced_hires_18, },\n  97, 228, 51, 26, 128,\n    {105,102,117,110,111,122,102,106, 97,93,168,92,91,102,30,86, 53,83,126,96,72,96,70,66, 56,74,134,61,61,50,82,84,\n   173,124,96,100,127,93,113,131, 120,100,114,112,110,97,113,106, 131,100,95,101,117,100,100,131, 116,92,116,116,90,96,94,114,\n   108,154,124,147,148,125,114,181, 110,139,111,106,104,133,107,106, 146,124,109,108,100,126,167,105, 99,95,111,104,173,187,163,102,\n   108,154,121,114,150,117,103,190, 108,128,103,98,103,136,103,119, 177,122,113,108,105,127,163,98, 101,94,113,91,173,200,184,105,\n   157,114,89,88,132,136,106,94, 88,90,191,83,103,92,21,83, 80,123,164,148,146,158,157,131, 101,129,189,106,99,97,60,118,\n   182,145,102,152,141,111,120,142, 116,154,142,145,107,121,136,120, 155,111,121,104,137,100,101,159, 112,95,162,165,88,117,91,157,\n   152,195,152,169,197,184,168,180, 179,205,169,140,116,192,148,134, 200,173,128,194,156,153,196,117, 179,108,175,138,198,216,209,171,\n   181,200,141,171,198,195,168,167, 169,200,157,140,147,201,136,123, 200,173,148,196,144,154,194,118, 178,142,175,128,185,237,209,106,\n   },\n  {116,4,4,52,4,0,0,0, 0,144,148,0,0,163,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   225,145,184,86,101,112,168,165, 141,153,125,111,189,160,182,143, 136,151,146,136,133,132,125,124, 121,122,175,136,205,105,128,148,\n   108,194,176,188,184,192,169,184, 174,197,159,189,200,191,205,183, 174,151,205,195,198,180,178,169, 146,174,178,113,109,127,105,136,\n   126,195,178,194,186,194,171,181, 172,199,157,204,211,202,219,182, 177,139,210,201,200,185,177,168, 141,187,198,94,139,85,111,0,\n   103,94,114,122,104,131,103,108, 103,87,157,89,94,91,51,79, 84,99,153,107,139,122,104,101, 94,118,157,108,103,94,118,122,\n   173,126,101,99,126,94,115,123, 121,124,114,109,106,119,122,111, 133,112,90,112,118,97,110,129, 118,94,113,120,110,107,93,127,\n   117,118,123,173,147,114,112,166, 112,142,110,109,107,167,114,104, 170,127,113,114,95,153,141,101, 99,92,103,107,131,170,176,150,\n   116,123,113,173,147,118,110,169, 112,133,111,107,99,168,113,98, 188,128,113,112,119,153,142,91, 104,92,117,99,135,199,197,107,\n   },\n  {84,0,50,70,50,58,42,52, 90,82,80,100,68,64,68,44, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   36,0,2,2,2,2,2,2, 32,24,16,38,6,2,6,2, 62,0,2,22,2,10,2,4, 36,28,22,44,12,8,10,2,\n   26,0,2,2,2,2,2,2, 2,2,2,4,2,2,2,2, 16,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   20,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 4,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   140,0,112,126,144,140,106,118, 180,152,152,160,192,130,148,104, 142,0,134,130,100,98,134,132, 138,168,142,178,148,152,184,152,\n   164,0,136,162,116,118,104,106, 140,152,204,176,140,126,126,118, 160,0,144,152,118,124,102,106, 174,182,180,238,162,154,150,126,\n   92,0,94,92,145,149,90,92, 190,154,156,172,184,168,132,134, 112,0,114,118,143,143,116,118, 140,146,112,138,166,182,162,148,\n   132,0,138,124,44,56,131,135, 142,176,130,156,120,128,176,162, 128,0,132,132,50,60,137,135, 130,160,114,122,98,130,138,168,\n   },\n},\n\n{ // CP1253 (37.682M chars) [23]\n  {NULL, NULL, ced_hires_11, ced_hires_11, },\n  186, 218, 73, 21, 128,\n    {98,79,82,91,78,122,85,90, 0,82,68,76,0,75,0,65, 79,105,101,115,101,127,107,94, 0,98,0,91,0,78,48,0,\n   174,70,182,88,122,76,110,130, 119,95,70,153,108,88,101,71, 130,87,79,77,106,197,107,129, 184,175,187,114,184,75,166,169,\n   118,206,179,192,195,207,164,187, 184,199,203,195,198,200,165,203, 202,197,70,205,210,185,180,184, 155,178,137,90,181,184,178,187,\n   86,203,172,188,189,203,161,188, 181,199,199,194,198,198,162,203, 195,196,156,202,208,186,176,181, 148,179,137,85,184,167,169,70,\n   158,116,88,89,133,138,107,95, 0,84,72,80,9,91,0,87, 58,101,143,127,125,137,136,110, 0,108,60,84,28,75,32,6,\n   183,68,95,153,143,112,121,144, 117,156,66,147,109,122,138,78, 157,112,123,105,106,101,102,161, 98,99,87,166,100,118,81,80,\n   77,163,130,131,140,152,105,166, 133,145,142,124,131,145,100,159, 140,114,66,160,135,141,123,127, 100,118,86,68,176,144,181,166,\n   74,200,125,123,122,177,112,190, 115,197,147,142,142,198,114,189, 137,143,206,134,146,192,116,125, 82,149,116,80,182,162,153,66,\n   },\n  {118,0,0,0,0,0,0,0, 0,138,161,0,0,163,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   226,143,175,80,96,111,174,154, 134,154,123,101,184,149,186,143, 136,152,147,137,135,133,126,125, 122,123,168,139,197,118,114,121,\n   107,133,118,132,121,129,117,114, 119,125,113,112,122,124,119,128, 125,97,124,130,131,115,120,120, 116,111,103,108,101,126,102,112,\n   111,143,112,125,126,141,110,108, 120,135,105,107,128,122,124,134, 122,86,123,151,133,128,120,103, 90,103,102,77,126,78,111,0,\n   91,79,78,82,79,127,85,84, 0,77,0,78,58,76,0,63, 76,87,132,84,113,123,101,97, 0,101,76,105,55,86,59,12,\n   175,74,185,85,123,84,113,121, 119,111,74,101,104,87,118,74, 133,87,79,85,119,144,95,130, 181,183,190,144,180,79,178,172,\n   112,208,162,180,176,202,160,198, 168,204,190,189,187,198,160,206, 190,199,70,200,200,190,175,174, 145,183,138,111,190,189,185,193,\n   80,212,167,183,177,208,161,200, 173,208,193,194,190,201,165,209, 197,204,194,200,202,195,177,177, 147,186,139,111,184,182,175,72,\n   },\n  {120,0,80,110,184,184,160,166, 142,128,86,68,44,50,40,48, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   20,0,2,2,32,36,28,32, 64,50,2,2,2,2,2,2, 2,0,2,2,10,14,6,10, 78,62,14,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 70,56,6,2,2,2,2,2, 2,0,2,2,2,2,2,2, 58,46,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 32,20,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 38,26,2,2,2,2,2,2,\n   168,0,138,162,188,202,172,168, 248,222,164,132,100,104,104,108, 150,0,142,148,180,174,188,192, 212,242,158,156,116,114,118,120,\n   162,0,136,170,180,178,174,172, 148,160,176,108,132,134,106,104, 162,0,146,164,172,168,166,156, 118,142,100,98,134,138,126,114,\n   144,0,152,152,156,152,144,136, 116,120,132,142,139,135,116,112, 146,0,150,152,142,134,126,118, 106,104,132,134,139,131,120,126,\n   148,0,152,144,90,118,116,110, 122,122,68,86,30,122,137,139, 150,0,152,148,90,116,122,112, 122,132,66,88,12,118,139,137,\n   },\n},\n\n{ // CP932 (5.390M chars) [24]\n  {NULL, NULL, NULL, NULL},\n  151, 140, 55, 26, 129,\n    {73,188,237,214,159,83,84,109, 191,199,191,194,200,199,202,199, 190,190,186,192,182,191,188,186, 105,102,112,102,102,102,107,115,\n   101,107,119,112,119,135,100,99, 106,106,107,101,103,109,105,120, 121,117,114,106,104,110,111,112, 114,105,127,110,129,118,108,105,\n   123,109,100,111,120,109,109,99, 105,106,114,108,122,112,116,106, 102,102,113,101,100,99,102,108, 110,108,119,107,108,116,122,117,\n   117,116,111,115,112,109,113,115, 113,111,167,178,184,104,106,183, 160,142,115,156,149,130,163,163, 184,191,154,133,75,97,94,93,\n   0,223,195,229,107,12,47,131, 44,180,189,184,179,185,191,185, 177,166,168,174,170,173,169,172, 162,86,89,86,93,87,87,91,\n   99,113,100,104,106,122,111,98, 99,99,99,99,99,99,99,99, 105,99,100,99,98,99,99,102, 124,99,99,99,106,103,99,99,\n   100,99,99,98,105,99,99,99, 99,101,99,99,112,99,98,99, 99,100,99,99,99,98,102,99, 99,103,99,99,99,104,106,104,\n   115,99,101,108,103,106,99,99, 99,103,97,0,23,91,96,0, 105,107,95,165,148,101,154,130, 96,175,132,116,100,109,98,101,\n   },\n  {87,0,0,0,0,0,0,0, 0,84,91,0,0,87,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   114,86,99,84,84,84,86,86, 90,93,85,89,87,94,87,86, 91,88,89,86,85,85,84,84, 84,84,85,87,119,84,84,84,\n   199,198,192,189,158,189,180,168, 171,180,178,171,176,161,191,183, 172,169,179,177,178,160,185,181, 190,169,175,200,180,158,185,172,\n   177,159,190,175,162,179,173,191, 177,187,182,158,184,167,174,182, 179,167,177,179,178,179,187,176, 174,176,173,178,169,174,176,0,\n   175,177,175,172,170,176,176,180, 169,182,188,188,178,179,172,172, 159,180,158,195,174,169,176,176, 162,162,166,158,168,174,176,177,\n   179,175,195,161,185,163,180,172, 181,189,190,180,175,184,173,177, 166,185,175,184,166,192,178,192, 166,176,169,178,190,190,180,180,\n   168,183,176,163,192,193,192,176, 191,192,177,162,203,189,171,167, 173,162,169,159,174,148,173,170, 163,160,175,166,188,175,165,174,\n   186,163,176,177,162,176,185,182, 187,190,188,161,175,174,179,176, 192,187,162,164,156,172,160,145, 155,145,181,167,175,93,93,93,\n   },\n  {84,0,82,82,2,2,4,6, 2,2,8,8,4,18,2,2, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   128,0,126,120,6,10,10,14, 22,24,18,18,14,28,20,30, 128,0,128,126,2,8,8,12, 22,26,18,18,14,30,20,30,\n   128,0,128,128,6,10,12,14, 26,28,22,22,18,32,24,34, 128,0,128,128,8,12,14,16, 26,30,22,22,18,32,24,34,\n   68,0,44,44,2,2,2,2, 26,30,24,22,18,34,24,34, 66,0,40,42,2,2,2,2, 2,2,2,2,2,2,2,2,\n   0,0,0,0,140,138,140,138, 132,130,132,132,136,132,134,128, 0,0,0,0,134,140,142,142, 130,134,132,134,124,134,132,142,\n   222,128,252,248,124,128,128,130, 148,136,134,126,124,132,86,120, 214,128,240,244,136,132,130,132, 136,118,136,132,126,152,84,118,\n   212,128,244,242,126,130,132,134, 136,128,130,128,118,156,82,122, 212,128,242,242,126,130,132,134, 136,130,128,144,130,142,66,122,\n   0,0,0,0,134,144,136,142, 138,144,128,150,72,88,76,86, 184,180,164,164,126,140,126,154, 134,144,126,132,124,128,136,134,\n   },\n},\n\n{ // Hebrew (10.753M chars) [25]\n  {NULL, NULL, NULL, NULL},\n  196, 235, 78, 9, 128,\n    {0,0,0,0,0,0,0,0, 0,63,63,0,0,63,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   165,0,80,80,80,80,80,80, 80,82,80,80,82,89,80,80, 85,80,80,80,86,80,80,82, 80,80,83,80,80,80,80,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,80,\n   205,203,189,201,216,218,185,196, 190,220,185,190,212,212,202,200, 199,194,199,175,193,168,187,196, 214,202,217,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,77,77,0,0,77,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   145,0,87,87,105,87,87,87, 88,138,88,88,88,89,105,87, 89,88,88,87,91,87,87,118, 87,87,87,88,88,89,87,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,87,\n   194,196,170,172,206,189,164,179, 163,185,130,182,196,152,197,145, 174,174,179,130,174,124,162,174, 179,192,183,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,136,147,0,0,157,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   227,138,183,80,80,95,170,157, 104,163,103,95,150,163,151,133, 86,103,112,90,86,90,87,88, 85,86,126,96,204,95,106,111,\n   82,84,81,84,82,82,81,81, 82,84,81,81,81,81,82,82, 82,80,85,94,81,81,80,82, 81,80,82,83,104,130,83,93,\n   114,87,82,84,83,83,82,81, 82,88,80,81,82,82,82,86, 83,81,84,85,88,82,81,85, 80,82,80,81,92,108,97,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   165,0,81,80,80,80,80,81, 80,82,80,80,81,81,80,80, 86,80,81,80,85,80,80,83, 80,80,81,80,80,80,80,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,80,\n   209,210,192,200,210,223,187,198, 189,223,131,200,211,161,212,142, 207,193,203,135,198,112,191,196, 208,208,204,0,0,0,0,0,\n   },\n  {180,0,128,152,204,204,204,202, 0,0,202,202,0,164,118,124, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   54,0,2,14,128,84,104,102, 0,0,66,128,0,128,2,2, 128,0,36,58,128,128,128,128, 0,0,98,128,0,128,4,16,\n   128,0,128,128,128,128,128,128, 0,0,128,128,0,128,128,128, 128,0,76,98,128,128,128,128, 0,0,128,128,0,128,50,62,\n   2,0,2,2,16,2,8,10, 0,0,2,38,0,78,2,2, 2,0,2,2,26,10,18,20, 0,0,6,56,0,98,2,2,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   154,0,146,158,230,204,230,232, 0,0,186,226,0,186,128,130, 186,0,128,164,228,226,226,226, 0,0,226,226,0,186,118,124,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 164,0,128,152,188,188,188,186, 0,0,186,186,0,148,116,124,\n   150,0,150,150,136,142,142,136, 0,0,130,118,0,118,130,132, 154,0,150,154,146,158,148,158, 0,0,124,124,0,122,132,128,\n   },\n},\n\n{ // KOI8U (14.358M chars) [26]\n  {NULL, NULL, ced_hires_9, ced_hires_9, },\n  189, 220, 69, 18, 129,\n    {87,87,87,87,87,87,87,87, 87,95,95,87,87,95,87,87, 84,84,84,84,84,84,84,84, 84,84,84,84,84,84,84,84,\n   87,87,87,119,129,87,162,137, 87,87,87,87,87,90,87,87, 87,87,87,119,131,87,163,137, 87,87,87,87,87,92,87,87,\n   156,198,183,173,193,200,169,185, 168,203,166,197,197,191,205,205, 196,169,201,203,201,185,173,196, 170,177,187,171,168,165,181,137,\n   158,200,188,175,195,200,175,189, 171,204,166,200,198,196,207,207, 201,170,204,206,202,187,175,199, 170,177,189,174,172,166,183,137,\n   82,82,82,82,82,82,82,82, 82,95,95,82,82,95,82,82, 56,56,56,56,56,56,56,56, 56,56,56,56,56,56,56,56,\n   82,82,82,124,131,82,157,142, 82,82,82,82,82,83,82,82, 82,82,82,87,89,82,115,97, 82,82,82,82,82,82,82,103,\n   164,191,135,141,166,194,119,163, 175,198,187,177,169,181,165,191, 138,192,163,174,180,171,125,189, 179,178,152,139,101,110,139,87,\n   131,161,130,111,132,145,129,147, 126,157,123,145,139,148,148,152, 142,148,128,154,139,149,110,167, 115,120,124,107,123,95,110,92,\n   },\n  {0,0,0,0,0,0,0,0, 0,112,170,0,0,149,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   223,146,172,86,86,96,164,138, 117,148,96,95,187,167,194,124, 88,108,104,96,97,94,99,91, 91,91,165,131,188,92,116,147,\n   126,98,86,90,87,99,86,86, 87,107,86,86,86,87,87,101, 112,86,87,87,86,86,87,91, 86,93,86,87,94,113,86,107,\n   97,99,87,90,86,99,86,86, 87,108,86,86,87,87,88,102, 114,86,88,87,86,86,87,86, 86,94,86,86,113,86,87,0,\n   87,87,87,86,86,86,86,86, 86,86,86,86,86,86,86,86, 86,86,86,86,86,86,86,86, 86,86,86,86,86,86,86,86,\n   86,86,86,123,128,86,170,136, 86,86,86,86,86,87,86,86, 88,86,87,121,127,88,168,135, 88,86,86,87,87,87,86,87,\n   169,212,182,169,188,211,160,181, 172,207,177,191,196,188,203,214, 181,185,201,197,203,191,170,194, 184,189,174,162,139,157,176,119,\n   167,209,179,168,186,208,159,179, 171,205,177,190,193,187,202,210, 178,185,198,195,202,188,168,192, 184,187,173,162,133,156,176,118,\n   },\n  {132,0,98,138,200,200,200,198, 200,200,174,176,92,102,94,104, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   44,0,2,24,84,92,96,96, 128,128,46,48,2,2,2,2, 42,0,2,24,84,90,96,94, 128,128,88,90,14,24,16,26,\n   2,0,2,2,10,14,16,16, 36,36,2,2,2,2,2,2, 2,0,2,2,16,20,22,22, 46,46,2,2,2,2,2,2,\n   2,0,2,2,8,12,14,14, 128,128,26,28,2,2,2,2, 2,0,2,2,14,16,20,18, 112,128,30,32,2,2,2,2,\n   174,0,126,164,224,224,224,222, 224,224,180,182,112,124,116,126, 200,0,128,168,224,224,224,222, 224,224,182,184,114,126,118,128,\n   146,0,154,150,184,194,200,194, 224,224,170,142,134,140,78,88, 158,0,142,170,224,224,224,222, 224,224,140,172,104,106,136,142,\n   156,0,154,152,148,140,142,142, 118,120,138,74,139,139,16,24, 154,0,154,156,130,146,148,152, 126,124,138,84,139,141,18,30,\n   136,0,154,156,180,186,186,174, 116,118,108,138,112,106,141,139, 140,0,152,158,182,184,182,178, 122,122,112,138,114,110,139,141,\n   },\n},\n\n{ // ISO-8859-5 (4.566M chars) [27]\n  {NULL, NULL, NULL, NULL},\n  178, 203, 63, 18, 128,\n    {0,0,0,0,0,0,0,0, 0,73,73,0,0,73,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   174,139,153,105,121,99,146,124, 153,123,130,127,103,100,117,115, 203,190,202,193,196,200,173,190, 205,165,202,200,198,206,204,202,\n   204,206,200,185,176,172,175,186, 177,166,129,174,167,168,175,170, 198,179,195,186,191,199,170,186, 202,165,197,197,190,203,202,194,\n   202,202,199,184,167,167,172,183, 170,164,142,174,169,160,162,170, 145,139,152,104,117,99,146,124, 151,121,129,126,103,100,117,115,\n   0,0,0,0,0,0,0,0, 0,96,96,0,0,96,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   183,107,100,119,101,102,114,101, 108,107,102,105,110,123,100,105, 155,132,162,147,135,132,126,125, 144,118,136,128,135,134,143,136,\n   129,148,131,134,127,123,119,121, 119,113,118,126,116,118,119,138, 196,133,191,156,166,192,126,148, 197,189,175,160,180,171,185,142,\n   170,174,180,171,119,174,145,137, 136,107,110,179,181,109,162,193, 112,129,101,118,119,103,147,123, 126,105,102,131,111,99,125,102,\n   },\n  {0,0,0,0,0,0,0,0, 0,114,146,0,0,157,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   222,138,169,99,103,106,165,146, 132,152,105,105,185,162,182,129, 128,138,133,123,122,122,115,115, 112,113,166,133,204,103,107,138,\n   107,127,114,123,114,133,112,117, 112,112,116,112,118,118,113,127, 126,101,118,122,116,107,107,118, 101,108,104,104,106,112,100,115,\n   103,127,109,118,116,128,106,107, 105,117,110,111,115,113,118,136, 126,100,117,119,115,110,109,117, 100,113,108,99,124,100,99,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   174,147,138,136,115,100,153,120, 139,118,125,128,109,100,117,138, 209,174,192,178,187,205,163,176, 205,178,190,191,185,200,208,172,\n   198,193,199,188,157,168,168,173, 166,150,130,185,182,133,166,183, 215,178,196,181,189,211,165,178, 208,178,192,200,187,202,213,176,\n   204,195,202,197,156,173,167,173, 161,154,133,189,185,135,171,185, 146,148,138,136,116,99,155,119, 139,120,128,128,109,103,118,137,\n   },\n  {176,0,130,152,216,216,216,214, 0,0,182,122,134,118,130,216, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   36,0,2,2,42,50,44,50, 0,0,16,2,2,2,2,24, 2,0,2,2,2,2,2,2, 0,0,18,2,2,2,2,26,\n   2,0,2,2,2,4,2,4, 0,0,32,2,2,2,2,42, 2,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   2,0,2,2,2,8,2,8, 0,0,2,2,2,2,2,2, 46,0,2,4,54,64,54,64, 0,0,38,2,2,2,2,48,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   178,0,132,168,188,188,180,186, 0,0,192,126,130,94,98,138, 140,0,150,154,182,178,186,182, 0,0,122,138,138,120,116,102,\n   146,0,146,160,198,200,184,190, 0,0,126,138,140,118,114,104, 148,0,154,154,116,130,140,130, 0,0,78,28,40,138,138,134,\n   156,0,154,148,128,138,132,134, 0,0,88,38,50,138,140,144, 150,0,152,140,186,198,198,204, 0,0,142,88,100,130,142,182,\n   },\n},\n\n{ // CP874 (90.889M chars) [28]\n  {NULL, NULL, NULL, NULL},\n  183, 197, 49, 21, 127,\n    {105,102,97,58,82,121,0,91, 87,94,89,61,69,81,0,58, 84,99,96,131,98,112,94,97, 77,90,89,80,56,80,84,0,\n   175,209,195,89,202,83,128,203, 192,151,191,169,87,166,132,138, 156,134,149,172,200,200,176,200, 176,211,199,193,179,149,192,164,\n   175,205,201,213,136,199,77,202, 175,173,203,200,140,209,144,122, 197,203,215,179,198,198,169,189, 190,187,93,58,56,58,53,74,\n   209,196,186,186,191,106,151,183, 207,205,151,138,179,120,113,126, 122,127,132,111,120,111,102,99, 97,95,58,89,84,72,69,79,\n   159,116,43,30,27,138,0,65, 1,58,62,0,19,89,0,87, 48,92,134,118,116,128,127,100, 0,39,50,0,17,66,20,0,\n   184,175,143,83,159,81,91,181, 155,114,141,116,87,135,98,96, 126,89,93,153,172,160,139,156, 133,188,176,156,101,93,162,122,\n   113,182,178,173,85,158,76,169, 155,135,151,108,93,170,98,140, 166,90,179,144,149,166,81,80, 132,137,85,52,53,62,58,119,\n   116,99,98,96,101,93,161,101, 173,168,107,110,179,86,93,109, 117,116,114,109,105,106,99,96, 94,95,54,89,94,56,64,98,\n   },\n  {119,0,0,44,0,0,0,0, 0,138,149,0,0,161,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   209,129,181,84,86,94,166,157, 152,153,115,111,167,151,188,147, 133,142,138,128,126,125,117,113, 111,112,165,104,202,96,121,126,\n   106,131,115,123,116,126,111,111, 114,120,111,105,118,121,113,118, 121,94,117,127,130,114,114,118, 116,109,100,126,115,121,92,108,\n   78,142,110,112,119,136,104,98, 116,133,97,101,116,118,116,127, 119,79,119,150,131,126,114,102, 84,97,98,64,134,70,101,0,\n   99,94,75,63,80,121,0,92, 94,84,92,59,78,81,49,49, 77,82,103,84,123,111,96,101, 80,100,87,78,55,86,81,0,\n   175,206,190,92,199,79,139,206, 190,148,188,166,94,168,152,144, 148,139,143,179,199,195,177,200, 172,213,199,192,172,143,191,161,\n   174,207,201,213,153,202,68,203, 176,170,200,196,121,209,144,145, 194,206,217,188,201,202,172,189, 193,191,94,68,66,68,64,77,\n   203,186,177,183,187,119,161,181, 208,206,149,139,187,118,121,123, 127,115,118,111,108,125,108,109, 106,112,74,99,91,72,79,91,\n   },\n  {110,0,78,92,172,172,158,156, 114,122,40,36,30,34,38,118, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 54,48,2,2,2,2,2,36, 2,0,2,2,2,2,2,2, 54,46,2,2,2,2,2,34,\n   2,0,2,2,2,2,2,2, 54,46,2,2,2,2,2,34, 2,0,2,2,2,2,2,2, 64,58,2,2,2,2,2,44,\n   2,0,2,2,2,2,2,2, 62,56,2,2,2,2,2,42, 66,0,18,30,108,104,86,80, 128,128,16,12,6,8,14,128,\n   174,0,152,160,182,202,168,162, 246,218,114,92,92,80,144,174, 156,0,156,144,186,176,196,194, 204,246,128,124,120,72,138,184,\n   164,0,158,164,172,166,158,160, 106,118,126,118,128,132,130,82, 156,0,162,160,124,144,118,126, 140,136,120,122,126,134,130,94,\n   156,0,162,160,120,152,110,128, 92,114,126,124,126,134,128,90, 164,0,160,162,132,138,124,138, 88,116,134,134,128,66,132,86,\n   160,0,160,160,130,146,126,132, 98,116,132,134,134,114,112,128, 156,0,164,148,202,212,190,188, 168,192,88,80,70,70,134,254,\n   },\n},\n\n{ // ISO-8859-13 (0.207M chars) [29]\n  {NULL, NULL, ced_hires_20, ced_hires_20, },\n  87, 221, 44, 20, 128,\n    {0,0,0,0,0,0,0,0, 0,140,140,0,0,140,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   172,141,141,141,142,142,141,144, 141,141,141,141,141,141,141,141, 142,141,141,141,141,141,141,144, 141,141,141,142,141,141,141,141,\n   145,148,162,142,153,142,141,165, 141,149,141,156,144,147,157,156, 180,141,166,141,141,141,143,141, 141,141,141,151,142,141,162,141,\n   145,149,162,141,154,141,141,165, 142,147,141,156,144,146,157,156, 178,141,165,141,141,141,151,141, 142,141,141,151,145,141,162,141,\n   0,0,0,0,0,0,0,0, 0,103,103,0,0,103,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   179,147,141,155,148,163,142,148, 141,157,141,149,141,141,147,141, 156,141,143,141,164,141,141,160, 142,141,141,164,141,141,141,141,\n   171,188,209,141,195,182,160,197, 197,203,141,208,168,155,202,175, 209,170,178,192,141,156,194,142, 172,141,141,197,196,141,202,170,\n   203,197,216,141,196,193,181,199, 198,198,141,215,167,153,203,176, 209,184,177,194,141,156,192,141, 218,141,141,197,184,141,201,147,\n   },\n  {0,0,0,0,0,0,0,0, 0,147,156,0,0,163,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   226,155,187,141,141,141,205,156, 147,165,143,141,191,150,188,145, 145,153,151,146,146,145,143,143, 142,143,177,149,200,141,141,157,\n   141,192,188,189,194,190,165,186, 169,203,196,195,196,191,201,180, 177,147,207,210,204,181,186,168, 149,175,171,141,141,143,141,141,\n   141,193,189,186,194,193,163,185, 166,205,196,195,195,191,200,180, 175,144,206,209,204,182,190,168, 147,177,171,141,143,141,141,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   172,142,142,141,143,141,142,142, 141,142,141,141,142,141,142,143, 144,141,141,141,144,142,141,144, 142,141,142,143,141,142,142,143,\n   146,151,168,141,152,142,142,159, 160,146,141,160,148,161,157,152, 174,141,150,141,141,141,143,141, 154,141,141,149,142,141,160,154,\n   147,151,168,141,152,142,142,159, 161,143,141,160,148,161,160,152, 174,141,150,141,141,141,143,141, 154,141,141,150,142,141,160,141,\n   },\n  {158,0,124,150,126,130,126,128, 0,0,170,174,162,166,162,166, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   24,0,2,2,2,2,2,2, 0,0,2,6,2,2,2,2, 30,0,2,2,2,2,2,2, 0,0,6,12,2,2,2,4,\n   18,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 16,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   18,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 16,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   162,0,130,160,124,122,116,118, 0,0,184,168,156,160,156,160, 160,0,136,152,118,120,118,120, 0,0,168,176,162,164,162,166,\n   112,0,92,110,143,143,98,102, 0,0,160,164,168,178,152,154, 116,0,94,110,143,141,116,110, 0,0,156,162,178,166,152,152,\n   130,0,134,134,68,72,135,137, 0,0,158,164,152,156,168,178, 126,0,136,124,74,78,137,135, 0,0,156,162,150,158,178,166,\n   },\n},\n\n{ // Latin4 (1.274M chars) [30]\n  {NULL, NULL, ced_hires_17, ced_hires_17, },\n  82, 215, 39, 25, 128,\n    {0,0,0,0,0,0,0,0, 0,115,115,0,0,115,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   173,117,116,117,126,117,148,132, 125,177,162,132,116,116,164,120, 128,118,116,117,124,117,148,116, 124,175,162,130,116,116,163,116,\n   157,149,123,151,148,122,117,138, 167,143,123,118,151,148,118,153, 121,162,122,139,120,119,129,118, 117,116,148,118,124,121,142,117,\n   157,149,118,127,151,122,117,137, 166,138,123,117,150,149,118,153, 120,162,122,131,121,119,146,117, 118,128,146,116,134,116,142,117,\n   0,0,0,0,0,0,0,0, 0,70,70,0,0,70,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   181,199,116,118,142,116,174,142, 124,175,196,171,116,126,169,127, 155,213,117,118,137,116,173,125, 122,173,197,168,117,142,170,118,\n   207,195,152,169,196,183,168,186, 199,205,192,140,210,191,148,201, 147,178,118,155,156,154,195,123, 178,174,175,140,198,117,198,171,\n   213,200,142,170,197,194,168,195, 200,199,205,141,216,201,138,202, 146,177,121,146,145,154,194,125, 178,220,175,131,185,119,198,126,\n   },\n  {57,0,0,38,0,0,0,0, 0,131,151,0,0,166,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   228,152,180,117,117,121,211,153, 140,167,128,117,189,148,187,138, 132,143,139,132,130,129,124,123, 122,123,176,138,202,117,118,154,\n   118,186,190,201,200,189,167,191, 171,184,194,192,197,190,201,180, 181,140,208,211,206,171,184,129, 140,156,180,118,122,126,119,124,\n   127,186,190,200,200,192,165,190, 168,185,194,192,197,189,200,179, 179,135,207,211,206,172,186,130, 136,162,180,118,128,117,119,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   173,117,117,117,128,123,146,126, 126,173,155,140,117,124,156,121, 126,119,117,117,121,134,147,117, 125,173,155,141,136,134,156,135,\n   164,151,124,120,147,123,118,143, 164,136,118,120,153,166,122,151, 121,140,124,152,118,120,129,119, 117,154,119,117,123,117,140,151,\n   164,153,120,117,148,124,119,144, 165,128,118,120,153,167,121,156, 125,142,122,153,127,119,128,121, 118,154,121,117,120,117,144,118,\n   },\n  {162,0,122,152,126,130,126,128, 0,0,168,174,170,184,168,186, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   20,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 24,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   26,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 36,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   26,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 36,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   142,0,104,138,144,136,100,96, 0,0,180,140,178,180,148,160, 132,0,136,126,68,68,138,130, 0,0,140,176,140,152,182,186,\n   108,0,90,112,143,143,98,98, 0,0,176,164,182,164,150,154, 118,0,100,112,139,145,112,108, 0,0,180,154,176,174,158,170,\n   134,0,132,134,46,52,137,137, 0,0,142,182,140,160,182,166, 120,0,140,126,56,60,127,133, 0,0,152,184,148,180,174,174,\n   },\n},\n\n{ // MACINTOSH (7.890M chars) [31]\n  {NULL, NULL, NULL, NULL},\n  93, 176, 57, 40, 128,\n    {157,149,165,157,149,138,123,160, 152,165,162,148,156,168,162,155, 132,145,140,141,135,131,120,139, 145,132,114,87,138,116,126,107,\n   122,121,109,120,124,153,124,137, 115,116,118,128,124,104,106,113, 104,117,104,104,109,107,139,107, 126,104,109,117,116,104,105,110,\n   111,159,167,120,108,142,122,128, 139,154,202,125,151,121,112,145, 122,135,125,128,127,169,111,105, 105,105,106,131,106,115,157,151,\n   178,165,177,166,176,175,150,161, 175,138,169,172,167,178,180,169, 181,177,176,161,145,151,149,162, 150,150,134,154,149,146,136,108,\n   187,160,176,222,183,180,186,200, 209,171,190,175,171,176,227,198, 178,155,199,157,162,155,181,198, 159,170,176,133,176,169,177,184,\n   153,174,115,162,149,204,131,171, 181,164,183,160,143,100,144,155, 100,123,132,132,125,113,123,102, 131,114,100,143,166,100,142,153,\n   167,156,133,122,124,144,123,171, 183,183,202,158,173,141,144,148, 197,182,196,197,174,218,115,99, 113,111,102,198,116,150,173,165,\n   163,179,162,158,169,174,179,196, 171,195,195,169,176,142,198,171, 137,149,180,180,122,144,118,130, 126,177,118,147,152,115,134,107,\n   },\n  {42,0,13,0,0,0,0,0, 0,162,166,0,0,180,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   232,145,182,109,125,120,185,162, 148,164,123,123,190,165,187,146, 152,167,161,152,152,149,142,140, 139,140,164,140,212,106,144,148,\n   114,197,179,197,187,193,175,187, 174,172,164,164,193,190,204,189, 182,167,202,202,200,165,181,159, 152,152,154,137,122,135,112,138,\n   124,201,182,197,188,200,175,187, 178,184,163,166,195,192,204,192, 182,163,203,213,204,179,184,151, 152,150,156,105,146,106,124,0,\n   154,118,136,147,125,135,127,149, 150,171,149,158,123,138,165,150, 145,167,173,164,158,153,119,174, 161,141,125,139,166,124,149,128,\n   121,135,106,117,127,149,123,154, 119,135,121,131,129,103,106,107, 103,121,103,103,108,106,141,104, 125,103,103,109,119,103,106,107,\n   121,146,166,124,112,147,123,119, 142,156,201,137,158,141,109,143, 126,135,114,134,124,136,109,103, 105,103,103,132,103,152,150,164,\n   189,156,172,160,169,185,143,151, 179,154,167,169,166,174,187,145, 178,169,174,164,137,148,147,154, 144,138,124,165,164,121,147,108,\n   },\n  {64,0,40,60,48,54,44,48, 40,32,58,74,24,52,16,30, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   30,0,2,2,2,2,2,2, 2,2,2,14,2,2,2,2, 40,0,2,14,2,8,2,2, 14,8,34,52,2,28,2,6,\n   2,0,2,2,2,2,2,2, 2,2,2,14,2,2,2,2, 16,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 2,2,2,4,2,2,2,2, 2,0,2,2,2,2,2,2, 2,2,14,30,2,8,2,2,\n   110,0,128,112,130,132,130,130, 172,160,146,144,140,156,152,144, 116,0,126,118,72,74,142,134, 166,176,152,142,114,142,138,132,\n   150,0,140,144,110,108,104,102, 150,144,198,192,158,160,124,142, 118,0,138,130,110,122,126,128, 152,146,184,206,166,166,128,142,\n   154,0,132,150,124,122,106,110, 110,102,160,166,174,156,114,104, 126,0,130,136,116,114,128,136, 178,160,156,162,138,174,134,142,\n   118,0,122,114,142,144,108,96, 120,128,142,140,104,154,162,162, 124,0,132,118,132,136,124,118, 114,100,130,140,112,150,162,164,\n   },\n},\n\n{ // GB18030 (0.640M chars) [32]\n  {NULL, NULL, NULL, NULL},\n  202, 189, 30, 18, 127,\n    {107,143,144,138,146,135,139,141, 137,141,140,132,146,144,130,130, 137,138,134,135,134,142,138,131, 141,139,135,139,136,137,138,133,\n   130,205,136,202,219,216,134,132, 133,158,133,130,130,130,130,130, 190,196,199,196,196,209,197,199, 197,204,195,200,202,198,193,195,\n   193,196,190,195,196,183,196,192, 202,197,207,198,197,198,202,200, 202,191,204,201,199,197,203,200, 140,132,132,140,134,135,133,131,\n   132,133,132,133,146,134,134,134, 133,133,134,132,135,132,132,131, 133,132,131,131,133,132,135,135, 130,130,130,130,130,130,130,0,\n   150,126,124,127,127,133,129,124, 132,124,123,123,132,122,120,121, 35,63,39,52,35,68,64,64, 75,69,63,67,52,52,39,65,\n   121,121,121,121,122,120,121,121, 126,122,121,120,121,120,121,121, 121,121,121,120,121,121,120,121, 121,121,120,121,122,121,121,121,\n   121,121,121,121,121,120,120,120, 121,120,120,121,121,121,121,120, 120,120,121,120,120,120,120,121, 121,121,121,121,121,121,121,121,\n   121,120,121,120,121,120,120,120, 121,121,121,121,120,121,120,120, 120,120,120,122,120,120,120,121, 121,121,120,120,121,121,120,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,79,79,0,0,79,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   79,85,79,79,79,79,95,79, 83,83,79,93,93,79,87,79, 126,115,111,106,110,106,103,106, 108,108,79,79,140,83,79,110,\n   132,131,132,136,135,131,132,131, 131,141,131,133,131,132,132,133, 131,133,131,132,138,132,132,137, 134,131,131,131,131,133,136,131,\n   131,131,131,131,131,132,132,133, 131,131,131,131,134,131,131,135, 131,131,139,131,132,131,131,132, 131,132,132,131,134,131,131,0,\n   138,132,131,134,130,131,132,130, 130,130,131,132,131,134,133,133, 131,134,137,134,131,130,133,133, 130,131,132,131,130,132,134,136,\n   138,196,198,193,197,176,186,185, 196,185,197,195,199,187,185,192, 190,191,180,190,190,195,182,192, 182,191,188,196,190,191,188,193,\n   187,175,193,194,203,190,193,195, 191,189,190,196,182,188,196,192, 200,179,185,187,190,187,193,181, 193,177,196,183,186,180,183,186,\n   186,188,190,186,184,188,186,187, 178,191,190,192,188,188,182,181, 179,186,189,196,174,178,187,193, 193,183,197,187,178,188,186,0,\n   },\n  {218,0,240,172,146,146,148,146, 120,44,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   56,0,26,2,2,2,2,2, 74,70,2,2,2,2,2,2, 50,0,20,2,2,2,2,2, 84,76,2,2,2,2,2,2,\n   50,0,22,2,2,2,2,2, 86,76,2,2,2,2,2,2, 58,0,28,2,2,2,2,2, 86,76,2,2,2,2,2,2,\n   128,0,128,64,36,36,38,38, 86,76,2,2,2,2,2,2, 128,0,128,68,40,40,42,42, 84,76,2,2,2,2,2,2,\n   0,0,0,212,188,194,188,186, 180,180,120,114,116,122,126,126, 0,0,0,192,194,188,194,194, 176,176,116,120,116,122,136,128,\n   0,0,0,194,206,204,216,214, 118,118,136,130,128,116,126,112, 0,0,0,198,208,208,228,220, 112,112,126,126,128,126,126,130,\n   0,0,0,188,210,208,232,222, 112,112,120,126,126,126,130,130, 0,0,0,192,210,208,232,222, 120,120,124,128,126,134,120,124,\n   0,0,0,188,210,208,236,222, 176,176,128,122,120,122,124,124, 0,0,0,180,210,208,236,222, 178,178,122,122,122,124,126,124,\n   },\n},\n\n{ // CP852 (9.112M chars) [33]\n  {NULL, NULL, NULL, NULL},\n  85, 183, 47, 36, 128,\n    {147,99,153,98,113,162,97,141, 139,113,105,98,99,105,112,106, 117,111,78,82,68,70,92,81, 93,63,63,89,87,89,89,145,\n   187,171,114,163,117,105,174,173, 163,149,96,97,180,97,98,99, 96,96,96,96,96,186,101,174, 97,96,96,96,96,99,100,96,\n   96,96,96,96,96,96,112,102, 96,96,96,96,96,96,96,96, 97,99,112,109,110,120,170,99, 174,96,96,96,96,98,162,96,\n   115,98,115,99,99,120,184,183, 99,167,99,97,153,153,98,101, 97,97,96,97,96,158,99,96, 100,97,97,100,191,191,96,158,\n   178,142,216,118,134,202,143,174, 177,140,130,157,125,109,134,147, 194,166,135,125,142,148,164,161, 172,142,141,143,163,165,129,208,\n   222,229,177,175,143,129,196,201, 175,165,92,102,208,119,112,129, 92,92,92,92,92,217,114,205, 120,92,92,92,92,119,130,92,\n   92,92,92,92,92,92,117,134, 95,95,92,92,92,92,92,99, 100,101,140,134,151,163,210,124, 213,92,92,92,92,116,181,94,\n   176,147,127,120,122,171,198,197, 98,182,97,109,208,197,117,134, 100,102,93,126,93,173,129,92, 111,100,112,145,203,203,92,168,\n   },\n  {0,0,0,0,0,0,0,0, 0,124,152,0,0,168,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   234,148,183,99,97,113,164,166, 117,160,105,108,196,160,193,147, 123,151,151,145,144,134,140,137, 123,116,177,135,205,109,140,149,\n   99,185,176,199,192,207,123,147, 188,196,177,198,197,199,208,171, 173,98,190,193,202,160,196,129, 101,116,185,101,102,119,97,112,\n   97,188,176,199,192,210,124,151, 188,197,178,199,198,199,208,173, 176,98,191,194,203,165,197,129, 100,117,186,97,109,97,97,0,\n   127,96,131,106,97,136,102,129, 109,96,96,129,100,96,97,102, 122,147,109,96,96,114,120,101, 101,96,96,149,150,109,105,174,\n   176,201,108,134,125,115,179,179, 153,141,96,96,173,96,98,99, 96,96,96,96,96,174,106,99, 96,96,96,96,96,110,110,96,\n   96,96,96,96,96,96,98,98, 96,96,96,96,96,96,96,98, 97,97,137,96,141,138,199,98, 99,96,96,96,96,100,136,96,\n   108,105,96,97,97,138,174,174, 99,131,100,96,100,100,100,102, 116,100,96,107,96,115,97,96, 100,97,97,99,180,181,96,164,\n   },\n  {92,0,50,80,56,70,54,68, 82,58,30,64,104,40,54,46, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   8,0,2,2,2,2,2,2, 2,2,2,2,6,2,2,2, 20,0,2,2,2,2,2,2, 4,2,2,2,24,2,2,2,\n   78,0,10,38,14,28,12,26, 96,60,28,64,128,38,54,46, 26,0,2,2,2,2,2,2, 2,2,2,2,24,2,2,2,\n   14,0,2,2,2,2,2,2, 2,2,2,2,24,2,2,2, 8,0,2,2,2,2,2,2, 10,2,2,2,32,2,2,2,\n   138,0,138,136,100,100,126,124, 180,178,162,150,190,144,146,142, 122,0,120,134,128,124,134,128, 182,146,170,148,172,110,140,132,\n   132,0,132,130,120,106,130,132, 158,170,152,172,148,158,164,162, 86,0,86,90,142,152,50,60, 150,144,154,132,162,132,174,174,\n   148,0,132,140,116,136,116,134, 232,176,140,174,232,152,168,164, 128,0,124,124,134,132,122,132, 156,160,164,142,166,136,162,164,\n   124,0,124,120,130,132,128,132, 156,156,160,132,156,166,160,146, 118,0,96,134,136,98,136,108, 136,130,160,158,150,168,118,150,\n   },\n},\n\n{ // Arabic (0.205M chars) [34]\n  {NULL, NULL, NULL, NULL},\n  180, 214, 71, 14, 128,\n    {0,0,0,0,0,0,0,0, 0,121,121,0,0,121,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   136,0,0,0,136,0,0,0, 0,0,0,0,138,136,0,0, 0,0,0,0,0,0,0,0, 0,0,0,136,0,0,0,152,\n   0,151,167,198,147,188,171,230, 205,155,210,171,192,196,187,199, 176,204,173,195,191,195,175,181, 170,203,174,0,0,0,0,0,\n   182,201,194,197,213,218,204,199, 211,169,210,171,161,136,141,183, 141,152,136,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,133,133,0,0,133,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   145,0,0,0,145,0,0,0, 0,0,0,0,184,145,0,0, 0,0,0,0,0,0,0,0, 0,0,0,148,0,0,0,159,\n   0,171,146,149,145,145,147,191, 180,203,194,168,171,165,164,185, 152,192,159,171,155,163,167,168, 152,175,156,0,0,0,0,0,\n   152,177,173,172,190,189,191,184, 173,192,184,156,145,145,146,145, 145,149,145,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,137,171,0,0,150,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   227,142,169,137,137,137,163,144, 137,152,138,137,171,141,178,147, 138,139,137,137,137,138,137,137, 137,137,167,137,194,137,137,137,\n   137,137,137,137,137,137,137,137, 137,137,137,137,137,137,137,137, 137,137,137,137,137,137,137,137, 137,137,137,137,138,137,137,142,\n   137,137,137,137,137,137,137,137, 137,137,137,137,137,137,137,137, 137,137,137,137,137,137,137,137, 137,137,137,137,137,137,137,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   137,164,151,154,137,159,165,165, 160,155,154,156,173,137,172,165, 170,158,160,163,159,161,154,161, 189,173,179,140,185,172,164,157,\n   0,171,144,171,160,163,176,218, 199,202,201,175,192,195,189,204, 182,210,177,202,184,184,183,185, 163,200,179,0,0,0,0,0,\n   160,196,197,191,226,205,211,195, 209,178,216,158,137,138,147,151, 146,154,138,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {158,0,126,158,180,178,180,180, 0,0,144,124,130,132,124,178, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   52,0,2,28,50,50,50,52, 0,0,2,2,2,2,2,34, 52,0,2,28,50,50,50,52, 0,0,20,10,2,2,2,56,\n   2,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,16,\n   2,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 48,0,2,24,46,46,46,48, 0,0,22,12,2,2,2,58,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   166,0,150,140,158,156,158,158, 0,0,146,124,130,132,122,178, 154,0,138,166,170,170,170,170, 0,0,134,162,120,124,114,168,\n   134,0,150,152,144,144,144,144, 0,0,106,68,128,132,132,124, 144,0,150,152,154,154,154,154, 0,0,110,76,134,124,130,130,\n   156,0,150,144,146,146,146,146, 0,0,140,142,130,128,126,130, 156,0,134,156,178,178,178,178, 0,0,138,116,132,130,128,174,\n   },\n},\n\n{ // BIG5_HKSCS (0.271M chars) [35]\n  {NULL, NULL, NULL, NULL},\n  157, 175, 62, 14, 128,\n    {0,0,0,0,0,0,0,0, 108,149,150,140,0,150,152,140, 132,132,131,132,132,132,132,132, 132,132,132,131,131,132,131,130,\n   139,181,164,132,214,207,204,195, 203,198,208,192,195,201,196,187, 202,189,195,196,188,194,190,182, 195,188,192,186,188,188,191,185,\n   184,180,185,187,180,189,169,181, 135,142,140,142,141,141,140,141, 141,140,140,140,141,140,141,140, 140,140,142,140,140,141,141,140,\n   140,140,140,140,140,146,149,145, 143,146,140,141,149,140,140,140, 140,140,140,140,140,140,140,140, 140,151,141,140,141,139,140,0,\n   0,0,0,0,0,0,0,0, 134,133,133,134,0,124,134,133, 122,122,122,122,122,122,122,122, 122,122,122,121,121,122,122,121,\n   132,216,163,137,212,204,205,192, 184,187,190,192,193,185,187,179, 188,190,183,193,178,189,189,198, 181,189,172,184,183,181,173,166,\n   178,176,172,174,168,176,168,176, 163,140,141,134,134,134,135,134, 134,134,135,135,135,135,134,134, 135,135,134,134,134,134,134,134,\n   134,134,134,134,134,134,135,136, 134,134,134,134,134,134,135,134, 134,134,134,134,134,136,135,134, 134,134,144,134,134,134,134,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,81,81,0,0,81,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,81,81,81,81,81,81,81, 81,81,81,81,81,81,81,81, 81,81,81,81,81,81,81,81, 81,81,81,81,85,81,81,81,\n   200,202,189,193,189,173,185,189, 193,179,177,176,184,185,182,192, 186,181,175,172,181,185,166,189, 183,172,168,173,170,186,179,178,\n   174,184,179,166,182,181,171,178, 178,187,186,179,178,172,187,186, 185,189,169,194,178,186,186,183, 180,180,179,177,186,177,193,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   157,191,170,191,186,176,168,184, 181,177,175,185,177,176,169,168, 182,178,179,190,172,180,184,171, 183,186,201,182,169,184,171,170,\n   185,180,173,171,183,175,187,182, 183,185,183,177,184,178,189,186, 187,188,183,195,166,177,177,182, 181,174,185,182,180,178,175,181,\n   176,176,179,175,179,183,187,172, 179,192,190,179,187,180,169,178, 168,171,175,183,191,176,182,182, 188,183,186,178,183,179,177,0,\n   },\n  {232,0,254,254,110,120,118,114, 128,128,4,2,2,2,2,4, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   40,0,16,16,2,2,2,2, 128,128,2,2,2,2,2,2, 46,0,24,22,2,2,2,2, 128,128,2,2,2,2,2,2,\n   66,0,42,40,2,2,2,2, 128,128,2,2,2,2,2,2, 128,0,128,128,2,2,2,2, 128,128,2,2,2,2,2,2,\n   128,0,128,128,2,2,2,2, 128,128,2,2,2,2,2,2, 128,0,128,128,2,2,2,2, 128,128,2,2,2,2,2,2,\n   0,0,0,0,132,142,144,140, 0,0,140,124,126,126,126,126, 0,0,0,0,134,142,142,138, 0,0,136,134,134,134,134,134,\n   0,0,0,0,142,138,138,134, 0,0,136,138,132,132,134,134, 0,0,0,0,132,138,140,144, 0,0,134,128,138,138,132,136,\n   0,0,0,0,134,144,136,140, 0,0,126,134,132,132,142,138, 0,0,0,0,134,144,142,138, 0,0,136,134,134,134,136,136,\n   0,0,0,0,134,144,142,138, 0,0,144,132,132,132,132,132, 0,0,0,0,136,142,140,138, 0,0,136,132,134,136,134,138,\n   },\n},\n\n{ // CP866 (75.238M chars) [36]\n  {NULL, NULL, NULL, NULL},\n  144, 168, 54, 34, 129,\n    {202,189,201,189,198,201,176,191, 205,171,201,198,196,207,207,203, 202,204,202,184,177,168,173,180, 170,166,142,175,168,167,156,168,\n   200,185,197,186,194,201,174,188, 204,171,197,197,192,205,205,197, 60,60,60,60,60,60,60,60, 60,60,60,60,60,60,60,60,\n   60,60,60,60,60,60,60,60, 60,60,60,60,60,60,60,60, 60,60,60,60,60,60,60,60, 60,60,60,60,60,60,60,60,\n   203,204,203,185,172,167,174,181, 171,168,145,178,171,163,156,169, 122,121,61,61,64,61,61,61, 82,60,60,60,60,60,60,149,\n   155,129,160,132,130,136,112,122, 155,123,142,126,140,137,156,133, 109,124,109,108,94,99,94,88, 84,75,58,94,87,91,94,119,\n   193,150,189,167,164,195,129,155, 199,188,180,165,183,167,190,143, 55,55,55,55,55,55,55,55, 55,55,55,55,55,55,55,55,\n   55,55,55,55,55,55,55,55, 55,55,55,55,55,55,55,55, 55,55,55,55,55,55,55,55, 55,55,55,55,55,55,55,55,\n   172,176,181,172,118,175,146,138, 137,99,105,181,182,104,163,194, 90,129,56,55,55,62,55,57, 106,70,89,55,55,55,55,167,\n   },\n  {0,0,0,0,0,0,0,0, 0,118,150,0,0,157,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   221,147,180,74,65,105,160,149, 120,156,94,110,186,165,186,136, 108,128,124,115,112,121,107,104, 100,97,169,132,195,113,104,144,\n   134,102,74,101,82,91,78,71, 88,102,80,94,92,80,75,94, 112,60,73,125,77,72,89,82, 78,91,81,80,102,111,73,107,\n   93,109,104,99,117,99,90,77, 101,105,109,107,97,101,119,121, 134,59,107,112,113,105,117,82, 72,94,116,60,90,75,74,0,\n   210,180,193,179,186,209,168,174, 206,179,191,195,187,202,211,177, 198,196,203,188,161,170,168,174, 161,156,124,189,187,127,169,186,\n   213,183,195,180,188,212,170,177, 208,179,193,198,188,204,215,181, 60,60,60,60,60,60,60,60, 60,60,60,60,60,60,60,60,\n   60,60,60,60,60,60,60,60, 60,60,60,60,60,60,60,60, 60,60,60,60,60,60,60,60, 60,60,60,60,60,60,60,60,\n   202,198,205,193,164,172,168,175, 162,157,125,191,187,137,171,187, 127,130,61,61,67,67,60,61, 82,60,61,60,66,61,60,147,\n   },\n  {2,0,2,2,50,52,44,42, 12,26,10,176,176,176,22,96, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,4,6,2,2, 2,2,2,68,68,68,2,8, 128,0,58,84,128,128,128,128, 52,68,48,128,128,128,66,128,\n   128,0,58,84,128,128,128,128, 52,68,48,128,128,128,66,128, 128,0,58,84,128,128,128,128, 52,68,48,128,128,128,66,128,\n   2,0,2,2,16,18,10,10, 2,2,2,86,86,86,2,18, 64,0,4,30,96,98,92,86, 2,2,2,128,128,128,2,62,\n   146,0,152,154,174,180,156,152, 138,138,114,116,116,116,110,112, 148,0,150,162,184,184,176,158, 138,140,112,130,130,130,110,118,\n   154,0,152,150,150,138,126,128, 10,12,138,118,118,118,138,116, 176,0,132,158,200,200,200,198, 118,136,116,200,200,200,132,200,\n   176,0,132,158,200,200,200,198, 118,136,116,200,200,200,132,200, 176,0,132,158,200,200,200,198, 118,136,116,200,200,200,132,200,\n   152,0,152,154,122,140,132,122, 10,14,136,132,132,132,138,120, 166,0,126,164,192,204,210,212, 118,118,110,200,200,200,116,224,\n   },\n},\n\n{ // UTF-16BE (921.761M chars) [37]\n  {NULL, NULL, NULL, NULL},\n  58, 128, 46, 5, 128,\n    {255,148,128,107,171,104,157,100, 118,108,101,120,124,90,133,117, 110,115,104,101,109,109,114,104, 109,116,118,96,107,107,124,118,\n   70,74,71,58,71,66,66,63, 77,54,49,59,103,87,65,64, 97,64,107,90,85,62,70,84, 68,102,96,78,93,84,65,62,\n   98,86,102,72,68,106,98,98, 86,95,76,75,78,83,75,75, 86,85,82,77,76,85,76,77, 73,80,63,66,87,93,89,101,\n   71,70,54,77,57,100,56,43, 81,50,69,75,59,63,75,80, 86,62,64,76,70,35,84,71, 72,68,83,83,81,83,96,112,\n   158,116,117,132,124,138,121,108, 116,113,119,126,121,103,105,108, 120,97,117,112,89,96,106,109, 108,102,107,100,99,84,118,104,\n   97,103,109,97,115,85,102,101, 103,94,96,102,108,105,104,111, 112,95,96,109,94,101,100,108, 109,120,113,105,98,89,95,106,\n   95,111,93,114,92,107,109,118, 118,105,105,108,86,103,97,102, 101,110,88,98,94,117,109,105, 78,77,73,73,66,78,86,78,\n   104,107,89,105,83,121,89,89, 97,107,111,111,101,103,99,100, 88,81,89,122,99,70,98,85, 99,87,106,114,125,103,97,136,\n   },\n  {236,123,89,99,100,109,89,100, 108,198,193,73,119,181,104,83, 99,103,97,99,99,97,82,94, 101,109,110,107,104,93,93,106,\n   216,151,203,161,118,166,169,173, 164,164,144,152,168,182,186,198, 189,182,179,173,169,172,169,168, 170,168,177,180,198,196,198,153,\n   139,171,167,169,169,168,165,158, 160,167,150,145,164,164,166,162, 165,146,165,168,170,153,155,156, 147,151,149,145,145,143,117,176,\n   111,206,186,196,198,208,187,191, 193,205,165,175,201,192,202,201, 195,149,202,203,208,188,183,182, 175,180,162,150,135,150,118,103,\n   112,108,111,92,98,93,88,76, 111,111,111,115,106,106,97,112, 115,111,81,95,101,109,110,98, 111,93,99,76,83,70,93,76,\n   118,92,84,86,91,83,65,85, 86,99,71,87,101,87,83,95, 96,99,90,82,97,95,62,97, 88,93,93,96,90,93,79,99,\n   100,101,86,92,104,90,86,96, 95,94,77,82,107,97,85,85, 105,105,86,90,102,108,87,87, 97,112,82,93,109,99,100,96,\n   112,124,97,99,120,103,92,104, 114,131,110,75,88,121,83,84, 84,109,72,116,98,89,110,72, 99,78,96,85,114,106,69,129,\n   },\n  {126,120,126,128,126,126,126,126, 206,210,222,240,224,222,220,216, 122,164,100,126,150,150,112,122, 232,224,222,208,220,232,222,228,\n   28,128,42,46,76,82,30,42, 128,128,128,128,128,128,128,128, 18,128,28,34,58,64,18,28, 128,128,128,128,128,128,128,128,\n   16,128,26,32,54,62,16,26, 128,128,128,128,128,128,128,128, 22,128,32,38,70,74,22,32, 128,128,128,128,128,128,128,128,\n   30,128,42,48,82,88,32,42, 128,128,128,128,128,128,128,128, 90,190,74,128,122,156,100,110, 212,182,194,168,162,186,118,178,\n   96,180,78,128,126,140,100,104, 98,96,94,100,98,90,80,92, 108,222,102,132,140,156,114,122, 236,234,220,202,226,226,226,230,\n   118,206,78,150,134,154,108,118, 228,218,192,196,192,176,210,224, 112,218,96,148,132,158,110,122, 232,232,220,208,226,212,224,228,\n   112,224,102,146,142,156,108,124, 234,232,226,222,226,226,216,222, 114,196,84,148,140,164,110,118, 242,232,196,208,200,198,192,206,\n   110,160,74,150,140,156,114,118, 230,224,160,160,162,160,160,220, 124,240,102,144,132,152,106,116, 230,226,200,198,162,174,190,230,\n   },\n},\n\n{ // Latin3 (0.294M chars) [38]\n  {NULL, NULL, ced_hires_16, ced_hires_16, },\n  99, 202, 43, 23, 128,\n    {0,0,0,0,0,0,0,0, 0,142,142,0,0,142,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   180,143,143,143,145,0,143,148, 145,143,143,143,143,143,0,146, 147,143,143,143,144,143,143,148, 145,206,195,143,143,143,0,145,\n   143,143,143,0,158,143,143,150, 143,151,143,143,143,143,143,143, 0,145,143,162,143,143,147,143, 143,143,143,143,172,143,143,143,\n   154,143,143,0,165,177,154,182, 165,150,143,148,143,144,143,145, 0,145,143,162,143,143,157,143, 143,143,143,143,172,144,143,143,\n   0,0,0,0,0,0,0,0, 0,112,112,0,0,112,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   188,148,144,162,154,0,145,154, 146,209,160,192,146,145,0,200, 163,148,147,145,151,144,144,167, 145,236,159,192,146,145,0,204,\n   161,202,162,87,203,144,144,187, 186,211,176,153,145,198,159,150, 76,180,149,201,165,145,202,146, 144,144,182,153,204,144,144,178,\n   188,206,154,0,204,144,144,175, 177,206,166,153,158,208,152,146, 0,180,159,203,157,145,200,146, 144,155,182,149,192,144,144,147,\n   },\n  {86,0,0,0,0,0,0,0, 0,149,151,0,0,159,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   223,146,167,143,143,144,158,154, 152,149,146,143,193,154,169,146, 150,160,164,151,150,149,147,146, 146,146,160,144,200,143,144,146,\n   143,194,180,194,186,193,173,187, 178,180,164,179,196,190,207,184, 177,157,206,202,196,184,182,176, 156,184,174,143,143,145,144,143,\n   144,192,181,189,184,193,172,184, 175,179,163,204,214,197,221,182, 173,152,217,199,214,184,180,176, 154,186,193,144,147,143,144,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   180,143,143,143,146,164,143,146, 146,145,143,171,143,144,177,162, 146,143,143,143,145,143,143,148, 146,199,202,192,143,143,169,162,\n   145,144,145,0,158,143,143,149, 143,151,144,143,143,146,144,143, 0,144,144,146,143,143,148,144, 143,143,143,143,146,143,143,161,\n   144,144,144,0,159,143,143,146, 143,147,144,143,143,146,143,143, 0,144,144,147,146,143,150,143, 143,143,144,143,145,143,143,143,\n   },\n  {162,0,130,150,128,132,120,124, 0,0,156,140,170,170,172,172, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   24,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   30,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 26,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   16,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 24,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   144,0,124,142,134,134,124,120, 0,0,174,132,162,162,162,166, 118,0,132,130,74,76,134,134, 0,0,126,164,140,140,140,142,\n   118,0,100,110,147,145,94,90, 0,0,152,136,178,170,170,170, 124,0,102,116,143,145,108,108, 0,0,170,132,166,166,164,166,\n   134,0,140,130,82,86,131,131, 0,0,168,152,154,156,164,156, 130,0,124,124,92,96,137,137, 0,0,148,152,164,170,166,166,\n   },\n},\n\n{ // UTF-16LE (912.138M chars) [39]\n  {NULL, NULL, NULL, NULL},\n  58, 128, 46, 4, 127,\n    {255,146,126,120,177,123,159,99, 110,78,94,116,115,99,130,112, 110,112,82,97,100,94,113,102, 100,94,112,92,103,102,120,113,\n   60,84,76,72,67,43,63,72, 75,64,74,96,95,88,83,52, 78,81,96,84,76,57,31,82, 83,85,86,82,92,78,88,68,\n   84,91,96,52,84,96,99,105, 89,83,72,65,83,88,84,86, 81,94,75,70,97,95,78,57, 109,82,33,91,80,77,77,75,\n   25,59,64,81,47,69,60,19, 96,31,92,30,20,68,72,81, 58,66,54,80,88,55,60,66, 55,40,45,78,55,99,113,116,\n   161,117,113,130,127,131,118,108, 119,110,115,123,129,107,105,108, 116,99,114,110,93,99,108,111, 109,103,113,103,97,84,101,103,\n   91,100,101,94,110,85,98,97, 98,88,86,93,108,101,99,107, 111,91,107,105,91,95,97,104, 105,118,111,98,97,92,87,101,\n   101,106,99,111,87,110,107,116, 114,105,99,102,87,99,93,98, 100,103,88,98,89,111,105,101, 111,92,89,98,104,108,110,105,\n   102,102,83,99,77,115,78,86, 85,100,104,107,98,100,92,97, 86,77,86,117,94,64,98,84, 97,89,103,109,121,97,98,126,\n   },\n  {236,123,100,94,96,100,91,97, 108,196,193,90,112,182,101,92, 101,105,95,98,102,96,89,96, 98,112,104,103,108,101,95,106,\n   216,149,203,169,119,166,174,176, 165,165,142,152,168,181,187,198, 189,182,180,175,173,177,172,171, 173,176,177,184,198,197,198,156,\n   139,172,168,169,171,168,166,159, 159,167,150,145,165,165,166,163, 165,145,164,168,170,153,155,156, 147,150,149,144,147,141,118,176,\n   125,206,186,196,197,208,187,190, 192,205,164,175,200,191,201,201, 195,151,202,202,207,188,182,182, 175,179,161,149,134,149,121,100,\n   115,103,100,89,101,94,90,87, 101,114,108,116,108,98,92,113, 113,107,90,81,101,110,105,94, 107,95,107,74,84,72,92,81,\n   118,95,89,86,95,86,81,84, 92,99,79,88,102,91,89,97, 104,100,92,91,99,99,79,96, 89,102,98,99,90,95,85,101,\n   101,103,87,94,104,94,85,94, 97,94,83,90,106,96,82,86, 105,103,85,93,102,108,92,91, 91,103,79,87,101,91,92,87,\n   112,124,97,99,119,112,90,105, 108,128,107,81,91,121,89,85, 88,97,79,113,98,90,111,79, 102,83,100,94,112,102,86,130,\n   },\n  {128,124,128,126,126,126,126,126, 204,202,224,222,224,224,220,218, 120,164,116,98,140,156,124,122, 220,224,168,162,168,220,206,238,\n   82,158,96,72,110,162,88,92, 170,160,158,158,158,176,158,164, 54,158,66,68,104,108,56,66, 158,158,158,158,158,148,158,158,\n   48,158,58,62,88,96,50,60, 158,158,158,158,158,148,158,158, 50,158,60,64,90,98,52,62, 158,158,158,158,158,148,158,158,\n   62,158,74,80,110,116,66,76, 158,158,158,158,158,148,158,158, 112,192,96,138,138,132,104,106, 206,210,184,198,188,196,186,186,\n   106,174,86,120,124,134,92,112, 96,94,82,82,82,78,66,76, 122,214,110,132,136,160,112,112, 228,230,210,212,214,210,216,212,\n   90,200,118,146,140,162,114,120, 234,222,202,200,206,188,196,196, 96,206,128,142,144,156,116,126, 238,216,210,206,214,206,218,208,\n   94,216,130,142,136,160,108,126, 238,236,218,214,222,212,214,212, 94,214,134,138,140,158,114,124, 238,238,212,208,212,204,214,208,\n   62,162,54,148,148,164,116,124, 232,226,164,164,162,150,164,174, 94,210,110,146,134,162,112,118, 232,228,192,198,194,188,198,208,\n   },\n},\n\n{ // HZ-GB-2312 (87.400M chars) [40]\n  {NULL, NULL, NULL, NULL},\n  92, 0, 37, 0, 255,\n    {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189,\n   189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189,\n   189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {126,0,164,0,0,0,126,0, 178,139,148,0,0,132,154,146, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   161,195,176,211,162,158,148,144, 213,209,179,164,154,148,168,174, 182,184,172,182,184,188,187,175, 180,183,176,176,182,177,179,172,\n   170,193,196,199,167,165,195,168, 183,178,178,180,168,178,186,182, 183,158,180,182,181,183,186,180, 155,132,136,132,146,136,132,132,\n   132,132,136,139,173,183,178,171, 162,161,132,142,144,132,139,139, 132,136,139,144,132,132,149,139, 132,132,136,152,139,132,245,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n},\n\n{ // CSN_369103 (8.850M chars) [41]\n  {NULL, NULL, NULL, NULL},\n  90, 204, 46, 27, 127,\n    {0,0,0,0,0,0,0,0, 0,90,90,0,0,90,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   176,178,96,184,92,102,188,127, 120,153,117,98,133,96,143,153, 122,178,93,182,115,102,188,96, 119,152,117,98,133,101,141,152,\n   98,169,119,130,151,111,96,137, 171,147,170,103,153,155,105,120, 96,98,118,171,112,104,128,105, 180,129,158,96,133,127,119,102,\n   99,169,99,125,153,107,102,128, 169,142,170,99,155,155,103,119, 95,99,118,171,112,105,148,95, 180,130,154,95,137,127,119,96,\n   0,0,0,0,0,0,0,0, 0,55,55,0,0,55,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   185,202,93,207,98,140,210,145, 119,178,153,123,170,124,172,196, 158,217,94,211,139,141,210,121, 116,176,151,152,187,124,173,200,\n   103,198,155,156,200,128,165,183, 202,208,195,143,194,194,151,144, 149,174,157,197,159,157,199,120, 192,171,178,137,201,170,155,174,\n   106,203,144,173,201,105,197,170, 203,203,208,143,202,204,139,150, 148,188,166,199,147,166,197,121, 192,191,178,144,188,182,155,122,\n   },\n  {62,0,0,0,0,0,0,0, 0,129,153,0,0,162,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   228,154,181,95,91,108,164,158, 144,155,114,105,191,153,189,148, 132,145,139,130,128,126,119,117, 115,116,177,135,201,95,124,155,\n   93,200,180,210,197,203,168,188, 175,191,170,190,200,190,208,194, 182,141,204,199,200,181,182,186, 146,188,181,105,114,126,105,120,\n   112,201,181,209,196,205,167,186, 172,191,169,190,200,189,207,194, 180,135,203,198,199,182,181,191, 143,189,181,100,125,92,99,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   176,176,95,167,93,99,163,117, 120,144,106,125,140,115,142,179, 121,178,93,168,111,97,163,92, 119,144,107,125,141,107,143,179,\n   99,160,117,127,149,96,190,132, 166,138,143,97,95,185,108,127, 94,120,128,168,99,91,130,104, 171,126,127,95,123,101,122,153,\n   100,161,110,128,150,96,190,125, 167,128,145,96,95,185,105,130, 94,120,128,170,114,91,134,95, 172,126,113,95,119,100,122,97,\n   },\n  {182,0,124,152,122,132,122,132, 0,0,162,164,156,176,156,176, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   12,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 14,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   24,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 26,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   24,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 26,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   132,0,96,130,142,136,100,114, 0,0,172,130,168,162,110,142, 130,0,136,132,52,54,136,130, 0,0,108,174,92,106,170,166,\n   98,0,90,100,140,142,100,90, 0,0,164,122,170,178,132,132, 100,0,92,102,138,142,108,110, 0,0,166,106,174,156,130,144,\n   134,0,136,134,38,54,134,134, 0,0,118,168,102,146,168,180, 132,0,130,134,44,58,136,140, 0,0,108,170,98,158,172,156,\n   },\n},\n\n{ // ISO-2022-KR (85.145M chars) [42]\n  {NULL, NULL, NULL, NULL},\n  44, 144, 15, 3, 129,\n    {0,0,130,0,0,0,0,0, 0,66,66,0,0,66,213,252, 0,0,0,0,0,0,0,0, 0,0,0,224,0,0,91,91,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {80,0,0,0,0,0,0,0, 0,155,178,0,0,191,94,16, 0,0,0,0,0,0,0,0, 0,0,0,159,0,0,115,80,\n   237,178,211,150,215,142,197,197, 215,186,147,141,202,191,204,184, 182,193,189,179,176,177,168,168, 173,174,186,191,233,164,175,184,\n   177,172,153,166,162,158,159,169, 164,164,152,159,147,160,152,147, 160,143,152,154,156,148,153,153, 128,113,118,160,143,179,134,168,\n   120,133,133,128,134,139,123,121, 142,133,113,107,120,125,168,114, 123,102,122,140,136,109,112,132, 116,115,107,101,157,124,155,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {130,130,126,130,130,130,118,128, 0,0,0,0,0,0,0,0, 42,2,134,2,62,40,70,60, 0,0,0,0,0,0,0,0,\n   128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0, 128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0,\n   128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0, 128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0,\n   128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0, 128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n},\n\n{ // Latin6 (0.061M chars) [43]\n  {NULL, NULL, ced_hires_19, ced_hires_19, },\n  93, 214, 54, 26, 129,\n    {0,0,0,0,0,0,0,0, 0,156,156,0,0,156,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   175,158,158,158,158,158,158,159, 158,158,161,158,159,158,158,158, 158,158,158,158,159,158,158,159, 158,158,161,158,159,158,158,158,\n   159,164,158,159,162,158,158,158, 171,161,158,158,159,162,158,158, 158,160,158,158,158,158,159,158, 158,158,162,158,158,158,158,158,\n   159,164,158,158,163,158,158,158, 171,160,158,158,159,162,158,158, 158,160,158,158,158,158,162,158, 158,159,162,158,159,158,158,158,\n   0,0,0,0,0,0,0,0, 0,130,130,0,0,130,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   180,198,158,158,160,158,158,160, 158,163,190,158,168,158,159,158, 163,212,158,158,162,158,158,166, 159,158,180,158,168,158,158,158,\n   206,194,163,172,195,183,171,185, 198,203,191,160,209,190,162,159, 161,179,158,193,165,163,194,158, 179,176,175,160,196,171,160,172,\n   211,198,160,173,196,193,171,194, 199,198,204,160,214,199,160,158, 167,178,159,195,161,163,193,158, 178,219,176,159,185,179,160,158,\n   },\n  {0,0,0,0,0,0,0,0, 0,160,164,0,0,168,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   227,163,177,159,159,159,210,162, 160,170,159,159,189,161,185,159, 162,161,160,159,159,159,159,159, 159,159,178,159,200,159,159,164,\n   159,184,177,200,197,187,171,187, 174,180,189,189,194,188,202,180, 180,160,204,208,200,171,181,173, 162,166,178,159,159,159,159,159,\n   159,184,179,199,197,189,170,185, 172,181,189,189,194,186,201,179, 179,159,203,208,200,171,185,173, 162,169,178,159,159,159,159,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   176,159,159,159,159,159,159,159, 159,159,163,159,161,159,159,159, 159,159,159,159,159,160,159,159, 159,159,163,159,161,159,159,159,\n   161,164,159,159,163,159,159,159, 168,160,159,159,159,168,159,159, 160,159,159,159,159,159,159,159, 159,159,159,159,159,159,159,164,\n   161,164,159,159,163,159,159,159, 169,159,159,159,159,169,159,159, 160,159,159,159,159,159,159,159, 159,159,159,159,159,159,159,159,\n   },\n  {152,0,122,146,128,132,128,130, 0,0,154,156,154,156,154,158, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 4,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 4,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2, 4,0,2,2,2,2,2,2, 0,0,2,2,2,2,2,2,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   144,0,114,140,138,132,120,128, 0,0,162,154,152,154,152,154, 142,0,138,134,108,112,134,126, 0,0,154,158,154,156,154,156,\n   118,0,98,118,143,145,106,106, 0,0,154,154,162,156,154,154, 132,0,108,126,143,143,118,118, 0,0,154,156,158,158,154,156,\n   126,0,132,132,90,92,139,139, 0,0,152,156,152,156,162,156, 126,0,140,126,98,102,131,131, 0,0,154,156,154,158,156,158,\n   },\n},\n\n{ // UTF7 (0.037M chars) [44]\n  {NULL, NULL, NULL, NULL},\n  77, 207, 29, 27, 255,\n    {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189,\n   189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189,\n   189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,184,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,189,189,0,0,189,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,189,189,189,189,189,189,189, 189,189,189,0,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189,\n   189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189,\n   189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,189, 189,189,189,189,189,189,189,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n},\n\n{ // ISO_2022_CN (63.392M chars) [45]\n  {NULL, NULL, NULL, NULL},\n  43, 144, 14, 3, 129,\n    {0,0,0,0,0,0,0,0, 0,70,70,0,0,70,213,252, 0,0,0,0,0,0,0,0, 0,0,0,222,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {79,0,0,0,0,0,0,0, 0,155,177,0,0,190,19,19, 0,0,0,0,0,0,0,0, 0,0,0,158,0,0,114,79,\n   240,177,210,148,212,141,197,195, 214,185,147,140,202,190,203,183, 182,192,188,179,175,177,167,168, 173,174,186,190,231,164,175,183,\n   177,172,152,166,161,157,158,168, 164,163,151,158,146,160,151,146, 159,143,151,153,155,147,152,152, 127,112,117,160,142,178,133,168,\n   119,132,130,126,124,138,122,120, 141,131,112,106,119,124,122,112, 122,101,108,135,135,101,111,130, 112,115,106,96,156,123,154,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {130,130,126,128,130,128,128,130, 0,0,0,0,0,0,0,0, 44,2,134,2,62,26,62,10, 0,0,0,0,0,0,0,0,\n   128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0, 128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0,\n   128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0, 128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0,\n   128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0, 128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n},\n\n{ // BIG5-CP950 (0.029M chars) [46]\n  {NULL, NULL, NULL, NULL},\n  158, 182, 61, 26, 128,\n    {0,166,166,166,166,166,166,166, 166,177,177,166,166,177,166,166, 158,158,158,158,158,158,158,158, 158,158,158,158,158,158,158,158,\n   166,179,169,151,208,201,198,190, 197,193,202,187,190,196,191,184, 197,185,191,191,184,189,185,179, 190,185,188,182,184,184,187,182,\n   181,178,182,183,178,186,166,166, 166,166,166,166,166,166,166,166, 166,166,166,166,166,166,166,166, 166,166,166,166,166,166,166,166,\n   166,166,166,166,166,167,168,167, 166,167,166,166,168,166,166,166, 166,166,166,166,166,166,166,166, 166,168,166,166,166,166,166,101,\n   0,161,161,161,161,161,161,161, 161,161,161,161,161,161,161,161, 149,149,149,149,149,149,149,149, 149,149,149,149,149,149,149,149,\n   161,211,166,161,206,199,200,187, 180,182,185,186,188,181,182,176, 183,186,179,188,175,185,185,193, 178,185,170,180,179,177,170,167,\n   175,174,171,172,168,174,169,161, 161,161,161,161,161,161,161,161, 161,161,161,161,161,161,161,161, 161,161,161,161,161,161,161,161,\n   161,161,161,161,161,161,161,161, 161,161,161,161,161,161,161,161, 161,161,161,161,161,161,161,161, 161,161,161,161,161,161,161,167,\n   },\n  {0,0,0,0,0,0,0,0, 0,113,113,0,0,113,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,113,113,113,113,113,113,113, 113,113,113,113,113,113,113,113, 113,113,113,113,113,113,113,113, 113,113,113,113,113,113,113,113,\n   197,198,187,191,188,176,184,188, 190,180,179,179,184,184,183,189, 185,182,178,177,182,184,174,187, 183,177,175,178,176,185,181,180,\n   178,183,181,174,182,182,176,180, 180,186,185,181,180,177,186,185, 184,187,175,191,180,185,185,183, 181,180,181,179,185,179,190,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   150,188,176,189,185,179,174,184, 181,179,178,184,179,179,175,174, 182,179,180,187,176,180,183,176, 183,185,197,182,175,183,176,175,\n   184,181,177,176,183,178,186,182, 182,184,183,179,184,180,187,185, 186,186,182,191,174,179,179,182, 182,177,184,182,180,179,178,181,\n   179,179,180,177,180,182,186,176, 180,190,188,180,185,181,175,179, 174,176,178,183,188,178,182,182, 186,183,185,180,183,180,180,121,\n   },\n  {170,0,170,170,104,110,110,108, 128,128,2,2,2,2,2,78, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   14,0,2,2,2,2,2,2, 128,128,2,2,2,2,2,2, 20,0,2,2,2,2,2,2, 128,128,2,2,2,2,2,2,\n   34,0,10,10,2,2,2,2, 128,128,2,2,2,2,2,2, 42,0,18,18,2,2,2,2, 128,128,2,2,2,2,2,2,\n   40,0,18,16,2,2,2,2, 128,128,2,2,2,2,2,2, 42,0,18,18,2,2,2,2, 128,128,2,2,2,2,2,2,\n   0,0,0,0,134,142,140,138, 0,0,132,132,132,132,132,132, 0,0,0,0,134,142,140,138, 0,0,136,134,134,136,136,136,\n   0,0,0,0,142,136,138,134, 0,0,134,138,132,134,134,134, 0,0,0,0,134,136,140,144, 0,0,134,130,138,136,134,136,\n   0,0,0,0,136,142,138,140, 0,0,130,134,134,132,140,138, 0,0,0,0,134,142,140,138, 0,0,136,134,134,136,136,136,\n   0,0,0,0,134,142,140,138, 0,0,138,134,134,134,134,134, 160,128,160,160,134,140,140,138, 128,128,136,134,134,134,136,136,\n   },\n},\n\n{ // JAGRAN (0.046M chars) [47]\n  {NULL, NULL, NULL, NULL},\n  142, 199, 66, 34, 133,\n    {174,174,174,174,174,174,174,174, 174,182,182,174,174,182,174,174, 174,174,174,174,174,174,174,174, 174,174,174,0,0,0,174,174,\n   0,182,182,182,182,182,182,182, 182,182,182,182,182,0,182,182, 182,182,0,182,182,182,182,182, 182,182,182,182,182,182,182,182,\n   182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182, 182,182,182,182,182,182,0,182,\n   182,182,182,182,182,182,182,182, 182,182,182,182,182,182,0,182, 182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182,\n   166,166,166,166,166,166,166,166, 166,178,178,166,166,178,166,166, 166,166,166,166,166,166,166,166, 166,166,166,0,0,0,166,166,\n   0,178,178,178,178,178,178,178, 178,178,178,178,178,0,178,178, 166,166,0,166,166,166,166,166, 166,166,166,166,166,166,166,166,\n   166,166,166,166,166,166,166,166, 166,166,166,166,166,166,166,166, 166,166,166,166,166,166,166,166, 166,166,166,166,166,166,0,166,\n   166,166,166,166,166,166,166,166, 166,166,166,166,166,166,0,166, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   },\n  {0,0,0,0,0,0,0,0, 0,180,180,0,0,180,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,180,127,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180,\n   180,180,180,180,180,180,127,180, 180,180,180,180,180,180,180,180, 180,180,127,180,180,180,180,180, 180,180,180,180,180,180,180,180,\n   180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,127,180,180,0,\n   176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176, 176,176,176,0,0,0,176,176,\n   0,176,176,176,176,176,176,176, 176,176,176,176,176,0,176,176, 176,176,0,176,176,176,176,176, 176,176,176,176,176,176,176,176,\n   176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176, 176,176,176,176,176,176,0,176,\n   176,176,176,176,176,176,176,176, 176,176,176,176,176,176,0,176, 176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176,\n   },\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   132,0,132,132,132,132,132,132, 130,130,130,130,130,130,130,130, 136,0,134,134,134,134,134,134, 130,130,130,130,130,130,130,130,\n   136,0,134,134,134,134,134,134, 130,130,130,130,130,130,130,130, 136,0,134,134,134,134,134,134, 130,130,130,130,130,130,130,130,\n   136,0,134,136,134,134,136,134, 130,130,130,130,130,130,130,130, 136,0,134,134,134,134,134,134, 130,130,130,130,130,130,130,130,\n   136,0,134,134,134,134,134,134, 130,130,130,130,130,130,130,130, 136,0,134,136,134,134,136,134, 130,130,130,130,130,130,130,130,\n   },\n},\n\n{ // BHASKAR (0.047M chars) [48]\n  {NULL, NULL, NULL, NULL},\n  141, 199, 66, 34, 132,\n    {174,174,174,174,174,174,174,174, 174,182,182,174,174,182,174,174, 174,174,174,174,174,174,174,174, 174,174,174,0,0,0,174,174,\n   0,182,182,182,181,182,182,182, 182,182,182,182,182,0,182,182, 182,182,0,182,182,182,182,182, 182,182,182,182,182,182,182,182,\n   182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182, 182,182,182,182,182,182,0,182,\n   182,182,182,182,182,182,182,182, 182,182,182,182,182,182,0,181, 182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182,\n   166,166,166,166,166,166,166,166, 166,178,178,166,166,178,166,166, 166,166,166,166,166,166,166,166, 166,166,166,0,0,0,166,166,\n   0,178,178,178,178,178,178,178, 178,178,178,178,178,0,178,178, 166,166,0,166,166,166,166,166, 166,166,166,166,166,166,166,166,\n   166,166,166,166,166,166,166,166, 166,166,166,166,166,166,166,166, 166,166,166,166,166,166,166,166, 166,166,166,166,166,166,0,166,\n   166,166,166,166,166,166,166,166, 166,166,166,166,166,166,0,166, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   },\n  {0,0,0,0,0,0,0,0, 0,180,180,0,0,180,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180,\n   180,180,180,180,180,180,126,180, 180,180,180,180,180,180,180,180, 180,180,126,180,180,180,180,180, 180,180,180,180,180,180,180,180,\n   180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,0,\n   176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176, 176,176,176,0,0,0,176,176,\n   0,176,176,176,176,176,176,176, 176,176,176,176,176,0,176,176, 176,176,0,176,176,176,176,176, 176,176,176,176,176,176,176,176,\n   176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176, 176,176,176,176,176,176,0,176,\n   176,176,176,176,176,176,176,176, 176,176,176,176,176,176,0,176, 176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176,\n   },\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   132,0,132,132,132,132,132,132, 130,130,130,130,130,130,130,130, 134,0,134,134,134,134,134,134, 130,130,130,130,130,130,130,130,\n   136,0,134,134,134,134,134,134, 130,130,130,130,130,130,130,130, 136,0,134,134,134,134,134,134, 130,130,130,130,130,130,130,130,\n   134,0,134,136,134,134,136,134, 130,130,130,130,130,130,130,130, 136,0,134,134,134,134,134,134, 130,130,130,130,130,130,130,130,\n   136,0,134,134,134,134,134,134, 130,130,130,130,130,130,130,130, 134,0,134,136,134,134,136,134, 130,130,130,130,130,130,130,130,\n   },\n},\n\n{ // HTCHANAKYA (0.041M chars) [49]\n  {NULL, NULL, NULL, NULL},\n  142, 202, 68, 32, 133,\n    {173,0,0,0,173,173,173,173, 173,182,171,173,105,171,0,0, 0,173,173,0,173,173,173,173, 0,0,173,0,0,0,0,0,\n   181,182,182,182,181,182,182,182, 182,182,182,182,182,0,182,182, 182,182,182,182,182,182,182,0, 182,182,182,182,182,182,182,182,\n   182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182,\n   182,182,182,182,182,182,182,182, 182,182,182,182,182,182,0,181, 182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182,\n   169,0,0,0,169,169,169,169, 169,180,170,169,0,170,0,0, 0,169,169,0,169,169,169,169, 0,0,169,0,0,0,0,0,\n   0,180,180,180,179,180,180,180, 180,180,180,180,180,0,180,180, 169,169,169,169,169,169,169,0, 169,169,169,169,169,169,169,169,\n   169,169,169,169,169,169,169,169, 169,169,169,169,169,169,169,169, 169,169,169,169,169,169,169,169, 169,169,169,169,169,169,169,169,\n   169,169,169,169,169,169,169,169, 169,169,169,169,169,169,0,168, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180,\n   },\n  {0,0,0,0,0,0,0,0, 0,181,181,0,0,181,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,181,129,181,181,181,181,181, 181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,181,\n   181,181,181,181,181,181,181,181, 181,181,181,129,181,181,181,181, 181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,181,\n   181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,0,\n   176,0,0,0,176,176,176,176, 176,176,0,176,0,0,0,0, 0,176,176,0,176,176,176,176, 0,0,176,0,0,0,0,0,\n   175,176,176,176,176,176,176,176, 176,176,176,176,176,0,176,176, 176,176,176,176,176,176,176,0, 176,176,176,176,176,176,176,176,\n   176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176,\n   176,176,176,176,176,176,176,176, 176,176,176,176,176,176,0,176, 176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176,\n   },\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   130,0,128,130,128,130,130,128, 128,128,128,128,128,128,128,128, 134,0,134,134,134,134,134,134, 132,132,132,132,132,132,132,132,\n   134,0,134,134,134,134,134,134, 132,132,132,132,132,132,132,132, 134,0,134,134,134,134,134,134, 132,132,132,132,132,132,132,132,\n   134,0,134,134,134,134,134,134, 132,132,132,132,132,132,132,132, 134,0,134,134,134,134,134,134, 132,132,132,132,132,132,132,132,\n   134,0,134,134,134,134,134,134, 132,132,132,132,132,132,132,132, 134,0,134,134,134,134,134,134, 132,132,132,132,132,132,132,132,\n   },\n},\n\n{ // TSCII (0.047M chars) [50]\n  {NULL, NULL, NULL, NULL},\n  141, 199, 66, 33, 134,\n    {173,173,173,173,173,173,173,173, 173,182,182,173,173,182,173,173, 173,173,173,173,173,173,173,173, 173,173,173,173,173,173,0,173,\n   0,181,181,181,181,181,157,157, 157,181,0,181,181,181,181,181, 181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,181,\n   181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,181,\n   181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,0,\n   167,167,167,167,167,167,167,167, 167,179,179,167,167,167,167,167, 167,167,175,168,170,167,167,167, 167,167,167,167,167,167,0,167,\n   0,178,178,178,178,178,0,0, 0,183,0,178,178,178,178,178, 167,167,167,167,167,167,167,167, 167,167,167,167,167,167,167,167,\n   167,167,167,167,167,167,167,167, 167,167,167,167,167,167,167,167, 167,167,167,167,167,167,167,167, 167,167,167,167,167,167,167,167,\n   167,167,167,167,167,167,167,167, 167,167,167,167,167,167,167,167, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,179,179,0,0,125,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   170,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179,\n   179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179,\n   179,180,179,179,179,180,179,179, 179,180,179,179,179,179,179,179, 179,179,179,182,179,179,179,179, 179,179,179,179,179,179,179,0,\n   175,175,175,175,175,175,175,175, 175,175,175,175,175,175,175,175, 175,175,175,175,175,175,175,175, 175,175,175,175,175,175,0,175,\n   0,175,175,175,175,175,0,0, 0,175,0,175,175,175,175,175, 175,175,175,175,175,175,175,175, 175,175,175,175,175,175,175,175,\n   175,175,175,175,175,175,175,175, 175,175,175,175,175,175,175,175, 175,175,175,175,175,175,175,175, 175,175,175,175,175,175,175,175,\n   175,175,175,175,175,175,175,175, 175,175,175,175,175,175,175,175, 175,175,175,175,175,175,175,175, 175,175,175,175,175,175,175,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   132,0,132,132,132,132,132,132, 128,128,130,128,128,128,128,128, 132,0,134,132,132,132,134,136, 130,130,132,130,130,130,130,130,\n   134,0,136,134,134,134,134,134, 132,130,130,132,132,130,130,130, 134,0,134,134,134,134,134,134, 130,130,132,130,130,130,130,130,\n   134,0,134,134,134,134,134,134, 130,130,132,130,130,130,130,130, 134,0,134,134,134,134,134,134, 130,130,132,130,130,130,130,130,\n   134,0,134,134,134,134,134,134, 130,130,132,130,130,130,130,130, 134,0,134,134,134,134,134,134, 130,130,132,130,130,130,130,130,\n   },\n},\n\n{ // TAM (0.036M chars) [51]\n  {NULL, NULL, NULL, NULL},\n  140, 203, 70, 33, 133,\n    {0,0,174,174,174,174,174,174, 174,184,184,174,174,174,0,0, 0,0,0,0,0,0,0,0, 174,174,174,174,174,0,0,174,\n   0,183,183,183,183,0,183,183, 183,0,161,161,161,0,183,183, 183,183,183,183,183,183,183,0, 183,183,183,183,183,183,183,183,\n   183,183,183,183,183,183,183,183, 183,183,0,183,183,183,183,183, 0,0,0,0,0,0,183,183, 183,183,183,183,183,183,183,183,\n   183,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,183,\n   0,0,170,170,170,170,170,170, 170,181,181,170,170,0,0,0, 0,0,0,0,0,0,0,0, 170,170,170,170,170,0,0,170,\n   0,181,181,181,181,0,181,181, 181,0,0,0,0,0,181,181, 170,170,170,170,170,170,170,0, 170,170,170,170,170,170,170,170,\n   170,170,170,170,170,170,170,170, 170,170,0,170,170,170,170,170, 0,0,0,0,0,0,170,170, 170,170,170,170,170,170,170,170,\n   170,170,170,170,170,170,170,170, 170,170,170,170,170,170,170,170, 181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,181,\n   },\n  {0,0,0,0,0,0,0,0, 0,182,182,0,0,132,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182,\n   182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182, 182,182,182,132,132,132,132,132,\n   132,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182, 182,182,182,182,182,182,182,182, 182,182,182,132,132,132,132,0,\n   0,0,177,177,177,177,177,177, 177,177,177,177,177,0,0,0, 0,0,0,0,0,0,0,0, 177,177,177,177,177,0,0,177,\n   0,177,177,177,177,0,177,177, 177,0,0,0,0,0,177,177, 177,177,177,177,177,177,177,0, 177,177,177,177,177,177,177,177,\n   177,177,177,177,177,177,177,177, 177,177,0,177,177,177,177,177, 0,0,0,0,0,0,177,177, 177,177,177,177,177,177,177,177,\n   177,177,177,177,177,177,177,177, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,177,177,\n   },\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   132,0,132,132,132,132,132,132, 130,130,130,128,128,128,128,128, 134,0,136,136,136,134,136,134, 132,132,132,134,134,132,132,132,\n   134,0,134,134,134,134,134,134, 132,132,132,132,132,132,134,134, 134,0,134,134,134,134,134,134, 132,134,132,132,132,132,132,132,\n   134,0,134,134,134,134,134,134, 132,134,132,132,132,132,132,132, 134,0,134,134,134,134,134,134, 132,132,134,132,132,132,132,132,\n   134,0,134,134,134,134,134,134, 132,134,132,132,132,132,132,132, 134,0,134,134,134,134,134,134, 132,134,132,132,132,132,132,132,\n   },\n},\n\n{ // TAB (0.030M chars) [52]\n  {NULL, NULL, NULL, NULL},\n  137, 210, 72, 28, 132,\n    {0,0,0,0,0,0,0,0, 0,174,174,0,0,174,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,183,183,183,0,183,183, 183,0,165,165,165,0,183,183, 183,183,183,183,183,183,183,0, 183,183,183,183,183,183,183,183,\n   183,183,183,183,183,183,183,183, 183,183,0,183,183,183,183,183, 0,0,0,0,0,0,183,0, 0,0,0,183,183,183,183,183,\n   183,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,183,\n   0,0,0,0,0,0,0,0, 0,174,174,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,186,186,186,0,186,186, 186,0,0,0,0,0,186,186, 177,177,177,177,177,177,177,0, 177,177,177,177,177,177,177,177,\n   177,177,177,177,177,177,177,177, 177,177,0,177,177,177,177,177, 0,0,0,0,0,0,177,0, 0,0,0,177,177,177,177,177,\n   177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177, 186,186,186,186,186,186,186,186, 186,186,186,186,186,186,186,186,\n   },\n  {0,0,0,0,0,0,0,0, 0,183,183,0,0,136,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,183,\n   183,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,183,\n   183,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,183, 183,183,183,183,183,183,183,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,176,176,176,0,176,176, 176,0,0,0,0,0,176,176, 176,176,176,176,176,176,176,0, 176,176,176,176,176,176,176,176,\n   176,176,176,176,176,176,176,176, 176,176,0,176,176,176,176,176, 0,0,0,0,0,0,176,0, 0,0,0,176,176,176,176,176,\n   176,176,176,176,176,176,176,176, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,176,176,\n   },\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 128,128,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,0,0,0,0, 2,0,2,2,2,2,2,2, 128,128,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 128,128,2,2,2,2,2,2, 128,0,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   132,0,132,134,134,134,134,132, 128,128,134,134,134,134,138,138, 132,0,132,132,132,132,132,132, 128,128,136,136,136,136,136,136,\n   132,0,132,132,132,132,132,132, 128,128,136,136,136,136,136,136, 132,0,134,134,134,134,134,134, 128,128,136,136,136,136,136,136,\n   132,0,132,134,134,134,134,132, 128,128,136,136,136,136,136,136, 132,0,132,134,134,134,134,132, 128,128,136,136,136,136,136,136,\n   },\n},\n\n{ // EUC-CN (0.035M chars) [53]\n  {NULL, NULL, NULL, NULL},\n  197, 192, 37, 32, 128,\n    {0,0,0,0,0,0,0,0, 0,169,169,0,0,169,119,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,240,216,176,191,186,168,185, 184,166,0,0,118,0,0,0, 0,103,0,0,0,0,29,0, 0,0,0,0,0,0,0,0,\n   0,0,169,0,197,197,190,192, 190,212,188,187,188,186,190,188, 187,186,186,185,184,186,187,187, 185,185,186,185,193,186,186,190,\n   185,185,185,187,189,185,186,191, 185,185,185,184,186,185,184,184, 185,184,184,184,184,184,184,184, 186,184,184,184,184,173,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,147,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,134,134,0,0,134,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,134,134,134,134,134,134,134, 134,134,134,134,134,134,134,134, 134,134,134,134,134,134,134,134, 134,134,134,134,134,134,134,134,\n   134,134,134,134,138,134,138,134, 134,138,134,134,138,134,134,134, 134,134,134,134,138,138,134,134, 134,134,134,134,134,134,134,134,\n   134,134,134,134,134,134,134,134, 134,134,134,134,138,134,134,134, 134,134,134,134,134,134,134,134, 134,134,134,134,134,134,134,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   170,230,193,197,184,184,184,184, 210,184,185,182,188,181,181,185, 183,207,189,182,181,182,181,180, 181,181,182,185,181,179,187,187,\n   183,180,180,181,182,180,186,180, 180,185,195,191,183,180,182,180, 179,182,189,183,182,180,192,195, 179,179,181,182,181,179,183,183,\n   180,180,178,184,182,198,195,192, 180,183,186,180,180,183,181,181, 183,179,180,189,179,179,178,178, 182,179,212,180,186,180,211,0,\n   },\n  {182,0,182,182,180,182,182,182, 128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 128,128,2,10,14,14,12,8, 76,0,52,52,50,52,52,52, 128,128,128,128,128,128,128,128,\n   4,0,2,2,2,2,2,2, 128,128,128,128,128,128,128,128, 8,0,2,2,2,2,2,2, 128,128,128,128,128,128,128,128,\n   8,0,2,2,2,2,2,2, 128,128,128,128,128,128,128,128, 12,0,2,2,2,2,2,2, 128,128,128,128,128,128,128,128,\n   0,0,0,0,0,0,0,0, 0,0,76,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,134,124,114,118,122,124, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,116,126,130,128,126,136, 0,0,0,0,0,0,0,0, 0,0,116,128,136,132,134,124,\n   0,0,0,0,0,0,0,0, 0,0,118,130,132,134,130,124, 0,0,0,0,0,0,0,0, 0,0,118,130,132,134,130,126,\n   },\n},\n\n{ // EUC (15478 chars) [54]\n  {NULL, NULL, NULL, NULL},\n  197, 200, 38, 33, 129,\n    {0,0,0,0,0,0,0,0, 0,173,173,0,0,173,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,234,211,180,190,188,173,189, 189,170,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,174,0,193,195,190,191, 191,208,190,189,190,189,191,190, 190,189,190,189,189,190,189,190, 189,189,190,189,193,189,190,191,\n   189,189,189,190,191,190,190,193, 189,190,189,189,190,189,189,189, 189,189,189,189,189,189,189,189, 190,189,189,189,189,178,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,140,140,0,0,140,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140,\n   140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140,\n   140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   162,226,192,195,186,186,185,186, 205,186,187,185,188,185,185,186, 184,202,187,184,184,184,183,183, 184,184,184,185,183,183,187,187,\n   183,183,183,183,184,183,186,183, 183,185,192,189,184,183,184,183, 182,184,187,184,183,182,190,192, 182,182,182,183,184,182,184,184,\n   182,182,182,185,184,194,191,190, 183,184,185,183,183,184,183,183, 184,182,182,188,182,182,182,182, 184,182,206,183,185,182,206,0,\n   },\n  {176,0,176,176,176,176,176,176, 128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 128,128,128,128,128,128,128,128, 128,0,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   2,0,2,2,2,2,2,2, 128,128,128,128,128,128,128,128, 2,0,2,2,2,2,2,2, 128,128,128,128,128,128,128,128,\n   2,0,2,2,2,2,2,2, 128,128,128,128,128,128,128,128, 2,0,2,2,2,2,2,2, 128,128,128,128,128,128,128,128,\n   0,0,0,0,0,0,0,0, 0,0,2,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,136,124,116,118,122,124, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,118,126,128,128,128,136, 0,0,0,0,0,0,0,0, 0,0,118,128,132,130,130,126,\n   0,0,0,0,0,0,0,0, 0,0,120,128,130,132,130,126, 0,0,0,0,0,0,0,0, 0,0,120,130,130,130,130,126,\n   },\n},\n\n{ // CNS (15478 chars) [55]\n  {NULL, NULL, NULL, NULL},\n  197, 200, 38, 33, 129,\n    {0,0,0,0,0,0,0,0, 0,173,173,0,0,173,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,234,211,180,190,188,173,189, 189,170,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,174,0,193,195,190,191, 191,208,190,189,190,189,191,190, 190,189,190,189,189,190,189,190, 189,189,190,189,193,189,190,191,\n   189,189,189,190,191,190,190,193, 189,190,189,189,190,189,189,189, 189,189,189,189,189,189,189,189, 190,189,189,189,189,178,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,140,140,0,0,140,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140,\n   140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140,\n   140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,140, 140,140,140,140,140,140,140,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   162,226,192,195,186,186,185,186, 205,186,187,185,188,185,185,186, 184,202,187,184,184,184,183,183, 184,184,184,185,183,183,187,187,\n   183,183,183,183,184,183,186,183, 183,185,192,189,184,183,184,183, 182,184,187,184,183,182,190,192, 182,182,182,183,184,182,184,184,\n   182,182,182,185,184,194,191,190, 183,184,185,183,183,184,183,183, 184,182,182,188,182,182,182,182, 184,182,206,183,185,182,206,0,\n   },\n  {176,0,176,176,176,176,176,176, 128,128,128,128,128,128,128,128, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 128,128,128,128,128,128,128,128, 128,0,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   2,0,2,2,2,2,2,2, 128,128,128,128,128,128,128,128, 2,0,2,2,2,2,2,2, 128,128,128,128,128,128,128,128,\n   2,0,2,2,2,2,2,2, 128,128,128,128,128,128,128,128, 2,0,2,2,2,2,2,2, 128,128,128,128,128,128,128,128,\n   0,0,0,0,0,0,0,0, 0,0,2,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,136,124,116,118,122,124, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,118,126,128,128,128,136, 0,0,0,0,0,0,0,0, 0,0,118,128,132,130,130,126,\n   0,0,0,0,0,0,0,0, 0,0,120,128,130,132,130,126, 0,0,0,0,0,0,0,0, 0,0,120,130,130,130,130,126,\n   },\n},\n\n{ // UTF-32BE (1032.458M chars) [56]\n  {NULL, NULL, NULL, NULL},\n  77, 151, 56, 41, 127,\n    {250,137,119,116,158,116,151,92, 103,89,82,111,111,75,204,151, 102,106,71,86,94,92,104,91, 88,92,106,215,97,93,99,106,\n   79,97,116,106,115,126,78,66, 89,96,94,80,79,92,90,90, 93,101,90,90,72,96,79,91, 82,89,78,88,80,99,84,86,\n   86,92,83,59,101,100,101,79, 89,93,71,46,102,89,64,68, 78,74,72,65,71,56,71,64, 76,84,65,68,92,98,94,106,\n   182,177,181,215,194,207,203,198, 193,188,166,179,184,171,90,183, 67,2,0,27,20,10,16,20, 7,0,3,46,24,71,43,104,\n   160,104,104,120,120,123,106,99, 106,101,107,114,119,100,91,96, 110,88,107,102,79,91,100,101, 99,92,100,94,88,67,104,92,\n   68,80,83,73,92,62,75,75, 79,64,69,73,88,82,78,88, 92,73,82,84,71,76,74,82, 84,98,91,76,78,66,71,80,\n   78,89,78,91,66,88,86,94, 97,83,76,79,62,78,71,75, 80,86,62,78,68,93,85,80, 83,80,76,75,69,83,90,83,\n   82,82,61,78,58,98,56,64, 68,80,85,85,74,85,73,74, 60,46,58,83,68,31,72,64, 71,62,78,78,88,72,62,103,\n   },\n  {231,96,83,86,82,95,79,87, 91,190,189,71,101,175,87,75, 88,93,82,83,89,84,75,84, 89,98,94,150,95,84,82,97,\n   211,164,198,158,206,163,163,167, 204,160,139,149,163,176,181,194, 186,180,173,172,169,172,164,166, 171,171,175,177,193,193,193,164,\n   169,173,164,169,169,167,165,166, 164,164,153,153,160,162,163,160, 163,145,162,165,167,153,156,157, 144,147,146,140,138,138,110,171,\n   103,201,181,192,192,203,181,185, 187,200,161,171,196,187,196,196, 190,145,197,197,203,183,178,178, 170,174,157,147,130,147,113,85,\n   194,202,196,197,161,172,160,164, 174,168,169,165,163,162,161,172, 167,152,151,154,172,173,173,172, 170,167,172,172,181,172,158,158,\n   158,165,152,155,174,160,165,166, 161,156,155,157,154,167,173,166, 170,159,161,164,160,162,155,162, 190,174,180,181,186,173,165,168,\n   96,98,83,90,99,87,83,90, 91,88,75,80,102,90,78,81, 99,97,81,86,97,102,86,85, 95,107,84,92,106,96,96,92,\n   105,120,91,98,114,104,86,102, 104,125,102,72,80,118,81,79, 79,91,70,110,91,83,108,69, 93,74,94,86,107,97,65,124,\n   },\n  {132,132,126,132,132,132,132,132, 122,128,140,130,230,224,222,224, 60,24,152,14,68,74,40,40, 104,122,122,98,204,218,206,224,\n   8,96,12,22,38,48,10,20, 44,64,80,56,128,128,128,128, 20,128,26,34,56,70,22,32, 40,58,72,50,128,128,128,128,\n   20,128,24,34,54,66,22,32, 38,56,70,50,128,128,128,128, 26,128,30,40,62,74,28,38, 40,60,76,52,128,128,128,128,\n   2,2,2,2,2,2,2,2, 42,62,78,54,128,128,128,128, 134,180,74,128,144,158,114,92, 116,128,122,78,150,192,132,164,\n   118,142,64,114,106,120,82,106, 14,12,26,10,92,80,68,72, 138,192,94,128,132,154,112,108, 34,52,40,14,124,118,102,106,\n   142,188,72,144,148,176,108,110, 156,152,90,112,202,162,200,174, 142,200,86,138,146,162,110,118, 156,146,132,106,208,200,212,192,\n   142,208,88,138,138,162,96,118, 154,152,138,122,208,212,182,178, 138,180,68,144,148,178,114,122, 154,162,112,112,184,192,158,168,\n   140,128,102,142,150,172,108,116, 148,148,148,148,20,14,4,12, 136,196,112,138,136,176,110,118, 132,148,136,112,148,160,162,150,\n   },\n},\n\n{ // UTF-32LE (1032.461M chars) [57]\n  {NULL, NULL, NULL, NULL},\n  77, 152, 56, 41, 127,\n    {250,137,119,116,158,116,151,92, 103,89,82,111,111,75,204,150, 102,106,71,86,94,92,104,91, 88,92,106,215,97,93,99,106,\n   79,97,116,106,114,126,78,66, 89,96,94,144,79,92,90,90, 93,101,90,90,72,96,79,91, 80,89,78,88,80,99,84,86,\n   86,92,83,58,101,100,101,79, 89,93,71,46,102,89,64,68, 78,74,72,65,71,54,71,64, 76,84,65,68,92,98,94,106,\n   182,177,181,215,193,207,203,198, 193,188,166,178,184,171,90,183, 67,3,0,27,20,11,17,20, 8,0,4,46,24,71,162,104,\n   160,104,104,120,120,123,106,99, 106,101,107,114,118,100,91,94, 110,88,107,102,79,91,100,101, 99,92,100,94,88,67,104,92,\n   68,80,83,73,92,62,75,75, 79,64,71,124,88,82,78,88, 92,73,82,84,71,76,74,82, 84,98,91,76,78,66,71,80,\n   78,89,78,91,66,88,86,94, 97,83,76,79,62,78,71,75, 80,86,62,78,68,93,85,80, 83,80,76,75,69,83,90,83,\n   82,82,61,78,57,98,57,64, 68,80,85,85,74,85,73,74, 60,46,57,83,68,31,72,64, 71,62,78,78,88,72,122,103,\n   },\n  {231,96,83,86,82,95,79,87, 91,190,189,71,101,175,87,75, 88,93,82,83,89,84,75,84, 88,98,94,158,95,84,82,97,\n   211,164,198,159,206,163,163,167, 204,160,139,149,163,176,181,194, 186,180,174,172,169,172,165,166, 171,171,175,177,193,193,193,164,\n   169,173,164,169,169,167,165,166, 164,164,155,154,161,163,165,160, 163,145,162,165,167,154,157,157, 144,147,146,140,138,138,110,171,\n   103,201,181,192,192,203,181,185, 187,200,161,171,196,187,196,196, 190,145,197,197,203,183,178,177, 170,174,157,147,130,147,131,85,\n   193,202,196,197,161,172,160,164, 174,168,169,165,163,162,161,172, 167,152,151,154,172,173,173,172, 170,167,172,172,181,172,158,158,\n   158,165,152,155,174,160,165,166, 161,155,155,157,154,167,173,166, 170,159,161,164,160,162,155,162, 190,174,180,181,186,173,165,168,\n   99,99,87,92,100,90,85,93, 93,89,79,83,102,91,81,82, 101,97,82,87,97,102,87,86, 95,107,84,92,106,96,96,92,\n   105,120,93,102,115,107,92,103, 105,125,103,77,82,118,81,84, 79,91,70,110,91,83,107,69, 93,74,94,86,107,97,65,124,\n   },\n  {132,124,126,132,132,132,132,132, 122,128,140,130,228,224,222,224, 60,14,152,16,66,74,40,40, 104,122,122,98,204,218,206,224,\n   44,212,2,12,34,104,44,134, 116,112,144,150,220,208,220,130, 20,116,26,34,56,70,22,32, 40,58,72,50,128,128,128,128,\n   20,104,24,34,54,66,22,32, 38,56,70,50,128,128,128,128, 26,114,30,40,60,74,28,38, 42,60,76,52,128,128,128,128,\n   2,2,2,2,2,2,2,2, 44,62,78,54,128,128,128,128, 84,190,114,148,160,156,70,62, 116,118,160,144,212,200,222,166,\n   118,134,64,114,106,120,82,106, 14,12,26,8,90,80,66,72, 138,168,94,128,130,154,112,108, 34,52,40,14,122,116,100,106,\n   130,162,60,130,122,146,98,100, 146,140,78,102,202,162,172,162, 142,200,86,138,144,162,110,118, 158,146,132,106,208,200,212,192,\n   142,208,88,138,136,162,96,118, 154,152,138,122,208,212,182,176, 138,180,68,144,148,178,114,122, 156,162,112,112,182,192,156,168,\n   140,128,102,142,150,172,108,116, 148,148,148,148,18,14,4,12, 124,168,100,124,114,154,98,106, 76,90,78,54,122,120,108,108,\n   },\n},\n\n{ // X-BINARYENC (0 chars) [58]\n  {NULL, NULL, NULL, NULL},\n  0, 0, 0, 0, 255,\n    {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   },\n},\n\n{ // X-UTF8UTF8 (43.271M chars) [59]\n  {NULL, NULL, NULL, NULL},\n  150, 194, 32, 13, 129,\n    {191,104,167,173,203,123,113,0, 0,69,69,80,0,107,0,105, 95,0,125,146,116,0,0,0, 104,129,184,0,125,122,159,0,\n   139,144,162,111,112,105,148,117, 115,101,122,104,217,112,130,114, 151,116,107,120,116,116,98,89, 124,119,136,113,115,116,126,105,\n   0,0,239,243,62,181,145,62, 62,62,62,147,62,62,62,62, 62,62,62,62,62,62,62,62, 62,62,62,62,62,62,62,62,\n   0,0,220,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,58,0,0,0,0,5,0, 0,0,36,0,102,23,86,28, 9,0,75,142,74,0,0,0, 89,85,64,0,119,139,99,0,\n   121,119,159,71,88,75,139,88, 67,69,78,82,156,71,75,61, 134,70,55,54,61,63,56,60, 80,102,119,63,76,71,134,73,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,24,140,0,0,147,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   195,107,138,80,100,83,158,123, 107,139,106,91,157,127,159,122, 111,135,127,120,115,117,108,109, 106,109,120,113,182,78,121,111,\n   84,149,138,143,143,145,133,136, 138,145,127,129,143,142,149,143, 141,113,143,148,151,137,137,140, 124,119,115,112,96,117,97,106,\n   108,137,132,140,136,131,138,130, 131,133,119,128,140,133,137,128, 135,113,137,152,143,136,130,123, 116,108,106,112,84,77,91,0,\n   196,150,226,235,119,165,141,52, 52,52,52,115,52,142,52,124, 121,52,147,165,107,52,52,52, 97,124,126,52,187,166,117,52,\n   216,191,222,181,200,177,168,187, 191,218,177,170,169,189,169,153, 169,175,160,194,171,165,189,171, 182,163,176,175,198,160,155,150,\n   0,0,205,182,0,189,133,0, 0,0,0,163,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,0,209,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   12,0,2,2,2,2,2,2, 0,0,0,0,2,128,2,128, 66,0,20,36,40,48,50,54, 0,0,0,0,2,128,2,128,\n   2,0,2,2,2,2,2,2, 0,0,0,0,128,128,128,128, 128,0,84,128,128,128,128,128, 0,0,0,0,128,128,128,128,\n   10,0,2,2,2,2,2,2, 0,0,0,0,128,128,128,128, 128,0,128,128,128,128,128,128, 0,0,0,0,128,128,128,128,\n   120,0,130,112,192,198,136,140, 2,168,134,98,134,128,124,128, 160,0,168,162,178,176,178,178, 2,2,2,2,170,128,2,128,\n   178,0,174,178,150,154,158,156, 2,2,2,2,158,128,164,128, 156,0,162,152,182,182,182,184, 2,26,2,2,170,128,10,128,\n   0,0,128,128,128,128,128,128, 128,108,130,130,2,128,2,128, 0,0,128,128,128,128,128,128, 120,210,124,154,74,128,70,128,\n   0,0,128,128,128,128,128,128, 140,2,2,2,2,128,2,128, 0,0,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   },\n},\n\n{ // X-TAM-ELANGO (0.036M chars) [60]\n  {NULL, NULL, NULL, NULL},\n  126, 180, 58, 30, 129,\n    {0,180,180,180,180,180,180,180, 180,191,191,180,180,191,0,180, 170,170,170,170,170,170,170,170, 170,170,170,170,170,170,0,170,\n   0,180,180,180,180,180,180,180, 180,180,180,180,0,0,180,0, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180,\n   180,180,180,180,180,180,0,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,0,0,180,180,\n   180,0,180,180,0,0,0,0, 0,0,0,0,180,0,180,180, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,181,181,181,181,181,181,181, 181,191,191,181,181,191,0,181, 171,171,171,171,171,171,171,171, 171,171,171,171,171,171,0,171,\n   0,181,181,181,181,181,181,181, 181,181,181,181,0,0,181,0, 181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,181,\n   181,181,181,181,181,181,0,181, 181,181,181,181,181,181,181,181, 181,181,181,181,181,181,181,181, 181,181,181,181,0,0,181,181,\n   181,0,181,181,0,0,0,0, 0,0,0,0,181,0,181,181, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {0,0,0,0,0,0,0,0, 0,180,180,0,0,180,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180,\n   180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180,\n   180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,0,\n   0,180,180,180,180,180,180,180, 180,180,180,180,180,180,0,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,0,180,\n   0,180,180,180,180,180,180,180, 180,180,180,180,0,0,180,0, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180,\n   180,180,180,180,180,180,0,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,0,0,180,180,\n   180,0,180,180,0,0,0,0, 0,0,0,0,180,0,180,180, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   },\n  {110,0,110,110,110,110,110,110, 110,110,110,110,110,110,110,128, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,128, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,128,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,128, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,128,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,128, 128,0,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   132,0,132,132,132,132,132,132, 132,132,132,132,132,132,132,128, 136,0,134,134,134,134,134,134, 136,136,136,136,136,136,136,128,\n   136,0,136,136,136,136,136,136, 136,136,136,136,136,136,136,128, 136,0,134,134,134,134,134,134, 136,136,136,136,136,136,136,128,\n   136,0,134,134,134,134,134,134, 136,136,136,136,136,136,136,128, 136,0,134,134,134,134,134,134, 136,136,136,136,136,136,136,128,\n   136,0,136,136,136,136,136,136, 136,136,136,136,136,136,136,128, 128,0,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   },\n},\n\n{ // X-TAM-LTTMBARANI (0.043M chars) [61]\n  {NULL, NULL, NULL, NULL},\n  141, 199, 69, 34, 128,\n    {0,178,178,0,178,0,178,178, 0,187,187,178,178,176,0,0, 0,0,0,0,0,168,0,0, 0,0,168,168,168,0,0,168,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   0,176,176,0,176,0,176,176, 0,187,187,176,176,178,0,0, 0,0,0,0,0,165,0,0, 0,0,165,165,165,0,0,165,\n   0,176,176,176,176,176,177,176, 176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,182, 176,176,176,176,176,176,176,176,\n   176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176, 176,176,176,176,176,177,176,176,\n   176,176,176,176,176,176,176,176, 176,176,176,176,176,176,176,176, 181,176,176,176,176,176,176,176, 176,176,176,176,176,189,176,176,\n   },\n  {0,0,0,0,0,0,0,0, 0,178,177,0,0,177,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   185,177,177,177,177,177,178,177, 177,177,177,177,178,177,178,177, 177,177,177,177,177,177,177,177, 177,177,177,177,180,177,177,177,\n   177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177,\n   177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,0,\n   0,178,178,0,178,0,178,178, 0,178,178,178,178,0,0,0, 0,0,0,0,0,178,0,0, 0,0,178,178,178,0,0,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,179, 179,178,178,178,178,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   },\n  {116,0,114,116,116,116,116,116, 118,118,116,118,118,118,118,118, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   134,0,132,134,134,134,134,134, 132,132,132,132,132,132,132,132, 138,0,136,138,138,138,138,138, 136,136,136,136,136,136,136,136,\n   138,0,138,138,138,138,138,138, 136,136,136,136,136,136,136,136, 138,0,138,138,138,138,138,138, 136,136,136,136,136,136,136,136,\n   138,0,136,138,138,138,138,138, 136,136,136,136,136,136,136,136, 138,0,138,138,138,138,138,138, 136,136,136,136,136,136,136,136,\n   138,0,136,138,138,138,138,138, 136,136,136,136,136,136,136,136, 136,0,142,138,136,136,136,136, 136,136,136,136,136,136,136,136,\n   },\n},\n\n{ // X-TAM-SHREE (0.037M chars) [62]\n  {NULL, NULL, NULL, NULL},\n  140, 204, 70, 30, 129,\n    {0,0,0,0,0,0,0,0, 0,188,179,0,0,179,0,0, 0,168,0,0,0,168,0,0, 0,0,0,168,0,0,0,168,\n   0,178,178,178,178,178,178,178, 178,178,178,178,0,0,178,178, 178,178,178,178,178,178,0,0, 178,178,178,178,178,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,0,178,\n   0,0,0,0,0,0,0,0, 0,188,178,0,0,178,0,0, 0,169,0,0,0,169,0,0, 0,0,0,169,0,0,0,169,\n   0,179,179,179,179,179,179,179, 179,179,179,179,0,0,179,179, 179,179,179,179,179,179,0,0, 179,179,179,179,179,179,179,179,\n   179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179,\n   179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,0,179,\n   },\n  {0,0,0,0,0,0,0,0, 0,179,179,0,0,179,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179,\n   179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179,\n   179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,0,\n   0,0,0,0,0,0,0,0, 0,179,0,0,0,0,0,0, 0,179,0,0,0,179,0,0, 0,0,0,179,0,0,0,179,\n   0,179,179,179,179,179,179,179, 179,179,179,179,0,0,179,179, 179,179,179,179,179,179,0,0, 179,179,179,179,179,179,179,179,\n   179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179,\n   179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,0,179,\n   },\n  {132,0,132,132,132,132,132,132, 134,134,132,132,132,132,132,132, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   118,0,118,118,118,118,118,118, 118,118,118,118,118,118,118,118, 136,0,136,138,138,138,138,136, 138,138,138,138,138,138,138,138,\n   136,0,136,136,136,136,136,136, 138,138,138,138,138,138,138,138, 136,0,136,136,136,136,136,136, 138,138,138,138,138,138,138,138,\n   136,0,136,136,136,136,136,136, 138,138,138,138,138,138,138,138, 136,0,136,136,136,136,136,136, 138,138,138,138,138,138,138,138,\n   136,0,136,136,136,136,136,136, 138,138,138,138,138,138,138,138, 136,0,136,136,136,136,136,136, 138,138,138,138,138,138,138,138,\n   },\n},\n\n{ // X-TAM-TBOOMIS (0.038M chars) [63]\n  {NULL, NULL, NULL, NULL},\n  139, 205, 71, 31, 129,\n    {178,0,0,0,0,0,0,0, 0,178,178,0,0,178,0,0, 0,0,0,168,168,0,0,0, 0,0,0,0,0,0,0,0,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   178,0,0,0,0,0,0,0, 0,178,178,0,0,178,0,0, 0,0,0,168,168,0,0,0, 0,0,0,0,0,0,0,0,\n   0,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   178,178,178,178,178,200,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 179,178,178,178,181,190,178,188,\n   },\n  {0,0,0,0,0,0,0,0, 0,178,178,0,0,178,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   200,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,180,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,177,\n   178,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,178,178,0,0,0, 0,0,0,0,0,0,0,0,\n   177,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   },\n  {134,0,130,132,132,132,132,132, 132,132,132,132,132,132,132,132, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 94,94,94,94,94,94,94,94,\n   118,0,114,116,116,116,116,118, 116,116,118,116,116,116,116,116, 138,0,134,136,136,136,136,138, 136,136,138,136,136,136,136,136,\n   138,0,134,136,136,136,136,136, 136,136,138,136,136,136,136,136, 138,0,134,136,136,136,136,138, 136,136,138,136,136,136,136,136,\n   138,0,134,136,136,136,136,138, 136,136,138,136,136,136,136,136, 138,0,134,136,136,136,136,138, 136,136,138,136,136,136,136,136,\n   134,0,144,134,134,134,134,134, 136,136,138,136,136,136,136,136, 134,0,138,136,134,134,134,134, 136,136,138,136,136,136,136,136,\n   },\n},\n\n{ // X-TAM-TMNEWS (0.037M chars) [64]\n  {NULL, NULL, NULL, NULL},\n  141, 205, 71, 29, 128,\n    {0,0,0,0,0,0,0,0, 0,179,179,0,0,179,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179,\n   179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179,\n   179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179,\n   0,0,0,0,0,0,0,0, 0,179,179,0,0,179,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   0,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179,\n   179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179,\n   179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,190,179,180,181,179, 180,179,179,179,179,179,179,179,\n   },\n  {0,0,0,0,0,0,0,0, 0,179,179,0,0,179,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   180,179,180,179,179,179,179,179, 179,179,179,179,180,179,180,179, 179,179,179,179,179,179,179,179, 179,179,180,179,181,179,179,179,\n   179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179,\n   179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,179, 179,179,179,179,179,179,179,0,\n   0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   179,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180,\n   180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180,\n   180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180, 180,180,180,180,180,180,180,180,\n   },\n  {138,0,136,136,138,138,138,138, 128,128,136,136,136,136,136,136, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 128,128,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 128,128,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 128,128,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 128,128,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 128,128,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 128,128,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 128,128,2,2,2,2,2,2, 128,0,128,128,128,128,128,128, 128,128,128,128,128,128,128,128,\n   138,0,136,136,136,136,136,136, 128,128,136,136,136,136,136,136, 138,0,136,136,138,138,138,136, 128,128,136,136,136,136,136,136,\n   138,0,136,136,138,138,138,136, 128,128,136,136,136,136,136,136, 138,0,136,136,138,138,138,136, 128,128,136,136,136,136,136,136,\n   138,0,136,136,138,138,138,136, 128,128,136,136,136,136,136,136, 136,0,140,136,136,136,136,136, 128,128,136,136,136,136,136,136,\n   },\n},\n\n{ // X-TAM-WEBTAMIL (0.050M chars) [65]\n  {NULL, NULL, NULL, NULL},\n  142, 193, 66, 37, 129,\n    {178,178,178,178,178,178,178,178, 178,186,186,178,178,186,178,178, 169,169,169,169,169,169,0,169, 169,169,169,169,169,169,169,169,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,179, 178,178,178,178,178,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178, 178,178,178,178,178,178,178,178,\n   174,174,174,174,174,174,174,174, 174,186,186,174,174,186,174,174, 162,162,162,162,162,162,0,162, 162,162,162,162,162,162,162,162,\n   0,174,174,174,174,174,174,174, 174,174,174,174,174,174,174,174, 174,174,174,174,174,174,174,181, 174,174,174,174,174,174,174,174,\n   174,174,174,174,174,174,174,174, 174,174,174,174,174,174,174,174, 174,174,174,174,174,174,174,174, 174,174,174,174,174,174,174,174,\n   174,174,174,174,174,174,174,174, 174,174,174,174,174,174,174,174, 174,174,174,174,174,174,174,174, 174,174,174,174,174,174,174,174,\n   },\n  {0,0,0,0,0,0,0,0, 0,178,177,0,0,177,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   158,177,177,177,177,177,178,177, 177,177,177,177,177,177,178,177, 177,177,177,177,177,177,177,177, 177,177,177,177,179,177,177,177,\n   177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177,\n   177,177,177,177,177,177,177,177, 177,177,177,177,178,177,177,177, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,0,\n   177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,133,177, 177,177,177,177,177,177,177,177,\n   177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,178, 177,177,177,177,177,177,177,177,\n   177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177,\n   177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177, 177,177,177,177,177,177,177,177,\n   },\n  {108,0,108,108,108,108,108,108, 110,110,110,110,110,110,110,110, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,0,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n   134,0,134,134,134,134,134,134, 132,132,132,132,132,132,132,132, 138,0,138,138,138,138,138,138, 134,134,134,134,134,134,134,134,\n   138,0,138,138,138,138,138,138, 134,134,134,134,134,134,134,134, 138,0,138,138,138,138,138,138, 134,134,134,134,134,134,134,134,\n   138,0,138,138,138,138,138,138, 134,134,134,134,134,134,134,134, 138,0,138,138,138,138,138,138, 134,134,134,134,134,134,134,134,\n   138,0,138,138,138,138,138,138, 134,134,134,134,134,134,134,134, 138,0,138,138,138,138,138,138, 134,134,134,134,134,134,134,134,\n   },\n},\n\n{ // UTF8CP1252 (178.156M chars) [66]\n  {NULL, NULL, NULL, NULL},\n  127, 200, 59, 31, 133,\n    {181,189,183,184,176,167,163,162, 171,165,167,170,170,164,161,165, 163,161,165,161,164,166,165,166, 163,164,168,163,171,163,158,162,\n   206,174,166,168,175,173,174,175, 177,166,173,171,187,176,178,175, 178,168,166,174,175,166,165,168, 186,173,179,177,184,174,171,171,\n   119,121,206,216,183,183,147,141, 116,157,118,125,127,125,181,171, 210,198,125,120,113,136,145,187, 200,196,150,157,110,121,122,116,\n   177,173,191,209,190,201,198,198, 188,185,166,178,183,167,123,183, 120,134,134,122,116,132,155,115, 122,120,125,97,146,127,124,122,\n   186,143,146,128,162,163,140,136, 145,136,144,136,144,130,143,126, 134,159,199,183,181,182,183,161, 136,161,149,139,147,147,140,133,\n   194,145,152,160,146,142,140,152, 139,166,140,162,150,144,159,142, 165,141,142,133,158,130,129,165, 138,130,156,172,141,139,132,152,\n   146,177,150,157,188,159,153,165, 178,205,165,144,125,177,148,136, 125,164,126,181,156,148,180,118, 161,109,162,137,189,137,127,170,\n   196,183,151,159,189,172,153,166, 185,210,166,152,154,180,147,138, 133,164,153,186,156,147,178,152, 160,162,164,140,188,144,126,109,\n   },\n  {148,50,56,78,0,0,0,0, 0,146,153,0,0,166,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   225,137,174,103,110,121,177,155, 149,159,126,115,183,160,179,142, 162,172,165,154,151,151,144,143, 141,143,157,138,205,108,138,142,\n   124,187,176,189,179,184,170,182, 175,169,154,158,186,182,198,181, 175,156,199,194,193,169,173,155, 158,150,147,134,124,138,112,134,\n   122,193,181,189,179,191,172,183, 177,178,152,159,187,182,199,184, 175,153,200,203,195,176,174,143, 147,148,143,122,135,97,118,45,\n   189,193,197,200,179,177,173,171, 177,169,174,172,176,171,162,170, 167,165,159,165,169,171,167,170, 167,172,168,170,176,168,162,169,\n   201,180,183,168,179,169,167,182, 176,187,173,166,167,178,173,174, 182,177,171,180,173,177,171,169, 186,175,179,179,186,179,179,171,\n   129,129,169,152,124,152,130,133, 107,158,114,130,116,114,119,120, 120,118,126,120,107,124,147,116, 137,132,118,122,118,119,119,156,\n   174,145,176,207,186,198,193,190, 186,184,161,173,176,161,128,175, 133,123,125,123,107,155,137,103, 119,110,131,110,136,122,127,123,\n   },\n  {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n   2,0,2,2,2,2,2,2, 0,0,0,0,2,4,2,6, 2,0,2,2,2,2,2,2, 0,0,0,0,4,14,2,16,\n   2,0,2,2,2,2,2,2, 0,0,0,0,2,2,2,2, 2,0,2,2,2,2,2,2, 0,0,0,0,2,2,2,2,\n   2,0,2,2,2,2,2,2, 0,0,0,0,2,2,2,2, 32,0,2,4,2,2,2,2, 0,0,0,0,2,2,2,2,\n   156,0,136,152,124,138,112,108, 126,134,130,124,120,126,140,96, 138,0,138,136,122,116,134,138, 124,130,118,122,140,122,146,112,\n   150,0,140,156,114,112,112,112, 108,122,140,112,150,128,142,122, 144,0,142,152,118,120,114,114, 124,134,120,126,132,136,144,128,\n   0,0,90,80,150,152,98,98, 134,120,142,130,128,128,70,112, 0,0,102,98,150,148,124,110, 134,128,128,144,104,128,66,114,\n   0,0,138,118,64,72,142,142, 138,138,122,134,110,120,110,140, 0,0,126,122,70,82,148,144, 88,108,108,110,162,194,128,196,\n   },\n},\n\n};\t\t// End unigram_table\n\nstatic const uint8 kMostLikelyEncoding[] = {\n// 00xx\n  37,39,39,39,39,39,39,39, 39,37,37,39,39,39,39,39, 39,39,39,39,39,39,39,39, 39,39,39,39,39,39,39,39,\n  37,37,37,39,39,37,39,39, 39,39,37,39,37,37,39,37, 39,39,39,39,39,39,39,39, 39,39,37,39,37,39,37,39,\n  37,39,39,39,39,37,39,39, 37,37,39,37,39,39,39,39, 37,39,37,37,37,37,37,37, 39,39,39,37,39,37,56,39,\n  39,37,37,37,37,37,39,37, 37,37,37,37,37,37,37,37, 37,39,37,37,37,37,37,37, 39,37,37,37,39,37,39,56,\n  56,39,56,56,39,39,39,39, 56,56,56,56,56,56,39,56, 56,56,39,39,57,56,56,39, 56,56,56,57,39,39,56,39,\n  39,39,39,39,39,39,39,39, 39,39,39,39,39,39,39,57, 39,56,39,39,39,56,39,39, 39,39,39,39,39,57,39,39,\n  39,39,57,39,39,39,39,39, 39,39,39,39,56,39,39,39, 39,39,39,39,39,57,39,39, 57,57,57,57,56,57,56,57,\n  39,37,39,39,37,39,39,39, 39,37,39,39,39,37,39,39, 39,37,39,37,39,39,39,39, 39,39,39,39,37,39,39,57,\n  // 01xx\n  56,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,39,37,37,37,\n  39,39,39,37,37,37,39,39, 39,39,37,37,39,39,39,37, 39,37,39,37,37,37,37,37, 37,37,39,39,39,37,37,39,\n  39,37,37,37,37,39,37,39, 37,39,39,39,39,39,37,39, 39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,39,39,39,39,37,37, 37,39,39,37,39,39,39,39, 39,37,39,39,39,39,39,39, 39,39,37,37,37,37,37,37,\n  39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 39,37,37,37,37,37,37,37, 39,37,37,37,37,37,37,37,\n  39,37,37,39,39,39,39,39, 37,39,37,39,39,39,37,37, 37,39,37,39,39,37,39,39, 37,39,37,37,37,37,37,39,\n  37,39,39,39,37,39,39,39, 39,39,39,39,39,37,37,37, 37,37,37,39,37,39,37,39, 37,56,56,56,37,56,39,56,\n  39,39,39,39,39,39,39,39, 39,39,39,39,39,39,39,37, 39,39,39,39,39,37,39,37, 39,39,39,37,39,39,37,39,\n  // 02xx\n  37,37,37,39,37,37,37,39, 39,39,39,37,37,39,37,37, 37,8,37,37,37,37,37,37, 37,37,37,37,39,39,37,39,\n  37,37,39,40,37,39,37,37, 39,39,39,39,39,39,39,39, 39,37,37,37,37,37,40,37, 40,40,39,39,39,39,37,37,\n  6,39,39,40,39,37,39,39, 39,39,37,37,39,39,37,37, 37,37,37,37,37,37,37,37, 39,37,37,37,37,37,39,37,\n  37,37,37,37,39,37,37,37, 37,37,39,37,37,37,37,39, 37,37,39,37,39,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,39,37,37,37,39, 37,37,37,37,37,37,37,37, 39,37,37,37,37,37,37,37, 39,37,37,37,37,37,37,37,\n  37,37,37,37,37,39,37,37, 37,37,37,37,37,37,37,37, 37,37,37,39,39,37,37,39, 39,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,39,37,37,37,37,37,39, 37,39,39,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,39,37,37,37,37,\n  // 03xx\n  56,37,37,37,56,37,37,37, 37,37,39,56,37,39,39,37, 39,37,37,39,37,39,37,37, 37,39,56,39,37,37,39,39,\n  39,39,39,37,37,37,39,39, 39,39,39,39,39,39,39,39, 37,39,39,39,39,39,39,39, 39,56,39,39,39,39,39,56,\n  39,39,39,56,56,39,39,39, 39,39,39,39,39,39,37,37, 37,37,37,37,37,37,37,37, 37,37,39,37,37,37,39,37,\n  37,37,37,39,37,37,37,39, 37,39,37,37,37,39,39,39, 39,37,37,37,39,37,37,37, 37,37,37,37,37,37,40,37,\n  39,37,37,39,39,37,37,37, 37,37,37,37,39,37,37,39, 37,37,37,37,37,37,37,37, 39,37,37,37,37,37,37,37,\n  37,37,39,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 39,37,37,37,37,37,37,39, 37,37,37,37,37,37,37,37,\n  37,37,37,39,37,39,37,37, 37,39,39,37,39,37,37,37, 39,37,39,37,39,37,37,37, 39,39,39,39,39,39,37,37,\n  // 04xx\n  56,39,37,39,37,39,37,37, 37,39,39,37,39,39,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  39,37,39,37,37,37,39,39, 37,39,39,37,39,39,39,37, 39,39,37,39,39,39,39,37, 39,39,39,39,39,39,39,37,\n  39,39,39,39,39,37,39,39, 39,39,39,39,39,37,39,39, 37,39,37,37,39,37,37,37, 37,39,37,37,39,39,37,39,\n  37,39,37,39,39,37,37,37, 39,39,37,39,37,37,39,39, 37,37,37,37,37,37,37,37, 37,37,37,37,37,39,39,37,\n  37,37,37,39,37,37,37,37, 37,37,37,39,37,37,37,37, 37,37,37,39,37,37,37,39, 37,37,37,37,39,37,37,39,\n  39,37,39,39,37,37,39,39, 37,39,37,37,39,39,37,37, 37,39,37,37,39,39,37,39, 37,39,37,39,39,39,39,37,\n  37,37,37,39,37,37,39,37, 39,37,39,37,37,39,39,37, 39,39,37,37,37,39,39,39, 37,37,37,37,37,37,37,37,\n  39,37,39,39,39,39,39,39, 37,37,39,37,39,37,37,37, 37,37,37,37,39,39,39,37, 39,39,39,39,37,39,37,37,\n  // 05xx\n  56,37,37,37,37,37,37,37, 37,37,39,37,37,39,37,37, 37,37,37,39,37,37,37,37, 37,37,37,37,37,37,37,37,\n  39,39,39,37,37,37,39,39, 39,39,39,39,39,39,39,39, 37,39,39,39,37,37,40,37, 37,39,39,39,39,39,39,39,\n  37,39,40,39,37,37,37,39, 37,37,37,37,40,37,37,37, 37,37,37,39,37,37,39,37, 37,37,37,37,37,37,39,39,\n  39,37,37,37,39,37,37,37, 37,37,37,37,37,37,39,37, 37,37,37,37,37,37,37,37, 37,37,39,37,37,39,37,37,\n  39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,39,39,37, 39,39,37,37,37,37,37,37,\n  39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,39,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,39,37,37, 37,37,37,37,39,37,37,37,\n  // 06xx\n  56,37,37,37,37,37,37,37, 37,37,39,37,39,39,39,39, 37,37,37,39,37,37,37,37, 39,39,37,37,37,37,37,37,\n  39,39,39,37,37,37,39,37, 37,39,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,39,39,39,39,39,39,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,39,37,37,37,37,37, 37,37,37,37,39,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39, 37,37,39,37,39,37,37,37, 37,37,37,37,37,37,37,39,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 39,37,39,37,37,37,37,37, 37,37,37,39,37,37,37,37,\n  39,37,37,39,37,37,37,39, 37,37,37,39,39,39,39,37, 37,37,37,37,37,37,37,39, 37,37,37,39,37,37,37,39,\n  37,37,37,37,37,37,37,37, 37,37,39,37,37,37,37,39, 37,37,37,39,37,37,37,39, 37,37,37,37,37,37,37,37,\n  39,39,39,39,39,37,39,37, 39,37,39,37,39,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  // 07xx\n  56,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,39,37,37,37,\n  39,37,39,40,37,37,37,37, 37,39,37,37,39,37,39,37, 37,39,37,40,37,40,37,37, 37,37,40,37,39,37,37,37,\n  37,37,39,37,37,37,40,40, 37,37,37,40,37,37,39,37, 37,37,39,37,37,39,37,37, 37,39,39,37,39,39,37,37,\n  37,37,37,39,37,37,37,37, 39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,39,37,37,37,39,37, 37,39,37,37,37,37,37,37, 37,37,37,37,37,37,37,39, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,39,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  // 08xx\n  37,37,37,37,37,37,37,37, 3,39,39,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,39,40,40,37,37,37, 40,40,37,37,37,37,37,37, 37,39,40,40,40,40,40,40, 40,40,40,40,40,40,40,37,\n  40,40,40,40,37,37,37,37, 40,40,37,37,40,37,37,37, 37,37,37,37,39,37,37,37, 37,37,37,37,39,37,39,37,\n  37,39,37,37,37,37,37,39, 37,37,37,37,37,37,39,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,40,37,\n  37,37,39,37,37,37,37,37, 37,37,39,37,39,37,37,37, 37,37,37,37,37,37,37,37, 39,37,37,37,37,39,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,39,37, 37,39,37,37,37,37,37,37, 39,37,37,37,37,37,37,37,\n  37,37,37,39,37,37,39,37, 39,37,37,37,37,39,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,39,37,37,37,37,39,\n  // 09xx\n  37,37,37,37,37,37,37,37, 37,0,0,37,37,0,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  0,10,0,0,0,0,0,0, 0,0,0,0,0,10,0,10, 10,0,0,0,0,0,0,0, 0,0,0,0,0,10,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  // 0Axx\n  37,37,37,37,37,37,37,37, 37,0,0,37,37,0,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  0,10,0,0,0,0,0,0, 0,0,0,0,0,10,0,10, 10,0,0,0,0,0,0,0, 0,0,0,0,0,10,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  // 0Bxx\n  56,37,37,37,37,37,37,37, 37,37,39,37,37,37,37,40, 37,37,37,37,37,37,37,37, 37,39,37,37,37,37,37,37,\n  39,40,39,40,37,37,37,37, 37,39,37,37,39,39,39,40, 37,39,39,39,39,39,39,40, 39,39,39,37,39,37,37,37,\n  37,37,40,40,37,37,40,37, 39,37,37,37,39,37,39,37, 39,37,37,37,37,37,37,39, 37,37,37,37,39,37,37,37,\n  37,37,37,37,37,37,37,39, 37,37,37,37,37,39,37,37, 37,37,37,37,37,37,37,39, 37,37,39,37,37,37,40,37,\n  37,37,37,37,37,37,39,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  // 0Cxx\n  57,37,39,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  39,37,39,37,37,37,37,37, 37,39,37,37,39,37,37,37, 37,39,37,37,37,37,37,37, 37,37,39,37,39,37,37,39,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,39,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39, 37,37,37,37,37,37,37,37,\n  39,37,37,37,39,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,39,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,39,37,37, 37,37,37,39,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39,\n  // 0Dxx\n  37,37,37,37,37,37,37,37, 37,0,0,37,37,0,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  0,10,0,0,0,0,0,0, 0,0,0,0,0,10,0,10, 10,0,0,0,0,0,0,0, 0,0,0,0,0,10,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  // 0Exx\n  56,37,37,37,37,37,37,37, 37,37,37,37,37,39,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  39,57,56,57,56,37,56,37, 56,56,37,56,56,37,39,39, 57,57,57,57,57,57,57,57, 57,57,57,57,57,57,57,57,\n  57,57,56,57,57,57,57,57, 57,57,56,57,57,57,56,56, 57,56,57,56,56,57,56,57, 56,56,56,56,57,56,56,56,\n  56,56,56,56,56,56,39,56, 56,56,56,56,56,56,56,56, 56,56,56,56,56,37,56,56, 37,56,39,56,56,37,37,37,\n  37,37,37,39,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,39,39,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 6,37,37,37,37,37,37,37, 37,37,37,37,37,37,39,37,\n  37,37,37,37,37,37,37,37, 37,39,37,39,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39,\n  // 0Fxx\n  37,37,40,37,37,37,37,37, 40,42,42,37,37,42,40,37, 37,37,37,37,37,37,37,37, 37,40,37,57,37,37,37,37,\n  42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,\n  42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,\n  42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,37,\n  37,39,42,37,37,37,37,37, 37,37,37,37,37,37,39,37, 39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  // 10xx\n  56,39,37,37,39,37,39,37, 37,37,39,37,37,37,37,37, 37,37,37,39,37,37,37,37, 37,37,37,37,39,39,37,39,\n  39,40,39,37,37,37,37,37, 40,39,40,37,39,39,39,39, 37,39,37,39,40,40,37,37, 40,40,39,39,39,37,37,39,\n  37,40,40,40,37,40,37,37, 37,40,40,37,40,37,37,37, 37,37,37,37,37,39,37,37, 37,37,37,37,37,37,37,37,\n  37,37,39,37,37,37,37,37, 37,37,37,37,37,37,39,37, 37,37,39,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  39,37,37,37,37,37,37,37, 37,37,37,37,39,37,39,37, 39,37,37,39,37,37,37,37, 39,39,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 3,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,39,37,37,37,37,37,\n  // 11xx\n  56,39,37,37,39,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,40,39,40,37,37,37,37, 37,37,37,37,37,37,39,37, 37,40,40,40,40,40,40,37, 40,40,40,40,40,40,40,40,\n  37,40,40,40,40,37,40,40, 40,40,40,40,37,40,37,39, 39,37,37,37,39,37,37,37, 37,37,37,37,39,37,37,37,\n  37,37,39,39,37,37,37,37, 39,37,37,37,39,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,39,37,37,40,37,\n  37,39,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,3,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,39,37,37,37,37,37,37, 37,37,37,37,37,37,39,37, 37,37,37,37,37,37,37,37,\n  39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,39,37,37,37,37,37,\n  // 12xx\n  37,37,37,37,39,39,37,37, 37,37,37,39,37,39,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  39,40,39,39,37,37,37,37, 37,39,37,39,37,37,39,39, 37,39,37,40,37,37,37,37, 39,40,37,39,39,37,37,37,\n  40,37,37,37,37,39,37,37, 37,37,39,37,37,37,37,37, 39,37,39,37,37,37,37,39, 37,37,37,37,37,37,37,37,\n  39,37,39,37,37,37,37,37, 37,39,37,37,37,39,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,40,37,\n  37,37,39,37,37,37,37,39, 37,37,37,37,37,37,37,37, 39,37,37,37,37,37,37,37, 37,37,39,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39,\n  // 13xx\n  37,39,37,37,37,37,37,37, 37,37,39,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,39,37,37,\n  39,37,37,40,37,37,37,37, 37,37,39,37,39,39,37,37, 37,39,40,37,40,37,37,37, 37,37,40,37,39,37,37,37,\n  37,37,37,40,37,37,37,37, 37,37,37,37,40,37,39,37, 37,37,37,37,37,37,37,39, 37,37,37,37,37,37,37,37,\n  37,37,37,37,39,37,39,37, 39,37,39,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,40,39,\n  37,37,37,37,37,39,37,37, 37,37,39,37,39,37,37,37, 37,37,37,37,37,37,37,39, 37,39,39,37,39,37,37,39,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,39,37,37,37,6,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 39,37,37,39,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,39,37,37, 37,37,37,39,37,39,37,37, 37,37,37,37,37,37,37,39,\n  // 14xx\n  37,37,37,37,37,39,37,37, 37,37,37,37,37,37,37,37, 37,39,39,39,39,37,37,37, 37,37,37,37,37,37,37,37,\n  39,37,37,40,37,39,37,37, 39,37,37,39,39,39,39,37, 37,37,37,39,40,40,40,40, 40,37,40,40,39,37,40,40,\n  40,40,40,40,40,37,39,39, 40,40,40,40,37,40,39,37, 37,37,37,37,37,37,37,37, 37,37,37,37,39,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,39,37,37,39, 37,37,37,37,37,37,37,37, 39,37,37,39,37,39,40,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,39,37,37, 37,37,37,37,39,37,39,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39,\n  // 15xx\n  56,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  39,40,39,40,39,37,39,37, 37,37,37,37,39,37,37,37, 37,37,39,37,40,40,37,37, 37,40,37,37,39,37,40,40,\n  37,40,40,37,37,37,37,37, 37,37,40,37,40,37,37,37, 37,37,37,37,37,37,39,37, 39,39,37,37,37,37,37,39,\n  39,39,37,37,37,37,37,37, 37,37,37,37,37,37,37,39, 37,37,37,37,37,37,37,37, 39,37,37,37,37,37,40,37,\n  39,37,37,37,37,37,37,39, 39,37,37,37,37,37,37,39, 37,39,39,37,37,37,37,37, 37,37,37,37,37,39,37,37,\n  37,39,37,37,37,39,37,39, 37,37,37,39,39,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,39,37,37,37,\n  37,37,39,37,37,37,37,37, 39,37,37,37,37,37,37,37, 39,37,37,37,37,37,39,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,39,37,37,37,37,37, 37,37,39,37,37,37,37,37, 37,37,37,37,37,37,37,39,\n  // 16xx\n  56,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,39,37,37,37,37,37,37, 37,40,37,37,37,37,37,40, 37,39,37,40,37,37,40,37, 40,40,37,40,37,37,40,37,\n  37,40,37,37,40,37,40,37, 40,37,37,40,37,37,39,37, 37,37,37,39,37,37,37,39, 37,39,37,37,37,37,37,37,\n  39,37,39,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39,\n  37,37,37,37,37,37,39,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,39, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  // 17xx\n  56,37,37,37,37,37,37,37, 37,37,39,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,39,37,37, 40,37,37,37,37,37,40,37, 37,39,40,37,37,37,37,37, 37,37,37,37,37,40,40,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39, 37,37,39,39,39,37,39,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 39,37,37,37,39,37,39,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,40,37,\n  39,37,39,37,37,39,37,39, 37,37,39,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  // 18xx\n  37,37,37,37,39,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,39,37,40,37,37,37,37, 37,37,37,37,40,37,37,40,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39, 39,37,37,37,37,37,37,39, 37,37,39,37,39,37,37,37,\n  37,37,39,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39,\n  37,37,37,37,37,37,37,39, 37,37,39,37,37,37,37,37, 37,37,37,37,39,37,37,37, 39,39,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,39,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39,\n  // 19xx\n  37,37,37,37,37,37,37,37, 37,39,37,37,37,39,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,39,37,40,37,37,37, 37,37,37,37,37,37,40,37, 37,37,37,37,37,37,37,37, 37,37,40,37,37,40,37,37,\n  37,37,37,40,37,37,37,37, 37,37,37,37,37,37,37,37, 39,37,39,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,39,37,37,37,37, 37,37,39,37,37,37,37,37, 37,39,37,37,37,37,37,37, 37,39,37,37,37,39,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 39,37,37,37,37,39,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  // 1Axx\n  37,37,37,37,37,37,37,37, 37,37,4,37,37,37,37,40, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,40,39,40,37,37,37,37, 37,37,37,37,37,37,37,37, 37,39,37,37,40,40,37,37, 37,37,37,37,37,37,40,6,\n  40,37,37,37,37,37,37,37, 37,37,37,37,37,37,39,39, 37,37,37,37,37,37,37,37, 37,39,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,39,37,37,\n  37,37,37,37,37,39,37,37, 37,37,37,37,37,37,37,37, 39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39,\n  // 1Bxx\n  56,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,57,37,37,37, 57,37,37,37,37,37,37,37, 37,39,37,37,40,40,37,37, 40,37,37,37,37,40,37,37,\n  37,37,37,37,37,40,37,37, 37,37,37,37,37,37,56,37, 37,37,39,37,39,37,37,37, 37,37,39,37,37,39,37,37,\n  37,39,37,37,37,37,37,39, 37,37,37,37,39,39,39,37, 37,37,39,39,37,37,37,37, 37,37,37,37,37,37,40,37,\n  37,37,37,37,37,37,37,37, 37,37,37,39,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,39,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39,\n  // 1Cxx\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  39,37,37,40,37,39,37,37, 37,37,40,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,40,37,37,37,37, 37,40,40,37,37,37,39,37, 37,37,37,37,37,37,37,37, 37,39,39,37,37,37,37,37,\n  37,37,37,37,39,37,37,37, 37,39,37,37,37,37,37,37, 37,37,37,39,37,39,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,39, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,39,39, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,39,37,37,37, 37,37,37,37,39,37,37,37,\n  37,39,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  // 1Dxx\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  39,37,40,40,37,39,37,37, 37,37,37,37,37,37,37,37, 37,39,37,37,37,37,37,37, 40,37,37,37,37,40,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39, 37,37,39,37,37,37,37,37, 37,37,37,37,37,37,39,37,\n  39,37,37,37,37,37,37,39, 37,37,37,37,37,37,39,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,39,37,37,37, 37,37,37,39,37,39,39,37, 39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,39,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  // 1Exx\n  57,37,37,37,37,37,37,37, 37,39,39,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,39,37,37,\n  39,40,39,40,37,37,39,39, 37,39,37,37,39,39,39,39, 37,40,42,40,40,40,40,37, 40,40,39,39,39,40,37,39,\n  37,39,42,37,37,37,42,37, 42,39,40,40,40,39,39,39, 39,37,37,37,39,39,37,37, 37,37,42,37,37,37,37,37,\n  37,39,37,39,39,39,37,37, 39,39,42,39,37,37,39,39, 39,37,37,37,39,39,37,39, 37,39,37,37,37,37,40,37,\n  37,37,39,37,37,37,37,37, 37,37,37,37,37,39,37,37, 39,37,39,37,37,37,37,39, 37,37,37,37,37,37,39,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39,\n  // 1Fxx\n  37,37,37,37,39,37,39,37, 37,39,37,37,37,39,40,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,40,42,40,37,37,37,37, 42,37,37,42,39,37,37,42, 37,39,40,40,40,40,40,40, 40,40,40,40,40,40,42,40,\n  40,40,42,40,40,40,40,42, 40,40,40,40,42,42,37,37, 39,37,37,37,37,37,37,39, 37,37,39,37,37,37,37,37,\n  37,39,37,37,37,37,39,39, 37,37,37,37,37,37,37,37, 37,37,37,37,37,39,37,39, 37,37,37,37,37,37,40,37,\n  37,37,39,37,37,37,37,37, 37,37,37,37,37,39,37,37, 39,37,37,37,37,37,39,37, 37,37,37,37,37,37,39,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,39,37,37,37,37, 37,37,37,39,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,39,\n  // 20xx\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  // 21xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 22xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 23xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 24xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 25xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 26xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 27xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 28xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 29xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 2Axx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 2Bxx\n  2,39,1,37,37,37,37,5, 3,2,2,37,3,2,42,42, 37,40,37,37,37,40,37,37, 40,37,40,57,37,37,37,21,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,3,3,3,11,11,11,11, 3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, 3,11,12,11,12,36,12,4,\n  11,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,\n  2,2,2,2,2,2,2,11, 2,1,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,11,2,1,11,13,6,\n  14,10,2,2,2,2,2,2, 2,2,2,2,2,10,17,2, 10,10,10,10,10,10,1,17, 17,17,17,2,11,10,13,37,\n  // 2Cxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 2Dxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 2Exx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 2Fxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 30xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 31xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 32xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 33xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 34xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 35xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 36xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 37xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 38xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 39xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 3Axx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 3Bxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 3Cxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 3Dxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 3Exx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 3Fxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 40xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 41xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 42xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 43xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 44xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 45xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 46xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 47xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 48xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 49xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 4Axx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 4Bxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 4Cxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 4Dxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 4Exx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 4Fxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 50xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 51xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 52xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 53xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 54xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 55xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 56xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 57xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 58xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 59xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 5Axx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 5Bxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 5Cxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 5Dxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 5Exx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 5Fxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 60xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 61xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 62xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 63xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 64xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 65xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 66xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 67xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 68xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 69xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 6Axx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 6Bxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 6Cxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 6Dxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 6Exx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 6Fxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 70xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 71xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 72xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 73xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,31, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,33,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 74xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 75xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 76xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 77xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 78xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 79xx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 7Axx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 7Bxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 7Cxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 7Dxx\n  37,37,37,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,37,\n  3,10,11,11,11,11,11,11, 11,11,0,11,11,10,0,10, 10,11,11,11,11,11,11,11, 0,11,0,11,11,10,0,0,\n  11,1,11,11,11,11,11,11, 11,11,1,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,1,11,11,11,11,1,\n  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,11, 1,1,1,1,1,1,1,1,\n  11,1,11,1,1,1,1,11, 11,11,11,11,1,1,11,11, 1,1,1,1,11,1,1,11, 1,11,1,11,11,1,1,1,\n  // 7Exx\n  2,39,39,39,39,39,39,39, 39,2,2,39,39,2,42,42, 39,39,39,39,39,39,39,39, 39,39,39,56,39,39,39,39,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,3,\n  3,3,3,3,39,39,11,11, 11,3,3,3,3,3,3,3, 3,3,3,3,3,11,3,3, 39,11,39,3,39,39,39,37,\n  11,3,3,3,11,3,3,3, 3,3,3,3,3,3,11,3, 11,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,\n  2,2,2,2,2,2,2,11, 2,2,2,2,11,11,2,2, 2,11,2,11,11,2,2,2, 2,37,11,11,11,11,11,11,\n  17,11,2,2,2,2,2,2, 2,2,2,2,2,2,17,2, 14,17,17,11,37,1,11,17, 16,17,11,39,37,11,39,37,\n  // 7Fxx\n  56,39,39,39,39,39,39,39, 39,39,39,39,39,39,39,39, 39,39,39,37,39,37,37,39, 37,39,39,39,39,37,39,39,\n  39,39,39,39,39,39,39,39, 39,37,39,39,39,39,39,39, 37,39,39,39,39,39,37,39, 39,39,37,39,39,39,39,39,\n  39,39,39,39,39,39,39,39, 39,39,39,39,39,39,37,39, 37,37,37,37,37,39,37,37, 39,37,39,37,37,37,39,37,\n  37,39,39,37,37,37,37,39, 39,37,37,37,37,37,37,39, 37,37,37,39,37,37,37,39, 39,37,39,37,39,37,37,39,\n  37,39,37,37,39,37,39,39, 37,39,37,37,39,37,37,37, 39,39,39,39,37,39,37,39, 39,37,37,39,39,39,39,39,\n  39,39,39,39,37,39,39,39, 37,37,39,39,39,39,39,39, 39,39,39,39,37,39,39,39, 39,39,39,39,39,37,39,39,\n  39,37,39,39,39,37,39,39, 39,39,39,39,37,39,39,39, 39,39,37,39,37,39,39,39, 56,56,39,56,56,56,56,56,\n  37,39,39,39,39,39,39,39, 39,37,39,39,39,39,39,39, 37,37,39,39,39,39,39,39, 39,39,39,37,37,39,39,37,\n  // 80xx\n  11,37,39,37,39,37,39,39, 39,2,2,39,37,2,39,39, 37,39,39,39,39,37,39,37, 39,39,39,39,39,39,39,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,11, 2,11,11,2,11,11,11,11, 11,11,11,2,11,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,11,2,2, 2,2,2,2,2,2,2,39,\n  2,2,2,2,36,2,2,36, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 59,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  10,39,2,2,2,10,37,2, 10,2,39,2,37,39,2,2, 2,2,2,10,39,2,33,11, 2,2,2,2,37,5,37,5,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 36,31,39,39,39,31,37,39, 37,39,37,39,11,37,4,37,\n  // 81xx\n  56,39,37,39,39,37,39,37, 37,2,2,39,39,2,39,39, 37,37,39,39,39,39,39,39, 39,37,37,39,39,39,39,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  6,6,6,6,6,6,6,6, 6,6,2,6,6,6,2,6, 6,6,6,2,2,6,6,2, 6,2,6,6,6,6,6,6,\n  6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,37,\n  36,6,2,6,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,6,2, 2,2,6,2,6,2,2,2,\n  2,6,6,2,2,6,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  10,39,2,2,2,10,4,11, 6,6,6,6,6,6,2,2, 2,11,11,11,11,39,12,19, 2,2,6,2,6,6,6,6,\n  2,6,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 6,6,6,6,6,6,6,6, 4,4,37,39,6,19,39,37,\n  // 82xx\n  56,39,39,39,39,39,39,37, 37,2,2,39,39,2,42,39, 39,39,37,39,39,39,39,39, 39,39,39,39,39,39,37,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,6, 6,6,6,6,6,6,6,6, 6,2,2,2,2,2,2,2,\n  6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 6,6,2,2,2,2,2,37,\n  2,2,2,2,2,6,2,2, 2,2,2,2,2,2,6,2, 6,36,2,2,6,6,6,6, 2,2,2,36,2,2,2,6,\n  6,2,6,2,6,2,6,2, 6,6,6,6,2,6,6,2, 2,6,6,6,2,6,6,6, 2,2,2,6,6,6,6,6,\n  6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6,\n  6,6,6,2,2,2,6,6, 6,6,6,6,6,6,6,2, 6,6,31,12,11,31,39,19, 5,19,39,19,11,33,39,37,\n  // 83xx\n  56,39,37,37,37,37,39,39, 39,2,2,39,39,2,37,39, 39,39,39,39,39,39,39,37, 39,39,39,39,37,39,39,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 37,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6,\n  6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,37,\n  6,6,6,2,6,6,2,6, 2,6,6,6,6,6,2,6, 2,2,2,6,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,6,\n  6,6,59,6,6,59,59,6, 19,6,6,6,6,6,2,2, 2,2,6,6,19,6,6,11, 2,2,2,2,37,6,4,4,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,5,2, 31,4,11,10,39,19,19,11, 37,39,39,39,39,39,39,37,\n  // 84xx\n  57,39,39,39,39,39,39,39, 39,2,2,39,39,2,39,39, 39,39,39,39,39,39,39,39, 37,39,39,39,39,39,39,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,11,2,2,2, 2,2,2,11,2,2,2,2, 2,2,2,11,2,2,11,11, 2,2,11,2,2,2,2,2,\n  37,11,2,2,11,2,2,11, 2,2,2,11,2,2,11,2, 2,6,2,2,6,6,39,2, 6,6,11,6,2,6,2,37,\n  36,2,2,2,2,36,2,2, 2,2,2,36,2,36,36,2, 2,2,2,36,2,2,2,2, 2,2,2,2,2,2,2,2,\n  6,2,59,6,2,6,2,2, 36,6,6,6,6,2,36,6, 2,2,2,2,2,6,2,2, 2,2,6,5,2,5,2,2,\n  10,10,2,2,2,10,10,10, 12,12,10,2,10,10,2,2, 2,2,10,19,10,19,12,2, 2,2,2,2,12,19,16,10,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,5,2, 36,10,10,10,11,12,12,10, 12,12,12,39,11,39,16,37,\n  // 85xx\n  56,11,39,37,39,39,39,39, 39,2,2,39,39,2,39,11, 39,39,39,37,37,39,39,37, 37,37,37,39,39,39,39,39,\n  2,2,2,2,11,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,39,2,2,2,2,11,11, 2,2,2,2,2,2,19,2,\n  2,11,11,2,11,2,2,2, 2,11,33,2,2,2,2,11, 11,11,2,11,11,2,33,11, 11,11,33,2,2,2,2,39,\n  2,2,36,2,2,2,2,2, 2,2,36,2,2,2,2,36, 2,36,2,2,2,2,36,36, 2,2,2,5,2,2,2,36,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  39,5,2,2,19,11,5,11, 11,12,5,2,2,37,2,2, 2,2,6,11,11,19,12,39, 2,2,2,2,11,11,11,11,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,5,2, 36,36,4,23,23,4,19,11, 19,11,12,37,11,33,11,37,\n  // 86xx\n  56,39,39,11,39,39,39,37, 39,2,2,39,39,2,39,39, 39,39,39,39,39,39,39,39, 39,39,39,39,39,39,39,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,37,\n  2,6,2,2,36,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,19,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,36,2, 2,2,2,2,2,5,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  39,19,2,2,2,2,2,2, 11,2,19,2,19,37,2,2, 2,2,4,12,12,19,12,11, 2,2,2,2,11,12,4,6,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 36,36,39,31,39,4,39,11, 4,39,39,39,11,12,19,37,\n  // 87xx\n  56,39,37,39,39,39,39,39, 39,2,2,39,39,2,39,37, 39,37,37,37,39,37,39,37, 37,39,39,39,37,39,39,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  6,6,6,6,6,6,6,6, 6,2,6,6,2,2,2,2, 2,11,2,2,6,6,6,6, 6,6,6,2,2,2,2,2,\n  6,2,2,2,6,39,2,31, 2,11,11,2,2,2,2,6, 2,6,31,31,2,2,31,2, 11,2,37,2,2,2,2,37,\n  36,6,2,2,2,36,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,5,2, 2,2,2,36,2,2,5,2,\n  2,2,36,2,2,2,2,2, 2,5,2,36,2,2,11,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  19,12,2,2,2,2,4,11, 4,12,4,2,19,39,2,2, 2,2,4,12,12,4,19,11, 2,2,2,2,11,11,31,19,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,5,2, 36,4,37,11,11,11,4,11, 19,37,19,11,19,4,4,37,\n  // 88xx\n  57,39,39,39,39,39,39,39, 39,2,2,39,39,2,39,39, 39,39,39,39,39,39,39,39, 39,39,39,39,39,39,39,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 37,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,39,\n  2,36,36,36,2,36,2,2, 2,2,2,36,36,36,2,2, 2,2,2,36,2,2,2,2, 2,2,2,2,2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,6,6,2,6,\n  6,6,6,6,6,6,6,6, 2,2,6,6,6,6,6,36, 6,6,6,2,6,6,6,6, 6,6,6,2,6,6,6,6,\n  10,6,2,6,6,6,2,6, 6,6,6,6,6,6,6,6, 2,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6,\n  6,2,2,2,2,6,2,2, 2,2,2,2,2,2,6,2, 6,6,6,6,6,6,6,6, 6,6,6,6,6,22,22,37,\n  // 92xx\n  56,39,39,37,39,39,37,39, 39,2,2,39,39,2,39,39, 37,39,37,39,37,37,39,37, 37,39,39,39,37,39,37,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,11,2,2,2, 39,2,2,2,2,2,2,2, 2,2,2,11,2,2,2,2,\n  6,11,6,6,6,6,2,2, 11,6,6,6,2,6,6,6, 6,6,2,6,6,6,2,6, 2,6,6,6,2,6,6,6,\n  6,11,6,6,11,11,6,6, 11,6,6,6,6,6,6,11, 6,6,6,11,11,6,6,6, 6,11,6,6,6,6,6,37,\n  36,6,36,6,2,6,6,6, 2,6,6,6,2,6,36,2, 36,6,2,6,2,2,2,2, 6,2,6,36,36,6,2,2,\n  6,6,2,6,6,6,6,6, 2,6,6,2,6,2,6,2, 2,2,6,2,6,6,6,6, 6,6,6,2,6,2,6,6,\n  6,6,6,6,6,6,2,6, 6,6,6,6,6,6,6,6, 6,2,6,6,6,6,6,6, 6,6,6,6,6,6,6,6,\n  6,6,6,2,2,2,2,2, 6,2,6,6,2,6,11,2, 6,6,6,6,6,6,6,6, 6,6,6,6,6,22,10,10,\n  // 93xx\n  56,39,39,39,37,39,39,39, 39,2,2,39,39,2,39,39, 39,39,39,39,39,39,39,37, 37,39,39,39,39,39,37,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 37,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  6,11,11,11,11,6,11,6, 11,6,6,6,11,11,6,6, 11,11,11,6,6,11,6,6, 6,6,6,2,6,6,6,6,\n  6,6,2,6,6,11,6,11, 6,2,11,6,6,2,2,6, 11,6,6,6,11,2,11,6, 6,6,6,6,6,6,6,37,\n  6,2,6,6,2,2,36,6, 2,2,6,6,6,2,2,6, 6,36,6,2,6,6,6,36, 36,6,6,6,2,6,6,6,\n  2,2,6,2,2,2,2,6, 2,6,6,6,6,6,6,6, 6,6,2,5,6,6,6,2, 2,6,2,6,2,6,6,6,\n  10,6,6,59,6,6,6,6, 6,12,6,6,10,6,2,6, 6,2,6,10,6,6,6,2, 6,2,6,6,6,6,6,6,\n  6,2,2,2,2,2,2,2, 2,2,2,2,6,6,6,2, 6,6,6,6,19,6,6,6, 6,6,6,6,6,10,19,37,\n  // 94xx\n  56,39,39,39,39,39,39,39, 39,2,2,11,39,2,39,39, 39,39,39,39,39,39,39,37, 37,39,39,39,37,39,39,39,\n  2,2,2,11,2,2,2,2, 2,2,2,2,11,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,11,2,\n  6,6,2,6,6,6,6,6, 2,2,6,6,6,6,6,6, 2,2,6,6,6,2,6,2, 6,6,6,6,6,6,2,6,\n  6,2,2,6,6,6,2,6, 6,2,6,2,2,2,6,6, 6,6,6,6,6,2,6,6, 6,6,6,6,6,6,6,39,\n  2,2,2,6,6,2,2,2, 2,2,2,2,2,6,6,6, 2,6,6,6,2,6,6,6, 2,2,6,6,2,2,6,2,\n  6,2,2,2,2,36,6,6, 2,2,6,6,2,6,2,2, 2,2,6,2,2,2,2,2, 2,2,2,2,6,6,2,2,\n  6,6,6,2,6,6,6,6, 6,6,6,6,6,6,2,6, 2,6,6,6,6,6,6,2, 6,2,6,6,6,6,6,6,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,6,6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,22,37,37,\n  // 95xx\n  56,39,39,39,39,37,39,39, 37,11,2,39,39,11,39,39, 37,39,39,39,39,39,39,39, 39,37,39,39,39,39,39,39,\n  11,2,2,39,11,2,11,2, 2,2,2,2,2,2,11,2, 2,2,2,2,2,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6,11,11,39,6,2, 2,2,2,2,11,11,5,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,5,2, 6,6,37,6,6,4,39,6, 6,5,6,39,6,37,37,37,\n  // 99xx\n  56,39,39,37,39,37,39,39, 39,2,2,39,39,2,39,39, 37,39,39,37,39,39,39,39, 37,37,39,39,39,39,37,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,6,2,2,2,11,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,6,6,2,2,2,37,\n  2,2,2,2,2,2,2,2, 2,2,6,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,37,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,5,2,2,2,2,2, 2,2,2,2,2,2,2,5,\n  6,6,2,2,2,2,2,11, 6,6,6,2,6,6,2,2, 2,2,6,6,6,6,6,2, 2,2,19,2,11,6,11,6,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,5,2, 6,36,6,6,6,6,6,6, 6,6,6,6,6,39,4,37,\n  // 9Axx\n  56,39,39,39,39,39,39,39, 39,2,2,39,39,2,37,39, 39,39,37,37,39,39,39,39, 39,37,39,37,39,39,37,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,12,2,2,2,12,2,2, 2,12,2,12,12,2,12,12, 12,6,2,2,12,12,12,2, 2,2,2,2,2,2,2,37,\n  2,2,2,5,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,6,2,2,2,2,2, 2,2,12,2,2,12,6,36,\n  6,6,2,2,2,5,2,2, 2,2,2,2,6,6,2,5, 2,2,5,5,2,2,2,2, 2,2,2,2,2,2,2,2,\n  5,6,59,2,2,2,6,12, 6,2,6,2,4,6,2,2, 2,2,6,6,37,39,6,2, 37,2,6,6,6,19,6,6,\n  2,2,2,2,2,2,2,2, 2,2,2,5,2,12,6,2, 36,6,12,10,12,6,6,6, 6,12,6,6,12,12,39,37,\n  // 9Bxx\n  56,39,39,39,39,39,37,39, 39,2,2,39,39,2,39,39, 39,39,39,37,39,39,39,39, 39,39,39,39,39,39,39,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,6,2,2,2,2,2,2, 2,2,39,2,2,2,2,2, 5,2,6,2,2,2,2,2,\n  2,2,2,2,2,2,2,6, 2,2,6,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,6,6,2,2,2,37,\n  2,2,36,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,6,2,36,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,5,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  6,6,2,2,6,2,6,2, 4,6,6,2,2,12,2,2, 2,2,6,6,6,39,2,2, 2,2,6,6,6,6,6,6,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,6,2, 6,6,6,6,6,6,6,11, 4,6,6,6,11,11,22,37,\n  // 9Cxx\n  56,39,39,11,37,37,39,39, 39,2,2,39,39,2,39,39, 37,37,39,37,39,37,39,39, 39,39,39,39,39,39,39,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,6,2,2,2,\n  2,2,2,12,2,2,2,2, 2,2,2,2,12,2,2,2, 2,2,12,2,2,11,2,12, 2,2,2,2,2,2,2,37,\n  2,2,2,2,2,36,2,2, 2,2,2,2,2,2,2,2, 2,36,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  6,4,2,2,2,2,6,2, 6,6,19,2,6,4,2,2, 2,2,2,2,6,2,2,2, 2,2,2,6,6,6,6,6,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 6,12,6,10,37,4,6,6, 6,6,6,6,11,4,19,37,\n  // 9Dxx\n  56,39,12,4,37,39,37,39, 37,2,2,39,39,2,39,39, 37,39,37,39,37,37,39,37, 37,37,37,39,37,37,39,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,6, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 6,2,2,2,2,2,2,2,\n  2,12,2,2,2,2,6,2, 2,2,2,2,2,2,2,12, 2,2,2,2,12,12,2,2, 2,2,2,2,6,2,2,37,\n  2,2,2,2,2,5,2,2, 2,2,2,36,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,5, 2,2,2,36,2,2,2,2, 2,2,5,2,2,2,2,2, 2,2,6,2,2,2,2,2,\n  5,6,2,2,2,2,11,11, 11,6,11,2,11,11,11,11, 2,11,11,11,11,11,4,6, 2,2,11,6,6,11,11,11,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,19,2, 6,19,6,6,6,6,6,19, 6,6,12,10,4,19,11,37,\n  // 9Exx\n  56,39,39,39,37,39,39,39, 39,2,2,39,39,2,39,39, 39,39,39,39,39,39,39,39, 39,39,39,39,39,39,37,37,\n  12,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,12,12,2,12,12,2,2, 2,12,2,12,2,2,12,12, 2,2,2,12,2,12,2,2, 2,2,2,2,2,2,2,37,\n  2,2,2,2,2,2,6,2, 2,2,6,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,11,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,5,6,2,2,2,2,2, 2,6,2,2,2,6,2,2,\n  6,12,59,2,6,2,2,2, 6,6,6,6,2,5,2,6, 2,2,6,11,6,6,6,2, 11,6,6,2,6,19,37,6,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,12,5,2, 12,4,12,10,6,19,39,6, 6,12,12,6,6,12,11,37,\n  // 9Fxx\n  56,39,39,39,4,39,39,39, 39,2,2,39,39,2,37,39, 39,39,39,37,39,37,39,39, 37,39,39,39,39,39,39,39,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,6,6, 2,2,2,2,6,2,2,2, 2,2,2,2,2,2,2,2,\n  2,33,2,31,12,33,2,31, 31,2,2,33,33,2,2,2, 33,6,31,2,33,33,2,12, 2,2,2,6,2,2,2,37,\n  2,2,36,2,2,36,6,36, 2,2,36,2,36,36,2,2, 2,2,2,2,2,6,36,2, 2,36,2,2,2,2,36,2,\n  2,33,2,2,2,2,2,2, 6,2,36,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  6,4,2,2,6,2,6,6, 6,6,6,2,6,6,2,2, 2,2,1,6,6,6,4,2, 2,2,6,6,4,6,6,6,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 6,12,6,6,19,6,6,6, 6,6,6,6,6,19,4,37,\n  // A0xx\n  7,11,37,11,37,1,37,1, 1,11,11,37,1,11,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  11,2,2,11,11,11,2,2, 11,2,2,11,2,11,2,2, 11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,2,\n  2,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,11,11,11,2,2,2,\n  2,11,11,11,11,11,11,11, 11,11,11,11,33,11,33,11, 11,11,11,11,11,11,11,11, 11,11,11,11,11,2,2,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,11,2,2,12,2,\n  11,2,36,36,2,2,36,36, 2,36,2,36,36,2,36,2, 2,2,2,5,2,2,2,2, 2,2,2,2,2,2,2,12,\n  10,10,2,2,10,11,10,11, 11,1,10,14,10,10,10,10, 2,11,11,11,11,11,1,2, 2,2,11,11,1,10,11,11,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,36,2, 10,10,10,10,10,10,10,10, 12,17,1,10,11,33,1,10,\n  // A1xx\n  7,37,37,1,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,3,37,37,37,37,\n  11,2,2,2,2,2,11,2, 2,2,2,2,2,2,14,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,14,2,\n  8,8,8,8,9,8,8,8, 8,8,8,8,8,8,8,8, 8,8,8,9,9,8,8,8, 8,1,9,2,8,8,8,2,\n  8,8,33,2,33,8,8,1, 33,8,8,33,33,8,8,2, 2,8,8,33,2,8,8,8, 8,8,8,39,2,8,2,37,\n  2,2,2,2,2,2,2,2, 2,2,2,39,2,2,2,2, 2,2,2,2,2,2,6,2, 2,2,2,2,2,2,2,33,\n  2,3,3,3,3,7,7,7, 2,7,7,3,2,3,3,3, 3,3,7,8,8,2,3,3, 8,7,3,3,7,7,3,3,\n  3,7,7,7,7,14,9,14, 7,7,7,7,7,14,7,7, 8,14,14,14,14,14,7,7, 7,7,7,7,7,7,5,7,\n  2,5,5,2,2,2,2,2, 2,2,2,7,2,2,3,3, 3,3,3,7,3,7,7,7, 3,7,7,7,7,7,7,37,\n  // A2xx\n  7,37,37,1,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 37,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  8,8,2,2,8,2,2,8, 8,8,8,2,2,2,2,2, 2,2,2,2,2,2,2,2, 8,2,2,2,2,2,2,2,\n  2,2,8,8,33,8,8,2, 8,8,2,8,2,2,2,2, 8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,37,\n  2,2,6,2,2,2,2,2, 2,6,2,2,2,2,2,6, 6,2,2,2,6,6,2,2, 2,2,2,2,2,2,2,2,\n  36,7,7,7,7,7,7,7, 7,7,7,2,7,7,36,8, 2,8,8,8,8,8,8,14, 5,5,5,14,2,5,5,5,\n  5,5,5,5,5,14,5,14, 5,5,14,23,5,14,5,5, 8,5,14,8,8,14,14,8, 14,3,3,3,3,5,8,5,\n  2,2,2,2,2,2,2,2, 2,2,8,36,8,8,8,2, 8,3,3,3,8,8,7,8, 8,3,8,8,8,8,8,37,\n  // A3xx\n  7,37,37,39,37,37,37,37, 37,2,2,37,4,2,9,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  2,2,2,2,11,11,2,2, 2,2,2,2,2,2,2,2, 11,11,11,11,11,11,11,11, 11,11,2,2,2,2,2,2,\n  36,12,12,12,12,12,2,12, 2,2,2,12,2,12,12,12, 12,2,2,12,12,12,11,12, 8,12,12,2,8,2,11,2,\n  8,12,2,2,33,12,2,8, 11,2,8,12,2,2,2,2, 2,11,2,8,2,12,8,2, 8,2,8,8,8,8,8,37,\n  2,2,2,6,2,2,2,2, 3,2,2,2,2,2,2,2, 2,2,2,2,3,2,5,2, 2,2,2,2,2,2,2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14,8,14, 14,2,8,2,8,8,8,5,\n  2,8,2,2,2,2,2,2, 2,2,8,5,8,8,8,2, 8,8,8,5,8,10,8,8, 8,8,8,8,8,8,8,37,\n  // ABxx\n  7,1,1,37,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,6,37,37,37, 37,37,37,37,37,37,37,37,\n  2,2,2,2,2,2,11,2, 2,2,2,2,2,2,2,2, 37,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,11,8,8,8,11,8,8, 8,8,8,8,8,11,8,8, 8,8,2,11,8,8,11,8, 8,8,2,2,8,2,8,8,\n  8,8,8,11,8,8,11,8, 8,8,8,8,8,2,8,8, 8,8,8,8,8,2,8,8, 8,8,8,8,8,8,8,37,\n  2,2,2,2,2,2,5,2, 2,2,2,2,2,2,39,2, 5,2,2,2,2,11,2,2, 2,2,5,2,2,5,2,2,\n  2,8,8,8,5,2,2,8, 36,2,2,8,8,2,36,2, 8,8,3,8,8,8,2,5, 2,2,8,2,8,8,2,2,\n  8,8,8,8,8,8,5,8, 8,8,8,8,8,14,8,11, 14,8,8,8,14,14,14,8, 8,14,11,8,8,8,11,8,\n  2,8,2,2,2,2,2,2, 2,2,2,2,36,8,36,2, 20,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,37,\n  // ACxx\n  7,37,37,39,37,39,39,37, 37,2,2,37,39,2,37,39, 37,37,37,37,37,39,37,37, 39,37,37,39,37,37,37,37,\n  2,2,2,11,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  8,8,8,9,8,33,8,8, 2,8,8,8,9,8,9,8, 8,8,9,2,2,8,8,9, 8,8,8,8,8,2,2,8,\n  8,8,2,8,8,33,8,11, 8,2,2,2,2,8,8,8, 8,8,8,8,8,8,8,8, 8,8,8,2,8,8,8,37,\n  2,6,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,6,5,2,2,2,2, 2,2,2,2,2,2,2,2,\n  36,8,2,8,2,36,2,2, 36,6,8,36,2,36,36,8, 8,2,2,8,2,8,8,3, 2,8,2,2,2,8,2,3,\n  8,8,59,8,8,59,8,3, 8,8,3,59,8,8,3,2, 8,5,8,8,8,8,8,8, 2,8,5,8,8,8,8,8,\n  2,2,59,2,2,2,2,2, 2,2,2,2,2,2,8,2, 8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,37,\n  // ADxx\n  7,39,37,37,39,39,37,39, 39,2,2,37,39,2,37,39, 39,37,39,39,39,39,39,37, 39,39,37,39,39,39,37,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 37,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  8,8,2,8,8,2,8,8, 2,8,8,2,8,8,2,2, 8,2,2,8,8,8,8,8, 8,8,8,8,2,8,8,2,\n  8,2,8,2,11,8,8,11, 8,2,11,11,8,8,8,11, 8,8,11,8,2,8,11,8, 8,2,8,8,2,8,2,37,\n  2,2,2,2,2,2,2,2, 2,2,39,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,5,2,\n  36,2,2,2,2,2,2,8, 36,2,14,8,2,8,36,2, 2,8,8,2,2,8,8,8, 2,8,8,8,8,2,2,8,\n  8,14,8,14,8,8,8,8, 8,8,8,8,8,8,2,2, 7,8,14,8,8,14,7,8, 2,8,8,8,8,8,8,8,\n  2,8,2,2,2,2,2,2, 2,2,2,2,8,2,36,2, 8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,37,\n  // AExx\n  7,39,1,39,39,39,37,37, 37,2,2,37,39,2,37,39, 39,39,39,39,39,39,37,37, 39,39,37,39,39,39,37,37,\n  2,2,2,2,2,2,2,2, 2,2,2,5,2,2,2,2, 37,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  8,9,8,2,2,9,2,2, 8,9,8,9,8,8,9,9, 2,8,2,8,8,2,8,2, 2,2,8,2,2,8,2,8,\n  8,8,8,8,8,8,2,8, 8,8,2,8,8,8,2,8, 8,8,8,2,8,8,8,8, 8,8,8,8,8,8,11,37,\n  2,2,6,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,36,8,8, 2,2,2,2,36,2,2,2, 2,2,2,2,2,2,2,8, 2,2,2,8,8,2,2,2,\n  8,8,8,14,8,6,8,8, 8,8,8,14,8,9,2,2, 8,8,8,8,8,8,8,8, 8,2,8,8,8,6,8,8,\n  2,36,36,2,2,2,2,2, 2,2,2,2,2,8,8,2, 8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,37,\n  // AFxx\n  7,9,1,1,39,39,39,37, 37,2,2,37,39,2,37,37, 37,37,37,37,37,39,37,37, 39,39,37,37,39,37,37,37,\n  2,2,2,2,2,2,2,2, 2,11,2,2,2,2,2,2, 39,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,12,8,2,12,12,8,2, 2,8,2,12,12,8,12,12, 8,8,8,8,8,2,2,2, 2,12,8,8,2,8,2,2,\n  11,2,8,2,8,8,8,8, 2,2,2,8,8,2,2,12, 2,8,2,2,2,8,8,8, 8,12,8,8,2,8,2,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  36,9,2,6,2,2,2,2, 2,2,8,8,8,2,36,2, 11,2,8,8,2,8,2,2, 8,2,8,2,2,8,2,2,\n  8,8,8,8,6,8,8,8, 8,8,8,6,6,10,8,8, 8,8,8,8,14,10,1,8, 2,2,2,2,8,8,8,8,\n  8,2,2,2,2,2,2,2, 2,2,2,8,2,2,8,2, 8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,37,\n  // B0xx\n  7,39,37,37,39,4,37,37, 39,11,2,37,37,2,37,37, 39,39,37,37,39,39,37,37, 39,39,37,39,39,39,37,37,\n  2,2,2,2,11,2,2,2, 2,2,11,2,2,2,2,2, 11,11,11,11,11,11,11,11, 11,11,2,2,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3,7,7,8,5,3,8,\n  5,8,5,2,2,2,2,2, 2,2,3,5,5,5,5,2, 5,10,8,5,7,8,3,3, 8,8,5,3,8,3,3,10,\n  // B4xx\n  7,39,1,39,39,37,37,4, 39,14,2,14,39,2,37,39, 37,39,37,37,39,39,37,37, 37,39,37,39,37,39,39,37,\n  2,2,2,11,11,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  8,11,8,8,8,11,2,2, 8,8,8,8,8,8,8,8, 8,8,11,11,8,8,8,2, 8,8,8,8,2,2,8,8,\n  8,11,8,8,8,11,8,8, 11,11,8,8,2,11,11,8, 11,8,8,11,11,11,11,8, 8,8,8,2,2,8,2,37,\n  2,2,2,6,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,3,2,8,8,3,3,14, 3,5,2,3,3,2,3,2, 2,7,3,7,3,8,7,14, 2,2,5,2,8,3,2,3,\n  5,8,5,5,7,3,7,3, 3,5,3,3,3,14,3,5, 5,7,14,3,5,14,7,5, 7,5,8,7,5,5,5,3,\n  2,14,2,2,5,2,2,5, 2,2,2,5,2,2,3,3, 3,5,3,3,7,5,5,3, 3,7,3,3,7,3,8,37,\n  // B5xx\n  7,39,37,39,39,37,37,37, 39,2,2,37,39,2,37,37, 37,39,39,37,37,37,37,37, 37,39,37,37,37,37,37,37,\n  2,2,2,2,39,2,2,2, 2,2,2,2,2,2,14,2, 37,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  8,2,33,33,33,2,11,8, 8,8,8,33,8,8,33,8, 8,39,33,8,33,8,33,8, 8,8,33,8,8,2,8,2,\n  8,9,8,8,8,8,8,11, 8,8,8,8,8,11,8,8, 8,8,11,8,3,8,8,8, 8,8,8,8,8,8,2,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,5, 2,2,2,2,2,2,2,5,\n  2,7,7,3,7,3,8,8, 5,3,8,3,7,7,3,3, 2,3,8,3,8,5,5,2, 5,8,3,7,3,3,3,5,\n  3,3,3,3,3,5,3,5, 3,5,5,5,3,3,5,3, 3,14,7,14,14,7,3,3, 3,7,3,8,7,3,7,7,\n  2,7,5,3,3,5,2,3, 2,5,3,2,2,2,5,2, 5,5,5,8,3,3,7,3, 8,8,3,8,8,8,7,37,\n  // B6xx\n  7,1,4,39,37,37,37,37, 37,2,2,37,37,2,37,37, 37,37,37,37,39,37,37,37, 37,39,37,37,37,37,37,37,\n  9,2,2,2,11,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,9,2,2,2,9,\n  8,2,8,2,8,8,8,2, 8,2,8,8,8,2,2,8, 8,8,8,8,8,8,8,8, 8,3,8,2,2,8,8,2,\n  8,30,8,9,8,8,2,8, 8,8,2,9,9,8,9,8, 9,8,9,8,8,8,8,9, 8,2,8,8,8,8,8,37,\n  2,2,2,5,2,2,5,5, 2,2,2,2,2,5,2,2, 2,11,5,2,2,2,5,5, 2,2,2,2,2,2,2,2,\n  2,8,8,2,8,3,7,5, 3,3,3,3,3,3,8,3, 8,5,2,2,3,7,7,3, 7,3,8,5,3,3,3,7,\n  3,3,8,8,3,3,3,5, 3,7,7,3,3,3,3,3, 7,7,14,3,3,8,3,8, 7,3,7,7,8,7,6,5,\n  3,7,7,2,2,2,2,2, 2,2,8,8,7,3,3,2, 8,7,5,5,5,5,5,5, 3,3,3,3,3,8,3,37,\n  // B7xx\n  7,39,37,14,39,37,39,37, 39,11,11,37,39,2,37,39, 39,39,37,39,39,39,39,37, 39,39,37,39,39,39,37,37,\n  11,2,2,11,11,2,11,2, 2,2,11,2,2,2,11,2, 37,2,2,2,2,2,2,2, 2,2,2,2,2,2,11,2,\n  8,8,8,33,33,11,8,8, 8,2,8,33,8,8,8,8, 8,8,8,8,33,8,8,8, 8,8,33,2,8,2,2,2,\n  11,11,8,2,8,11,8,11, 8,8,8,8,11,8,8,8, 2,8,8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,3,3,3,3,7,3, 3,3,5,3,5,3,3,2, 5,8,3,3,2,2,5,3,\n  3,14,8,3,14,3,5,8, 5,8,5,5,8,3,7,5, 7,14,5,3,8,5,3,5, 5,3,7,3,7,3,3,5,\n  5,8,2,2,2,2,2,5, 2,2,2,7,7,3,5,5, 7,3,7,5,8,3,3,5, 5,3,5,5,3,3,7,37,\n  // BFxx\n  7,11,37,37,37,12,37,1, 37,2,2,37,39,2,37,37, 37,37,37,37,39,37,37,37, 37,37,37,37,39,37,37,37,\n  12,11,2,2,2,2,2,11, 2,2,2,2,2,2,2,2, 37,2,2,2,2,2,2,2, 2,2,12,2,2,2,2,1,\n  8,8,1,1,8,8,1,2, 1,1,2,8,1,1,8,8, 1,1,1,1,1,8,1,8, 8,1,8,2,8,2,8,2,\n  8,12,12,8,12,12,8,2, 1,8,8,12,12,2,2,12, 2,8,1,12,2,2,8,12, 2,12,8,2,8,8,2,37,\n  2,2,2,2,2,2,2,2, 2,2,2,6,2,2,2,2, 2,2,2,5,2,2,2,2, 2,2,5,2,2,2,2,2,\n  2,5,5,5,8,5,7,7, 3,5,3,2,5,5,7,3, 5,5,7,8,3,5,7,7, 3,5,2,2,3,2,5,7,\n  5,5,5,5,8,3,3,7, 7,3,7,3,3,7,3,5, 5,14,3,3,5,3,3,3, 3,3,3,3,5,3,7,8,\n  2,3,3,2,5,2,2,2, 2,8,3,5,5,3,5,5, 8,3,5,3,7,5,3,3, 5,5,8,8,5,8,5,37,\n  // C0xx\n  7,39,37,1,39,39,37,1, 39,10,18,1,39,10,37,39, 39,39,37,37,39,39,39,37, 39,39,7,37,39,39,37,39,\n  10,10,10,10,1,10,10,10, 10,10,10,10,10,10,10,10, 37,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10,\n  8,8,1,1,1,8,1,1, 8,8,8,30,1,1,1,1, 1,1,8,1,1,3,8,8, 1,8,8,8,8,8,3,3,\n  8,3,8,1,8,8,8,8, 39,3,8,3,3,8,8,39, 8,8,1,8,8,8,8,8, 8,8,8,8,8,37,8,37,\n  10,6,6,6,6,39,3,3, 39,6,12,6,10,6,6,6, 6,6,6,6,6,6,6,6, 6,3,37,3,3,5,37,1,\n  10,3,3,8,7,5,8,5, 3,3,7,3,3,3,7,5, 5,5,5,8,3,7,3,14, 5,7,5,5,3,5,7,3,\n  3,10,10,10,10,10,10,5, 3,8,10,10,5,10,5,5, 10,10,10,5,5,10,5,3, 10,8,5,5,7,10,10,7,\n  3,5,10,7,3,5,3,5, 7,7,10,3,7,3,3,3, 10,3,8,10,8,7,3,3, 3,8,5,5,5,3,7,10,\n  // C1xx\n  7,39,1,39,39,39,37,37, 39,14,18,37,39,11,37,39, 39,39,37,39,39,39,37,39, 39,39,39,39,37,37,37,37,\n  11,18,14,14,37,11,18,14, 14,11,11,14,18,18,14,11, 37,20,11,14,14,14,14,11, 37,14,11,18,11,10,18,18,\n  8,8,1,1,1,1,1,1, 1,1,1,1,1,1,1,8, 1,1,1,1,1,1,1,8, 1,8,1,14,8,11,8,8,\n  8,8,1,8,16,16,1,1, 1,10,8,1,1,16,8,8, 8,8,1,16,1,8,16,8, 8,8,1,8,8,8,8,37,\n  39,6,6,4,39,11,3,6, 3,39,12,39,37,12,12,6, 37,6,6,6,39,3,6,6, 37,3,3,3,4,11,12,1,\n  14,5,3,3,5,3,5,3, 5,5,3,3,3,3,5,5, 7,7,10,7,3,3,5,5, 5,5,3,5,3,3,5,3,\n  10,5,5,14,3,10,3,7, 10,11,8,3,18,20,10,3, 3,14,14,10,18,14,5,14, 5,3,3,10,3,5,3,5,\n  10,7,3,3,8,3,3,8, 14,3,7,10,3,3,5,5, 5,5,5,10,3,5,5,3, 5,3,5,10,7,5,5,10,\n  // C2xx\n  7,39,37,37,39,39,39,37, 39,14,14,1,39,14,37,1, 39,37,39,39,39,39,39,37, 37,37,37,39,37,39,37,39,\n  10,14,14,14,39,10,14,14, 14,14,14,10,14,10,10,14, 37,10,10,14,14,10,10,10, 39,14,14,10,14,10,14,14,\n  8,8,1,16,16,8,8,1, 8,8,16,16,16,1,1,8, 16,8,16,16,1,1,16,8, 8,1,8,8,8,14,8,8,\n  8,8,8,8,8,8,8,1, 1,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,1, 8,8,8,8,14,8,8,37,\n  37,59,2,11,3,39,11,11, 2,39,10,2,2,59,11,59, 11,11,12,3,2,3,2,2, 11,11,3,12,4,59,17,11,\n  2,2,7,2,2,3,7,2, 59,2,2,2,3,7,2,3, 2,2,8,7,2,2,3,3, 7,14,2,2,3,3,7,2,\n  10,3,8,3,3,10,3,3, 10,3,3,10,3,10,10,18, 7,10,14,7,3,18,3,3, 7,14,10,3,8,3,3,7,\n  8,11,10,11,3,7,7,7, 7,3,7,3,14,3,10,5, 3,10,3,3,3,10,3,5, 5,5,3,5,5,3,3,10,\n  // C3xx\n  7,1,4,39,39,37,37,1, 37,14,12,3,39,14,1,1, 39,37,39,37,37,39,37,37, 39,39,37,37,39,37,37,37,\n  14,14,14,1,1,1,14,14, 14,11,11,5,14,11,14,11, 37,14,10,14,14,10,14,14, 10,10,11,14,14,11,14,1,\n  8,10,8,8,8,1,8,12, 8,12,8,8,12,8,12,1, 8,8,12,1,12,12,10,10, 8,8,8,8,8,8,8,39,\n  8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8, 1,8,1,8,8,8,8,8, 8,8,8,8,14,8,8,37,\n  2,2,59,59,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,5,2,5, 2,2,2,5,2,2,2,3,\n  3,14,7,14,10,3,7,3, 11,3,5,3,11,11,10,7, 14,11,14,11,11,11,5,3, 3,14,11,11,3,11,11,5,\n  5,11,5,11,11,7,3,3, 3,14,7,5,14,11,10,3, 10,3,5,11,3,11,8,3, 5,3,7,3,3,8,8,10,\n  // C4xx\n  7,6,1,39,37,37,37,37, 39,10,18,1,39,18,1,37, 37,37,37,37,39,37,37,37, 39,37,37,37,39,37,37,37,\n  18,18,10,1,1,1,10,1, 6,10,6,3,18,10,18,10, 37,10,10,10,10,5,5,5, 5,5,18,18,10,6,10,1,\n  8,8,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,8,1,1,1,1,1,8, 1,8,1,8,8,8,8,8,\n  3,8,8,8,8,1,8,1, 1,8,8,1,8,8,1,8, 1,8,1,1,1,1,8,8, 8,8,8,8,8,8,8,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,5,7,3,3,7,3,5, 5,3,3,5,3,5,7,2, 2,2,8,8,7,8,3,3, 3,7,7,3,2,3,3,3,\n  10,5,10,3,5,10,10,3, 10,3,10,10,7,10,10,3, 3,3,8,10,3,18,3,18, 3,18,3,10,3,8,5,10,\n  10,3,3,3,3,10,8,20, 10,20,3,10,7,5,10,3, 10,3,8,7,3,8,5,5, 7,7,3,5,5,8,3,10,\n  // C5xx\n  7,39,37,14,39,39,37,37, 39,14,18,39,39,18,39,39, 39,39,37,37,39,39,37,39, 39,39,39,39,39,39,37,37,\n  18,18,18,14,39,18,18,1, 14,18,14,3,18,18,18,14, 37,10,10,10,10,6,10,10, 39,20,18,18,18,1,18,18,\n  8,8,1,3,1,1,8,1, 1,1,8,1,1,1,1,1, 1,8,1,1,1,8,1,8, 8,8,1,8,8,8,8,8,\n  39,8,1,3,1,8,8,1, 1,8,12,1,1,1,8,8, 1,8,1,1,1,8,8,8, 8,8,12,3,8,8,8,37,\n  2,2,2,2,2,2,2,2, 2,37,5,2,2,2,12,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,3,2,3,14, 3,5,7,2,5,5,3,2, 5,2,5,2,7,3,3,7, 5,7,2,5,2,2,2,5,\n  7,5,5,5,10,3,3,10, 11,10,10,10,10,5,18,11, 10,10,10,11,7,10,11,5, 5,7,11,5,8,3,11,7,\n  3,11,3,8,5,8,5,7, 14,8,7,5,7,11,3,3, 5,10,7,3,3,5,7,5, 5,7,3,3,7,8,7,37,\n  // C6xx\n  7,37,39,1,39,39,37,37, 37,10,12,37,39,11,37,37, 39,39,37,39,39,39,39,37, 39,39,37,39,39,39,37,39,\n  11,12,10,1,37,39,11,1, 37,11,11,10,12,18,10,10, 37,3,11,10,3,3,3,3, 39,3,12,39,11,6,10,12,\n  37,12,1,8,1,12,8,1, 1,12,8,1,1,1,1,8, 8,8,1,1,1,8,1,8, 8,8,8,8,8,8,8,8,\n  8,8,1,1,1,8,8,8, 8,12,8,8,8,12,1,12, 8,8,8,8,1,12,8,12, 8,1,8,8,8,8,8,37,\n  37,6,6,6,4,3,2,4, 6,39,6,39,6,6,6,2, 6,6,2,6,37,6,39,6, 39,2,4,2,39,3,37,4,\n  2,2,3,7,3,3,7,7, 7,7,3,3,3,3,5,5, 2,3,5,7,3,3,3,3, 3,3,3,7,5,3,3,3,\n  3,3,3,7,5,10,3,5, 10,7,10,5,3,10,10,7, 5,11,5,10,5,3,3,3, 3,3,3,5,11,5,3,3,\n  7,11,7,11,3,10,3,3, 10,7,5,3,3,5,7,3, 3,7,5,3,3,3,11,5, 3,5,5,3,7,7,7,37,\n  // C7xx\n  7,39,39,39,37,39,39,39, 39,11,11,14,39,11,37,39, 39,39,37,39,39,39,39,37, 39,39,37,39,39,39,39,39,\n  11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11, 37,11,11,11,11,14,11,11, 11,11,11,11,11,11,1,11,\n  18,1,1,16,16,1,8,16, 1,1,16,16,1,1,16,1, 16,8,16,16,16,1,16,1, 37,1,16,11,39,11,11,11,\n  39,1,1,31,16,1,8,1, 1,1,8,1,1,1,1,1, 8,8,1,1,37,1,1,3, 37,8,8,39,37,11,8,37,\n  2,11,6,2,37,37,39,12, 37,6,39,3,39,2,2,39, 11,2,2,2,2,11,2,6, 11,11,2,2,2,2,11,2,\n  11,11,3,3,7,5,3,3, 3,3,5,3,3,7,3,7, 5,3,5,5,14,7,3,3, 3,14,7,5,7,7,7,3,\n  10,11,10,1,10,3,11,11, 11,11,11,11,11,11,11,5, 5,5,5,11,11,5,11,5, 5,5,11,11,7,11,11,11,\n  5,11,5,11,11,11,11,3, 5,3,3,3,3,11,7,3, 11,7,3,3,5,5,5,3, 3,5,3,5,5,5,3,10,\n  // C8xx\n  7,37,37,14,37,37,39,39, 37,11,11,37,39,11,37,39, 37,37,37,37,39,37,37,39, 39,39,37,39,37,37,37,37,\n  11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11, 37,11,11,11,11,11,18,11, 18,11,11,18,11,11,10,18,\n  11,12,1,1,1,12,1,1, 12,12,12,12,12,1,12,12, 12,1,1,1,1,12,1,12, 1,1,1,11,11,11,11,11,\n  11,12,1,1,1,12,3,1, 12,12,12,12,12,1,1,12, 10,37,12,12,12,12,12,11, 39,12,12,11,11,11,3,37,\n  39,11,6,6,3,37,2,3, 39,6,12,37,39,11,10,6, 11,6,6,6,11,11,6,6, 11,2,2,2,2,11,11,1,\n  11,3,7,5,3,3,3,3, 3,7,3,3,7,5,5,5, 5,3,5,7,3,3,3,3, 5,5,3,3,3,7,3,5,\n  10,10,10,3,5,10,5,11, 3,11,10,3,10,11,3,3, 10,11,10,11,11,3,7,10, 11,3,11,11,11,3,11,10,\n  7,11,3,11,11,11,11,3, 7,3,5,3,10,11,10,5, 10,5,7,7,3,3,11,5, 3,5,11,5,3,3,7,37,\n  // C9xx\n  7,39,11,39,37,39,37,10, 39,11,18,39,37,11,37,39, 39,37,39,37,39,39,37,37, 39,39,37,39,39,39,37,39,\n  11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11, 37,11,11,11,11,11,11,11, 11,11,11,18,11,11,11,18,\n  8,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,11,11,11,11,11,\n  18,8,1,1,1,8,1,1, 1,1,1,1,1,1,1,8, 1,1,1,1,1,8,1,3, 1,1,1,1,11,11,11,37,\n  39,6,6,6,6,11,37,12, 6,6,12,6,6,6,12,6, 2,2,2,6,2,11,6,2, 6,2,2,2,2,11,11,2,\n  11,11,3,3,7,3,7,7, 3,7,3,3,7,3,7,3, 3,3,7,3,7,3,3,3, 7,3,3,11,7,3,7,11,\n  14,3,7,7,10,18,3,3, 18,18,7,3,3,10,18,3, 3,10,10,18,7,7,18,7, 7,3,18,7,3,7,18,7,\n  3,7,7,3,3,7,3,3, 3,7,3,7,3,3,3,20, 7,3,3,3,7,3,3,7, 3,3,3,7,7,3,7,37,\n  // CAxx\n  7,6,39,37,39,37,37,37, 37,11,11,37,37,11,37,37, 37,37,37,37,39,37,37,37, 39,37,37,37,39,37,37,4,\n  11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11, 37,11,11,11,11,11,11,11, 14,11,11,18,11,11,10,18,\n  11,10,12,12,12,1,1,12, 1,8,1,12,1,1,1,10, 12,1,1,1,1,1,1,12, 1,37,12,11,8,11,8,11,\n  37,10,1,8,12,8,37,37, 1,1,12,12,12,12,1,8, 10,1,1,12,1,1,39,1, 1,8,12,1,11,11,11,37,\n  2,2,6,2,2,11,2,2, 2,2,2,2,12,2,39,6, 11,39,2,6,2,11,6,6, 11,11,37,2,10,11,2,2,\n  11,3,3,7,3,3,3,3, 3,3,7,3,7,3,3,3, 3,3,3,3,14,3,3,3, 7,3,14,3,3,3,3,3,\n  10,14,3,11,7,10,3,3, 11,7,3,10,7,11,10,11, 3,11,3,11,3,3,3,3, 11,3,11,3,3,11,11,11,\n  10,11,7,11,3,11,11,7, 14,3,3,10,3,11,10,3, 10,7,10,7,3,3,3,3, 3,20,7,3,7,3,7,11,\n  // CBxx\n  7,1,39,37,37,39,37,37, 1,11,18,37,37,11,37,37, 37,37,37,37,37,37,37,37, 37,37,7,37,37,37,37,37,\n  11,18,11,10,1,39,18,11, 11,11,11,3,18,18,10,11, 37,10,10,3,10,3,10,10, 3,11,11,18,11,3,11,18,\n  8,10,1,1,16,1,1,16, 1,1,16,16,1,16,1,10, 16,1,1,16,16,1,16,1, 1,39,1,37,11,10,11,11,\n  37,1,1,1,1,37,1,1, 1,10,1,1,1,8,1,1, 1,1,1,1,1,37,37,37, 8,39,39,3,8,37,3,37,\n  2,6,6,4,39,2,2,2, 2,2,2,2,2,2,2,37, 2,2,6,16,6,11,37,6, 2,2,2,2,2,2,2,1,\n  11,7,3,3,3,3,7,3, 7,3,3,3,7,3,3,3, 3,7,10,3,7,3,3,7, 3,3,7,7,3,3,3,3,\n  10,14,3,14,3,10,3,11, 10,3,10,10,7,3,3,18, 3,3,14,10,18,3,3,3, 3,3,7,10,7,8,10,3,\n  3,11,7,3,3,10,3,14, 7,14,3,3,11,11,10,3, 3,3,8,10,7,3,7,3, 3,3,3,3,3,3,7,10,\n  // CCxx\n  7,39,39,37,39,39,39,37, 39,11,18,37,37,11,37,39, 39,39,39,37,39,39,39,37, 39,39,37,37,39,39,37,37,\n  11,10,11,11,11,11,11,11, 18,11,11,10,11,10,10,11, 37,11,11,11,11,11,11,11, 11,11,11,6,11,37,6,18,\n  8,1,12,12,12,16,1,1, 12,16,12,12,12,12,12,31, 12,1,12,12,12,8,12,6, 8,10,12,1,11,11,1,11,\n  10,1,1,1,8,16,1,1, 1,10,1,1,1,3,1,1, 1,8,18,1,1,10,37,11, 8,10,1,8,8,11,3,39,\n  2,2,6,2,2,2,2,2, 2,2,12,6,6,12,12,6, 6,6,6,6,6,6,3,6, 6,37,2,3,37,11,2,1,\n  11,7,7,7,7,3,3,3, 3,3,7,3,3,3,7,3, 3,7,3,3,7,7,3,3, 3,3,3,3,3,3,7,7,\n  10,18,7,3,7,10,3,11, 10,18,11,10,7,10,10,11, 11,11,11,10,3,3,3,3, 3,3,7,10,7,3,11,10,\n  10,3,3,11,11,3,11,7, 10,7,3,7,3,11,10,3, 3,7,7,7,3,3,7,7, 3,3,3,3,3,3,7,10,\n  // CDxx\n  7,39,37,14,39,37,37,37, 37,14,18,14,37,11,14,11, 39,39,37,39,39,39,37,37, 39,37,37,37,39,37,37,37,\n  11,18,11,11,11,11,14,14, 14,11,11,11,18,18,14,11, 37,14,11,14,14,14,14,14, 14,11,14,18,11,11,10,18,\n  18,1,1,1,1,1,1,1, 1,10,1,1,1,1,1,1, 1,1,1,1,1,1,1,8, 1,10,1,37,37,11,37,11,\n  6,1,1,1,1,16,37,1, 8,10,8,39,1,1,1,1, 37,8,1,1,1,37,10,8, 1,39,8,37,14,11,11,37,\n  37,6,6,6,37,39,37,2, 6,37,12,6,6,12,12,6, 6,39,6,6,37,6,6,6, 11,37,37,3,37,11,11,1,\n  1,14,7,3,14,3,3,14, 3,3,3,7,3,7,3,3, 3,3,10,3,3,3,3,3, 3,14,14,3,3,7,3,3,\n  10,3,14,14,10,10,3,11, 10,11,11,3,11,10,10,11, 3,7,10,11,14,7,11,7, 3,11,3,10,11,11,11,11,\n  10,11,3,11,11,10,11,3, 7,14,3,3,11,11,10,20, 7,7,3,11,3,3,3,7, 3,3,3,3,3,7,3,10,\n  // CExx\n  7,39,37,37,39,39,37,37, 39,11,18,37,39,11,37,37, 39,39,37,37,39,39,37,37, 39,39,3,37,39,39,37,37,\n  11,10,11,11,39,10,10,10, 11,10,11,5,11,18,10,11, 37,11,10,10,11,10,10,11, 11,11,11,18,11,11,10,18,\n  5,8,16,16,16,10,1,16, 1,1,16,16,1,16,1,37, 16,37,16,16,1,31,16,39, 37,1,16,37,37,8,37,10,\n  8,18,37,1,8,37,10,8, 37,18,1,39,1,1,1,1, 16,8,16,16,37,37,16,37, 8,18,1,37,39,8,3,37,\n  37,6,6,6,2,2,2,2, 2,2,2,6,2,6,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,3,2,2,3,2,3, 7,7,3,3,3,2,2,3, 3,2,2,2,3,2,3,2, 2,2,2,3,2,2,2,2,\n  3,10,10,10,3,3,10,11, 3,10,3,10,10,10,11,7, 10,10,3,7,10,3,10,10, 11,18,3,3,11,3,3,10,\n  7,11,3,7,3,3,11,3, 3,3,10,10,10,11,7,3, 10,3,10,3,10,3,3,3, 7,10,3,3,3,3,3,37,\n  // CFxx\n  7,11,37,37,37,39,37,37, 37,11,18,11,39,11,37,37, 39,37,37,37,39,39,37,37, 39,39,37,39,37,39,37,37,\n  11,11,11,6,11,11,11,11, 11,11,11,11,11,18,11,11, 37,11,11,11,11,11,11,11, 11,11,11,18,11,11,11,18,\n  11,12,1,1,1,1,1,30, 1,16,30,1,1,1,1,16, 10,1,1,1,1,16,1,1, 1,1,1,11,11,11,11,11,\n  8,12,37,39,12,39,8,37, 8,8,1,39,1,8,1,10, 10,8,12,8,1,12,8,8, 8,8,37,37,18,11,39,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,37, 11,39,11,6,11,2,2,6, 11,11,37,2,2,11,2,1,\n  11,11,3,3,3,3,3,3, 3,7,3,7,3,7,3,3, 3,3,3,7,3,3,3,3, 3,3,7,7,3,3,20,7,\n  10,3,3,7,3,10,3,11, 3,11,3,10,18,18,10,11, 10,11,18,10,3,3,3,3, 3,3,11,10,3,11,3,3,\n  3,11,3,11,3,11,11,3, 3,3,3,3,3,11,10,3, 10,3,3,3,3,11,11,3, 11,3,3,3,3,3,3,10,\n  // D0xx\n  7,39,1,37,39,1,39,9, 39,14,14,1,39,14,1,39, 39,39,37,37,39,39,37,37, 39,39,37,39,39,37,37,37,\n  11,14,14,11,1,10,14,14, 14,14,14,14,10,10,10,11, 37,10,10,10,10,14,10,31, 10,10,11,10,14,10,10,14,\n  1,13,1,13,13,13,1,1, 1,13,1,16,13,13,16,16, 16,37,13,1,16,13,16,1, 39,16,13,14,3,14,14,10,\n  8,16,1,39,1,16,31,3, 37,16,1,16,16,16,16,16, 18,8,16,8,16,16,16,8, 39,16,8,8,14,8,3,37,\n  10,2,6,2,2,2,2,2, 2,2,2,2,2,3,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,3,2,3,2,2,3,3, 2,3,14,2,3,3,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  10,3,3,10,3,3,10,3, 10,11,10,3,10,3,10,18, 3,10,10,10,3,3,3,3, 3,18,10,10,10,3,3,11,\n  10,11,3,3,11,10,11,3, 3,3,3,3,3,3,10,20, 3,20,3,10,3,3,11,3, 3,3,11,3,3,3,3,10,\n  // D1xx\n  7,37,37,37,39,39,11,37, 39,11,18,37,39,11,37,39, 39,39,37,37,39,39,37,37, 39,39,37,39,39,37,37,37,\n  11,11,11,10,11,11,11,11, 11,11,11,11,11,11,11,11, 37,11,11,11,11,11,11,11, 11,11,11,18,11,11,11,18,\n  11,1,12,12,10,1,10,1, 10,1,1,12,8,12,37,1, 10,37,37,12,10,1,10,31, 11,3,1,37,11,11,11,11,\n  39,1,3,10,31,1,37,37, 10,10,1,11,11,37,7,1, 31,11,10,37,31,1,37,31, 11,39,37,8,11,11,11,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 11,2,2,2,2,2,2,2, 2,2,2,2,2,11,2,2,\n  11,3,3,3,14,3,3,3, 3,3,3,3,3,3,3,3, 3,3,3,14,14,3,3,14, 3,3,14,3,3,3,14,3,\n  10,20,10,11,11,10,11,11, 11,11,10,10,11,11,10,11, 3,10,10,11,3,3,11,3, 3,20,11,3,10,11,11,11,\n  10,10,10,11,11,11,11,3, 10,3,10,3,11,11,10,10, 10,10,10,3,3,3,11,10, 3,3,11,3,3,3,3,10,\n  // D2xx\n  7,39,39,37,39,39,37,12, 39,14,14,39,39,14,37,37, 39,39,37,39,39,39,39,37, 39,39,37,37,39,37,37,37,\n  11,10,14,14,11,11,14,14, 14,14,11,11,11,10,10,14, 37,10,14,14,10,14,11,11, 14,11,14,18,14,14,14,18,\n  11,16,1,1,1,16,8,1, 31,16,31,12,1,1,1,12, 1,1,1,12,12,12,1,31, 1,31,1,11,8,14,11,11,\n  10,31,31,31,31,12,31,31, 31,12,8,39,31,31,31,1, 31,31,1,31,31,16,10,31, 1,31,8,1,14,39,14,39,\n  37,6,6,2,2,39,3,4, 39,39,3,6,6,12,3,6, 11,2,2,2,28,3,2,2, 11,2,2,2,2,2,39,1,\n  14,14,14,3,14,3,3,14, 14,3,3,3,3,14,3,2, 3,3,3,3,14,3,3,14, 14,14,3,3,14,3,14,14,\n  10,14,10,14,3,10,3,11, 10,3,14,3,11,10,10,18, 10,3,3,10,3,3,3,3, 18,18,3,10,10,3,11,3,\n  10,11,3,11,3,3,3,3, 10,3,3,3,3,11,10,3, 10,3,3,10,3,3,3,3, 3,3,10,3,3,3,3,10,\n  // D3xx\n  7,37,37,1,39,37,37,37, 39,11,18,39,37,11,37,18, 37,39,37,39,37,39,37,37, 39,39,37,39,39,37,37,37,\n  11,11,11,11,11,11,11,11, 11,11,11,11,11,18,18,11, 11,11,11,11,11,11,11,11, 11,11,11,18,11,11,31,18,\n  11,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,3,8,11,3,11,\n  37,1,1,1,1,1,1,37, 1,8,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,8,1,11,11,8,39,37,\n  10,11,6,6,2,11,3,12, 39,6,6,3,6,3,6,12, 11,2,11,3,11,6,6,2, 2,2,3,3,37,11,3,2,\n  11,3,3,12,3,3,3,14, 3,2,3,3,9,3,3,3, 3,3,3,3,3,3,3,14, 20,14,14,14,14,3,3,3,\n  3,10,3,3,10,3,10,11, 11,3,3,18,11,3,3,10, 3,3,3,11,18,3,3,10, 11,10,3,18,11,11,10,11,\n  3,11,10,11,11,11,11,10, 3,3,3,3,11,11,3,3, 10,3,3,11,3,20,3,10, 11,3,3,3,3,3,3,10,\n  // D4xx\n  7,39,37,1,39,39,39,37, 39,14,18,37,39,11,37,37, 39,39,39,37,39,39,37,37, 39,39,37,37,39,37,37,37,\n  11,18,18,1,11,11,11,1, 18,11,11,3,18,18,18,14, 37,11,11,10,11,11,10,11, 11,11,18,18,11,11,11,18,\n  1,1,1,1,1,8,1,8, 1,1,1,1,1,1,1,1, 1,1,1,1,1,8,1,11, 1,39,1,37,37,3,11,18,\n  18,33,14,31,39,20,31,1, 11,10,1,39,1,1,1,20, 18,8,8,31,1,3,31,31, 1,18,1,8,11,11,3,39,\n  37,6,6,3,3,11,12,3, 37,6,3,6,6,6,12,37, 11,6,3,3,3,6,6,6, 11,3,39,3,3,11,3,4,\n  11,14,3,3,3,3,3,14, 14,3,3,3,3,3,3,3, 3,3,3,5,3,3,3,14, 3,14,3,14,3,3,3,3,\n  10,18,3,3,3,18,3,11, 11,18,3,3,11,11,11,18, 3,11,18,3,3,18,3,18, 3,3,3,11,11,3,11,11,\n  10,11,3,11,11,11,11,3, 10,14,14,3,3,11,10,20, 3,3,3,3,3,3,3,3, 3,3,3,3,3,10,3,37,\n  // D5xx\n  7,39,37,39,37,39,37,37, 39,14,18,14,37,11,37,37, 39,39,37,39,39,39,37,37, 39,39,37,39,39,39,39,39,\n  11,14,11,14,39,11,14,14, 14,11,11,14,18,10,18,11, 37,11,11,11,11,11,10,11, 11,11,11,18,11,11,10,18,\n  1,31,1,12,12,1,12,1, 1,1,1,12,1,1,1,12, 1,37,1,12,1,1,12,37, 37,37,12,37,37,18,8,11,\n  37,31,1,1,31,31,3,37, 1,1,1,1,39,31,1,31, 1,39,31,31,31,8,31,1, 1,31,37,3,14,37,8,37,\n  2,2,2,2,2,2,2,2, 2,37,2,39,2,2,2,2, 2,2,2,3,2,2,2,6, 39,11,2,2,2,2,2,4,\n  14,2,3,2,14,2,3,2, 3,3,3,2,3,3,3,3, 3,3,2,3,2,2,2,14, 2,3,2,14,3,3,3,3,\n  10,14,3,3,3,3,3,11, 11,11,3,3,18,11,10,11, 3,11,3,18,3,3,3,3, 3,3,11,3,11,11,18,3,\n  10,11,3,3,11,11,11,3, 14,14,3,3,3,11,10,3, 3,3,3,3,3,3,11,3, 11,3,11,3,3,3,3,37,\n  // D6xx\n  7,39,37,37,37,39,37,37, 37,11,11,37,39,11,39,39, 39,37,37,37,37,37,37,37, 39,39,39,39,39,39,37,37,\n  11,11,11,1,39,11,11,1, 11,6,11,3,11,1,11,1, 37,1,11,1,11,11,11,11, 37,1,11,1,11,3,1,1,\n  39,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,37,37,11,3,11,\n  8,1,1,1,1,37,1,1, 1,1,1,1,1,1,1,1, 1,8,1,1,1,1,1,1, 1,1,1,1,39,8,3,37,\n  2,2,2,2,2,2,2,2, 6,2,39,12,6,4,6,37, 6,2,2,6,2,12,2,2, 6,2,2,2,2,2,2,4,\n  2,14,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, 3,3,3,3,3,3,2,3, 3,3,20,3,3,3,3,3,\n  10,3,3,3,18,10,3,11, 10,11,3,18,3,11,3,11, 3,11,3,3,3,3,3,3, 3,3,3,10,3,3,3,8,\n  3,11,10,11,11,10,11,3, 10,3,3,3,3,11,3,3, 3,3,3,3,3,3,11,3, 3,3,3,3,3,3,3,10,\n  // D7xx\n  7,39,37,37,39,37,37,6, 39,18,18,37,39,18,37,4, 37,37,37,39,39,39,37,37, 37,39,37,37,39,39,37,37,\n  18,18,18,11,11,11,18,10, 11,18,11,3,18,10,18,10, 37,11,11,11,11,11,11,11, 11,11,18,18,18,11,10,11,\n  11,10,11,3,11,10,11,11, 8,10,11,11,11,11,11,37, 11,8,3,39,11,8,11,11, 11,10,11,11,11,11,8,39,\n  11,11,11,11,11,37,11,3, 11,18,11,11,11,11,11,3, 18,11,11,11,11,3,37,11, 3,18,11,11,11,11,11,37,\n  2,2,2,2,2,3,11,6, 2,6,37,6,3,4,6,6, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,3,3,2,3,2,2, 2,2,2,3,3,3,3,3, 3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,\n  10,18,10,3,7,3,3,3, 10,3,3,3,3,14,18,18, 3,20,10,3,3,18,3,11, 10,18,3,3,3,3,3,3,\n  10,20,3,3,3,3,3,3, 14,3,3,10,3,3,3,3, 3,3,3,3,3,3,3,3, 3,3,11,10,7,8,20,37,\n  // D8xx\n  7,39,39,39,39,39,39,39, 39,1,18,39,39,11,39,39, 39,39,39,39,39,39,39,39, 39,39,39,39,39,39,39,39,\n  11,11,11,39,39,39,11,11, 11,11,1,3,11,1,11,1, 7,1,1,1,1,1,1,1, 1,1,11,18,11,1,18,18,\n  1,12,1,12,1,12,1,1, 1,12,1,1,1,1,1,12, 1,39,1,1,1,1,1,1, 1,1,1,11,11,11,39,11,\n  39,12,1,33,33,12,1,1, 33,1,33,1,33,33,1,1, 8,39,1,1,33,1,1,1, 1,1,33,8,18,11,3,39,\n  39,6,6,6,39,39,39,39, 3,39,12,6,2,6,6,39, 3,6,39,3,3,6,6,6, 39,39,39,2,33,11,39,2,\n  11,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,14,14,3,14,5,\n  10,14,14,14,3,10,11,11, 11,11,10,10,10,12,18,10, 10,11,10,10,3,27,10,27, 11,27,11,11,11,11,11,11,\n  10,11,10,11,11,11,11,20, 14,14,10,10,11,11,10,10, 10,11,10,11,3,11,11,3, 11,3,11,10,3,3,3,3,\n  // D9xx\n  7,12,39,1,4,39,4,39, 39,18,18,39,39,11,39,39, 39,39,39,39,39,39,39,39, 39,39,39,39,39,39,39,39,\n  11,18,18,14,1,18,18,11, 6,18,14,5,18,18,18,18, 7,6,6,6,6,6,6,6, 6,6,18,18,18,18,14,18,\n  8,1,12,12,12,1,3,1, 12,1,12,12,12,12,12,1, 12,3,12,12,12,1,12,7, 1,3,12,7,7,6,8,39,\n  18,8,12,12,12,1,7,8, 12,1,1,12,1,12,1,8, 3,8,12,12,12,3,12,6, 1,8,39,7,3,14,5,3,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,3,6,6, 6,6,3,3,3,3,39,3,\n  2,14,2,5,3,5,2,14, 14,3,14,2,2,14,9,3, 6,2,3,3,14,14,3,14, 3,2,14,14,2,5,2,3,\n  10,14,7,14,18,10,3,11, 10,11,18,18,18,20,10,6, 20,11,18,20,20,5,20,18, 12,3,11,18,10,11,18,11,\n  14,11,3,11,11,11,11,8, 14,14,14,5,11,11,10,7, 3,3,3,11,3,11,11,3, 11,5,11,7,5,5,5,10,\n  // DAxx\n  7,1,39,1,39,39,39,39, 11,11,11,39,39,11,39,11, 39,39,39,39,39,39,39,39, 39,39,39,39,39,39,39,39,\n  11,11,11,11,11,11,11,11, 11,11,11,5,11,11,11,11, 7,11,11,5,5,3,5,11, 11,11,11,18,11,11,11,18,\n  11,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,3, 1,1,1,11,11,11,11,11,\n  8,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,8,1,1,1,1,1,3, 1,1,1,8,8,39,11,3,\n  2,2,6,6,2,2,2,2, 2,2,12,6,2,12,12,2, 6,2,6,2,11,2,2,6, 2,2,2,3,2,11,12,1,\n  11,11,5,3,3,8,5,3, 10,2,5,3,8,2,3,2, 6,5,6,2,3,2,3,5, 5,3,2,8,3,6,2,11,\n  18,18,11,3,18,10,10,11, 11,11,11,11,11,18,18,11, 11,11,11,11,11,11,11,18, 11,11,11,3,11,11,11,10,\n  27,11,27,11,11,11,11,7, 12,3,3,5,11,11,3,3, 11,11,11,11,3,11,11,3, 12,3,11,3,3,5,3,11,\n  // DBxx\n  7,39,39,39,39,39,39,39, 39,10,10,39,39,10,39,39, 39,39,39,39,39,39,39,39, 39,39,39,39,39,39,39,39,\n  11,10,10,10,39,10,10,1, 3,11,11,5,11,10,10,31, 7,31,31,31,31,31,31,31, 31,31,10,18,10,10,10,10,\n  18,12,1,16,16,12,12,16, 12,1,12,16,16,16,16,39, 16,7,16,16,1,1,12,7, 10,1,16,7,7,8,7,8,\n  8,1,12,39,16,1,39,16, 31,8,8,16,8,8,1,10, 8,39,1,1,1,8,39,1, 1,8,7,39,3,8,5,39,\n  2,2,6,2,39,39,2,2, 2,6,6,2,2,2,2,39, 2,6,2,2,2,2,6,6, 39,3,2,39,2,2,2,1,\n  11,3,3,8,3,8,8,3, 10,2,3,3,3,3,5,3, 2,2,2,2,2,2,2,2, 2,2,3,3,3,6,5,3,\n  3,18,10,10,10,10,10,11, 11,10,10,10,10,10,18,11, 11,11,10,11,18,10,11,10, 11,7,3,1,11,11,27,10,\n  3,11,3,11,11,11,11,3, 3,1,7,3,11,11,27,27, 7,3,11,11,5,11,5,3, 11,7,11,3,3,3,3,3,\n  // DCxx\n  7,39,1,11,4,39,39,39, 39,1,11,39,39,11,39,39, 39,39,39,39,39,39,39,39, 39,39,39,39,39,39,39,39,\n  11,11,11,11,11,11,11,1, 11,1,11,11,11,11,11,11, 7,11,11,11,11,11,11,11, 11,11,11,20,11,11,1,1,\n  11,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,11,1,1,1,11,1,1, 1,1,1,11,11,11,11,11,\n  8,11,1,1,1,1,1,8, 1,11,11,1,1,1,1,11, 11,11,1,1,1,11,1,11, 1,1,1,11,11,3,11,3,\n  39,6,6,39,6,11,11,3, 39,3,3,6,6,6,3,39, 2,11,11,6,3,11,6,6, 2,11,2,3,3,2,3,2,\n  2,11,3,3,3,7,11,11, 5,11,2,3,5,3,11,6, 3,5,3,3,7,3,6,3, 3,5,11,5,3,3,3,3,\n  3,10,11,11,11,10,18,11, 11,11,11,18,11,10,11,11, 13,11,11,11,18,11,11,11, 11,11,11,11,11,11,13,11,\n  3,11,5,11,11,11,11,3, 20,20,20,20,11,11,3,3, 11,20,11,20,20,11,3,20, 11,3,11,3,1,5,3,11,\n  // DDxx\n  7,1,4,39,39,39,39,39, 39,13,11,13,39,11,4,39, 39,3,39,39,39,39,39,39, 39,39,39,39,39,39,39,39,\n  11,13,11,11,11,11,13,13, 13,11,13,5,11,13,13,11, 7,11,11,11,11,11,11,13, 11,11,11,13,11,11,13,13,\n  11,13,1,1,13,13,13,13, 13,1,1,13,13,13,13,13, 1,39,13,13,13,1,1,13, 13,13,13,7,13,11,3,11,\n  13,13,13,13,13,13,13,13, 13,13,13,13,13,13,13,13, 13,13,13,13,13,7,13,7, 13,13,13,11,13,11,5,3,\n  56,6,6,6,3,3,3,6, 39,6,12,6,6,12,12,6, 6,6,6,6,6,6,6,6, 11,6,6,3,3,11,3,3,\n  11,11,8,5,5,3,7,8, 7,9,3,3,3,3,3,8, 3,3,6,1,3,7,3,3, 3,3,3,5,3,6,5,11,\n  6,5,10,11,11,11,11,11, 11,11,11,10,11,11,11,11, 11,11,10,11,11,11,11,5, 11,11,11,11,11,11,11,11,\n  3,11,10,11,11,11,11,13, 20,10,10,10,11,11,20,10, 10,20,10,11,20,11,11,20, 11,20,11,8,3,10,13,3,\n  // DExx\n  7,1,39,39,4,39,4,39, 39,11,11,39,6,11,39,39, 39,39,39,39,39,39,39,39, 39,39,39,39,39,39,39,39,\n  11,11,11,11,11,11,11,11, 6,11,11,11,11,11,13,11, 7,11,11,11,11,11,11,6, 11,11,11,6,11,11,13,18,\n  11,13,13,13,16,13,13,13, 13,13,1,13,13,13,16,16, 16,8,1,16,13,13,13,13, 1,13,33,11,11,11,11,1,\n  13,13,13,1,1,13,13,1, 13,13,1,3,13,16,13,13, 1,3,1,8,13,13,16,1, 7,16,39,7,6,11,11,3,\n  2,6,2,2,2,2,2,2, 2,2,2,2,2,2,2,6, 2,2,31,2,2,2,2,2, 6,2,2,4,2,2,2,4,\n  11,11,3,3,3,3,2,2, 2,2,2,2,2,2,2,7, 2,3,6,8,5,6,6,3, 6,3,3,3,7,6,6,11,\n  5,18,10,10,10,18,10,11, 11,11,11,18,10,11,18,11, 10,11,10,11,18,11,11,10, 11,10,11,18,11,11,11,11,\n  27,11,10,11,11,11,11,10, 20,5,20,10,11,11,13,10, 10,20,20,11,20,11,11,7, 11,10,11,7,13,13,11,11,\n  // DFxx\n  7,1,39,39,7,10,39,39, 39,11,11,7,39,11,39,11, 39,39,39,39,39,39,39,39, 39,39,37,37,39,39,39,39,\n  11,11,11,11,11,11,11,11, 11,11,11,6,11,1,11,11, 7,11,11,11,11,14,14,11, 14,14,11,6,11,11,11,1,\n  3,11,1,1,1,1,1,1, 1,1,1,8,1,3,8,1, 1,1,1,1,1,1,1,39, 11,8,1,3,3,11,3,11,\n  3,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,39,1,1,1,1,1,1, 3,1,1,7,11,11,39,3,\n  3,6,6,6,6,3,12,6, 6,6,6,6,6,6,6,6, 6,6,6,12,6,6,6,3, 39,6,6,6,6,11,3,4,\n  11,11,3,5,5,6,3,5, 11,5,10,5,3,6,3,6, 6,3,5,3,3,3,3,7, 3,3,3,3,6,3,5,11,\n  7,10,10,11,10,10,10,11, 11,11,11,11,10,10,11,11, 11,11,10,11,11,10,10,10, 10,10,11,11,11,11,10,11,\n  27,11,10,11,11,11,11,10, 20,3,10,20,11,11,20,20, 10,10,3,11,20,11,11,3, 11,20,11,3,1,7,11,11,\n  // E0xx\n  7,37,37,14,1,37,37,37, 37,10,10,37,37,10,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  11,10,10,10,11,11,10,10, 10,10,10,10,10,10,10,10, 37,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10,\n  10,3,11,11,33,11,6,33, 8,11,11,6,33,11,33,3, 11,39,33,8,8,11,6,33, 11,6,8,10,10,10,10,6,\n  17,11,11,11,11,39,11,11, 6,11,16,30,11,11,11,11, 11,11,11,11,11,6,11,11, 11,11,39,6,17,37,3,37,\n  6,6,6,6,6,11,6,6, 6,6,6,6,6,6,6,6, 6,6,6,6,10,6,6,6, 37,6,12,3,10,6,10,10,\n  36,14,14,36,2,2,2,2, 14,14,14,14,36,36,2,2, 2,2,2,2,2,14,2,14, 2,2,14,14,14,2,14,14,\n  14,14,14,14,17,14,17,14, 14,1,14,14,18,14,14,8, 27,3,18,27,5,27,3,3, 27,3,3,6,27,7,3,6,\n  3,10,10,10,10,17,10,10, 17,17,10,10,10,10,17,10, 10,10,10,10,10,10,10,10, 17,17,17,18,5,10,10,10,\n  // E1xx\n  7,1,1,37,37,39,4,37, 12,1,11,20,37,11,3,11, 39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  11,11,11,11,11,11,11,11, 11,11,11,11,11,1,10,11, 37,11,11,11,17,11,11,11, 11,11,11,1,11,11,11,1,\n  11,11,1,1,1,17,1,17, 17,8,1,1,1,8,1,39, 6,39,1,6,39,1,8,11, 6,8,1,11,17,11,11,11,\n  37,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,6, 1,6,1,6,11,11,11,37,\n  2,2,2,2,2,2,2,6, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,6, 11,2,12,6,12,12,12,2,\n  36,14,14,3,14,36,5,14, 14,6,36,36,36,36,36,36, 3,7,3,10,14,14,14,14, 2,14,2,2,2,2,14,14,\n  3,14,11,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,18, 11,11,11,11,11,11,11,11,\n  10,11,36,11,11,11,11,17, 10,17,20,10,11,11,10,17, 10,18,17,10,18,11,11,18, 17,17,17,10,10,18,18,10,\n  // E2xx\n  7,7,37,37,37,39,37,37, 37,10,10,37,4,10,1,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  10,10,10,10,11,10,10,17, 10,10,10,3,10,10,10,10, 37,10,17,10,10,10,10,10, 10,10,10,10,10,10,10,10,\n  10,8,8,11,3,6,11,6, 6,6,6,6,6,6,11,6, 6,6,11,6,11,6,6,6, 6,37,6,10,17,10,37,10,\n  17,10,11,16,16,10,16,11, 11,10,16,16,16,11,11,10, 16,8,16,16,11,11,16,6, 8,11,16,3,6,6,3,37,\n  2,2,2,6,2,2,2,2, 2,2,2,6,2,6,2,6, 6,2,2,2,2,2,2,2, 2,2,10,6,2,2,6,6,\n  36,14,36,3,14,36,14,3, 36,5,14,14,3,36,36,3, 3,3,3,10,14,14,3,14, 10,14,14,14,14,3,14,3,\n  14,18,14,14,6,18,3,14, 3,18,14,14,18,14,14,18, 27,3,18,3,7,18,3,3, 27,18,27,7,20,20,27,3,\n  10,18,10,17,10,10,17,10, 10,17,10,10,17,10,10,18, 10,10,10,10,17,18,10,10, 17,18,10,10,10,3,16,10,\n  // E3xx\n  7,37,37,37,37,37,37,1, 3,11,11,37,37,11,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,39,37,\n  11,11,11,11,11,11,11,11, 11,11,11,11,11,11,10,11, 37,11,11,11,11,11,11,11, 11,11,11,10,11,11,11,17,\n  10,12,1,6,6,12,6,1, 31,18,6,6,1,31,39,6, 6,37,6,39,12,1,6,6, 1,6,8,11,11,10,11,11,\n  6,10,12,12,12,1,37,12, 11,12,6,6,12,12,8,1, 12,8,12,1,12,12,10,37, 37,3,12,11,17,11,11,37,\n  2,2,2,2,2,2,2,6, 2,2,2,2,2,2,2,2, 11,11,6,6,6,6,6,6, 11,11,6,4,6,11,6,4,\n  36,11,36,36,14,36,36,36, 14,6,14,36,36,36,7,36, 3,3,3,10,14,14,3,7, 8,14,14,11,5,3,3,11,\n  5,5,11,11,11,18,11,11, 11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,18, 11,11,11,11,11,11,11,11,\n  10,11,17,11,11,11,11,36, 10,17,10,10,11,11,10,20, 10,20,17,11,17,11,11,17, 17,17,11,3,3,5,3,1,\n  // E4xx\n  7,11,1,11,37,37,37,37, 1,11,11,4,4,11,3,11, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  11,17,11,11,11,11,11,17, 11,11,11,17,11,17,11,11, 11,11,11,11,11,11,11,11, 11,11,11,17,11,11,11,17,\n  11,1,6,6,6,1,6,1, 1,17,1,1,1,1,6,11, 6,37,1,6,1,1,1,8, 6,1,1,11,11,11,11,11,\n  17,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,17,11,11,1,\n  2,11,6,6,12,11,2,6, 6,6,6,6,6,6,11,6, 11,6,31,3,11,6,6,6, 11,11,6,3,12,12,2,6,\n  36,11,14,7,14,36,8,14, 36,14,14,14,5,3,36,3, 3,3,5,10,14,14,6,14, 2,2,2,2,2,2,2,2,\n  3,14,3,14,11,18,11,11, 11,11,11,14,11,11,11,11, 11,11,11,11,11,11,11,18, 11,11,11,11,11,11,11,11,\n  10,17,10,11,1,10,11,17, 10,17,10,10,11,11,10,18, 10,17,17,10,17,18,17,17, 17,17,17,10,10,20,11,10,\n  // E5xx\n  7,10,37,37,37,39,37,4, 39,10,10,1,37,10,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  10,10,10,11,11,10,10,10, 11,11,11,10,10,10,10,10, 37,11,11,11,36,11,10,11, 11,11,10,10,11,11,10,10,\n  11,6,31,31,6,31,8,1, 6,6,6,6,1,6,6,37, 8,6,1,37,31,6,1,37, 3,6,6,11,10,11,11,11,\n  17,1,1,10,1,1,1,1, 1,1,6,1,1,1,1,33, 1,39,1,1,1,33,1,39, 8,6,1,11,11,11,11,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  17,7,11,11,11,18,18,11, 11,11,11,3,11,18,11,11, 11,11,11,18,11,5,11,18, 11,11,11,3,11,11,11,20,\n  17,11,10,11,10,11,11,10, 17,10,10,10,10,10,18,17, 10,10,10,18,17,11,10,17, 17,17,17,18,5,20,10,10,\n  // E6xx\n  7,11,1,9,1,39,1,12, 1,12,12,11,37,11,37,11, 39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  11,12,11,11,11,11,11,11, 11,11,11,5,12,11,12,11, 37,11,11,11,11,11,11,11, 11,11,11,12,11,11,11,12,\n  6,33,11,8,11,33,6,11, 11,33,11,33,33,31,33,33, 33,6,1,6,33,33,6,11, 8,37,11,39,17,6,11,11,\n  17,12,1,1,1,12,1,1, 1,12,1,1,1,1,1,12, 1,1,1,1,1,12,1,12, 6,8,1,11,6,11,6,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  5,11,11,11,3,11,7,11, 11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,3, 11,11,11,11,11,11,11,11,\n  10,11,10,11,11,11,11,20, 10,17,10,17,11,11,17,18, 1,10,11,11,18,11,11,17, 11,20,11,10,10,3,11,10,\n  // E7xx\n  7,10,37,37,4,39,37,37, 37,11,10,20,4,10,10,37, 37,37,37,37,37,37,37,37, 37,37,37,3,37,37,37,37,\n  10,10,10,11,11,10,11,11, 10,10,10,11,10,10,10,17, 37,10,10,11,11,11,10,17, 11,10,11,20,10,11,11,10,\n  11,11,11,11,31,8,31,31, 6,11,11,11,31,8,31,6, 31,3,31,31,31,11,31,6, 11,11,31,11,17,11,6,11,\n  11,11,11,16,16,11,11,16, 11,11,16,16,11,11,16,11, 16,6,16,16,16,11,16,11, 8,11,16,11,17,11,8,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,14,2,2,2,2,2,2,\n  1,14,14,14,18,18,1,14, 5,18,14,14,18,3,6,18, 27,3,18,7,3,18,6,3, 27,18,27,3,8,5,3,3,\n  10,17,10,1,10,17,17,17, 10,17,10,10,10,10,10,18, 10,17,18,10,17,1,1,17, 17,17,17,10,11,13,10,10,\n  // E8xx\n  7,1,37,1,12,39,1,37, 37,10,10,10,37,10,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  10,10,10,17,11,10,10,10, 10,10,10,10,10,10,10,10, 37,14,14,14,14,14,14,14, 14,14,10,10,10,10,10,10,\n  10,6,6,11,6,12,3,11, 14,6,6,12,31,6,12,6, 18,37,11,11,11,12,6,6, 8,37,6,10,10,10,10,10,\n  10,12,11,11,11,12,11,11, 12,12,12,12,12,11,12,12, 12,11,11,11,12,12,11,6, 11,11,11,6,10,39,10,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  10,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,14,2,2,2,2,2,2,\n  14,14,14,14,7,14,3,14, 14,3,14,14,18,14,14,18, 14,3,14,14,6,18,3,3, 5,3,27,3,20,20,20,7,\n  10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,18, 10,10,10,10,10,10,10,10, 17,10,17,8,20,20,10,10,\n  // E9xx\n  7,1,11,4,1,37,39,37, 37,11,11,11,37,11,37,1, 37,37,37,37,37,37,37,37, 37,37,37,3,37,37,39,37,\n  11,10,11,11,11,11,11,11, 11,11,11,11,11,11,11,11, 37,17,11,17,11,11,11,11, 11,11,10,10,11,10,11,11,\n  11,11,11,11,11,11,3,8, 33,11,6,33,6,31,11,11, 33,6,31,31,3,11,11,11, 11,11,33,6,6,11,11,11,\n  6,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,8, 11,11,11,6,17,6,17,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,14, 2,2,2,2,2,2,2,2, 2,2,2,2,14,14,2,14, 2,14,2,2,2,2,2,3,\n  18,14,14,14,3,14,3,14, 18,3,14,14,18,14,18,3, 14,3,14,14,18,27,18,18, 3,3,18,18,20,20,20,3,\n  14,17,17,17,17,17,17,17, 17,17,20,17,17,17,18,17, 17,10,10,18,18,17,17,17, 17,17,17,18,20,18,18,10,\n  // EAxx\n  7,37,9,37,37,39,37,9, 37,10,10,37,37,10,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  10,12,10,12,11,10,10,10, 10,10,10,10,10,10,10,10, 37,10,6,10,10,10,10,10, 10,10,10,10,10,10,10,12,\n  10,31,31,31,31,31,6,12, 31,6,6,31,31,8,31,31, 3,31,37,31,31,37,31,8, 11,11,31,10,12,10,12,10,\n  10,10,12,12,12,11,37,12, 11,10,11,12,11,11,11,10, 12,11,11,11,11,11,11,12, 11,6,12,8,17,6,3,37,\n  6,39,6,6,2,3,2,3, 6,6,6,2,39,6,6,6, 6,3,6,6,6,6,6,6, 6,11,6,11,12,6,6,6,\n  10,14,6,5,14,36,8,14, 3,3,5,5,5,5,5,3, 2,2,2,2,2,2,9,2, 2,2,2,2,2,2,2,12,\n  3,3,14,3,10,5,3,3, 3,3,3,3,3,3,5,3, 14,3,14,3,3,3,5,3, 3,34,3,7,20,20,20,20,\n  10,20,10,10,18,10,10,20, 10,20,10,10,10,10,10,20, 10,10,10,10,18,20,10,10, 10,20,10,18,20,20,18,10,\n  // EBxx\n  7,10,37,37,4,37,37,37, 37,10,10,10,37,10,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  10,10,10,10,11,10,16,10, 10,11,10,5,10,10,10,11, 37,10,17,17,17,10,10,17, 17,10,10,10,10,36,10,10,\n  10,3,8,8,8,3,11,11, 3,18,14,11,8,3,31,18, 18,37,8,3,31,3,8,37, 39,18,37,3,10,10,37,39,\n  17,10,11,11,16,11,11,16, 11,11,16,16,11,16,11,10, 16,11,11,16,16,11,16,11, 3,3,11,37,8,37,5,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,36,2,5,2,2,2, 2,2,2,36,2,2,2,2, 2,2,2,2,2,5,2,2, 2,2,5,2,5,2,7,2,\n  5,18,14,5,3,18,3,14, 3,18,3,3,18,14,18,18, 3,3,18,18,18,18,3,3, 3,3,3,8,20,20,20,20,\n  10,18,10,10,10,10,10,20, 10,18,10,10,17,10,10,18, 17,10,18,10,18,18,18,10, 17,17,17,10,10,20,10,10,\n  // ECxx\n  7,11,37,1,37,37,37,37, 37,14,10,14,37,11,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  11,10,11,11,11,10,10,17, 14,10,11,11,10,10,10,10, 37,11,10,10,17,11,17,11, 17,17,11,10,11,10,14,10,\n  11,1,17,8,8,18,8,8, 8,8,1,8,31,17,39,11, 17,31,17,17,1,1,17,17, 17,18,3,14,17,11,11,11,\n  3,1,12,12,12,16,1,1, 12,16,12,12,12,12,12,1, 12,1,12,12,12,16,12,1, 11,10,12,11,17,11,11,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,10,2,2,2,2,2, 2,2,2,2,2,2,2,2,\n  2,2,2,2,2,2,2,2, 14,2,2,3,36,36,3,2, 2,2,2,10,2,2,2,14, 2,2,2,2,2,2,14,11,\n  18,14,14,14,17,3,17,14, 14,18,14,14,3,14,14,18, 3,5,3,11,7,18,3,5, 18,3,12,5,20,20,20,20,\n  10,18,17,17,17,10,17,17, 10,17,10,17,10,10,10,10, 17,17,17,10,17,18,17,17, 18,17,17,10,10,10,11,10,\n  // EDxx\n  7,11,37,37,37,37,37,37, 4,1,1,1,37,1,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  11,1,11,17,11,11,1,1, 11,11,11,17,1,10,1,1, 37,11,11,11,11,11,11,11, 11,11,10,1,11,11,10,1,\n  11,1,33,33,33,18,1,1, 33,18,1,33,8,33,1,1, 33,39,33,33,33,33,33,37, 11,37,33,11,10,11,11,11,\n  17,1,1,1,1,1,1,1, 1,10,1,1,1,1,1,1, 1,1,1,1,1,1,1,8, 1,10,1,11,17,10,11,37,\n  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 11,2,2,3,2,2,2,2, 2,2,2,2,2,2,2,10,\n  1,11,36,3,11,3,3,3, 11,7,36,36,3,5,5,7, 7,5,3,10,7,3,3,3, 10,9,5,5,3,3,9,11,\n  5,18,11,11,11,18,11,11, 11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,\n  10,11,36,11,11,10,11,10, 10,18,10,10,11,10,10,18, 18,10,10,10,10,11,10,10, 11,18,11,10,10,20,10,10,\n  // EExx\n  7,10,37,37,37,37,4,37, 37,10,10,1,37,10,10,37, 39,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  10,10,10,10,11,10,10,10, 10,10,10,10,10,10,10,10, 37,17,17,17,10,17,10,10, 10,17,10,10,10,10,10,10,\n  10,3,3,31,31,18,31,31, 3,3,31,8,31,31,31,39, 8,37,31,31,31,37,31,31, 31,18,8,10,10,10,3,10,\n  17,11,16,16,16,37,11,16, 8,11,16,16,11,16,11,11, 16,11,16,16,11,8,16,3, 11,11,16,37,10,3,3,37,\n  2,2,6,2,2,10,3,2, 2,2,3,2,6,2,6,2, 3,6,11,2,10,6,2,2, 37,2,2,2,2,3,2,2,\n  10,3,5,3,5,3,8,3, 3,3,3,3,36,10,3,5, 5,7,3,5,3,7,3,3, 10,2,10,5,10,3,3,10,\n  17,18,3,10,17,18,3,8, 3,18,5,3,17,5,3,18, 3,3,3,3,3,18,3,27, 18,3,3,3,5,20,20,20,\n  17,10,10,10,10,10,10,17, 10,10,10,10,10,10,18,10, 10,10,10,18,10,10,10,10, 17,17,17,18,18,10,10,10,\n  // EFxx\n  7,37,37,37,37,37,37,10, 37,17,20,17,37,17,37,37, 37,37,37,37,37,37,37,37, 37,37,37,3,37,37,37,37,\n  17,17,17,17,17,10,18,17, 17,17,17,17,17,10,10,17, 37,10,10,17,10,10,10,17, 17,10,17,17,17,17,17,17,\n  3,11,11,11,11,11,3,3, 8,18,3,11,3,31,37,37, 18,37,37,39,31,11,37,8, 8,37,11,37,17,17,37,17,\n  17,12,11,11,11,11,11,30, 3,16,30,11,11,11,11,16, 10,11,11,11,11,16,11,11, 11,39,39,8,17,37,3,37,\n  2,2,2,2,2,2,2,2, 2,37,2,2,2,39,2,2, 2,2,2,2,2,2,2,3, 39,3,2,2,2,2,12,2,\n  17,36,36,3,2,5,5,5, 2,36,7,7,36,2,3,2, 5,3,3,10,2,3,3,5, 2,2,2,2,2,2,2,2,\n  3,5,18,18,18,7,18,18, 18,3,18,18,18,18,18,3, 18,3,18,18,18,7,18,5, 3,5,3,3,20,20,18,20,\n  10,5,18,20,18,10,18,18, 10,20,18,10,18,18,10,10, 10,20,18,10,18,20,18,18, 10,20,18,10,10,20,18,10,\n  // F0xx\n  3,37,1,37,10,37,39,39, 37,10,10,37,37,11,4,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  10,10,10,10,11,10,10,10, 10,10,11,10,10,10,10,10, 37,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,1,\n  10,12,3,14,1,1,1,13, 1,13,8,8,13,13,37,18, 18,37,13,39,37,13,39,11, 39,37,1,11,10,10,3,10,\n  17,13,1,13,13,13,1,1, 1,13,1,16,13,13,16,16, 16,37,13,1,16,13,16,1, 1,16,13,11,10,11,14,39,\n  39,6,6,6,36,11,4,36, 6,6,6,6,6,6,6,6, 2,6,6,6,6,6,6,6, 6,4,3,3,10,2,10,10,\n  2,11,3,3,3,3,2,3, 5,3,3,5,5,5,3,5, 3,3,5,10,5,3,5,5, 7,5,11,11,5,3,5,11,\n  3,18,5,8,3,18,3,11, 5,18,3,3,18,3,18,18, 3,18,18,18,18,18,3,7, 3,18,5,3,20,20,20,20,\n  10,10,10,10,17,10,10,10, 10,17,10,17,10,10,10,18, 10,10,10,10,10,10,10,17, 10,17,17,10,10,13,10,10,\n  // F1xx\n  3,9,37,9,1,10,39,37, 1,12,10,37,37,10,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  10,10,10,10,10,10,10,10, 10,10,17,10,10,10,10,10, 37,10,10,10,10,10,10,10, 10,10,10,12,10,10,10,10,\n  1,1,1,12,8,1,8,1, 1,1,1,8,1,1,37,1, 3,8,3,12,8,1,37,12, 8,37,8,10,1,12,8,10,\n  17,1,12,12,10,1,10,1, 10,1,8,12,10,12,1,1, 10,1,10,12,10,1,37,1, 10,10,1,3,17,11,5,37,\n  39,6,6,6,4,10,4,4, 6,6,37,6,6,6,6,6, 6,6,6,6,10,6,6,6, 6,37,10,3,4,3,4,4,\n  10,11,36,3,3,7,5,5, 3,8,5,3,5,7,3,8, 3,3,3,10,3,3,5,3, 10,5,3,3,3,7,3,3,\n  17,5,11,3,3,3,3,3, 11,3,3,18,3,18,18,11, 18,3,18,5,3,5,3,18, 3,7,18,18,20,20,20,20,\n  10,20,10,17,10,10,10,20, 10,17,10,10,10,10,10,10, 10,10,10,10,17,10,10,10, 10,20,10,10,10,18,10,10,\n  // F2xx\n  3,1,37,1,37,37,39,37, 37,10,10,10,37,10,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  10,10,10,10,1,10,10,10, 10,10,10,10,10,10,10,10, 37,10,10,10,10,10,10,10, 10,10,10,10,10,20,10,10,\n  10,31,31,17,31,12,10,1, 1,18,31,1,31,31,31,1, 31,37,8,31,31,8,39,37, 39,3,31,10,10,10,8,10,\n  17,16,1,1,1,16,39,1, 12,16,1,12,1,1,1,12, 1,1,1,12,12,12,1,1, 1,10,1,1,17,11,37,37,\n  37,6,6,39,4,10,3,4, 37,6,6,6,6,6,6,37, 6,6,6,6,10,6,39,6, 39,4,12,11,3,12,3,4,\n  10,11,5,3,5,5,3,3, 5,5,5,3,5,8,1,3, 3,5,7,10,7,5,26,5, 10,3,3,20,3,3,3,7,\n  3,18,11,3,5,18,3,11, 11,18,11,3,3,11,3,18, 3,3,1,11,3,18,11,3, 5,18,3,3,11,11,11,3,\n  10,18,10,17,17,10,17,18, 10,17,10,10,17,10,10,18, 10,10,10,10,18,18,17,10, 17,18,17,10,10,10,10,10,\n  // F3xx\n  3,1,1,37,4,4,39,37, 1,10,10,9,37,10,37,1, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  10,10,10,10,17,10,10,10, 10,10,11,17,10,10,10,1, 37,18,1,10,10,18,10,18, 10,18,1,10,10,10,1,10,\n  3,11,1,1,1,1,1,1, 18,18,31,31,31,1,1,8, 1,11,1,39,31,37,39,1, 37,37,31,37,1,10,37,1,\n  39,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,11,17,11,24,37,\n  37,39,6,6,37,10,3,12, 37,37,6,6,6,6,6,6, 6,11,23,6,12,6,6,39, 37,24,10,3,12,3,10,12,\n  10,11,5,3,8,8,3,3, 5,3,8,3,3,5,5,3, 3,3,3,12,3,3,9,5, 3,3,10,3,9,2,3,12,\n  5,18,18,11,18,18,3,11, 11,11,11,18,18,11,11,18, 18,11,18,11,18,18,11,18, 11,11,11,11,11,11,11,11,\n  10,10,10,10,10,18,10,10, 10,18,10,18,18,10,18,10, 10,10,10,18,18,10,10,10, 10,10,18,18,20,20,10,10,\n  // F4xx\n  3,4,37,37,37,37,39,37, 37,11,10,37,37,11,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  10,11,17,11,11,10,20,11, 11,10,11,3,10,10,18,20, 37,10,25,17,10,10,10,11, 10,10,10,11,11,17,10,10,\n  17,18,11,8,11,18,11,11, 11,18,24,11,11,11,37,18, 18,37,11,37,11,11,39,11, 11,37,11,11,17,11,37,11,\n  17,11,11,11,11,37,39,11, 11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,11,11,11,39,3,37,\n  2,39,6,6,3,24,3,3, 11,37,37,39,11,6,6,6, 37,6,23,6,3,39,6,37, 37,11,12,3,39,12,12,4,\n  25,5,3,7,11,3,11,11, 8,3,8,3,3,8,3,8, 8,8,3,10,3,3,5,3, 5,5,3,5,3,3,9,8,\n  18,18,3,3,3,18,3,3, 5,3,3,3,3,3,8,18, 3,5,18,3,3,18,3,18, 3,18,1,3,20,20,20,3,\n  10,18,17,17,17,17,3,20, 10,17,10,10,17,10,10,18, 10,17,18,10,10,18,17,18, 17,17,17,10,20,20,20,37,\n  // F5xx\n  3,37,1,4,37,39,39,37, 37,10,10,37,37,10,37,39, 37,39,37,37,37,37,37,37, 39,37,37,37,37,37,37,37,\n  10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10, 10,10,10,10,10,20,10,10,\n  10,10,11,1,3,8,8,1, 10,1,1,1,1,1,37,8, 1,1,1,1,1,1,1,8, 8,1,1,1,17,10,37,39,\n  17,12,1,12,12,1,12,1, 1,1,1,12,1,1,1,12, 1,3,1,12,1,1,12,1, 1,1,12,1,8,11,3,37,\n  37,6,6,6,4,10,4,4, 6,6,6,6,6,39,6,6, 6,11,6,6,10,6,6,6, 4,4,4,4,3,3,3,4,\n  10,11,5,3,3,3,8,8, 5,1,3,3,8,8,5,1, 8,5,3,10,3,3,5,3, 3,3,10,3,3,5,3,3,\n  3,5,18,5,18,5,18,1, 11,18,11,18,3,11,3,11, 18,11,18,18,11,11,11,18, 11,11,11,11,11,11,18,11,\n  10,11,18,11,18,11,11,18, 10,25,20,18,18,10,10,10, 10,1,18,18,18,10,18,18, 20,3,18,18,3,18,18,33,\n  // F6xx\n  3,1,37,37,37,37,39,37, 37,1,1,1,37,1,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  11,10,1,1,1,10,1,17, 3,10,11,5,10,10,10,1, 37,5,1,1,5,10,10,3, 1,1,10,10,1,11,1,1,\n  5,11,1,1,1,1,1,1, 1,24,1,1,1,1,39,37, 11,37,1,1,1,37,1,37, 1,1,1,37,17,1,39,1,\n  17,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,8,1,11,5,37,\n  39,6,6,4,24,24,3,3, 37,6,6,6,37,37,6,37, 6,17,17,6,39,37,39,6, 37,37,3,11,4,3,3,4,\n  11,11,5,3,3,8,3,3, 3,3,3,3,3,3,3,8, 3,3,3,10,3,3,3,5, 3,5,3,3,3,5,5,5,\n  3,3,3,3,3,18,11,11, 11,18,11,11,11,11,3,11, 11,11,11,11,11,18,11,3, 11,11,11,11,11,20,11,1,\n  10,17,10,11,17,10,11,17, 10,17,10,18,17,11,10,20, 13,20,17,10,17,18,1,17, 17,20,17,10,10,20,13,10,\n  // F7xx\n  3,1,37,37,37,37,39,37, 37,10,18,6,37,10,37,37, 37,37,37,37,37,37,37,37, 37,37,7,37,37,37,37,39,\n  17,17,17,17,11,10,18,17, 11,10,17,3,17,10,18,10, 11,11,11,11,11,11,11,11, 11,11,17,17,10,17,10,17,\n  8,18,11,8,3,18,8,8, 3,18,11,3,11,11,39,18, 11,37,11,39,37,3,11,39, 11,37,3,11,11,8,17,17,\n  17,10,37,11,11,10,11,11, 37,8,11,11,11,39,11,20, 11,11,11,11,11,11,11,11, 39,10,11,37,17,17,8,37,\n  3,6,6,3,3,3,3,3, 37,6,6,39,6,37,6,39, 6,37,11,6,10,6,6,6, 4,37,3,3,10,4,12,4,\n  17,3,3,3,11,3,26,3, 3,3,8,8,3,3,3,3, 3,3,3,10,8,3,26,3, 10,5,3,3,3,5,3,3,\n  3,18,3,3,3,18,3,5, 3,18,3,18,18,18,18,18, 18,3,18,18,18,18,3,18, 18,18,18,3,20,20,20,20,\n  10,18,10,17,17,10,17,17, 10,17,10,10,17,10,18,18, 17,17,10,18,17,18,17,18, 17,18,17,18,10,20,20,10,\n  // F8xx\n  3,1,37,37,37,37,39,37, 1,17,17,37,37,17,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  17,17,17,17,1,17,16,17, 17,16,17,5,17,17,17,17, 37,5,1,17,1,1,1,1, 1,10,17,17,17,17,17,17,\n  10,8,3,1,1,1,12,1, 1,1,8,1,1,1,37,37, 1,37,1,39,37,8,1,8, 8,37,1,37,17,17,37,1,\n  17,12,1,12,1,12,1,1, 1,12,1,1,1,1,1,12, 1,8,1,1,1,1,1,1, 1,1,1,3,37,37,5,37,\n  39,6,6,39,4,16,3,17, 39,6,37,39,6,37,6,37, 37,11,6,16,16,37,16,6, 37,37,12,3,10,3,12,24,\n  17,11,5,3,11,8,8,8, 5,1,8,5,8,8,1,8, 8,5,3,10,3,5,3,3, 10,5,5,3,5,5,3,5,\n  5,5,3,11,24,17,17,11, 11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,3, 11,3,11,11,11,11,11,11,\n  17,17,17,17,17,17,17,17, 10,17,10,17,17,12,18,17, 17,17,10,11,17,17,11,17, 17,17,17,18,10,18,10,37,\n  // F9xx\n  3,1,37,37,37,37,39,39, 37,12,12,1,37,12,37,39, 37,37,37,37,39,37,37,37, 37,37,37,37,37,37,37,37,\n  12,17,12,17,11,11,30,12, 12,12,17,5,12,12,12,17, 37,17,17,17,17,17,10,17, 3,17,12,12,12,17,12,12,\n  8,8,11,8,12,11,24,24, 24,24,11,17,11,11,11,8, 39,37,11,8,11,11,11,39, 11,11,3,39,17,12,24,11,\n  17,11,12,12,12,11,12,11, 12,11,12,12,12,12,12,11, 12,37,12,12,12,11,12,24, 11,11,12,37,17,24,24,37,\n  37,24,6,11,11,12,37,24, 24,24,24,37,37,24,24,24, 24,24,24,12,24,24,37,24, 24,24,12,24,24,24,12,24,\n  12,5,24,3,8,5,5,24, 5,24,1,5,5,5,8,8, 5,5,3,8,3,3,5,8, 10,5,8,5,24,3,9,24,\n  1,5,24,5,8,5,3,5, 3,1,5,24,17,5,5,5, 8,17,17,5,3,8,8,8, 8,8,8,5,8,8,8,8,\n  10,17,17,17,17,10,17,17, 10,17,18,17,17,17,17,17, 17,20,17,20,17,7,17,17, 17,17,17,18,10,8,8,10,\n  // FAxx\n  3,10,1,37,37,37,37,37, 37,1,17,1,37,17,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  17,17,17,17,1,17,17,17, 17,17,17,17,17,17,17,17, 37,17,17,17,17,17,17,17, 1,17,17,17,17,17,1,17,\n  8,8,1,8,8,1,1,8, 8,1,1,24,1,1,37,37, 8,39,1,37,1,1,39,39, 11,1,1,37,17,11,39,17,\n  17,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,37, 1,37,1,1,17,11,11,37,\n  39,6,6,6,12,17,37,12, 37,6,37,37,6,6,6,6, 6,6,6,6,12,6,6,24, 6,37,12,12,24,12,12,4,\n  17,5,3,5,5,6,8,8, 8,5,5,11,8,5,1,5, 5,3,3,3,5,3,3,5, 10,5,3,9,5,3,5,11,\n  5,18,11,11,18,18,3,11, 11,18,11,11,11,11,11,11, 11,11,11,11,11,11,11,18, 11,11,11,11,11,11,11,11,\n  17,18,17,11,17,17,11,17, 12,17,17,17,17,18,17,18, 17,18,17,17,17,18,17,17, 17,17,17,1,5,5,5,10,\n  // FBxx\n  3,37,37,37,37,37,37,14, 37,10,10,10,39,10,37,37, 37,37,37,37,37,37,37,37, 37,37,37,3,37,37,37,37,\n  10,10,10,10,11,10,10,10, 10,10,10,10,10,10,10,10, 39,10,10,10,10,10,10,11, 10,10,10,10,10,10,10,10,\n  10,8,11,11,8,18,8,3, 11,18,8,11,11,10,39,37, 11,39,37,37,37,37,37,37, 11,37,11,37,10,10,3,10,\n  10,12,11,16,16,12,12,16, 12,8,12,16,16,16,16,11, 16,3,16,16,11,37,12,37, 10,39,16,37,39,37,37,37,\n  37,6,6,6,37,10,11,39, 37,6,37,39,6,6,6,6, 3,37,37,6,6,39,6,6, 6,37,37,11,3,10,37,3,\n  10,5,10,3,8,8,5,8, 8,3,5,5,5,16,11,8, 3,8,8,5,5,3,3,3, 5,3,5,3,5,3,5,5,\n  5,18,5,3,3,18,3,5, 3,18,3,18,18,18,18,18, 18,3,18,3,18,18,3,18, 3,18,7,5,5,5,5,5,\n  5,18,10,10,10,10,10,10, 16,10,10,10,10,10,18,18, 10,10,10,5,18,10,10,10, 10,5,5,11,11,5,5,10,\n  // FCxx\n  3,10,37,37,37,37,37,37, 1,11,10,37,4,10,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  10,10,10,11,11,10,10,11, 10,10,10,10,10,10,10,10, 37,10,10,10,10,10,10,10, 10,10,10,10,10,11,10,10,\n  10,33,11,11,11,33,11,11, 11,33,11,11,11,11,11,33, 11,37,11,11,11,33,11,11, 11,11,11,39,10,10,37,11,\n  11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11, 11,11,11,37,11,37,39,39,\n  37,6,6,6,37,11,11,11, 6,6,6,6,39,6,6,6, 6,6,11,6,10,6,6,6, 39,11,3,11,11,4,39,4,\n  10,5,5,5,5,5,8,5, 8,8,8,8,5,11,8,5, 5,5,3,5,5,33,3,5, 5,5,5,5,3,5,5,5,\n  5,5,18,5,18,3,18,18, 18,3,18,18,18,18,18,5, 18,3,18,18,18,5,33,18, 5,3,18,18,5,1,5,1,\n  10,10,20,10,10,10,18,11, 10,18,10,18,20,10,10,10, 13,10,10,20,18,10,10,20, 10,10,18,18,11,1,13,10,\n  // FDxx\n  3,37,1,37,37,37,37,37, 37,13,13,37,37,13,4,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  13,13,13,13,13,13,13,13, 13,13,13,13,13,13,13,13, 11,11,11,11,11,11,11,11, 11,11,13,13,13,13,13,13,\n  13,13,13,13,13,13,13,13, 13,13,1,13,13,13,13,37, 13,37,13,13,13,13,39,37, 1,13,13,13,13,13,37,13,\n  13,33,1,13,13,33,13,13, 1,33,1,13,13,13,13,13, 13,13,13,13,13,13,1,13, 13,13,13,37,13,13,3,37,\n  39,37,37,37,37,22,3,3, 3,37,37,37,39,37,39,39, 39,37,22,12,22,11,37,37, 3,37,12,3,3,12,12,4,\n  33,33,8,3,8,8,5,5, 5,8,8,8,8,5,8,1, 3,5,3,5,13,3,3,3, 3,9,5,3,3,3,9,3,\n  5,3,3,3,3,18,3,11, 3,18,3,3,5,3,3,3, 13,3,3,3,3,3,3,3, 5,5,11,5,11,1,13,11,\n  10,18,10,11,10,18,11,13, 12,18,10,10,10,10,18,10, 13,10,10,20,10,10,1,20, 18,20,5,5,5,13,13,10,\n  // FExx\n  3,39,39,39,37,37,39,39, 37,13,10,37,39,11,39,39, 39,39,39,39,39,37,39,37, 39,39,37,39,37,39,37,39,\n  10,10,10,1,1,10,13,13, 11,10,11,13,10,10,10,13, 11,11,11,11,11,11,11,11, 11,11,13,13,13,13,13,10,\n  13,13,1,11,13,13,13,13, 11,13,11,13,13,11,37,37, 11,37,37,11,13,13,39,37, 37,13,11,11,13,11,3,13,\n  13,13,13,13,16,13,13,13, 13,13,1,13,13,13,16,16, 16,13,1,16,13,13,13,11, 11,13,13,11,13,11,3,37,\n  3,11,37,37,4,4,4,4, 37,37,39,39,37,11,37,37, 11,37,22,16,39,11,39,37, 39,4,3,37,4,11,37,3,\n  3,11,1,3,8,8,8,8, 8,8,8,11,8,13,1,1, 8,1,3,18,3,3,3,8, 3,3,10,3,3,3,3,11,\n  5,18,11,11,3,18,3,11, 11,18,11,11,11,11,11,11, 11,11,11,11,18,18,18,3, 11,11,11,11,11,11,11,11,\n  10,18,10,10,10,18,10,10, 10,18,10,18,10,20,18,18, 10,10,10,20,18,18,13,10, 18,10,1,18,13,13,11,37,\n  // FFxx\n  3,37,39,39,39,37,37,39, 37,37,10,37,37,10,37,37, 37,37,37,37,37,37,37,37, 37,37,37,37,37,37,37,37,\n  10,10,10,37,37,10,10,10, 10,10,10,10,10,10,10,10, 37,36,36,37,36,36,39,39, 39,39,10,10,10,1,10,10,\n  10,39,39,39,39,37,39,39, 1,39,39,36,39,39,37,39, 39,39,37,36,39,39,36,37, 36,39,36,10,10,10,37,10,\n  10,2,2,2,36,2,2,2, 2,2,2,36,2,2,36,36, 36,2,2,2,2,2,36,2, 2,2,36,39,10,39,39,39,\n  36,36,39,37,39,10,39,39, 4,37,36,39,36,36,36,36, 36,37,39,39,10,11,39,39, 37,39,39,39,39,37,39,33,\n  10,39,10,33,39,39,36,33, 36,1,36,39,33,10,36,36, 39,39,39,18,39,39,39,39, 39,39,10,11,39,39,39,1,\n  10,1,1,11,39,39,39,39, 39,39,39,39,39,39,39,39, 39,39,39,39,39,39,39,39, 3,3,3,3,11,3,3,1,\n  10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10, 10,10,39,39,10,37,10,10,\n\n};\t\t// End kMostLikelyEncoding\n\n// End of generated tables\n#endif  // COMPACT_ENC_DET_COMPACT_ENC_DET_GENERATED_TABLES_H_\n"
  },
  {
    "path": "third_party/ced/compact_enc_det/compact_enc_det_generated_tables2.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include \"util/basictypes.h\"\n\nstatic const uint8 ced_hires_0[1024] = {\n  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,\n  0,135,134,135,89,111,136,129,  81,121,130,40,64,74,78,13,  90,87,103,56,51,37,63,44,  0,97,60,55,143,97,70,100,\n  29,126,116,149,131,156,108,153,  147,119,135,111,133,135,115,0,  2,13,20,4,12,5,17,5,  4,0,58,50,2,30,80,64,\n  35,0,0,0,0,22,0,9,  14,12,4,6,7,8,16,3,  147,160,163,141,144,139,146,127,  131,124,23,17,0,11,16,6,\n  0,68,108,52,129,66,109,65,  113,58,116,124,126,117,88,114,  85,122,102,126,116,122,96,131,  102,126,107,117,49,113,80,128,\n  0,85,119,107,127,75,102,105,  118,101,108,118,101,117,98,128,  125,114,115,125,115,121,116,121,  125,130,122,119,64,102,78,124,\n  93,87,64,93,105,92,76,80,  113,82,75,88,89,68,88,97,  87,102,145,90,90,130,106,116,  129,61,81,75,47,69,74,64,\n  92,98,81,95,81,161,75,81,  101,95,93,75,100,87,108,91,  113,110,118,114,105,105,123,94,  89,92,104,90,62,85,81,84,\n\n  47,141,155,88,85,108,121,141,  94,73,82,81,163,125,111,89,  106,133,156,95,80,96,88,61,  65,47,74,55,33,54,59,19,\n  128,129,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,\n  128,131,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,\n  128,128,128,128,135,128,128,128,  128,128,161,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,\n  141,115,118,118,118,128,115,127,  136,136,122,124,125,126,128,121,  147,128,128,128,128,128,128,123,  128,121,128,128,107,154,128,124,\n  82,141,145,136,128,144,115,123,  124,117,107,104,103,99,107,90,  92,98,102,82,88,134,161,126,  115,104,114,106,73,91,111,84,\n  128,93,94,94,94,116,91,103,  108,106,98,100,101,102,110,97,  137,133,120,132,146,114,136,131,  144,145,155,131,107,151,144,133,\n  128,103,106,106,106,128,103,115,  120,118,110,112,113,114,122,109,  157,138,128,117,136,123,136,128,  137,123,152,126,104,136,137,134,\n\n  32,94,46,28,98,102,130,97,  59,91,81,73,26,125,102,48,  100,66,105,57,87,121,71,120,  86,64,64,83,68,105,91,70,\n  32,130,98,103,64,30,123,122,  97,123,58,127,70,74,55,59,  53,99,95,99,105,52,48,73,  52,68,138,89,29,104,97,142,\n  20,99,54,114,87,86,108,55,  46,27,42,99,130,118,83,95,  138,115,69,67,96,95,125,86,  82,121,92,145,131,142,115,134,\n  27,53,57,104,139,102,124,124,  135,81,79,148,118,90,71,25,  151,83,146,71,74,129,109,35,  84,115,121,77,48,24,58,63,\n  29,55,85,51,70,123,21,95,  116,128,90,107,124,74,98,80,  132,125,112,114,118,109,167,103,  57,127,95,84,13,65,84,109,\n  27,137,123,69,151,81,84,95,  124,80,115,38,140,164,121,122,  86,116,83,102,117,110,111,92,  72,94,114,144,62,90,84,109,\n  31,128,63,37,14,138,126,79,  132,63,54,95,60,132,89,132,  25,77,134,94,93,154,147,125,  104,98,113,119,70,130,98,111,\n  24,78,61,30,100,41,65,115,  80,28,93,97,86,38,74,112,  85,105,135,113,132,45,65,30,  126,91,113,114,73,89,65,130,\n\n  21,150,114,47,106,125,121,37,  79,158,90,155,73,92,94,107,  87,137,97,135,91,139,152,102,  98,85,126,121,80,140,42,25,\n  23,47,75,42,64,150,67,93,  100,140,70,62,117,140,54,122,  100,98,95,105,88,100,132,41,  81,137,76,144,60,131,128,66,\n  23,59,107,144,98,44,20,119,  70,80,58,85,119,93,113,59,  83,28,117,67,135,65,77,60,  130,114,138,111,31,109,92,87,\n  18,93,79,109,57,128,94,69,  135,54,72,38,53,55,94,56,  133,98,153,147,82,58,124,55,  48,50,153,128,24,54,80,89,\n  29,130,95,117,49,47,46,91,  164,58,99,148,64,113,86,110,  144,134,49,60,102,62,103,107,  69,89,149,71,113,31,107,71,\n  25,90,106,113,119,82,75,91,  111,128,139,79,130,101,90,31,  97,103,87,84,53,138,43,87,  155,57,75,150,93,128,120,43,\n  24,118,82,52,79,56,143,92,  47,103,22,46,70,106,155,129,  93,104,125,42,96,124,137,93,  73,43,134,98,100,111,139,56,\n  22,65,103,76,38,122,121,155,  111,147,47,76,96,103,153,78,  71,103,137,104,150,89,139,159,  77,120,71,98,98,125,78,143,\n};\n\nstatic const uint8 ced_hires_1[1024] = {\n  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,\n  62,124,71,116,117,77,46,71,  78,98,127,132,69,67,72,79,  34,37,88,95,81,88,135,138,  116,123,132,136,97,128,45,101,\n  68,71,36,0,24,19,3,1,  0,9,60,40,64,146,70,113,  20,16,20,26,13,20,9,12,  14,21,15,19,55,50,99,61,\n  17,127,133,119,128,134,113,109,  106,124,100,107,119,131,111,122,  138,113,136,154,132,125,120,114,  115,119,101,25,19,31,19,19,\n  122,112,48,123,115,89,133,132,  124,114,123,130,73,103,139,130,  106,90,103,114,71,97,92,74,  115,112,59,105,83,90,140,121,\n  118,113,51,133,112,43,123,112,  133,130,102,109,71,110,89,102,  128,125,104,139,115,139,129,134,  112,120,123,117,111,132,129,118,\n  73,151,165,130,127,146,100,107,  108,121,103,114,156,112,107,111,  125,129,150,135,107,155,118,116,  168,85,79,83,77,89,77,77,\n  98,101,81,63,71,82,66,64,  60,72,57,62,72,70,60,67,  75,153,138,154,129,161,146,125,  125,139,151,134,139,151,135,146,\n\n  59,21,36,18,26,37,21,19,  15,27,12,17,27,25,15,22,  30,34,38,44,31,38,27,30,  32,39,33,37,31,43,31,31,\n  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,\n  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,\n  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,\n  128,127,128,124,144,128,127,126,  121,128,118,123,128,128,121,128,  128,128,128,128,128,128,128,128,  128,128,128,128,150,128,128,128,\n  90,112,109,86,83,124,57,54,  84,70,53,84,62,78,53,75,  124,134,116,95,118,85,129,65,  67,74,68,72,66,78,66,66,\n  141,134,118,107,135,127,130,134,  118,109,94,99,109,107,97,104,  112,116,120,126,113,120,109,112,  114,121,115,119,113,125,113,113,\n  161,134,128,112,120,139,115,128,  122,121,106,111,121,119,109,116,  124,128,128,128,125,128,121,124,  126,128,127,128,125,128,125,125,\n\n  76,29,158,87,47,122,133,89,  63,101,139,116,147,111,79,122,  60,112,93,68,42,145,73,100,  89,123,46,122,124,112,99,90,\n  118,56,99,61,145,53,131,144,  66,122,110,97,113,82,19,27,  33,134,120,84,79,124,78,108,  138,87,26,133,114,84,47,165,\n  62,148,104,137,139,97,125,86,  134,47,127,93,141,85,119,111,  126,56,42,26,102,89,122,48,  59,116,110,106,46,115,64,113,\n  107,81,49,29,28,64,130,22,  111,53,142,89,89,127,131,86,  122,122,37,143,66,96,82,105,  155,96,154,124,63,121,90,60,\n  115,107,42,30,134,130,119,108,  66,145,122,85,105,19,88,92,  36,134,34,101,97,112,152,73,  150,89,116,144,71,130,131,103,\n  88,123,77,30,132,53,98,51,  116,61,95,57,84,109,31,74,  20,98,135,114,78,114,95,123,  45,136,116,111,130,94,120,99,\n  114,121,64,107,94,104,29,77,  152,133,124,119,135,98,0,78,  118,115,88,102,57,61,51,89,  120,51,115,109,64,111,61,66,\n  110,135,106,110,98,74,86,137,  124,103,134,80,86,43,76,131,  134,105,91,84,73,34,71,133,  60,111,117,53,90,133,106,61,\n\n  147,38,145,28,137,149,110,112,  52,83,99,128,56,129,105,74,  93,60,45,62,73,86,30,82,  80,44,19,97,85,87,108,103,\n  99,114,94,104,97,104,140,51,  98,62,119,74,85,141,51,23,  71,58,119,110,151,65,116,74,  130,81,86,90,7,99,38,116,\n  61,59,140,66,91,133,123,152,  80,82,98,67,112,110,110,89,  121,132,120,62,43,74,45,110,  88,146,113,101,134,135,104,131,\n  110,47,96,67,123,147,69,70,  131,106,98,109,71,118,116,128,  92,100,149,53,144,117,99,136,  127,128,3,43,114,100,85,117,\n  92,134,156,8,88,62,89,98,  6,19,46,96,145,108,88,69,  78,94,152,96,146,108,133,66,  75,102,101,10,79,44,57,61,\n  102,96,123,91,109,149,84,63,  39,134,53,110,111,64,97,103,  155,133,105,105,34,125,93,56,  28,84,65,95,103,58,41,83,\n  48,25,116,120,91,104,124,84,  111,119,105,64,63,97,116,114,  128,103,136,74,59,33,47,93,  54,80,130,39,139,130,119,83,\n  140,68,94,85,77,79,118,109,  120,106,114,103,115,165,94,79,  60,52,84,77,82,78,49,74,  88,49,48,76,102,99,138,71,\n};\n\nstatic const uint8 ced_hires_2[1024] = {\n  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,\n  44,106,18,108,117,63,65,73,  40,57,43,81,77,63,68,90,  54,16,20,95,85,131,112,100,  58,144,140,135,114,96,110,128,\n  111,93,68,129,135,62,95,32,  82,42,46,10,8,23,10,16,  26,21,70,26,93,84,168,105,  79,71,29,48,15,26,68,128,\n  28,126,105,123,109,126,102,109,  105,122,72,104,108,132,113,126,  118,82,122,110,129,125,114,134,  113,133,103,54,21,32,21,128,\n  113,122,134,118,123,77,97,101,  121,135,128,138,125,120,35,120,  31,24,148,129,0,0,0,0,  0,0,0,5,0,0,0,128,\n  137,137,112,130,105,127,110,121,  86,140,134,139,128,145,17,121,  19,27,60,150,106,62,95,0,  0,0,0,9,0,0,0,128,\n  86,81,78,87,82,79,82,75,  75,78,69,74,72,87,74,80,  90,85,84,72,92,96,88,82,  98,102,93,112,79,90,79,128,\n  162,135,144,153,151,137,127,118,  113,125,105,106,91,139,129,109,  124,140,83,71,91,95,87,81,  97,101,92,111,78,89,78,128,\n\n  40,35,34,43,36,33,36,29,  29,32,23,28,26,41,28,34,  44,39,38,26,46,50,42,36,  52,56,47,66,33,44,33,128,\n  128,128,128,131,128,128,130,128,  147,152,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,\n  128,128,128,138,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,\n  128,128,128,143,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,\n  166,128,128,130,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,146,128,128,  128,128,128,128,148,128,128,128,\n  139,134,133,75,121,105,114,103,  64,68,129,100,62,76,63,69,  79,74,73,114,137,85,77,71,  174,140,82,101,68,79,68,128,\n  122,117,114,122,118,115,118,113,  112,117,105,110,108,123,110,116,  126,121,120,108,128,128,124,118,  128,128,128,128,115,126,115,128,\n  128,128,126,154,128,127,132,123,  137,126,117,122,120,128,122,128,  128,128,128,120,128,128,128,128,  128,128,128,128,127,128,127,128,\n\n  67,115,51,135,110,136,135,45,  132,133,58,84,156,90,77,88,  106,108,86,29,51,132,78,133,  122,67,145,151,77,36,57,128,\n  142,57,81,110,113,64,18,123,  101,136,98,45,102,79,83,102,  85,86,54,106,94,38,117,74,  115,80,89,151,109,98,137,128,\n  57,126,70,74,47,54,112,60,  146,46,72,36,108,101,48,40,  135,151,135,128,78,111,70,101,  107,100,25,118,65,57,106,128,\n  67,74,25,123,123,65,42,95,  135,62,82,86,45,70,104,59,  92,30,63,55,143,71,26,83,  97,107,87,111,25,86,45,128,\n  65,102,90,116,124,16,45,51,  110,129,118,128,73,120,108,139,  139,102,109,110,120,134,85,66,  104,100,96,129,134,94,84,128,\n  68,135,60,114,78,126,135,56,  22,121,35,117,101,118,119,120,  109,82,99,96,29,91,118,96,  63,104,18,139,47,66,138,128,\n  78,148,152,94,129,120,107,96,  141,71,52,46,111,50,97,36,  101,133,87,23,91,150,92,38,  110,103,97,84,79,68,85,128,\n  118,16,110,124,126,74,99,94,  132,79,88,135,103,84,161,153,  35,41,125,78,122,107,74,90,  93,122,134,117,97,91,38,128,\n\n  56,121,75,93,68,139,117,78,  23,63,43,75,128,101,116,59,  57,65,121,13,48,108,74,121,  144,120,128,78,95,135,119,128,\n  141,128,143,68,91,46,137,151,  29,50,32,92,55,73,81,107,  139,145,72,67,54,129,86,35,  105,40,40,99,98,61,142,128,\n  136,98,109,69,113,126,85,56,  56,103,117,104,17,70,148,128,  55,61,117,55,58,53,121,155,  86,126,75,104,27,105,100,128,\n  117,110,66,101,135,87,114,88,  69,93,78,106,98,98,117,132,  43,125,54,39,97,119,157,98,  79,131,147,134,59,130,143,128,\n  60,89,40,119,87,99,73,123,  138,107,135,72,78,97,83,134,  85,110,119,93,43,141,77,98,  119,124,28,104,55,131,118,128,\n  130,92,71,117,97,53,50,134,  114,136,136,98,51,71,62,115,  96,155,36,1,104,124,59,137,  117,93,26,47,129,107,82,128,\n  25,44,71,115,56,152,109,40,  117,70,60,119,146,80,83,130,  162,18,126,52,102,137,91,39,  105,113,91,105,37,46,95,128,\n  68,104,78,51,112,141,87,82,  79,68,59,77,84,49,21,91,  81,68,66,30,149,62,30,70,  81,114,25,107,6,89,62,128,\n};\n\nstatic const uint8 ced_hires_3[1024] = {\n  145,108,107,112,108,128,119,120,  123,130,108,110,133,138,120,117,  120,120,128,121,121,116,128,119,  128,119,122,114,121,119,123,124,\n  77,160,155,161,143,37,29,56,  47,35,127,103,75,130,115,110,  149,149,88,80,89,85,145,135,  102,93,107,99,91,89,140,135,\n  123,90,70,105,58,80,64,65,  54,64,75,114,51,62,65,58,  91,121,130,110,109,105,111,102,  107,100,93,91,94,94,90,92,\n  173,130,70,57,104,116,65,65,  135,145,70,76,167,129,117,91,  127,129,135,120,115,112,120,109,  117,108,170,131,84,86,91,132,\n  62,79,115,64,137,72,131,76,  108,65,120,128,125,126,92,124,  97,123,106,137,119,127,102,145,  120,143,106,114,81,121,87,140,\n  32,95,125,118,134,80,123,115,  112,107,111,122,99,125,101,137,  136,114,118,135,117,125,121,134,  142,145,120,115,95,109,84,135,\n  149,90,62,97,105,90,90,83,  100,81,70,84,80,69,84,99,  91,95,141,93,85,127,104,122,  139,91,91,84,114,85,87,82,\n  128,108,87,106,88,166,96,91,  95,101,96,78,98,95,111,100,  124,110,121,124,107,109,128,107,  106,107,102,86,93,92,87,95,\n\n  128,128,121,112,126,121,150,106,  125,124,120,96,136,130,135,110,  131,109,148,108,124,113,113,94,  107,139,145,102,114,94,96,95,\n  92,96,25,73,155,144,172,124,  82,104,144,100,98,115,154,121,  106,60,79,85,106,68,75,81,  150,81,74,87,105,46,52,81,\n  128,115,75,109,150,190,102,84,  108,126,118,117,98,102,82,70,  101,160,145,120,104,121,112,110,  124,103,124,102,101,99,97,98,\n  128,121,92,125,93,113,104,105,  94,104,93,99,93,102,105,98,  129,127,166,129,127,135,139,136,  142,143,142,131,131,127,123,126,\n  128,115,81,140,82,102,107,94,  83,93,83,84,80,91,94,87,  131,132,152,131,139,139,150,144,  142,131,134,133,139,135,137,136,\n  128,144,99,131,100,120,124,112,  101,111,100,102,98,109,112,105,  126,133,137,137,132,146,148,131,  144,153,139,142,147,123,115,120,\n  128,132,96,135,97,117,108,109,  98,108,97,99,95,106,109,108,  133,126,134,126,133,142,142,127,  140,133,144,121,134,129,135,117,\n  128,137,98,138,99,119,110,111,  100,110,99,102,97,112,111,111,  133,122,147,135,132,142,126,127,  144,133,138,140,129,124,135,131,\n\n  66,120,131,103,77,97,82,96,  49,122,50,79,108,111,157,61,  103,104,175,93,150,114,129,97,  163,62,107,74,85,83,86,65,\n  60,104,55,155,93,106,145,111,  154,124,81,79,114,119,104,98,  78,156,105,125,122,58,126,51,  158,67,68,140,110,97,170,83,\n  57,133,137,102,68,149,108,61,  123,146,85,82,59,65,109,45,  93,71,73,77,93,78,111,93,  84,127,90,164,148,138,91,161,\n  61,151,94,146,151,131,111,141,  77,115,111,98,134,96,86,120,  72,120,108,84,108,154,91,107,  59,119,71,81,97,99,110,111,\n  61,123,117,54,44,130,154,70,  125,120,23,146,110,91,116,88,  138,83,134,93,150,98,76,53,  90,99,140,60,102,90,84,118,\n  48,50,50,114,97,154,78,31,  88,101,72,126,31,104,99,105,  108,142,96,135,96,117,112,62,  90,103,116,59,144,151,100,63,\n  60,111,72,74,81,149,104,72,  154,140,90,149,106,117,107,164,  94,68,40,103,113,75,95,119,  78,119,86,84,153,133,135,61,\n  57,55,162,113,44,109,106,106,  156,45,51,86,91,122,91,49,  59,115,122,101,140,123,148,88,  128,112,113,99,106,160,94,146,\n\n  60,103,65,134,55,108,82,107,  109,74,62,66,51,60,154,112,  107,132,118,98,153,90,145,96,  127,103,138,131,32,128,125,71,\n  83,37,62,74,156,128,140,85,  67,149,49,158,98,78,96,58,  74,105,154,86,85,104,70,106,  71,139,144,112,70,87,62,57,\n  61,52,121,154,38,91,135,69,  50,69,82,123,119,105,113,111,  94,87,99,91,73,100,97,82,  110,100,136,69,126,142,55,51,\n  74,69,108,46,132,141,110,157,  133,69,143,44,100,133,144,154,  148,71,78,118,106,110,142,141,  77,145,112,124,118,87,69,36,\n  55,94,65,106,116,57,117,82,  111,82,114,127,58,134,115,141,  151,122,124,60,133,57,158,91,  139,85,137,75,157,84,128,56,\n  59,132,91,110,40,123,69,72,  156,84,95,148,88,151,121,95,  59,132,143,80,88,128,94,95,  76,120,121,149,98,86,94,91,\n  63,124,105,95,61,107,107,129,  65,159,114,147,62,170,118,134,  140,104,135,145,113,123,129,67,  107,117,135,114,64,66,85,147,\n  65,101,84,63,70,103,113,106,  138,80,159,36,114,114,86,133,  93,102,95,90,159,137,73,65,  75,126,75,50,154,87,101,119,\n};\n\nstatic const uint8 ced_hires_4[1024] = {\n  125,128,119,118,134,121,118,117,  121,123,122,116,128,124,115,120,  123,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,133,\n  89,125,49,76,12,21,28,18,  21,36,39,85,85,24,34,27,  45,91,39,57,98,41,58,61,  34,65,57,69,88,91,63,51,\n  88,107,83,89,76,130,128,123,  123,120,114,104,121,106,102,107,  111,122,121,124,104,124,105,123,  75,193,173,183,166,161,151,140,\n  57,123,96,99,90,98,90,87,  92,100,90,86,102,110,91,100,  111,104,117,127,115,104,104,107,  93,107,76,126,75,129,66,99,\n  132,140,43,135,109,85,142,143,  142,123,145,142,88,114,151,140,  111,113,116,119,86,108,108,99,  125,132,66,121,102,103,162,139,\n  127,140,45,144,105,38,131,121,  150,137,124,119,85,120,100,111,  132,147,116,143,129,149,144,158,  121,139,129,132,129,144,150,135,\n  118,171,152,134,113,134,101,109,  118,121,117,117,163,115,111,113,  122,144,155,132,114,158,126,133,  170,108,78,105,109,94,91,87,\n  107,128,102,85,100,86,92,85,  99,107,95,79,99,102,94,112,  103,175,150,158,143,171,161,149,  134,158,157,149,157,163,156,163,\n\n  109,134,92,99,79,88,99,96,  113,116,109,96,117,109,94,107,  109,117,140,123,112,109,118,129,  82,99,110,93,90,120,93,105,\n  174,130,49,65,96,52,55,98,  100,54,66,43,94,53,51,88,  117,70,89,96,67,74,69,96,  111,61,42,98,52,58,55,82,\n  104,127,95,100,95,101,95,103,  111,102,126,112,114,120,101,120,  111,128,128,120,116,125,119,128,  87,104,85,98,95,101,98,94,\n  127,145,120,137,126,116,135,123,  128,134,149,145,134,137,137,135,  138,172,148,150,144,142,146,155,  116,128,113,126,123,128,126,122,\n  127,149,116,132,127,126,132,129,  142,132,146,137,136,137,141,133,  138,152,166,158,154,155,150,158,  104,121,102,120,112,119,115,111,\n  147,147,113,127,121,115,115,109,  131,129,132,124,135,125,120,129,  126,150,153,163,145,131,145,157,  122,128,120,128,128,128,128,128,\n  132,146,128,118,123,118,136,128,  140,142,131,133,128,133,123,134,  135,144,155,144,129,141,146,152,  119,128,117,129,127,128,128,126,\n  136,161,124,119,112,127,127,117,  125,135,136,116,159,139,127,131,  135,144,151,151,142,140,146,158,  121,128,119,128,128,128,128,128,\n\n  56,117,131,52,109,89,49,75,  81,137,58,134,87,143,104,64,  67,158,68,113,116,101,108,155,  107,161,107,92,127,123,72,117,\n  86,78,40,98,54,51,93,94,  146,77,132,88,105,47,86,121,  62,41,132,68,70,140,41,104,  135,103,110,99,123,62,88,138,\n  101,108,91,108,121,139,137,42,  81,139,135,123,107,124,135,85,  101,65,99,90,94,85,106,115,  139,139,64,101,103,134,95,143,\n  70,126,127,75,75,101,140,147,  87,164,107,104,165,99,81,128,  127,71,73,92,129,93,149,99,  116,117,63,116,99,109,92,116,\n  76,80,61,56,75,111,73,103,  101,107,139,145,119,80,146,97,  80,85,92,153,99,90,106,97,  63,145,46,83,77,87,100,104,\n  146,115,124,137,168,42,104,127,  143,56,58,87,91,127,81,104,  84,80,65,78,61,37,98,132,  153,100,149,107,103,115,86,77,\n  130,158,89,75,83,106,85,85,  154,103,67,119,146,96,127,133,  57,111,108,142,164,78,117,83,  96,129,56,73,114,66,45,67,\n  144,99,131,129,98,141,102,131,  94,130,123,75,85,40,91,109,  73,161,102,81,53,102,161,124,  69,88,72,127,111,144,48,90,\n\n  63,71,74,140,135,125,89,112,  80,139,117,97,84,70,104,105,  134,91,113,99,91,128,126,100,  80,119,115,145,82,39,81,166,\n  114,92,92,84,94,122,49,104,  105,137,124,110,127,85,72,101,  21,83,117,52,78,79,102,69,  159,137,104,143,160,134,95,104,\n  121,128,79,153,100,154,100,103,  107,108,78,130,91,172,136,158,  103,65,53,145,51,100,86,107,  108,103,136,103,149,108,105,77,\n  79,64,42,108,78,77,129,65,  55,77,109,88,67,93,68,52,  53,94,114,121,109,121,106,60,  146,113,83,116,96,136,58,100,\n  84,132,50,139,86,86,148,141,  107,91,140,68,130,131,107,42,  102,135,166,160,54,62,91,126,  79,136,52,161,124,123,100,71,\n  70,99,52,78,44,116,54,121,  67,112,82,59,164,83,92,133,  108,81,120,156,91,84,129,131,  107,110,139,91,122,128,82,92,\n  118,77,72,119,66,133,131,40,  125,123,54,65,72,159,54,65,  84,86,68,142,68,101,155,79,  102,155,56,134,117,163,131,155,\n  66,82,99,78,48,100,154,96,  81,163,89,132,131,155,126,110,  54,98,82,94,51,152,112,120,  138,77,149,127,74,99,109,80,\n};\n\nstatic const uint8 ced_hires_5[1024] = {\n  128,127,124,128,128,147,138,139,  162,124,125,126,127,127,152,184,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,\n  59,56,52,84,74,62,105,50,  75,46,54,59,89,56,113,130,  119,132,110,115,136,127,123,76,  85,121,121,94,112,104,106,128,\n  126,117,109,74,77,123,124,119,  122,105,96,86,86,78,87,79,  94,169,180,158,166,149,129,116,  113,117,109,100,100,85,105,128,\n  59,98,77,92,84,100,75,88,  93,94,54,78,89,98,98,106,  103,65,103,95,118,105,93,113,  76,102,66,54,135,52,60,128,\n  114,126,138,119,130,83,102,112,  141,139,142,144,138,118,52,132,  48,39,161,146,26,1,0,0,  0,6,0,43,34,8,25,128,\n  137,140,115,130,111,132,114,131,  105,143,147,144,140,142,33,132,  35,41,72,166,126,73,105,0,  0,0,0,53,3,50,23,128,\n  112,128,104,79,120,147,178,100,  105,85,90,74,80,77,120,87,  130,112,180,83,120,100,91,85,  85,95,84,102,99,90,92,128,\n  162,138,147,153,157,142,131,128,  132,128,118,111,103,136,145,120,  140,154,95,87,111,106,97,91,  91,101,86,97,105,96,98,128,\n\n  96,79,91,123,95,99,109,128,  124,80,77,74,81,79,85,86,  101,94,91,83,107,102,93,87,  87,97,91,93,101,92,94,128,\n  130,76,66,68,64,65,77,111,  81,61,51,63,45,76,57,136,  63,56,53,46,77,64,62,49,  49,59,123,97,63,54,56,128,\n  86,86,81,86,91,131,96,85,  96,81,82,79,84,117,90,91,  106,99,96,88,112,107,98,92,  95,102,87,98,113,97,99,128,\n  114,112,109,114,116,119,125,113,  127,111,110,121,112,112,118,119,  128,127,124,116,128,128,126,120,  120,128,115,126,140,125,127,128,\n  103,101,98,103,105,118,105,102,  113,98,99,96,101,101,107,108,  147,116,113,105,128,124,115,109,  109,119,104,115,136,114,116,128,\n  121,119,116,121,123,142,128,128,  128,116,117,114,119,119,125,126,  128,128,128,123,128,128,128,127,  127,128,122,128,128,128,128,128,\n  118,116,113,118,120,127,150,122,  139,118,114,111,116,116,122,123,  128,128,128,120,128,128,128,124,  124,128,119,128,128,128,128,128,\n  127,118,115,120,139,136,123,124,  134,127,116,113,118,118,124,125,  128,128,128,122,128,128,128,126,  126,128,121,128,128,128,128,128,\n\n  144,113,79,134,119,150,168,110,  109,123,87,135,164,70,123,153,  60,128,94,93,119,96,90,82,  80,91,52,120,157,65,95,128,\n  152,77,95,138,152,63,122,108,  72,111,161,80,53,163,71,71,  154,47,85,88,86,124,118,33,  115,126,72,98,91,95,82,128,\n  128,146,140,137,59,123,98,75,  133,154,41,39,133,67,133,64,  115,98,30,37,84,76,58,26,  78,73,153,84,82,120,63,128,\n  106,93,89,71,142,126,122,109,  127,113,101,74,47,71,102,125,  99,87,54,87,115,144,165,81,  99,49,47,81,86,139,114,128,\n  95,47,91,59,105,149,149,123,  89,57,69,124,88,133,119,156,  141,64,149,165,107,86,69,108,  135,57,146,122,119,128,82,128,\n  44,75,63,157,128,38,92,158,  41,77,129,36,81,96,88,54,  44,93,58,46,115,99,80,131,  96,65,76,87,70,72,83,128,\n  165,111,57,90,104,46,83,56,  72,75,68,75,96,118,139,55,  81,118,70,56,99,104,83,106,  143,142,105,139,81,83,155,128,\n  86,127,119,93,103,124,116,150,  118,69,88,93,98,72,109,119,  122,130,119,64,126,86,111,57,  87,131,74,125,103,69,156,128,\n\n  98,68,93,126,62,132,161,123,  149,72,93,84,65,65,112,144,  101,154,60,90,129,83,167,144,  140,140,113,105,164,79,61,128,\n  112,113,139,157,96,91,153,68,  106,113,83,60,100,103,74,71,  111,102,68,110,41,73,115,67,  93,107,158,143,83,149,120,128,\n  95,117,116,117,99,81,87,114,  115,118,121,91,142,90,110,101,  82,114,128,148,135,125,105,70,  80,91,110,89,129,99,140,128,\n  85,169,69,133,73,49,110,60,  96,123,99,77,114,72,157,121,  140,133,145,94,106,142,90,139,  96,154,153,76,95,136,38,128,\n  144,125,98,54,162,77,113,95,  108,88,42,67,143,69,97,30,  68,71,136,64,127,135,138,72,  107,115,59,137,148,97,158,128,\n  122,156,149,122,108,71,79,147,  128,144,38,68,131,98,99,121,  164,143,123,52,140,126,130,91,  154,67,95,124,146,43,91,128,\n  124,62,79,123,127,91,91,135,  121,69,95,76,76,128,74,47,  52,71,100,47,105,141,145,88,  123,140,106,86,152,110,91,128,\n  123,121,138,108,94,76,62,115,  57,128,70,49,149,129,153,78,  71,120,117,115,74,80,143,95,  64,35,73,80,92,79,49,128,\n};\n\nstatic const uint8 ced_hires_6[1024] = {\n  131,89,116,77,83,97,102,136,  133,105,111,105,87,87,87,105,  108,118,117,124,140,105,110,104,  68,96,93,87,81,101,115,102,\n  17,136,152,147,132,68,100,48,  56,48,81,53,20,72,87,102,  143,155,79,74,108,84,137,154,  76,94,89,93,83,102,92,87,\n  66,79,73,41,49,115,104,62,  46,89,89,70,100,49,89,121,  91,76,85,75,125,76,65,130,  119,156,144,96,123,158,156,118,\n  20,106,67,42,24,96,44,57,  144,132,70,77,156,109,89,83,  121,135,126,114,134,111,112,128,  91,109,152,125,78,102,101,136,\n  43,96,88,68,104,16,25,125,  72,107,35,59,22,13,0,14,  89,145,128,73,85,131,89,165,  108,108,98,155,106,124,167,120,\n  128,81,99,82,73,82,85,63,  69,94,110,62,46,48,43,56,  155,167,150,139,160,127,125,138,  97,126,85,77,73,94,89,89,\n  67,136,152,100,83,91,124,114,  106,89,92,124,146,131,103,110,  120,137,118,86,122,92,116,123,  90,103,95,79,104,103,104,97,\n  122,74,119,104,124,104,96,98,  90,118,93,81,76,100,118,130,  143,123,120,167,152,126,138,151,  125,120,83,101,102,118,116,108,\n\n  79,88,103,83,60,34,70,38,  92,77,94,49,116,95,82,88,  43,144,139,131,133,98,98,121,  86,94,95,101,96,80,109,97,\n  88,98,105,102,82,110,51,104,  115,100,128,93,119,80,46,69,  110,117,74,90,120,121,93,128,  119,85,83,79,94,103,104,110,\n  89,75,115,84,121,92,114,102,  122,90,122,128,106,108,84,118,  107,133,113,126,141,123,115,158,  103,135,99,112,107,138,121,141,\n  94,79,115,97,115,104,113,108,  122,102,110,119,95,109,90,121,  119,127,118,122,154,126,117,158,  112,137,104,112,113,135,125,129,\n  121,83,109,77,84,83,62,98,  104,84,113,116,93,81,73,85,  118,113,99,96,123,96,108,131,  95,111,79,75,101,113,113,103,\n  140,66,86,79,79,90,80,94,  100,88,90,93,77,79,74,87,  118,152,103,106,142,108,110,143,  111,131,122,106,115,147,126,135,\n  166,67,85,78,78,89,79,93,  99,87,89,92,76,78,73,86,  130,127,102,124,155,105,121,151,  123,149,123,109,120,162,148,136,\n  154,75,95,88,88,99,89,103,  109,97,99,102,86,88,83,96,  149,130,112,108,140,112,120,145,  114,125,119,102,115,145,139,135,\n\n  31,150,134,141,48,120,36,27,  151,116,122,82,89,136,91,28,  119,68,44,150,145,40,107,55,  36,92,23,66,46,41,24,59,\n  41,45,12,0,141,58,83,30,  9,9,61,106,0,45,9,16,  14,23,66,152,39,5,42,56,  144,155,123,64,151,84,75,33,\n  107,62,98,81,89,126,87,70,  167,111,120,112,104,100,108,129,  72,124,176,74,96,72,84,77,  115,63,29,72,108,97,111,154,\n  85,144,123,65,80,95,99,66,  65,55,176,121,104,135,27,146,  62,44,158,114,101,106,105,126,  60,80,72,160,55,126,113,101,\n  36,0,87,20,72,44,8,0,  67,127,87,121,10,84,77,51,  34,21,68,32,57,64,38,24,  9,14,132,0,17,87,36,41,\n  67,104,95,43,73,154,82,100,  126,72,76,68,26,71,58,32,  24,45,36,21,55,166,135,135,  134,126,7,36,81,101,84,170,\n  75,82,59,49,43,129,38,169,  67,116,63,94,69,64,52,101,  133,117,129,120,66,52,28,69,  66,82,50,119,104,83,74,71,\n  47,131,113,126,57,142,116,109,  99,107,76,126,9,6,123,152,  96,136,103,126,142,67,90,109,  102,148,97,101,76,87,83,95,\n\n  49,8,75,129,53,138,158,150,  98,83,101,27,3,66,159,125,  128,114,158,134,119,126,153,139,  137,128,35,126,84,61,108,84,\n  34,0,18,21,24,22,93,33,  38,1,18,168,88,79,156,105,  149,47,24,56,50,69,76,64,  20,102,71,68,46,62,48,58,\n  30,53,84,128,83,135,48,120,  32,36,94,29,44,92,100,149,  138,79,46,24,153,61,30,49,  158,143,56,138,115,118,110,93,\n  74,93,20,31,73,44,42,111,  52,105,68,74,46,43,29,66,  45,67,37,7,76,88,82,101,  52,70,30,45,51,78,66,100,\n  54,32,43,64,72,117,82,71,  69,29,37,29,4,167,126,75,  26,161,51,143,53,30,104,121,  74,79,144,27,157,129,153,117,\n  55,53,53,87,24,19,80,75,  68,63,40,42,111,20,59,68,  72,114,50,26,138,29,70,86,  43,51,156,34,99,130,66,103,\n  53,0,46,31,71,79,87,57,  59,51,34,39,24,0,25,66,  1,47,140,45,144,92,34,50,  90,75,50,2,24,40,147,114,\n  63,150,105,113,95,108,52,72,  62,157,153,73,141,125,32,38,  104,104,25,64,137,147,31,105,  16,139,27,46,1,90,101,23,\n};\n\nstatic const uint8 ced_hires_7[1024] = {\n  120,127,110,107,125,119,124,105,  127,128,122,128,102,123,102,99,  129,154,113,122,107,119,106,109,  116,98,104,108,120,117,116,111,\n  91,83,50,46,97,86,122,78,  99,143,61,80,78,80,62,52,  17,15,56,62,51,91,64,93,  138,118,150,133,136,119,114,121,\n  173,162,166,159,148,141,205,123,  204,166,143,146,120,144,133,153,  134,173,138,140,103,106,108,117,  108,108,71,103,148,151,114,164,\n  86,147,121,122,141,130,130,109,  132,142,124,133,108,143,112,113,  130,102,125,146,122,120,113,107,  113,92,86,127,123,136,75,107,\n  137,141,85,124,139,117,115,121,  96,81,80,124,153,77,61,54,  173,171,86,199,83,61,48,51,  58,40,46,50,62,59,58,53,\n  145,149,144,119,151,127,147,125,  167,161,116,130,99,120,128,128,  128,103,131,112,106,147,108,130,  151,83,89,93,105,102,101,96,\n  129,134,99,103,101,147,132,118,  111,96,87,94,100,88,67,64,  93,74,78,87,72,84,86,74,  81,63,69,73,85,82,81,76,\n  125,123,130,99,124,109,144,109,  111,115,106,113,93,107,93,83,  92,101,134,122,117,122,132,121,  100,122,88,92,104,101,112,95,\n\n  117,129,112,84,103,101,127,90,  87,91,82,100,75,179,112,185,  110,132,107,115,106,185,103,103,  136,103,135,134,129,86,137,125,\n  139,147,101,95,125,132,138,134,  114,118,109,116,89,113,94,123,  98,96,100,109,94,106,93,96,  103,85,91,95,107,104,103,98,\n  159,165,129,148,166,141,172,150,  179,163,171,181,122,149,165,145,  138,128,145,149,124,146,132,127,  143,122,121,133,144,135,162,148,\n  171,165,133,151,163,146,162,148,  172,168,156,165,126,154,137,132,  143,140,143,155,135,156,140,142,  142,127,130,137,149,145,153,146,\n  132,133,96,93,127,105,110,92,  113,117,108,115,88,109,88,85,  94,169,171,176,140,166,165,125,  134,143,158,156,158,166,150,158,\n  169,154,126,147,134,128,175,148,  138,128,128,128,118,128,118,115,  124,125,128,128,123,128,122,125,  128,114,120,124,128,128,128,127,\n  160,159,125,129,155,136,156,153,  149,128,128,128,117,128,117,114,  123,124,128,128,122,128,121,124,  128,113,119,123,128,128,128,126,\n  168,147,128,128,128,139,128,143,  141,128,128,128,127,128,127,124,  128,128,128,128,128,128,128,128,  128,123,128,128,128,128,128,128,\n\n  26,71,23,0,18,145,93,129,  88,129,0,160,78,145,20,29,  21,64,41,28,155,90,68,73,  46,65,128,9,130,142,83,131,\n  59,84,81,102,49,55,8,132,  69,48,0,80,0,123,0,36,  37,33,0,62,129,121,64,162,  123,122,0,154,69,160,143,89,\n  155,85,24,119,133,127,86,100,  126,180,98,119,16,37,81,98,  82,71,113,46,31,50,30,33,  70,148,98,135,141,102,162,99,\n  94,74,90,98,122,40,42,20,  72,125,152,93,42,97,112,5,  103,130,75,82,21,65,120,149,  107,58,80,48,61,150,41,63,\n  118,82,161,115,70,0,55,0,  13,151,100,56,59,0,25,151,  102,102,94,0,133,95,68,98,  35,166,95,80,163,108,138,85,\n  47,27,46,3,18,108,113,138,  156,140,109,142,22,49,123,83,  98,107,78,74,32,109,58,60,  83,0,109,0,1,0,105,55,\n  71,49,44,31,49,30,38,141,  120,37,96,114,14,14,14,21,  22,111,109,31,70,103,7,100,  17,109,62,65,72,49,18,128,\n  40,154,151,137,126,105,104,61,  119,144,127,42,0,0,164,141,  135,126,95,119,107,112,29,0,  0,0,99,11,15,13,9,0,\n\n  108,133,116,95,53,149,107,100,  56,66,115,79,15,100,65,0,  1,0,7,140,111,132,101,0,  95,4,92,92,46,22,161,72,\n  58,38,113,14,88,36,11,97,  67,63,27,39,143,108,133,82,  135,0,52,60,72,93,90,149,  109,147,143,103,45,159,148,153,\n  132,115,1,88,45,51,72,56,  44,62,5,83,23,28,153,121,  167,37,147,101,0,82,26,76,  97,99,17,1,1,0,40,86,\n  83,46,30,15,41,21,26,83,  78,66,41,84,84,78,0,41,  50,103,63,122,73,69,0,61,  48,0,97,105,70,96,62,90,\n  85,84,93,6,54,125,46,123,  102,62,7,71,96,44,54,0,  54,4,166,155,31,144,107,0,  87,55,65,143,79,47,0,5,\n  163,95,121,171,161,163,63,142,  100,152,141,64,95,125,105,56,  0,89,99,83,64,43,95,89,  83,50,23,0,68,0,0,76,\n  92,65,42,71,88,88,176,120,  171,105,154,154,18,44,54,106,  112,92,134,139,0,134,133,130,  116,101,84,51,64,46,90,155,\n  152,122,117,113,19,86,30,51,  85,122,99,90,18,146,45,102,  58,13,43,75,104,119,101,0,  77,0,0,0,146,0,119,0,\n};\n\nstatic const uint8 ced_hires_8[1024] = {\n  130,127,155,168,146,193,173,178,  138,176,189,169,199,152,146,172,  128,127,128,122,128,128,109,122,  115,128,126,128,120,128,128,128,\n  142,160,113,159,112,138,145,87,  133,125,100,110,109,101,70,134,  52,81,111,42,63,48,9,22,  34,44,34,64,45,60,106,128,\n  98,91,146,105,104,134,59,53,  74,82,71,49,70,51,52,76,  77,69,81,64,94,79,51,64,  57,75,68,77,62,74,106,128,\n  90,132,91,134,101,123,97,99,  109,125,92,97,124,114,109,140,  123,84,137,120,149,126,95,134,  90,124,96,82,140,78,116,128,\n  68,69,88,133,99,128,124,111,  101,105,137,125,134,111,84,138,  137,75,81,64,111,89,60,64,  57,75,68,77,62,215,110,128,\n  111,181,158,179,148,178,161,155,  155,149,184,172,200,153,139,187,  156,138,159,137,153,154,108,115,  129,118,111,120,105,117,128,128,\n  91,101,111,146,104,81,82,70,  84,86,94,72,93,74,75,99,  100,92,104,87,117,102,74,87,  80,98,91,100,85,97,128,128,\n  137,111,137,155,136,166,170,156,  138,140,168,155,174,149,139,169,  119,111,123,106,128,121,93,106,  99,117,110,119,104,116,128,128,\n\n  127,121,128,160,166,147,149,173,  185,181,184,160,174,149,143,166,  164,138,146,126,151,136,178,115,  117,182,167,95,80,92,124,128,\n  113,114,134,159,120,170,172,178,  160,151,180,174,185,158,134,167,  122,114,126,109,128,124,181,188,  193,130,119,145,158,155,152,128,\n  155,164,146,164,148,177,155,147,  159,166,174,167,174,147,135,174,  105,97,186,168,122,107,79,92,  85,103,96,105,90,102,128,128,\n  161,164,146,176,146,180,170,159,  156,165,177,172,179,155,145,171,  111,103,162,180,176,113,104,98,  91,109,102,111,96,108,128,128,\n  187,159,158,190,172,180,181,159,  155,156,183,160,177,165,170,171,  148,172,125,108,128,141,95,108,  101,119,112,121,126,118,128,128,\n  128,128,120,133,128,128,128,121,  128,128,128,123,128,125,126,128,  128,128,128,128,128,128,125,128,  166,128,128,128,131,128,128,128,\n  128,128,119,128,128,128,128,122,  129,131,128,122,128,124,125,128,  128,128,128,128,128,128,124,128,  128,128,128,128,128,128,128,128,\n  128,128,128,154,128,128,133,128,  142,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,  128,128,128,128,128,128,128,128,\n\n  20,141,64,92,31,78,151,53,  145,20,53,48,65,154,102,114,  93,115,27,0,49,93,58,115,  144,65,153,88,149,88,17,128,\n  84,40,161,60,108,42,125,33,  139,68,83,54,43,81,132,82,  69,84,108,0,122,85,6,2,  53,70,102,0,36,34,41,128,\n  100,104,66,145,69,110,103,89,  76,65,98,98,84,63,121,133,  106,95,152,44,168,45,122,127,  129,38,117,149,53,137,128,128,\n  134,104,149,56,114,62,74,104,  71,45,50,137,132,122,110,44,  112,56,54,136,150,128,59,0,  0,81,103,3,0,0,33,128,\n  81,17,22,151,126,101,49,126,  22,36,76,149,81,76,40,83,  64,111,53,68,65,145,96,0,  110,0,87,0,39,98,99,128,\n  104,20,78,59,26,158,114,116,  105,158,62,77,97,99,149,60,  158,104,111,51,111,77,41,70,  35,124,61,140,87,83,139,128,\n  89,103,71,128,99,85,122,108,  62,50,67,61,120,64,44,79,  43,9,107,179,176,163,107,154,  141,87,110,163,2,37,115,128,\n  0,162,20,49,20,47,97,121,  95,83,96,88,115,58,47,97,  61,11,73,19,29,17,0,0,  0,148,82,94,111,89,40,128,\n\n  120,92,69,58,56,38,49,120,  38,153,95,56,69,140,92,44,  157,155,88,91,145,0,89,50,  109,97,0,66,0,18,97,128,\n  114,13,57,120,93,77,153,77,  152,135,99,80,88,24,69,60,  107,53,43,2,13,0,131,78,  141,49,121,0,119,153,135,128,\n  0,4,6,55,124,56,65,29,  21,40,149,41,100,137,17,39,  3,163,111,111,140,0,52,59,  72,113,76,118,116,81,92,128,\n  47,32,26,62,0,51,45,166,  142,38,168,49,140,20,96,145,  124,74,90,169,73,151,143,89,  64,116,26,75,20,162,143,128,\n  0,0,91,31,9,39,39,26,  90,29,42,35,53,27,112,56,  58,67,4,76,79,51,153,115,  122,50,137,120,19,114,123,128,\n  78,120,61,100,65,59,85,52,  72,57,93,54,61,10,72,78,  56,75,77,0,33,34,43,38,  0,0,14,44,0,44,24,128,\n  151,95,67,85,59,72,70,135,  53,60,105,54,54,25,160,139,  142,61,116,126,90,1,104,159,  139,115,141,100,41,62,100,128,\n  0,0,16,46,152,103,55,43,  56,47,60,148,157,92,133,148,  0,0,158,50,138,103,111,67,  150,157,47,12,78,21,146,128,\n};\n\nstatic const uint8 ced_hires_9[1024] = {\n  130,71,129,141,137,60,133,127,  113,78,80,127,94,127,117,51,  103,62,119,129,148,68,133,101,  38,42,158,125,112,190,163,124,\n  139,45,127,155,132,105,145,125,  136,78,127,128,145,136,141,61,  122,142,128,129,137,97,140,143,  1,3,145,120,131,129,135,62,\n  124,125,104,88,80,128,69,72,  68,127,36,103,135,92,101,131,  77,126,132,112,51,143,88,87,  94,151,72,95,120,110,80,161,\n  81,123,101,98,60,133,79,54,  52,155,28,125,46,72,67,101,  90,70,86,76,45,128,37,119,  86,129,81,86,102,49,41,88,\n  96,132,92,99,114,136,90,108,  121,130,15,114,132,93,122,129,  135,112,129,111,82,133,131,124,  119,129,105,108,112,39,105,147,\n  115,68,124,132,149,103,109,139,  127,72,144,126,137,143,146,76,  122,99,138,142,133,69,134,126,  32,11,131,145,107,148,126,61,\n  77,126,72,78,49,124,127,85,  75,135,43,82,121,79,83,143,  74,43,129,98,111,130,44,45,  87,106,101,92,138,51,52,89,\n  95,126,67,51,135,116,72,112,  51,131,24,106,133,97,111,143,  71,33,136,82,68,135,62,78,  22,49,63,84,114,36,104,82,\n\n  46,129,63,71,69,93,73,121,  119,140,58,72,114,107,136,142,  96,57,126,112,97,126,48,117,  55,54,76,101,134,53,81,140,\n  139,93,114,144,122,123,128,130,  146,120,146,137,129,138,134,101,  109,151,120,136,133,78,129,131,  0,6,154,131,126,122,151,58,\n  103,57,111,129,142,74,122,99,  101,56,40,136,131,124,138,107,  93,87,91,150,153,48,74,96,  29,52,125,155,90,119,156,95,\n  71,137,72,129,58,106,76,87,  65,135,10,79,127,82,98,139,  95,29,127,121,126,138,126,104,  58,30,84,95,111,27,55,91,\n  148,128,84,57,100,136,84,113,  74,138,28,114,116,81,111,129,  86,138,17,107,80,134,130,64,  160,116,80,94,104,93,101,84,\n  76,131,112,98,55,135,114,120,  76,132,40,106,110,135,121,131,  146,114,77,99,59,136,66,90,  106,140,89,78,129,75,105,92,\n  119,136,75,128,125,129,141,113,  81,139,14,124,57,64,124,132,  74,124,75,119,117,122,73,70,  119,145,101,93,142,120,105,136,\n  111,62,156,130,141,107,139,152,  124,103,148,125,129,141,131,71,  138,116,130,137,129,82,139,148,  0,0,125,133,142,126,134,55,\n\n  72,116,48,77,48,122,93,65,  57,115,22,108,127,51,83,142,  87,100,151,86,87,131,39,43,  86,113,70,90,98,53,85,72,\n  149,20,138,146,143,112,62,118,  158,65,125,130,127,150,129,33,  114,116,113,124,140,58,141,141,  24,20,165,129,84,163,122,98,\n  106,140,115,104,111,132,132,124,  123,125,23,112,87,134,120,128,  118,121,93,124,114,141,143,116,  117,135,106,137,107,90,103,86,\n  104,114,115,105,103,116,131,80,  117,119,30,147,132,120,108,122,  147,136,106,132,147,127,81,123,  134,114,71,127,123,66,120,147,\n  106,131,95,77,65,135,100,63,  69,133,8,113,86,81,116,133,  74,114,131,122,67,128,53,135,  151,132,60,61,111,92,110,88,\n  161,88,152,116,143,105,115,146,  136,61,114,137,128,126,120,44,  151,90,132,138,125,54,155,126,  8,28,138,144,121,160,160,75,\n  87,124,98,82,154,145,88,92,  46,138,32,132,81,107,138,90,  81,34,84,103,27,129,104,81,  109,61,73,49,116,47,121,91,\n  72,136,72,95,97,132,49,95,  111,125,35,117,129,103,124,133,  112,95,117,134,95,115,67,97,  102,148,126,135,108,97,99,123,\n\n  165,12,134,132,98,115,126,113,  92,122,36,138,34,110,157,63,  107,139,40,148,113,22,79,71,  31,22,127,133,78,127,95,90,\n  38,12,112,64,133,138,43,108,  175,16,168,125,147,148,91,8,  100,54,87,106,121,17,106,130,  17,47,101,161,65,95,131,83,\n  119,144,110,98,143,110,64,120,  43,121,32,102,111,138,133,123,  86,119,120,80,52,126,109,143,  98,130,90,84,85,38,91,148,\n  95,124,58,99,38,144,76,50,  77,139,32,143,125,91,120,110,  106,28,108,77,132,126,36,92,  136,57,38,62,101,62,40,90,\n  47,23,65,73,87,20,162,94,  103,127,100,162,133,118,116,37,  117,60,94,98,151,51,49,98,  24,20,116,121,117,51,42,90,\n  54,123,33,45,31,151,56,33,  42,145,36,29,25,35,119,81,  32,43,48,22,12,118,44,43,  149,32,38,50,76,65,37,95,\n  46,130,41,34,22,145,59,49,  59,134,20,125,111,79,130,70,  69,37,81,47,140,127,73,75,  123,43,61,147,80,46,72,78,\n  115,32,81,74,58,149,102,67,  71,46,65,60,49,57,61,30,  68,174,54,51,45,52,72,53,  57,53,71,79,105,84,67,123,\n};\n\nstatic const uint8 ced_hires_10[1024] = {\n  58,122,143,128,136,100,142,138,  75,129,136,141,139,140,49,124,  126,129,133,99,142,134,152,137,  120,138,45,14,25,143,136,140,\n  125,108,87,90,85,127,88,79,  128,11,95,136,93,104,132,81,  132,106,62,140,86,72,90,83,  121,114,149,146,89,121,124,118,\n  133,75,100,96,92,129,79,127,  127,44,117,130,100,119,132,110,  114,131,93,115,52,110,92,107,  134,108,137,144,103,119,70,100,\n  129,70,93,99,140,110,67,56,  133,40,103,132,85,100,142,72,  134,84,77,132,70,53,62,94,  79,31,106,60,43,131,68,32,\n  132,100,125,106,118,135,136,106,  130,30,113,134,97,123,128,124,  125,111,84,130,80,106,89,109,  111,56,133,127,111,123,95,111,\n  67,126,128,140,149,99,132,133,  69,144,128,139,143,147,68,121,  136,137,133,67,119,131,136,128,  136,149,79,10,23,96,114,96,\n  125,102,73,98,152,143,106,80,  137,19,128,84,119,136,89,83,  74,107,89,132,74,58,81,126,  52,49,110,73,108,116,88,42,\n  142,113,137,119,142,109,104,86,  122,38,105,107,137,130,124,108,  116,84,69,126,79,79,97,100,  101,51,133,133,97,103,115,109,\n\n  96,116,125,136,124,122,129,150,  119,148,137,131,138,134,97,111,  120,136,131,74,132,148,147,147,  126,125,57,11,16,101,139,150,\n  64,113,99,105,134,74,84,122,  61,63,130,131,122,139,112,93,  90,147,154,53,127,109,126,145,  147,109,83,59,31,99,68,83,\n  137,90,110,94,59,103,126,88,  132,21,84,127,93,105,137,97,  124,122,120,138,85,68,128,65,  88,44,132,42,58,106,79,34,\n  124,85,81,119,108,133,128,91,  138,36,114,116,86,113,128,87,  26,102,87,132,98,77,76,98,  95,93,108,117,161,118,149,141,\n  131,125,92,102,68,135,80,85,  131,41,104,110,136,120,132,145,  74,100,62,135,119,73,95,106,  84,72,119,134,102,130,74,113,\n  136,71,72,117,124,128,73,106,  138,23,122,64,52,124,130,76,  75,120,120,120,127,85,126,105,  103,120,93,146,119,110,119,124,\n  59,156,145,150,141,110,137,123,  104,147,127,129,138,125,77,138,  130,135,130,87,148,123,129,136,  129,131,48,15,26,124,110,114,\n  115,51,73,57,54,120,36,57,  115,11,101,125,70,76,140,93,  150,94,84,126,85,49,83,103,  85,56,128,111,78,103,71,102,\n\n  137,112,116,124,112,131,132,116,  126,33,113,86,134,122,127,115,  94,124,117,137,127,116,110,91,  128,86,117,135,114,119,99,120,\n  116,104,122,83,102,118,81,68,  114,12,145,131,124,108,121,145,  103,127,145,127,115,112,108,119,  140,58,140,108,123,116,98,134,\n  131,98,133,63,58,136,35,61,  131,29,113,81,78,117,131,74,  128,121,76,127,101,71,79,105,  70,83,126,131,150,127,103,111,\n  95,145,124,149,145,102,158,144,  73,115,137,128,126,118,39,154,  127,136,124,85,112,136,102,157,  149,155,63,39,21,131,157,85,\n  121,75,41,91,52,123,59,122,  133,55,87,113,80,75,144,80,  121,95,110,126,123,72,70,79,  101,39,94,99,84,136,68,51,\n  127,76,124,126,75,95,60,87,  130,36,76,111,110,138,142,109,  125,113,92,127,77,120,87,88,  92,44,116,59,67,146,52,55,\n  124,94,127,65,59,135,31,83,  154,42,119,47,70,56,99,85,  70,79,69,127,80,57,107,42,  77,38,108,135,113,116,94,95,\n  134,58,90,56,42,142,76,51,  134,21,125,102,78,135,80,81,  78,60,137,122,61,53,43,84,  147,45,82,70,120,107,56,52,\n\n  125,58,101,70,50,142,31,51,  142,44,142,128,93,121,116,115,  115,88,119,127,79,67,100,81,  78,68,109,74,131,115,109,34,\n  128,20,41,24,44,151,46,58,  143,31,53,37,38,115,104,35,  49,13,50,110,40,29,34,32,  52,77,75,38,140,67,53,62,\n  30,102,98,113,102,138,130,139,  39,47,119,112,103,104,37,128,  128,103,110,33,80,102,106,125,  86,137,98,43,38,91,95,175,\n  21,105,132,102,123,141,110,109,  31,168,125,139,150,92,18,94,  86,105,122,38,63,172,77,132,  155,93,48,68,35,60,65,79,\n  28,139,76,117,98,118,79,120,  117,45,140,50,110,154,88,110,  45,147,116,36,127,99,132,98,  137,124,54,34,56,82,164,143,\n  35,74,103,109,98,33,86,125,  55,113,149,141,121,121,50,122,  113,105,152,60,154,113,84,61,  128,49,72,16,20,144,58,61,\n  82,126,110,148,135,61,143,155,  65,78,116,108,135,109,46,91,  122,125,145,67,103,116,124,162,  127,185,84,36,46,110,131,52,\n  42,137,146,121,136,110,144,167,  67,120,128,125,146,130,34,118,  111,122,138,47,72,152,133,119,  127,160,56,29,36,97,143,120,\n};\n\nstatic const uint8 ced_hires_11[1024] = {\n  129,46,102,93,87,61,93,55,  96,48,77,76,65,67,91,46,  64,58,113,75,57,62,82,91,  106,70,112,123,68,70,75,108,\n  113,55,138,144,134,87,155,40,  138,123,135,133,127,142,137,53,  147,126,126,136,132,133,154,124,  123,43,142,128,28,86,28,104,\n  122,134,145,124,106,123,46,119,  48,128,47,146,45,45,47,127,  41,140,89,43,38,100,46,40,  62,104,61,104,126,110,126,124,\n  91,125,26,136,96,129,23,115,  19,144,133,118,113,115,63,132,  59,137,94,51,29,117,36,127,  39,136,46,74,118,107,102,110,\n  89,128,72,40,74,135,21,135,  34,144,57,55,66,55,51,129,  53,127,93,50,32,126,63,29,  37,128,44,72,113,117,128,118,\n  77,69,127,126,130,77,123,31,  130,136,133,130,123,130,153,82,  138,132,127,134,127,137,125,128,  123,115,114,116,75,59,43,117,\n  113,116,62,47,39,142,82,137,  41,119,39,88,88,58,47,136,  28,38,72,11,27,108,35,44,  65,155,73,100,130,105,132,111,\n  93,34,108,139,100,55,67,50,  146,50,129,131,153,145,111,31,  105,138,137,151,137,51,116,127,  146,30,74,76,15,37,10,59,\n\n  98,133,33,28,17,143,30,136,  41,115,34,100,131,73,38,123,  12,134,69,24,4,134,39,29,  52,118,53,81,110,140,124,88,\n  82,128,133,117,145,106,126,85,  134,68,159,123,131,130,125,127,  111,117,130,146,125,44,111,141,  127,118,87,70,96,9,66,50,\n  92,145,86,40,68,123,37,120,  71,114,90,126,74,74,28,128,  73,120,89,54,119,118,68,72,  51,112,35,63,137,116,114,104,\n  98,123,104,91,72,135,54,139,  112,130,98,141,114,67,63,136,  86,42,87,61,112,117,101,58,  106,134,41,69,123,123,123,117,\n  85,137,150,37,54,142,42,126,  36,124,60,30,130,98,12,132,  135,24,89,53,49,98,125,57,  119,105,38,66,134,116,118,107,\n  98,141,79,89,141,133,98,129,  133,130,72,83,48,92,48,131,  38,31,95,107,139,113,59,69,  40,143,37,65,112,132,107,111,\n  112,118,69,50,46,149,49,152,  39,130,45,42,40,30,66,118,  54,26,75,14,107,112,49,54,  65,116,73,100,115,143,78,91,\n  91,69,145,144,140,88,104,98,  127,131,122,136,136,132,115,76,  134,134,127,139,121,152,149,142,  144,83,166,167,31,77,39,99,\n\n  82,130,53,59,64,129,54,110,  44,118,48,133,87,91,27,140,  84,148,91,51,122,101,61,86,  50,134,46,84,126,106,112,112,\n  84,135,121,143,124,127,87,121,  113,142,112,75,123,109,90,133,  90,98,88,84,123,123,125,129,  92,141,44,70,118,108,114,104,\n  134,108,127,101,121,121,98,125,  121,115,125,94,128,88,98,112,  124,82,126,112,130,134,126,138,  101,122,105,119,92,85,86,126,\n  77,117,116,48,78,138,27,142,  122,120,126,63,134,48,25,112,  112,39,86,120,154,143,120,143,  28,123,36,63,109,110,108,101,\n  71,131,58,45,30,128,122,146,  62,130,49,95,90,25,18,143,  48,127,97,99,74,119,33,43,  22,146,30,57,118,112,106,106,\n  95,104,131,129,128,72,131,81,  132,75,120,142,143,138,133,92,  155,132,138,149,139,63,128,144,  160,88,119,81,75,7,47,66,\n  102,128,48,47,57,119,70,107,  140,130,80,106,65,90,32,136,  116,123,82,61,117,132,66,43,  55,154,61,89,127,128,105,122,\n  110,129,58,13,38,138,30,112,  136,126,30,98,89,135,39,126,  55,147,70,32,117,122,68,87,  58,145,57,84,130,114,103,117,\n\n  118,115,58,40,45,141,61,156,  51,109,30,30,37,33,59,110,  34,25,81,42,99,147,71,54,  97,128,88,115,120,107,128,103,\n  102,62,107,133,115,63,64,42,  135,82,88,103,135,156,108,60,  147,137,139,149,144,30,125,110,  68,80,128,101,53,14,38,71,\n  127,100,145,84,145,70,134,37,  72,39,175,114,120,112,75,120,  76,99,111,119,117,48,91,106,  110,125,102,128,84,56,63,90,\n  129,77,130,151,138,88,126,88,  117,82,96,136,127,108,124,80,  155,101,115,124,94,99,175,159,  129,107,129,129,106,107,112,114,\n  98,9,84,76,73,44,76,33,  73,22,61,73,76,66,62,27,  84,63,137,71,74,28,80,84,  106,47,83,88,29,18,15,66,\n  102,23,80,68,70,48,77,40,  82,24,57,72,77,67,80,46,  70,66,135,70,62,10,75,87,  108,64,76,91,16,23,22,74,\n  105,19,61,52,70,26,63,47,  80,27,40,55,73,79,73,33,  71,69,127,73,72,12,72,69,  65,55,77,93,18,43,34,72,\n  104,44,77,65,69,48,79,52,  74,47,58,58,60,52,78,46,  61,55,123,55,55,61,74,74,  89,67,93,106,71,67,69,73,\n};\n\nstatic const uint8 ced_hires_12[1024] = {\n  79,129,118,114,118,130,135,136,  122,129,124,105,133,117,122,111,  134,119,65,123,122,86,117,114,  121,123,136,124,126,111,73,121,\n  134,116,126,128,129,122,119,131,  131,128,98,130,123,67,131,120,  126,125,137,42,120,129,124,126,  132,124,121,124,126,120,89,121,\n  112,133,109,133,111,132,130,71,  99,133,71,58,135,135,120,135,  124,96,123,110,95,72,54,65,  130,119,105,127,127,103,105,127,\n  118,122,128,106,129,130,78,100,  80,135,92,115,113,114,117,119,  117,117,148,147,127,77,100,118,  129,121,108,127,127,101,91,127,\n  135,132,136,125,118,124,139,134,  122,120,34,135,116,109,141,104,  122,131,129,5,132,82,135,130,  120,130,119,128,123,119,103,118,\n  126,133,130,135,119,105,128,126,  122,109,135,125,129,124,128,144,  130,124,127,128,125,138,129,123,  129,123,141,114,116,100,75,111,\n  126,110,99,100,152,132,105,74,  73,128,77,140,108,97,135,114,  115,76,102,86,74,55,93,128,  128,65,82,127,127,109,97,127,\n  83,137,114,142,118,131,144,118,  104,132,68,106,127,101,119,118,  124,123,62,94,123,122,117,132,  123,130,118,127,145,96,99,127,\n\n  115,129,121,73,117,134,107,125,  107,139,57,129,133,75,111,122,  115,108,124,112,115,65,89,120,  136,89,100,127,127,107,91,162,\n  116,124,116,129,125,122,126,120,  126,115,136,128,123,153,120,132,  126,124,119,124,121,125,124,127,  124,129,124,115,117,98,87,112,\n  110,93,120,88,101,100,92,100,  101,103,193,110,109,83,98,97,  81,85,93,129,84,120,83,96,  93,94,86,127,127,127,127,127,\n  130,129,102,125,118,128,139,116,  89,126,144,112,143,114,130,139,  137,125,99,129,122,105,77,70,  122,122,127,127,144,123,84,127,\n  140,124,123,126,138,124,114,136,  125,129,136,130,115,106,135,110,  119,120,124,115,130,112,127,128,  111,122,116,121,123,113,80,118,\n  109,106,107,107,110,111,111,99,  109,127,112,107,106,162,102,138,  105,111,114,99,121,103,86,90,  93,107,100,127,127,170,152,127,\n  129,122,126,129,130,127,131,138,  125,126,108,134,116,77,116,126,  127,138,131,43,123,110,137,129,  121,138,123,121,123,110,70,118,\n  108,114,111,100,106,124,104,100,  108,110,114,106,106,96,119,162,  90,141,96,108,93,105,112,107,  100,92,93,127,127,144,144,127,\n\n  119,102,134,125,132,132,111,116,  139,135,118,123,93,104,109,107,  109,137,126,109,126,113,120,127,  111,127,122,127,127,96,84,127,\n  108,121,133,121,111,125,73,107,  148,128,119,114,117,108,124,100,  119,106,116,170,155,38,84,144,  123,58,113,127,127,105,99,154,\n  57,128,109,135,124,126,134,42,  110,124,72,117,140,133,125,114,  124,133,85,97,99,143,140,113,  129,122,120,127,127,99,87,127,\n  93,88,77,107,97,101,91,104,  98,96,155,103,106,69,77,79,  81,137,97,206,81,184,134,112,  92,116,64,127,127,127,127,127,\n  118,85,115,94,120,133,99,119,  127,125,107,92,120,53,74,109,  133,143,137,92,89,114,118,130,  145,133,124,127,127,100,88,127,\n  93,97,96,121,91,124,100,109,  94,125,112,118,104,82,100,96,  123,97,112,138,108,200,107,142,  135,117,94,127,127,127,127,127,\n  130,129,119,115,125,130,53,116,  116,133,51,40,120,97,122,101,  108,62,141,108,137,124,103,105,  138,40,104,127,127,109,97,127,\n  111,131,74,122,129,132,85,105,  144,128,63,62,121,83,101,114,  133,139,115,123,125,105,139,99,  136,139,110,127,127,106,92,127,\n\n  132,119,131,119,128,131,116,120,  132,131,135,136,87,90,112,113,  116,132,115,124,125,154,127,132,  94,130,122,127,127,108,106,127,\n  127,129,109,98,125,122,112,115,  115,128,120,126,142,114,126,103,  132,96,127,105,124,69,102,122,  128,103,120,127,127,98,112,127,\n  121,120,145,97,119,126,115,132,  89,127,134,127,112,113,133,129,  130,102,128,127,135,64,118,140,  138,124,104,127,127,129,118,127,\n  127,127,127,127,127,122,127,127,  127,122,127,127,127,127,127,127,  127,127,127,127,127,127,127,127,  127,127,127,127,127,127,127,127,\n  127,127,127,127,127,118,127,127,  127,118,127,127,127,127,127,127,  145,127,127,127,127,127,127,127,  127,127,127,127,127,127,127,127,\n  121,124,104,109,109,81,110,97,  104,77,120,119,111,92,119,106,  100,107,107,127,117,127,112,104,  89,124,89,127,127,197,184,127,\n  115,99,101,103,110,78,92,110,  84,142,93,113,91,65,122,79,  105,120,109,104,120,113,97,90,  86,115,97,127,127,182,217,127,\n  127,127,127,127,127,122,127,127,  127,124,127,127,127,127,127,127,  127,127,127,127,127,127,127,127,  127,127,127,127,127,127,127,127,\n};\n\nstatic const uint8 ced_hires_13[1024] = {\n  79,36,84,88,70,26,101,101,  57,93,76,44,82,95,88,77,  79,102,93,112,76,86,62,31,  126,102,50,102,97,110,99,131,\n  52,43,113,117,112,51,119,123,  107,86,124,118,123,119,119,49,  114,113,112,125,118,105,132,18,  125,60,129,75,77,71,51,90,\n  99,65,124,123,98,65,96,121,  107,100,76,93,112,140,131,73,  92,127,90,86,132,109,81,54,  57,124,94,100,98,115,106,112,\n  81,31,42,63,61,107,26,43,  32,76,44,28,57,75,56,165,  61,40,75,79,77,82,47,21,  39,68,76,80,81,88,78,107,\n  53,55,83,115,118,88,124,129,  135,116,109,113,126,117,121,71,  103,69,120,116,124,140,113,25,  116,121,78,69,55,61,52,95,\n  75,63,96,27,126,105,92,121,  78,64,55,123,122,101,117,34,  107,33,121,105,112,47,100,18,  60,36,113,61,64,87,64,99,\n  70,75,100,78,116,77,119,135,  81,90,103,129,128,106,113,57,  91,57,132,124,117,87,117,49,  60,46,37,98,75,96,77,107,\n  104,148,95,50,41,136,45,51,  72,150,86,83,112,103,30,141,  59,39,43,55,90,129,56,44,  57,84,26,104,80,110,75,126,\n\n  72,54,96,117,102,69,79,123,  44,79,60,58,105,135,103,47,  69,152,129,129,112,72,124,24,  118,59,89,72,68,75,69,97,\n  49,104,110,125,122,126,125,119,  116,94,112,92,115,120,104,110,  129,129,113,124,117,103,117,22,  126,38,90,48,80,82,62,97,\n  76,70,64,110,64,64,46,62,  48,63,80,67,84,137,129,30,  93,115,59,121,142,110,109,61,  115,61,70,84,90,95,95,95,\n  100,63,73,65,82,99,97,66,  73,125,80,83,138,86,127,52,  78,109,102,98,105,78,103,62,  112,76,108,111,109,108,113,111,\n  111,114,86,93,91,76,81,78,  85,82,114,98,92,112,111,94,  98,94,75,90,95,93,90,72,  91,82,103,151,113,118,141,119,\n  49,138,104,130,121,72,113,92,  114,38,101,119,105,122,105,109,  107,112,87,116,119,68,115,8,  83,24,113,61,68,71,56,94,\n  114,52,76,101,85,55,85,54,  85,94,75,85,117,114,135,41,  81,88,76,85,140,64,70,51,  76,101,82,105,98,101,102,103,\n  114,111,126,117,134,117,113,90,  68,92,84,110,117,110,122,91,  91,164,90,122,124,100,108,120,  102,94,88,118,111,108,113,111,\n\n  101,137,103,32,71,95,111,96,  97,145,123,85,103,96,79,61,  52,54,86,108,68,157,102,41,  69,71,61,101,99,107,96,119,\n  73,150,20,28,25,114,26,26,  37,112,46,33,31,22,13,156,  23,49,1,30,13,101,28,20,  32,47,30,71,90,77,68,96,\n  105,79,95,84,96,64,96,113,  63,97,73,68,104,114,113,65,  121,104,111,119,80,88,85,63,  121,61,65,125,108,129,103,127,\n  42,53,109,91,120,40,90,107,  68,92,130,92,111,108,134,29,  112,80,111,94,96,54,105,150,  132,48,101,55,61,61,49,94,\n  106,68,93,88,93,69,69,61,  73,98,117,78,128,133,126,94,  114,78,82,97,141,98,102,65,  75,66,104,102,89,122,99,112,\n  107,83,114,50,97,149,84,90,  128,149,119,100,113,91,105,79,  132,52,98,96,108,142,94,37,  91,66,96,111,86,94,85,107,\n  46,66,107,104,113,66,126,117,  117,92,123,126,115,109,116,65,  119,42,129,113,104,53,118,79,  78,127,128,50,61,72,51,99,\n  121,71,63,62,64,61,69,65,  74,70,74,66,65,54,63,58,  71,84,44,54,50,87,74,66,  113,81,60,152,130,138,134,138,\n\n  84,83,129,39,123,95,106,128,  82,84,142,138,113,108,107,57,  118,38,127,106,107,90,120,60,  59,142,45,75,98,85,68,107,\n  105,90,94,88,71,76,71,67,  72,101,88,64,81,91,95,66,  85,76,67,85,79,82,82,58,  109,96,81,127,113,121,114,123,\n  73,100,141,107,128,71,80,84,  100,85,121,103,123,126,115,69,  119,72,94,128,109,59,112,26,  83,59,116,115,83,89,73,94,\n  104,73,90,91,87,88,89,78,  90,76,102,101,111,102,89,43,  82,81,118,96,146,75,100,50,  87,96,96,113,113,106,109,114,\n  66,58,131,124,106,86,118,114,  132,74,68,119,117,117,117,35,  102,36,125,106,106,24,98,35,  71,128,128,81,81,80,47,96,\n  73,41,118,138,109,28,78,48,  115,45,110,113,95,133,88,35,  121,38,106,109,103,103,117,18,  44,86,119,71,77,86,76,105,\n  94,137,71,54,52,142,72,61,  72,154,145,98,92,97,38,93,  58,58,95,69,85,132,127,42,  91,123,55,108,102,106,97,140,\n  113,65,76,58,62,92,85,62,  80,69,57,64,67,66,51,59,  80,72,50,69,62,68,58,73,  71,60,58,101,115,108,109,118,\n};\n\nstatic const uint8 ced_hires_14[1024] = {\n  127,73,147,96,119,88,105,109,  120,113,103,118,88,140,101,79,  110,127,68,112,151,94,90,83,  125,83,125,127,127,127,127,127,\n  88,49,130,116,118,52,139,140,  125,89,134,128,134,134,134,59,  124,140,131,139,131,105,148,19,  145,52,137,100,89,91,77,99,\n  131,71,141,122,104,66,116,138,  125,103,87,103,122,155,146,83,  102,154,109,100,144,109,97,55,  77,116,102,118,110,122,130,121,\n  134,25,93,100,106,94,68,101,  54,113,93,18,111,141,103,68,  142,68,136,117,127,146,99,18,  62,18,121,110,88,106,105,109,\n  87,60,100,113,123,88,143,145,  153,119,119,122,136,131,136,80,  113,95,138,130,136,140,128,26,  136,113,85,93,67,79,77,103,\n  127,99,154,57,97,71,91,93,  125,69,89,116,117,76,110,81,  149,113,85,77,84,90,75,68,  110,72,120,127,127,120,127,123,\n  107,127,106,67,34,132,96,32,  46,138,56,96,38,110,100,88,  74,63,26,39,49,130,29,120,  45,34,49,93,90,113,96,118,\n  140,153,112,49,46,136,65,67,  90,152,96,92,122,118,45,150,  69,64,61,68,102,129,71,44,  77,75,33,128,92,127,99,134,\n\n  74,133,89,64,55,143,71,52,  72,150,122,145,125,84,137,124,  106,53,105,97,125,131,90,27,  24,49,71,72,81,88,67,109,\n  83,109,127,124,128,126,144,135,  134,97,122,101,125,134,119,119,  139,155,131,138,129,102,132,22,  146,29,97,71,91,102,87,105,\n  88,4,133,137,142,3,28,140,  12,31,52,141,80,31,31,20,  149,46,21,114,133,20,2,90,  69,0,136,73,62,95,79,102,\n  126,68,90,64,87,99,117,82,  91,127,90,92,147,101,142,60,  88,136,120,111,116,77,118,62,  130,67,116,128,121,114,137,119,\n  79,15,89,109,132,0,34,27,  136,25,159,134,135,122,132,40,  105,35,121,133,141,23,146,2,  28,0,125,76,68,108,72,91,\n  84,143,121,128,126,72,133,108,  132,41,111,128,115,136,120,118,  117,138,105,130,131,68,130,9,  103,16,120,86,80,91,80,101,\n  144,57,93,100,91,55,105,70,  103,96,85,94,127,129,150,50,  91,114,94,98,152,63,85,51,  96,92,89,120,109,108,123,111,\n  121,154,45,60,63,64,68,39,  59,85,56,120,31,120,40,125,  43,86,21,83,136,120,56,36,  80,36,43,124,106,113,123,115,\n\n  121,150,74,14,27,151,56,36,  50,150,69,55,34,102,58,106,  39,82,28,56,34,160,40,31,  75,45,39,131,101,109,119,112,\n  104,54,77,132,55,34,31,18,  17,42,46,106,0,82,44,80,  36,49,0,155,40,40,6,33,  43,19,25,91,101,99,89,114,\n  112,141,38,57,37,72,43,25,  101,67,64,150,25,96,40,152,  26,69,15,132,116,149,27,18,  62,32,26,112,97,105,106,108,\n  78,60,127,91,126,42,111,125,  87,96,141,103,122,124,150,40,  122,106,129,108,108,54,120,151,  152,40,108,78,73,81,74,102,\n  140,74,110,87,99,70,89,78,  91,102,128,88,139,149,142,104,  123,104,100,110,153,97,117,66,  94,57,111,124,100,129,123,119,\n  112,104,136,78,126,105,142,117,  127,127,143,142,137,115,105,119,  116,69,120,135,123,76,130,29,  62,18,144,114,88,105,106,108,\n  82,72,125,103,119,67,146,134,  136,96,134,136,126,124,132,75,  129,68,147,127,116,53,133,80,  97,119,135,74,72,91,76,106,\n  131,76,81,61,69,61,88,82,  92,73,84,76,75,69,78,66,  81,110,61,67,61,85,87,66,  132,71,67,154,139,145,139,146,\n\n  84,133,98,52,42,158,37,23,  89,160,53,107,63,86,87,104,  70,38,30,103,87,98,78,0,  32,26,51,80,58,80,75,91,\n  95,14,130,98,109,14,63,29,  116,13,156,109,122,149,89,39,  70,49,106,128,105,19,149,25,  43,4,137,91,82,95,86,110,\n  109,107,159,107,134,73,101,102,  119,89,132,114,134,142,131,80,  129,98,112,142,121,59,127,27,  103,51,123,138,94,108,99,102,\n  123,108,129,80,86,116,133,102,  135,85,156,146,124,112,121,59,  80,90,122,135,124,64,156,40,  93,40,143,127,110,116,125,119,\n  102,64,148,123,112,87,139,131,  152,77,79,129,128,132,133,45,  111,62,143,119,118,22,113,35,  90,119,135,104,92,99,72,104,\n  109,48,136,138,115,29,99,66,  134,49,121,124,106,149,104,46,  131,63,124,123,115,103,132,19,  63,78,126,96,88,105,101,112,\n  117,136,38,70,20,133,49,30,  43,174,47,36,24,27,9,70,  34,75,10,15,28,140,32,25,  69,25,32,117,95,106,112,109,\n  136,54,77,34,51,77,76,61,  86,49,60,57,54,66,64,51,  69,93,44,77,50,54,57,55,  81,42,72,112,121,115,118,126,\n};\n\nstatic const uint8 ced_hires_15[1024] = {\n  128,67,142,105,122,81,101,108,  115,105,99,113,90,139,98,75,  108,127,69,108,148,90,86,94,  122,79,127,128,128,128,128,128,\n  69,43,125,125,121,45,135,139,  120,81,130,123,135,133,130,54,  122,137,129,135,128,100,144,30,  140,48,139,91,84,84,66,98,\n  115,65,136,131,106,59,112,137,  120,95,82,98,123,154,142,78,  100,151,107,96,141,104,93,66,  72,112,103,112,105,119,121,120,\n  117,20,88,109,109,87,64,100,  48,105,89,13,112,140,99,63,  140,65,134,113,124,141,95,29,  57,14,123,101,83,100,94,108,\n  68,54,95,122,126,81,139,144,  148,111,115,117,137,130,132,75,  111,92,136,126,133,135,124,37,  131,109,87,85,62,73,66,102,\n  128,93,149,66,99,65,86,92,  121,64,84,111,119,76,106,76,  146,112,85,74,81,85,71,79,  108,70,121,126,126,117,128,122,\n  88,121,101,75,36,126,91,31,  42,131,51,91,40,109,96,83,  71,59,25,36,46,125,25,131,  41,30,50,84,85,105,85,117,\n  121,147,107,57,49,130,60,66,  85,145,91,87,124,117,41,145,  66,61,60,65,99,124,67,55,  72,71,35,119,87,122,89,133,\n\n  57,127,84,73,58,136,67,51,  67,142,118,140,126,83,133,119,  104,49,103,93,122,126,86,38,  19,45,73,63,77,81,56,108,\n  65,103,122,132,130,120,140,134,  129,89,118,96,126,133,115,114,  137,152,130,134,126,97,128,34,  141,25,99,63,86,95,76,104,\n  69,0,128,145,144,0,23,138,  6,23,47,135,81,30,27,14,  146,42,19,110,129,14,0,100,  64,0,137,63,57,87,67,101,\n  115,62,85,72,89,93,112,81,  86,120,86,87,149,100,138,56,  85,132,119,108,113,72,114,73,  126,63,117,122,116,111,127,118,\n  60,9,84,117,134,0,29,27,  131,18,154,129,137,121,128,35,  102,31,120,130,138,19,142,14,  24,0,126,67,63,101,61,91,\n  65,137,116,137,129,65,129,107,  127,33,107,123,116,135,116,113,  115,135,103,126,128,63,126,20,  98,12,122,77,75,84,70,100,\n  130,51,88,108,93,49,100,69,  98,89,80,89,129,128,146,44,  88,110,92,95,149,58,81,63,  91,88,91,114,104,105,116,110,\n  111,148,40,69,66,57,65,38,  55,77,52,115,34,119,36,120,  41,83,19,79,133,115,53,47,  75,32,45,118,101,111,112,114,\n\n  109,144,70,22,29,145,51,35,  45,143,64,50,37,101,54,101,  36,78,28,54,31,155,37,42,  71,41,40,124,96,106,108,111,\n  84,47,72,141,57,27,25,15,  12,34,40,100,1,81,40,74,  33,45,0,151,36,34,1,42,  38,14,26,81,95,91,77,113,\n  96,135,34,65,40,66,38,23,  96,60,59,145,27,95,36,147,  23,65,15,129,113,144,24,29,  58,28,27,104,92,101,95,107,\n  59,54,122,100,129,35,107,124,  82,88,137,98,123,123,146,35,  120,103,127,104,105,49,116,162,  147,36,110,70,68,74,63,101,\n  123,67,105,95,101,63,84,76,  86,94,123,82,140,147,138,98,  120,100,98,106,149,91,112,76,  89,52,112,117,95,126,112,118,\n  96,98,131,86,128,99,137,116,  122,120,138,137,139,114,101,114,  113,65,119,132,120,71,126,41,  58,14,145,105,83,101,95,107,\n  63,66,120,112,122,60,142,133,  131,88,130,131,127,123,128,70,  127,65,145,123,113,48,129,91,  92,115,137,65,68,84,65,105,\n  132,70,76,69,72,54,84,81,  87,66,80,71,77,68,74,62,  78,106,61,63,58,81,84,77,  127,67,68,155,136,142,140,145,\n\n  65,127,93,61,45,151,33,22,  84,152,49,102,64,85,83,99,  68,35,28,99,84,93,74,2,  27,22,53,71,53,74,64,90,\n  76,8,125,107,112,8,59,28,  111,6,152,104,123,148,85,34,  68,46,104,124,102,13,145,36,  38,2,139,82,77,88,75,110,\n  90,101,154,116,137,66,97,101,  114,81,128,109,135,141,127,75,  127,95,110,138,118,54,123,38,  98,47,125,130,89,101,88,102,\n  117,102,124,88,89,109,129,101,  130,77,152,141,125,111,117,55,  79,87,120,131,121,58,152,51,  90,36,145,122,105,113,116,118,\n  83,58,143,132,115,81,134,130,  147,70,74,124,129,131,129,40,  109,59,141,116,115,18,109,46,  85,115,137,95,87,92,61,103,\n  90,42,131,147,118,23,95,65,  129,41,117,119,107,148,100,41,  129,60,122,119,112,98,128,30,  59,74,128,87,83,99,90,112,\n  102,130,34,79,23,126,45,29,  38,166,43,32,26,27,5,65,  30,72,8,11,24,135,28,36,  64,21,34,108,90,103,101,108,\n  121,48,73,42,53,70,71,61,  81,41,56,52,55,65,60,46,  67,89,42,73,48,49,53,67,  76,38,74,106,116,112,115,125,\n};\n\nstatic const uint8 ced_hires_16[1024] = {\n  126,77,94,99,85,77,105,111,  93,98,106,78,81,99,92,92,  100,116,99,119,82,86,89,94,  132,90,87,127,125,126,126,131,\n  97,47,126,130,125,63,130,137,  117,95,136,122,124,126,123,57,  128,120,120,134,123,99,146,65,  132,56,132,97,96,97,97,110,\n  143,93,132,131,106,93,114,132,  110,112,123,95,107,141,130,103,  112,132,92,86,131,103,106,111,  132,107,103,143,142,143,143,130,\n  128,105,112,105,109,106,116,109,  113,112,120,113,104,107,99,110,  114,124,100,102,105,111,112,115,  125,111,116,128,128,128,128,128,\n  97,58,96,127,131,95,134,142,  146,126,121,116,127,123,126,86,  117,87,128,126,128,135,126,65,  123,114,81,98,96,97,97,110,\n  157,107,120,109,115,107,128,115,  124,121,137,109,95,107,86,117,  126,146,89,100,96,117,120,125,  146,116,117,157,156,157,157,139,\n  157,107,120,109,115,107,128,115,  124,121,137,109,95,107,86,117,  126,146,89,100,96,117,120,125,  146,116,117,157,156,157,157,139,\n  120,155,109,72,78,142,91,78,  87,159,100,85,112,108,49,156,  89,109,52,63,93,123,83,88,  109,79,80,120,119,120,120,118,\n\n  119,70,107,128,115,75,90,135,  86,88,99,71,105,140,107,80,  93,159,136,138,115,79,136,87,  118,78,88,120,118,119,119,118,\n  92,112,123,137,135,133,135,132,  127,104,124,95,116,126,108,126,  143,137,121,134,121,97,130,60,  133,51,92,93,91,92,92,106,\n  130,80,93,121,88,80,101,88,  97,94,110,82,83,142,131,90,  104,119,62,128,144,100,121,98,  119,89,90,130,129,130,130,123,\n  148,98,111,100,106,98,119,106,  115,127,128,100,131,98,124,108,  117,137,102,96,97,108,111,116,  137,107,108,148,147,148,148,135,\n  149,100,112,101,108,100,120,107,  116,113,129,101,88,99,99,110,  118,139,82,93,88,109,112,117,  138,108,110,150,148,149,149,139,\n  98,145,117,142,133,78,123,105,  125,62,112,122,105,128,109,124,  120,119,94,125,123,58,128,66,  97,57,115,98,97,98,98,112,\n  145,96,108,110,104,96,116,103,  112,109,125,97,110,112,132,106,  114,135,78,89,137,105,108,113,  134,104,106,146,144,145,145,132,\n  153,111,124,118,134,108,124,111,  120,117,133,105,101,103,113,113,  122,159,85,115,115,113,116,121,  142,112,113,153,152,153,153,136,\n\n  128,112,119,112,116,113,123,116,  120,119,127,120,111,114,106,117,  120,128,106,108,111,117,118,121,  128,117,122,128,128,128,128,128,\n  120,158,83,72,78,121,91,78,  87,121,100,72,58,70,49,172,  88,108,51,62,58,95,82,87,  108,78,79,119,118,119,119,122,\n  146,96,109,98,104,96,117,120,  113,110,126,98,94,116,108,106,  130,134,109,118,84,105,108,113,  134,104,105,145,144,145,145,137,\n  98,58,122,104,132,48,101,121,  75,101,142,96,111,115,138,58,  126,86,118,103,100,57,118,161,  139,56,102,97,96,97,97,111,\n  139,89,102,96,102,89,110,97,  106,103,124,91,124,135,126,104,  122,127,80,99,141,98,106,106,  127,97,98,138,137,138,138,129,\n  155,105,128,107,113,105,126,113,  122,119,135,107,93,105,84,115,  133,143,86,97,93,114,117,122,  143,113,114,154,153,154,154,139,\n  99,72,121,117,126,72,137,131,  129,103,136,130,116,116,121,79,  134,87,137,123,109,58,132,89,  87,121,131,98,97,98,98,111,\n  154,104,117,106,112,104,125,112,  121,118,134,106,92,104,83,114,  122,142,85,96,92,113,116,121,  142,112,113,153,152,153,153,139,\n\n  156,106,119,108,114,106,127,114,  123,120,136,108,94,106,85,116,  124,144,87,98,94,115,118,123,  144,114,115,155,154,155,155,140,\n  150,101,113,102,109,101,121,108,  117,114,130,102,89,100,80,111,  118,139,82,93,88,109,112,117,  138,108,110,150,148,149,149,140,\n  118,107,154,120,140,68,89,96,  111,92,132,106,123,133,119,78,  133,106,101,137,113,77,125,85,  106,76,118,122,116,117,117,121,\n  149,99,112,101,107,99,120,107,  116,113,129,101,102,99,83,109,  117,137,115,96,139,108,111,116,  137,107,108,148,147,148,148,135,\n  102,62,144,137,119,94,129,128,  144,82,82,123,118,124,122,62,  116,90,133,116,111,61,112,69,  90,121,131,101,100,101,101,110,\n  156,106,119,108,114,106,127,114,  123,120,136,108,94,106,85,116,  124,144,87,98,94,115,118,123,  144,114,115,155,154,155,155,140,\n  156,106,119,108,114,106,127,114,  123,120,136,108,94,106,85,116,  124,144,87,98,94,115,118,123,  144,114,115,155,154,155,155,140,\n  137,88,100,89,96,96,108,95,  104,101,117,89,76,87,67,98,  105,126,69,80,75,96,99,104,  125,95,97,137,135,136,136,123,\n};\n\nstatic const uint8 ced_hires_17[1024] = {\n  89,91,92,133,130,37,125,74,  42,95,144,140,137,137,121,42,  123,75,132,124,133,87,128,83,  74,53,119,94,87,91,93,108,\n  102,61,121,126,115,65,141,137,  130,96,110,126,137,135,142,73,  128,143,129,129,127,116,147,95,  154,82,141,107,100,103,106,114,\n  152,89,132,131,102,84,114,134,  128,107,81,104,125,155,153,95,  103,154,108,87,139,120,95,146,  137,146,100,157,150,154,156,136,\n  130,66,62,72,62,122,86,62,  83,84,58,60,65,91,78,190,  73,115,92,83,85,91,68,123,  115,94,83,135,128,131,134,127,\n  103,75,93,124,121,103,146,143,  159,127,96,121,140,133,145,96,  118,98,137,121,133,153,128,96,  146,146,90,108,101,104,107,114,\n  111,83,105,33,129,120,114,135,  102,75,39,131,136,117,141,54,  122,96,138,110,121,62,115,104,  96,75,125,116,109,112,115,120,\n  131,94,108,84,119,91,141,148,  104,99,90,137,142,121,136,74,  104,117,149,128,125,99,131,125,  116,95,74,136,129,133,135,128,\n  109,71,69,85,106,85,106,131,  62,57,93,110,101,126,73,52,  116,94,127,130,102,60,143,102,  94,73,52,114,107,118,113,119,\n\n  100,147,79,74,50,157,72,48,  76,157,98,143,128,85,145,139,  110,85,103,87,121,143,89,93,  85,84,74,105,98,101,104,112,\n  97,124,119,134,125,141,147,132,  139,104,99,100,129,135,127,134,  143,159,130,128,125,115,131,91,  155,61,101,102,95,99,101,109,\n  101,37,124,147,139,33,57,137,  54,39,29,139,83,34,39,44,  153,86,16,104,129,52,39,151,  86,65,140,106,99,102,105,116,\n  159,95,91,81,81,113,115,91,  112,133,87,89,150,97,149,102,  102,144,118,100,111,110,113,152,  144,123,117,164,157,160,163,142,\n  86,23,75,47,132,18,43,105,  39,54,141,105,128,124,110,29,  89,72,105,147,131,38,115,80,  71,50,78,91,84,88,90,107,\n  103,158,113,138,124,86,135,105,  137,41,88,127,119,137,128,133,  120,142,104,120,127,81,129,97,  111,67,124,108,101,105,107,116,\n  156,93,94,108,84,88,113,88,  109,99,85,92,130,128,156,99,  99,142,88,85,147,108,94,150,  141,120,99,161,154,158,160,138,\n  98,50,162,115,131,30,54,149,  51,46,135,121,106,128,119,41,  135,83,109,116,138,49,147,91,  83,62,136,103,96,99,102,111,\n\n  160,171,92,82,82,172,116,92,  113,164,88,90,85,109,82,129,  97,139,69,66,71,175,92,147,  139,118,97,159,152,155,158,137,\n  129,176,77,84,94,159,85,102,  82,160,57,105,70,85,71,176,  89,108,48,73,73,173,81,116,  108,87,76,128,121,124,127,122,\n  180,139,119,109,109,119,143,119,  140,135,125,117,112,120,109,130,  124,166,112,93,98,160,119,174,  166,145,124,180,179,177,180,152,\n  156,139,88,78,116,166,138,88,  109,177,94,86,81,89,111,115,  93,135,95,88,77,162,98,171,  135,114,93,155,148,151,154,133,\n  156,92,106,103,101,88,112,88,  114,119,110,91,149,156,157,125,  129,135,101,102,152,114,117,143,  135,114,116,155,148,151,154,133,\n  152,109,131,74,109,171,109,112,  159,167,115,117,135,115,136,115,  148,132,118,103,119,157,112,140,  131,110,109,151,144,148,150,134,\n  112,94,124,121,124,90,156,139,  149,111,118,142,137,133,148,98,  137,91,149,121,116,67,136,145,  107,155,143,111,104,107,110,113,\n  180,119,115,104,105,114,139,114,  135,120,111,113,108,115,104,125,  119,162,92,88,93,128,114,170,  161,140,119,178,174,174,178,149,\n\n  128,111,146,50,134,118,137,150,  112,103,137,155,135,132,138,87,  135,108,147,113,118,105,137,126,  107,169,65,127,120,124,126,122,\n  109,46,52,31,32,41,66,41,  62,47,127,60,65,52,41,52,  46,89,19,130,30,55,41,97,  88,67,66,108,101,105,107,132,\n  131,129,158,124,139,93,111,106,  131,102,116,120,145,150,146,102,  136,111,114,135,120,77,129,119,  110,89,130,146,123,127,129,123,\n  171,107,103,101,93,108,127,103,  124,109,99,114,130,122,116,114,  108,150,135,102,155,116,111,158,  150,129,108,170,163,166,169,141,\n  115,87,147,141,117,109,149,136,  164,92,64,135,139,141,148,71,  119,94,145,113,118,60,116,102,  99,155,143,114,107,110,113,112,\n  180,125,121,120,111,120,145,120,  141,126,117,119,130,121,126,131,  125,168,98,94,99,134,120,176,  167,146,125,180,179,177,180,152,\n  108,45,99,103,139,40,96,117,  61,87,85,145,139,127,138,51,  127,88,152,133,136,64,131,96,  87,66,135,107,100,104,106,112,\n  157,94,95,80,80,109,114,90,  119,96,86,88,83,91,80,101,  95,137,67,64,69,103,90,145,  137,116,95,154,150,150,154,125,\n};\n\nstatic const uint8 ced_hires_18[1024] = {\n  100,47,105,106,88,37,119,122,  76,90,99,47,87,103,100,98,  95,121,106,126,89,84,80,50,  146,101,49,119,100,126,121,130,\n  74,55,134,135,131,65,138,145,  126,83,147,122,129,128,131,71,  130,133,126,138,131,103,151,36,  145,59,129,97,84,83,73,90,\n  123,78,145,142,117,80,115,143,  127,97,99,98,117,149,143,95,  108,146,104,100,145,107,101,72,  83,123,94,119,107,123,126,111,\n  102,42,63,81,78,121,44,64,  50,73,66,32,62,84,68,187,  77,62,89,92,89,80,66,40,  63,66,76,102,89,103,100,106,\n  72,67,105,133,136,102,142,150,  155,114,132,117,131,125,133,93,  119,88,133,130,137,139,132,46,  137,120,78,89,64,76,73,94,\n  94,75,117,44,144,118,110,142,  98,61,78,127,127,109,129,55,  123,48,134,119,125,45,118,38,  80,35,112,83,72,101,83,96,\n  95,87,122,95,134,91,137,156,  101,88,126,133,133,114,125,79,  107,76,145,138,130,85,136,69,  79,46,38,117,85,112,100,104,\n  124,160,116,69,60,150,64,73,  92,147,109,87,118,112,42,163,  75,62,57,68,103,128,75,63,  80,83,28,120,89,124,96,125,\n\n  94,66,118,135,120,83,97,144,  63,76,82,62,110,143,115,69,  85,171,142,143,125,71,143,43,  138,58,89,97,78,95,93,94,\n  67,116,131,143,140,140,143,140,  136,91,135,96,120,128,115,131,  145,148,127,138,130,101,135,42,  146,37,89,70,86,94,79,96,\n  101,82,86,128,82,78,65,84,  68,60,103,72,89,145,141,49,  109,135,73,134,155,108,128,81,  135,61,70,108,97,107,117,96,\n  123,75,94,83,100,113,116,87,  92,122,102,87,143,94,139,71,  93,129,116,111,117,75,121,80,  131,72,108,126,118,118,133,111,\n  125,126,107,111,110,90,98,100,  104,78,136,102,98,121,122,116,  113,113,88,103,108,91,109,90,  113,82,103,166,118,129,154,121,\n  71,150,125,148,139,85,131,113,  134,35,124,123,110,130,117,130,  123,131,100,130,132,66,133,26,  103,24,112,82,78,81,75,92,\n  134,66,98,119,103,70,104,77,  104,91,98,89,123,122,146,64,  97,108,89,98,153,65,88,72,  98,100,82,121,109,113,126,105,\n  134,123,148,135,153,131,131,112,  86,89,109,114,122,118,134,113,  106,183,104,135,137,97,127,140,  120,93,88,129,122,120,132,113,\n\n  95,138,100,94,128,146,84,59,  64,158,26,72,140,108,64,96,  48,37,129,66,66,162,79,20,  36,60,93,75,70,90,70,98,\n  95,163,41,47,45,129,41,47,  56,110,67,38,37,31,25,179,  45,69,19,50,32,105,52,43,  62,51,33,101,100,101,98,98,\n  122,92,117,103,114,78,115,136,  82,95,96,73,110,123,125,87,  143,128,130,139,99,92,109,87,  147,65,68,148,119,143,129,127,\n  68,66,131,110,138,55,109,130,  88,90,153,97,117,117,146,52,  134,105,130,114,115,58,129,176,  158,53,106,82,71,82,78,96,\n  129,80,114,106,112,83,88,82,  92,96,140,82,134,142,139,116,  135,103,101,116,160,101,127,91,  102,70,110,124,105,134,125,113,\n  123,95,135,69,116,163,102,112,  149,147,143,105,119,100,118,101,  153,80,118,115,127,146,119,62,  116,70,102,133,102,113,117,109,\n  70,78,129,122,132,80,145,139,  137,90,147,130,121,118,129,87,  141,67,148,133,123,58,143,105,  104,132,134,80,74,95,79,100,\n  136,82,86,79,83,76,90,87,  92,67,102,69,70,65,74,80,  92,115,66,71,68,91,96,94,  140,85,71,156,136,150,142,140,\n\n  104,96,151,58,141,110,125,150,  102,82,165,143,118,117,119,80,  140,61,146,125,125,94,144,85,  85,147,50,100,110,107,95,109,\n  122,103,115,106,89,90,88,87,  92,99,110,70,86,100,108,86,  107,107,86,104,98,85,106,87,  134,101,84,138,122,134,133,128,\n  93,113,163,126,146,86,99,107,  120,83,144,108,129,135,127,92,  141,96,113,148,128,63,136,50,  109,64,121,140,95,106,100,97,\n  128,86,112,109,106,102,108,101,  111,75,126,105,117,111,101,66,  104,108,137,116,165,81,125,82,  114,102,102,129,126,121,134,116,\n  89,71,152,143,125,101,137,136,  153,72,92,124,123,126,129,57,  123,62,145,126,125,29,123,61,  97,133,134,107,94,103,79,98,\n  99,71,108,117,119,66,122,99,  108,25,83,132,126,131,130,88,  120,83,124,123,119,71,105,40,  88,140,139,89,119,109,90,120,\n  109,146,119,71,82,143,99,110,  107,147,49,135,131,127,53,105,  80,80,69,92,140,135,125,42,  60,114,37,69,92,91,80,109,\n  129,78,95,77,81,106,104,83,  99,66,82,66,73,73,63,80,  101,97,69,88,80,74,80,98,  98,65,64,114,130,119,121,120,\n};\n\nstatic const uint8 ced_hires_19[1024] = {\n  98,93,104,135,134,69,120,71,  84,99,150,144,141,141,121,77,  123,96,135,127,139,85,130,83,  94,88,120,97,97,97,97,113,\n  110,85,134,128,119,81,138,142,  127,104,115,130,141,138,142,90,  128,119,133,131,132,117,148,95,  129,101,142,109,109,109,109,119,\n  145,120,126,112,107,116,133,123,  131,123,115,115,110,142,136,124,  123,143,99,95,128,132,120,130,  141,135,125,144,144,144,144,134,\n  134,109,115,93,96,120,122,107,  120,112,104,104,99,106,91,186,  112,132,88,84,92,121,109,119,  130,124,114,133,133,133,133,130,\n  111,86,102,124,125,107,142,148,  156,131,104,126,144,136,144,90,  119,109,140,123,138,153,129,96,  122,136,91,110,110,110,110,118,\n  118,93,119,78,133,123,107,139,  104,97,88,134,139,118,140,98,  122,117,141,111,125,105,113,103,  114,109,123,117,117,117,117,124,\n  135,110,116,95,117,106,124,148,  121,114,105,136,141,117,132,115,  114,134,148,125,126,122,125,120,  131,126,115,134,134,134,134,130,\n  117,92,98,86,109,98,105,136,  103,95,97,112,105,129,74,96,  110,115,130,131,106,104,144,102,  113,107,97,116,116,116,116,123,\n\n  108,150,89,67,70,160,96,81,  94,161,103,147,132,80,144,139,  109,106,105,88,126,143,83,93,  104,98,88,107,107,107,107,117,\n  106,127,132,135,129,144,143,138,  136,107,104,103,133,139,126,134,  143,136,133,131,131,114,133,91,  130,96,102,105,105,105,105,114,\n  109,84,137,148,143,80,97,142,  95,87,79,143,84,81,66,88,  152,107,63,106,134,96,84,104,  105,99,141,108,108,108,108,120,\n  146,121,127,106,108,117,135,119,  132,125,116,116,133,118,126,126,  125,145,101,96,104,133,121,131,  142,137,126,145,145,145,145,136,\n  95,70,86,54,136,66,83,111,  81,73,147,109,132,128,110,74,  88,93,108,151,137,82,117,80,  91,85,75,94,94,94,94,111,\n  112,161,124,140,127,83,131,110,  135,90,92,132,123,141,128,133,  120,110,106,123,133,99,130,97,  108,102,125,111,111,111,111,121,\n  145,120,126,105,107,116,134,118,  131,124,115,115,115,117,137,125,  124,144,100,95,132,132,120,130,  141,136,125,144,144,144,144,135,\n  148,123,129,107,115,119,136,121,  134,126,118,118,113,120,115,127,  126,146,102,103,111,135,123,133,  144,138,128,147,147,147,147,136,\n\n  147,153,128,106,109,118,135,120,  133,153,117,117,112,119,104,126,  126,146,102,108,106,165,123,133,  144,138,128,147,147,147,147,136,\n  132,174,113,92,94,156,121,105,  118,160,102,102,97,104,90,172,  112,132,88,83,91,175,108,118,  129,124,113,132,132,132,132,127,\n  152,127,133,112,114,123,141,125,  138,131,122,122,117,124,110,132,  132,152,108,103,111,140,128,138,  149,144,133,152,152,152,152,138,\n  117,92,136,107,132,88,105,132,  103,110,127,110,134,133,162,96,  133,116,138,108,116,105,127,176,  144,108,118,117,117,117,117,120,\n  148,123,129,107,110,119,136,121,  134,126,118,118,135,141,139,127,  127,147,103,99,147,136,124,134,  145,139,129,148,148,148,148,134,\n  148,123,129,107,110,162,136,121,  144,159,118,118,123,120,120,127,  142,147,113,99,117,151,124,134,  145,139,129,148,148,148,148,135,\n  117,92,133,120,125,98,149,141,  144,116,122,143,138,132,145,97,  142,117,157,127,125,105,141,103,  114,150,148,117,117,117,117,120,\n  153,128,134,112,115,124,141,126,  139,131,123,123,118,125,110,132,  132,152,108,104,112,141,129,139,  150,144,134,153,153,153,153,138,\n\n  132,107,153,92,134,113,121,151,  118,111,137,154,135,129,133,112,  140,132,153,117,125,120,141,118,  129,163,113,132,132,132,132,127,\n  113,88,94,73,75,84,102,86,  99,92,127,83,78,85,71,93,  93,113,69,135,72,101,89,99,  110,105,94,113,113,113,113,129,\n  135,125,166,120,137,106,124,108,  121,114,115,115,143,149,142,115,  138,135,119,140,128,123,131,121,  132,127,131,135,135,135,135,129,\n  151,126,132,111,113,122,140,124,  137,130,121,121,116,123,109,131,  131,151,114,102,138,139,127,137,  148,143,132,151,151,151,151,137,\n  120,95,157,140,118,108,142,138,  158,99,90,136,140,141,145,100,  121,120,153,120,127,108,119,106,  117,149,148,120,120,120,120,119,\n  136,111,140,151,118,107,124,109,  137,114,106,126,111,155,113,115,  138,135,129,118,120,124,137,122,  133,127,132,136,136,136,136,131,\n  151,146,132,110,113,145,139,124,  137,154,121,121,116,123,108,130,  130,150,106,102,110,139,127,137,  148,142,132,151,151,151,151,137,\n  146,121,127,105,108,117,134,119,  132,124,116,116,111,118,103,125,  125,145,101,97,105,134,122,132,  143,137,127,146,146,146,146,131,\n};\n\nstatic const uint8 ced_hires_20[1024] = {\n  111,51,50,66,67,37,61,60,  62,52,151,76,117,107,89,44,  64,85,123,112,43,48,109,55,  80,47,73,105,103,120,107,126,\n  99,78,66,40,113,81,103,136,  51,33,85,110,79,133,68,53,  121,80,125,133,107,49,144,49,  79,46,58,104,94,114,94,119,\n  82,89,103,144,141,45,125,85,  60,80,142,139,139,140,118,46,  133,65,134,127,134,77,126,29,  65,28,130,79,73,84,74,99,\n  148,112,111,112,105,115,135,114,  133,109,103,112,104,109,99,132,  123,145,97,101,94,117,110,138,  144,123,128,148,147,147,148,137,\n  97,70,96,138,128,103,151,149,  163,109,95,119,143,133,146,96,  122,107,138,122,134,143,125,67,  141,129,98,104,95,92,94,114,\n  112,73,108,62,136,120,118,141,  105,57,53,129,139,116,142,70,  126,92,139,111,122,64,111,67,  100,63,134,104,102,110,102,119,\n  126,53,74,82,77,64,78,76,  74,51,58,72,68,60,68,61,  85,102,50,148,65,58,59,77,  97,64,90,122,116,120,117,129,\n  94,50,95,141,134,56,69,127,  60,37,151,133,141,146,122,58,  115,74,138,121,145,52,105,44,  78,35,128,96,85,89,89,105,\n\n  93,143,83,89,63,158,83,60,  83,139,98,142,132,86,147,141,  115,84,105,89,123,134,85,67,  69,69,82,94,100,99,89,116,\n  92,119,122,149,133,142,152,139,  144,87,98,98,132,136,128,136,  148,160,131,130,127,105,129,63,  151,58,111,91,104,103,95,113,\n  148,106,116,121,106,102,130,108,  127,89,97,117,103,117,112,113,  133,145,97,94,107,111,109,132,  144,121,140,148,147,147,148,137,\n  96,26,70,54,136,23,56,118,  57,39,143,109,136,129,114,24,  102,75,104,149,132,26,115,40,  62,32,99,95,91,85,89,104,\n  122,116,63,61,63,156,88,58,  77,162,52,66,68,77,80,112,  84,106,43,53,46,123,55,75,  100,67,77,125,117,120,120,120,\n  137,128,86,79,104,158,111,95,  93,154,68,90,84,84,82,113,  113,121,63,81,93,155,94,91,  115,82,99,136,132,131,136,128,\n  91,40,166,130,139,40,74,156,  53,33,137,119,108,132,120,47,  139,70,109,117,140,49,148,47,  74,31,142,89,83,85,84,103,\n  113,165,84,84,91,133,107,85,  101,142,80,94,94,82,76,158,  92,97,86,89,67,171,112,67,  91,63,89,116,108,115,112,117,\n\n  84,151,102,50,102,126,72,103,  59,149,74,148,115,116,104,148,  125,78,106,107,133,146,137,43,  60,158,87,85,79,92,80,104,\n  115,72,78,158,69,65,71,53,  67,50,47,103,38,82,62,99,  72,98,29,152,56,69,47,84,  93,67,72,118,125,119,113,127,\n  116,167,96,89,95,156,80,88,  85,135,64,95,66,79,70,161,  97,98,65,84,85,166,84,67,  92,59,94,117,117,113,112,116,\n  95,66,122,116,132,60,119,129,  93,85,117,101,129,126,160,66,  136,118,134,105,111,69,122,180,  161,71,127,101,101,101,96,115,\n  148,107,121,119,120,108,132,120,  135,112,126,122,123,123,121,115,  140,147,122,115,120,131,127,129,  146,120,138,149,149,149,149,138,\n  145,100,125,89,108,164,120,114,  156,141,106,107,130,110,130,109,  154,126,119,105,123,147,113,96,  136,98,123,146,132,131,136,131,\n  96,81,121,129,125,83,154,139,  147,86,111,134,134,126,142,92,  143,98,152,124,120,68,135,108,  111,140,154,101,101,106,99,117,\n  148,101,97,103,91,93,119,102,  119,82,86,90,96,95,97,105,  112,145,87,80,83,109,104,119,  153,110,113,160,153,158,154,146,\n\n  96,28,42,33,46,35,53,45,  49,31,126,40,50,53,52,43,  68,80,39,131,35,47,41,50,  74,51,47,99,104,105,97,134,\n  148,137,108,111,112,125,128,118,  139,87,95,116,95,112,110,149,  117,147,86,88,103,140,105,130,  146,146,127,149,149,149,149,138,\n  148,129,121,142,101,121,132,114,  128,114,99,114,126,128,120,128,  126,147,104,99,97,132,116,156,  146,121,126,149,149,149,149,138,\n  94,39,97,117,138,45,88,117,  67,38,75,139,136,117,133,55,  139,78,153,138,143,54,128,55,  79,53,151,97,89,100,92,107,\n  108,73,144,149,117,103,147,136,  162,65,59,127,136,135,143,70,  126,97,148,117,122,55,115,79,  109,140,154,117,114,112,100,115,\n  148,128,120,108,115,137,133,110,  129,119,99,112,110,115,116,137,  127,147,98,107,93,131,122,130,  146,149,127,149,149,149,149,138,\n  90,141,92,62,123,145,98,94,  71,157,54,115,84,131,112,151,  121,73,99,126,103,146,129,51,  68,144,73,93,87,100,88,107,\n  137,80,87,78,75,97,105,85,  110,75,63,75,82,82,81,90,  99,126,66,86,72,87,81,105,  118,85,106,131,142,134,137,133,\n};\n\nstatic const uint8 ced_hires_21[1024] = {\n  83,35,83,86,68,31,99,99,  55,99,74,45,80,93,87,75,  79,100,91,111,76,86,61,33,  125,101,49,100,98,111,105,129,\n  59,43,112,116,111,56,117,121,  105,92,122,118,122,117,117,48,  113,112,111,124,119,105,131,14,  124,58,128,80,75,64,53,89,\n  102,65,123,122,96,71,94,119,  105,106,73,93,110,138,129,71,  91,126,89,85,132,109,80,55,  63,122,92,108,98,117,104,108,\n  87,29,40,62,58,112,27,40,  29,82,41,27,55,73,54,164,  60,39,74,78,77,82,45,14,  40,65,75,85,83,89,81,104,\n  56,54,82,113,116,92,121,126,  133,122,107,112,124,114,119,69,  102,67,118,115,124,140,111,23,  115,119,76,70,57,61,58,92,\n  78,62,95,25,124,109,90,119,  76,70,53,123,120,99,116,31,  107,29,119,104,112,46,98,15,  58,34,111,65,65,82,61,97,\n  81,74,99,75,114,81,117,133,  79,96,101,129,126,104,112,55,  91,50,130,123,117,86,115,48,  57,41,32,98,76,95,82,105,\n  107,147,94,49,39,141,43,49,  70,156,84,83,111,101,28,140,  58,35,42,54,90,129,55,41,  53,82,24,102,79,105,77,124,\n\n  75,53,95,115,100,73,77,121,  43,85,59,58,103,133,102,46,  69,150,127,128,112,72,122,25,  117,58,87,80,75,79,76,97,\n  52,103,109,123,121,131,123,117,  114,100,110,92,113,118,102,108,  129,127,111,123,117,103,115,21,  125,36,88,52,79,81,65,95,\n  87,70,63,109,62,69,46,61,  46,69,77,67,83,135,128,27,  93,114,58,120,143,110,108,59,  114,61,69,92,90,96,100,95,\n  109,61,71,65,81,104,96,64,  70,131,79,83,136,84,125,49,  77,107,101,97,105,80,101,61,  111,75,106,115,115,112,116,109,\n  112,114,84,92,90,82,79,75,  83,89,111,97,91,110,108,93,  97,93,73,90,96,92,89,68,  88,77,101,154,114,122,143,121,\n  53,137,103,128,119,76,111,90,  112,44,99,119,103,120,104,107,  107,110,85,115,119,68,113,4,  82,21,111,63,72,62,54,91,\n  115,54,75,100,84,61,84,54,  83,100,70,85,116,112,133,43,  80,88,74,84,141,60,68,52,  81,99,81,113,103,108,109,105,\n  120,111,126,115,133,122,111,89,  67,99,81,110,116,108,120,90,  90,163,89,121,125,100,107,119,  103,94,88,124,116,114,122,112,\n\n  102,136,101,31,69,99,109,94,  95,151,120,85,100,94,78,59,  51,53,85,107,69,157,101,38,  64,67,59,99,103,108,95,116,\n  79,150,19,27,24,119,22,24,  34,118,44,32,28,19,11,155,  18,43,0,29,14,101,25,9,  34,44,25,79,93,78,75,98,\n  109,79,94,83,94,67,94,111,  63,103,71,67,102,112,111,62,  121,102,109,118,80,89,83,60,  119,63,60,126,109,130,110,127,\n  52,53,108,90,118,45,88,105,  66,98,128,92,109,106,132,29,  112,78,109,93,96,54,103,149,  131,47,99,57,55,61,53,92,\n  113,67,91,86,91,74,66,59,  71,104,115,78,126,131,125,92,  113,78,81,96,142,98,101,64,  76,66,103,108,98,123,99,112,\n  107,81,112,47,95,153,81,88,  126,155,117,100,111,89,104,77,  131,53,97,95,109,142,93,38,  90,63,95,109,89,98,95,108,\n  53,65,106,102,111,70,124,115,  115,98,121,126,113,107,115,63,  119,40,128,113,105,54,117,78,  77,126,127,58,62,74,59,98,\n  130,70,67,61,62,63,68,65,  77,75,76,63,59,56,60,58,  74,89,44,52,52,89,72,70,  112,74,65,152,122,141,139,137,\n\n  87,83,128,38,121,100,104,126,  80,90,140,138,111,106,105,56,  118,38,125,105,107,90,118,59,  57,141,42,74,97,86,75,106,\n  113,89,93,86,69,80,73,66,  73,107,89,65,79,88,93,67,  86,81,65,83,79,83,81,62,  108,93,80,129,114,126,119,125,\n  72,100,140,106,126,76,78,82,  98,91,119,103,121,124,113,68,  119,69,92,127,109,58,110,23,  82,57,114,116,85,81,78,92,\n  114,71,89,89,85,92,85,77,  88,84,100,100,109,99,87,42,  81,78,116,95,146,76,98,54,  89,93,94,119,114,113,115,110,\n  73,57,129,122,104,91,116,112,  130,80,66,119,115,115,115,33,  101,33,124,105,107,25,97,34,  70,127,127,84,81,81,57,94,\n  74,41,117,137,107,32,76,46,  113,50,108,113,93,131,86,33,  121,33,104,108,103,103,115,9,  34,85,117,79,74,86,80,101,\n  105,136,69,50,52,146,69,59,  68,160,143,98,90,95,36,91,  54,64,94,68,86,132,126,39,  89,121,50,110,105,109,106,138,\n  119,64,72,56,60,96,83,58,  74,75,59,61,65,63,48,59,  78,73,49,68,62,65,54,71,  69,57,57,111,119,111,115,117,\n};\n\n\n\n"
  },
  {
    "path": "third_party/ced/compact_enc_det/compact_enc_det_hint_code.cc",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include \"compact_enc_det/compact_enc_det_hint_code.h\"\n\n#include <ctype.h>                      // for isalpha\n#include <string.h>                     // for NULL, memchr, strlen, etc\n\n#include \"util/basictypes.h\"            // for uint8, uint32\n#include \"util/string_util.h\"\n\n// Upper to lower, keep digits, everything else to minus '-' (2d)\nstatic const char kCharsetToLowerTbl[256] = {\n  0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d,0x2d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0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,\n};\n\nstatic const char* kFakeEncodingName[] = {\n  \"FakeEnc100\", \"FakeEnc101\", \"FakeEnc102\", \"FakeEnc103\", \"FakeEnc104\",\n  \"FakeEnc105\", \"FakeEnc106\", \"FakeEnc107\", \"FakeEnc108\", \"FakeEnc109\",\n  \"FakeEnc110\", \"FakeEnc111\", \"FakeEnc112\", \"FakeEnc113\", \"FakeEnc114\",\n  \"FakeEnc115\", \"FakeEnc116\", \"FakeEnc117\", \"FakeEnc118\", \"FakeEnc119\",\n};\nstatic const char* kFakeEncodingName2[] = {\n  \"FakeEnc_0\", \"FakeEnc_1\", \"FakeEnc_2\", \"FakeEnc_3\", \"FakeEnc_4\",\n};\n\n// Return name for extended encoding\nconst char* MyEncodingName(Encoding enc) {\n  if (enc < 0) {\n    return \"~\";\n  }\n  if (enc == ISO_8859_1) {\n    return \"Latin1\";   // I can't stand \"ASCII\" for this\n  }\n  if (enc < NUM_ENCODINGS) {\n    return EncodingName(enc);\n  }\n  // allow fake names, for exploration\n  if ((NUM_ENCODINGS <= enc) && (enc < (NUM_ENCODINGS + 4))) {\n    return kFakeEncodingName2[enc - NUM_ENCODINGS];\n  }\n  if ((100 <= enc) && (enc < 120)) {\n    return kFakeEncodingName[enc - 100];\n  }\n  return \"~\";\n}\n\n\n// Normalize ASCII string to first 4 alphabetic chars and last 4 digit chars\n// Letters are forced to lowercase ASCII\n// Used to normalize charset= values\nstring MakeChar44(const string& str) {\n  string res(\"________\");     // eight underscores\n  int l_ptr = 0;\n  int d_ptr = 0;\n  for (uint32 i = 0; i < str.size(); ++i) {\n    uint8 uc = static_cast<uint8>(str[i]);\n    if (kIsAlpha[uc]) {\n      if (l_ptr < 4) {                  // Else ignore\n        res[l_ptr] = kCharsetToLowerTbl[uc];\n        l_ptr++;\n      }\n    } else if (kIsDigit[uc]) {\n      if (d_ptr < 4) {\n        res[4 + d_ptr] = kCharsetToLowerTbl[uc];\n      } else {\n        // Keep last 4 digits by shifting left\n        res[4] = res[5];\n        res[5] = res[6];\n        res[6] = res[7];\n        res[7] = kCharsetToLowerTbl[uc];\n      }\n      d_ptr++;\n    }   // If neither letter nor digit, drop entirely\n  }\n  return res;\n}\n\n// Normalize ASCII string to first 8 alphabetic/digit chars\n// Letters are forced to lowercase ASCII\n// Used to normalize TLD values\nstring MakeChar4(const string& str) {\n  string res(\"____\");     // four underscores\n  int l_ptr = 0;\n  for (uint32 i = 0; i < str.size(); ++i) {\n    uint8 uc = static_cast<uint8>(str[i]);\n    if (kIsAlpha[uc] | kIsDigit[uc]) {\n      if (l_ptr < 4) {                  // Else ignore\n        res[l_ptr] = kCharsetToLowerTbl[uc];\n        l_ptr++;\n      }\n    }\n  }\n  return res;\n}\n\n// Normalize ASCII string to first 8 alphabetic/digit chars\n// Letters are forced to lowercase ASCII\n// Used to normalize TLD values\nstring MakeChar8(const string& str) {\n  string res(\"________\");     // eight dots\n  int l_ptr = 0;\n  for (uint32 i = 0; i < str.size(); ++i) {\n    uint8 uc = static_cast<uint8>(str[i]);\n    if (kIsAlpha[uc] | kIsDigit[uc]) {\n      if (l_ptr < 8) {                  // Else ignore\n        res[l_ptr] = kCharsetToLowerTbl[uc];\n        l_ptr++;\n      }\n    }\n  }\n  return res;\n}\n"
  },
  {
    "path": "third_party/ced/compact_enc_det/compact_enc_det_hint_code.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef COMPACT_ENC_DET_COMPACT_ENC_DET_HINT_CODE_H_\n#define COMPACT_ENC_DET_COMPACT_ENC_DET_HINT_CODE_H_\n\n#include <string>                        // for string\n\n#include \"util/basictypes.h\"             // for uint32\n#include \"util/encodings/encodings.h\"    // for Encoding\n\nusing std::string;\n\n// Return name for extended encoding\nconst char* MyEncodingName(Encoding enc);\n\n// Normalize ASCII string to first 4 alphabetic chars and last 4 digit chars\n// Letters are forced to lowercase ASCII\n// Used to normalize charset= values\nstring MakeChar44(const string& str);\n\n// Normalize ASCII string to first 4 alphabetic/digit chars\n// Letters are forced to lowercase ASCII\n// Used to normalize TLD values\nstring MakeChar4(const string& str);\n\n// Normalize ASCII string to first 8 alphabetic/digit chars\n// Letters are forced to lowercase ASCII\n// Used to normalize other values\nstring MakeChar8(const string& str);\n\n#endif  // COMPACT_ENC_DET_COMPACT_ENC_DET_HINT_CODE_H_\n"
  },
  {
    "path": "third_party/ced/compact_enc_det/compact_enc_det_unittest.cc",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include \"compact_enc_det/compact_enc_det.h\"\n\n#include <stdio.h>                      // for fprintf, stderr, FILE, etc\n#include <string.h>                     // for strlen, NULL\n#include <string>                       // for string\n\n\n#include \"gtest/gtest.h\"\n#include \"util/basictypes.h\"\n#include \"util/commandlineflags.h\"\n#include \"util/varsetter.h\"             // for VarSetter\n\nusing std::string;\n\nDECLARE_bool(enc_detect_detail);\nDECLARE_bool(ced_allow_utf8utf8);\nDEFINE_int32(trackme, -1, \"Track this encoding in --enc_detect_detail output\");\n\nstatic const char kDetailHead[] =\n#include \"compact_enc_det/detail_head_string.inc\"  // IWYU pragma: keep\n;\n\n// escape PostScript string (no parens)\nstring PsStr(const char* str) {\n  string res(\"\");\n  for (size_t i = 0; i < strlen(str); ++i) {\n    char c = str[i];\n    if (c == '(') {res.append(\"\\\\(\");}\n    else if (c == ')') {res.append(\"\\\\)\");}\n    else if (c == '\\\\') {res.append(\"\\\\\\\\\");}\n    else {res.append(1, c);}\n  }\n  return res;\n}\n\nvoid PsCopyHeader(FILE* psfile) {\n  // Write all but the trailing NUL\n  fwrite(kDetailHead, 1, sizeof(kDetailHead) - 1, psfile);\n  if (FLAGS_trackme >= 0) {\n    fprintf(psfile, \"/track-me %d def\\n\\n\", FLAGS_trackme);\n  }\n}\n\nvoid PsEndfile(FILE* psfile, int pagenum) {\n  fprintf(psfile, \"showpage\\n\\n\");\n}\n\n// Test strings. These are all included here to make the unit test self-contained.\n\nconst char* kTeststr00 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/pt_wikipedia_org_clean__ASCII.txt\n  \" a Al-Qaeda causa a morte a 202 pessoas. 2003 - Michael Schumacher, conq\"\n  \"uista o Hexa na F\\xF3\"\"rmula 1. Nasceram neste dia... 1537 - Rei Eduardo\"\n  \" VI de Inglaterra (m. 1553) 1798 - Imperador Pedro I do Brasil (Pedro IV\"\n  \" de Portugal, foto). 1923 - Fernando Sabino, escritor e jornalista brasi\"\n  \"leiro (m. 2004) 1935 - Luciano Pavarotti, cantor l\\xED\"\"rico italiano Fa\"\n  \"leceram neste dia... 638 - Papa Hon\\xF3\"\"rio I 1965 - Paul Hermann M\\xFC\"\"\"\n  \"ller, qu\\xED\"\"mico su\\xED\"\"\\xE7\"\"o (n. 1899) 1992 - Ulysses Guimar\\xE3\"\"\"\n  \"es, pol\\xED\"\"tico brasileiro (n. 1916) Outros dias: 10 \\xB7\"\" 11 \\xB7\"\" \"\n  \"12 \\xB7\"\" 13 \\xB7\"\" 14 | ver todos... Sabia que... Durante 400 anos, n\\xE3\"\"\"\n  \"o choveu no deserto do Atacama? E que esse \\xE9\"\" o maior per\\xED\"\"odo s\"\n  \"em chuvas j\\xE1\"\" registrado? Fala, o c\\xE3\"\"o do presidente Franklin Ro\"\n  \"osevelt, tornou-se um soldado raso honor\\xE1\"\"rio do Ex\\xE9\"\"rcito Ameri\"\n  \"cano ao \\\"contribuir\\\" com um d\\xF3\"\"lar para o esfor\\xE7\"\"o de guerra p\"\n  \"ara cada dia do ano? O primeiro presidente da Academia Brasileira de Let\"\n  \"ras foi Machado de Assis, aclamado em 15 de Dezembro de 1896? O visual d\"\n  \"os personagens Princesa Jasmine e Aladdin, do filme Aladdin, cl\\xE1\"\"ssi\"\n  \"co de anima\\xE7\"\"\\xE3\"\"o da Disney de 1992, foi inspirado no visual da a\"\n  \"triz Jennifer Connelly e do ator Tom Cruise? Llanfairpwllgwyngyllgogeryc\"\n  \"hwyrndrobwllllantysiliogogogoch \\xE9\"\" a cidade com o maior n\\xFA\"\"mero \"\n  \"de letras do mundo, com 58 letras? A escritora brasileira Clarice Lispec\"\n  \"tor nasceu na Ucr\\xE2\"\"nia? arquivo Eventos recentes O escritor turco Or\"\n  \"han Pamuk \\xE9\"\" galardoado com o Pr\\xE9\"\"mio Nobel da Literatura. Avi\\xE3\"\"\"\n  \"o particular do jogador de basebol Cory Lidle colide com pr\\xE9\"\"dio res\"\n  \"idencial em Nova Iorque. Google adquire o maior servi\\xE7\"\"o de v\\xED\"\"d\"\n  \"eos da internet, o YouTube, por 1,65 bilh\\xE3\"\"o de d\\xF3\"\"lares. Coreia\"\n  \" do Norte realiza pela primeira vez um teste nuclear subterr\\xE2\"\"neo, a\"\n  \"lvo de fortes cr\\xED\"\"ticas pela comunidade internacional. Erup\\xE7\"\"\\xE3\"\"\"\n  \"o de vulc\\xE3\"\"o causa p\\xE2\"\"nico na Papua Nova Guin\\xE9\"\"; o calor e o\"\n  \"s ventos causados foram respons\\xE1\"\"veis pelo estilha\\xE7\"\"amento das j\"\n  \"anelas de resid\\xEA\"\"ncias num raio de at\\xE9\"\" doze quil\\xF3\"\"metros. A\"\n  \"nna Politkovskaia, jornalista russa conhecida pelas cr\\xED\"\"ticas ao gov\"\n  \"erno de Vladimir Putin, foi assassinada em Moscovo. T\\xEA\"\"m in\\xED\"\"cio\"\n  \" os primeiros Jogos da Lusofonia em Macau. OTAN assume comando das tropa\"\n  \"s no Afeganist\\xE3\"\"o. Brasil decidir\\xE1\"\" em segundo turno a\"\n;\n\n// By design, this is the most sensitive test of the bunch, i.e. the most\n// likely to fail when the encoding detector is changed.\n// On a good day, Latin4 will be only about 2**2 more likely than Latin2.\n// In real input, Latin4 is almost always accompanied by a charset= hint\n//\nconst char* kTeststr03 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/lt_wikipedia_org_clean__Latin4.txt\n// Hand-edit to boost Latin4 by small amounts. Bigrams here must differ or\n// CED will ignore duplicates.\n  \", kuria neteko vis\\xF9\"\". savo va\"\n  \", kuria neteko vis\\xF9\"\"j savo va\"\n  \"Kor\\xEC\"\"jai \"\n  \"\\xE7\"\"vykiai \"\n  \"kra\\xB9\"\"tus \"\n  \"Pr\\xFE\"\"sija \"\n  \"t\\xFE\"\"k \"\n// end hand-edit\n  \" yra interneto enciklopedija, kuri\\xB1\"\" skaityti, tobulinti ir pildyti \"\n  \"gali visi \\xBE\"\"mon\\xEC\"\"s, be joki\\xF9\"\" apribojim\\xF9\"\" ar mokes\\xE8\"\"\"\n  \"i\\xF9\"\". Vikipedij\\xB1\"\" galima skaityti daugiau nei \\xB9\"\"imtu kalb\\xF9\"\"\"\n  \"; lietuvi\\xB9\"\"kuosiuose puslapiuose apra\\xB9\"\"ytos daugiau nei 30 t\\xFE\"\"\"\n  \"kstan\\xE8\"\"i\\xF9\"\" tem\\xF9\"\", skai\\xE8\"\"ius nuolat auga. Daugiau informa\"\n  \"cijos apie Vikipedij\\xB1\"\" Spalio 12 dienos \\xE7\"\"vykiai Lietuvoje infor\"\n  \"macija ruo\\xB9\"\"iama Pasaulyje informacija ruo\\xB9\"\"iama Keisti M\\xEC\"\"n\"\n  \"esio \\xB9\"\"alis \\xA9\"\"io m\\xEC\"\"nesio \\xB9\"\"alies projektas skirtas \\xA9\"\"\"\n  \"iaur\\xEC\"\"s Kor\\xEC\"\"jai ir Tad\\xBE\"\"ikistanui. Labai pra\\xB9\"\"ome prisi\"\n  \"d\\xEC\"\"ti prie straipsni\\xF9\"\" apie \\xB9\"\"iuos kra\\xB9\"\"tus vystymo. Kei\"\n  \"sti Savait\\xEC\"\"s iniciatyva \\xA9\"\"iaur\\xEC\"\"s karas \\xE7\"\"vyko tarp Rus\"\n  \"ijos, Danijos-Norvegijos ir Saksonijos-Abiej\\xF9\"\" Taut\\xF9\"\" Respubliko\"\n  \"s unijos koalicijos (nuo 1715 m. prie jos prisijung\\xEC\"\" Pr\\xFE\"\"sija i\"\n  \"r Hanoveris) ir \\xA9\"\"vedijos nuo 1700 iki 1721 m. Karo pasekm\\xEC\"\"s - \"\n  \"\\xA9\"\"vedijos \\xE7\"\"taka Baltijos j\\xFE\"\"roje smarkiai suma\\xBE\"\"\\xEC\"\"j\"\n  \"o, \\xB9\"\"vedams praradarus teritorijas j\\xFE\"\"ros pakrant\\xEC\"\"je (Livon\"\n  \"ijoje, Estijoje, Vokietijoje), tuo tarpu Rusija tapo viena i\\xB9\"\" did\\xBE\"\"\"\n  \"i\\xF9\"\"j\\xF9\"\" Europos valstybi\\xF9\"\". 1721 m. \\xA9\"\"vedija buvo privers\"\n  \"ta pasira\\xB9\"\"yti taik\\xB1\"\", kuria neteko vis\\xF9\"\" savo va\"\n;\n\nconst char* kTeststr04 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/av_wikipedia_org_clean__ISO-8859-5.txt\n  \"ed for the creation of a Wikipedia in the Avar (\\xB0\"\"\\xD2\"\"\\xD0\"\"\\xE0\"\"\"\n  \") language. There are currently 150 articles (mostly stubs). \\xB2\"\"\\xE1\"\"\"\n  \"\\xD5\"\" \\xE1\"\"\\xE2\"\"\\xE0\"\"\\xD0\"\"\\xDD\"\"\\xD8\"\"\\xE6\"\"\\xEB\"\" / All pages \\xB4\"\"\"\n  \"\\xD0\"\"\\xD3\"\"\\xEA\"\"\\xD8\"\"\\xE1\"\"\\xE2\"\"\\xD0\"\"\\xDD\"\" \\xDC\"\"\\xD0\"\"\\xD3\"\"I\\xD0\"\"\"\n  \"\\xE0\"\"\\xE3\"\"\\xDB\"\" \\xDC\"\"\\xD0\"\"\\xE6\"\"I \\xDC\"\"\\xD0\"\"\\xD3\"\"I\\xD0\"\"\\xE0\"\"\\xE3\"\"\"\n  \"\\xDB\"\"\\xD0\"\"\\xDB\"\" \\xB1\"\"\\xE3\"\"\\xD9\"\"\\xDD\"\"\\xD0\"\"\\xE5\"\"\\xEA\"\"\\xE1\"\"\\xDA\"\"\"\n  \" \\xC1\"\"\\xE3\"\"\\xDB\"\"\\xD0\"\"\\xE5\"\"\\xEA\"\" \\xC6\"\"I\\xDE\"\"\\xD1\"\"\\xDE\"\"\\xDA\"\"\\xEC\"\"\"\n  \" \\xB1\"\"\\xD0\"\"\\xE2\"\"\\xD0\"\"\\xE1\"\"\\xE3\"\"\\xDD\"\"\\xD0\"\" \\xB0\"\"\\xD7\"\"\\xD5\"\"\\xE0\"\"\"\n  \"\\xD1\"\"\\xD0\"\"\\xD9\"\"\\xD4\"\"\\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\\xEC\"\"\\xD5\"\"\"\n  \" \\\"\\xC6\"\"I\\xE3\"\"\\xDC\"\"\\xD0\"\"\\xD4\"\"\\xD0\"\"\\\" \\xE1\"\"\\xD0\"\"\\xD9\"\"\\xE2\"\"\\xD0\"\"\"\n  \"\\xDB\"\"\\xEA\"\"\\xE3\"\"\\xDB\"\" \\xDC\"\"\\xD0\"\"\\xE2\"\"\\xD5\"\"\\xE0\"\"\\xD8\"\"\\xD0\"\"\\xDB\"\"\"\n  \"\\xD0\"\"\\xD7\"\"\\xD4\"\"\\xD0\"\" \\xE2\"\"I\\xD0\"\"\\xD4\"\" \\xE5\"\"I\\xD0\"\"\\xDB\"\"\\xE2\"\"I\\xD8\"\"\"\n  \" \\xD3\"\"\\xEC\"\"\\xD0\"\"\\xD1\"\"\\xD8\"\"\\xD7\"\"\\xD5\"\". If you come across pages th\"\n  \"at shouldn't be here, replace their content with {{db|reasonfordeletion}\"\n  \"} so that when someone who speaks the language \\\"adopts\\\" the Avar Wikip\"\n  \"edia t\"\n;\n\nconst char* kTeststr05 =      // aka ISO-8859-6\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/ar_wikipedia_org_clean__Arabic.txt\n  \" \\xC8\"\"\\xC7\"\"\\xE4\"\"\\xE4\"\"\\xDA\"\"\\xC9\"\" \\xC7\"\"\\xE4\"\"\\xC2\"\"\\xD1\"\"\\xC7\"\"\\xE5\"\"\"\n  \"\\xEA\"\"\\xC9\"\". \\xEA\"\"\\xD3\"\"\\xE8\"\"\\xD9\"\" \\xC8\"\"\\xC7\"\"\\xE4\"\"\\xD9\"\"\\xC8\"\"\\xD1\"\"\"\n  \"\\xEA\"\"\\xC9\"\" \\xCA\"\"\\xE6\"\"\\xD7\"\"\\xE2\"\" \\xEA\"\"\\xD4\"\"\\xE8\"\"\\xD9\"\" \\xE8\"\"\\xE5\"\"\"\n  \"\\xD9\"\"\\xE6\"\"\\xC7\"\"\\xE7\"\"\\xC7\"\" \\xC7\"\"\\xE4\"\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C7\"\"\\xE4\"\"\\xE5\"\"\\xCE\"\"\\xCA\"\"\\xC7\"\"\\xD1\"\"\\xC9\"\". \\xCA\"\"\"\n  \"\\xD9\"\"\\xC7\"\"\\xE8\"\"\\xE6\"\" \\xC7\"\"\\xE4\"\"\\xC3\"\"\\xD3\"\"\\xC8\"\"\\xE8\"\"\\xD9\"\". \\xCA\"\"\"\n  \"\\xD9\"\"\\xC7\"\"\\xE8\"\"\\xE6\"\" \\xC7\"\"\\xE4\"\"\\xC3\"\"\\xD3\"\"\\xC8\"\"\\xE8\"\"\\xD9\"\" \\xE4\"\"\"\n  \"\\xE3\"\"\\xD1\"\"\\xC9\"\"\"\n;\n\nconst char* kTeststr06 =      // aka ISO-8859-7 Greek\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/el_wikipedia_org_clean__CP1253.txt\n  \" \\xE3\"\"\\xE9\"\"\\xE1\"\" \\xF4\"\"\\xE7\"\"\\xED\"\" \\xF0\"\"\\xE5\"\"\\xF1\"\"\\xE9\"\"\\xE3\"\"\\xF1\"\"\"\n  \"\\xE1\"\"\\xF6\"\"\\xDE\"\" \\xE3\"\"\\xE5\"\"\\xF9\"\"\\xE3\"\"\\xF1\"\"\\xE1\"\"\\xF6\"\"\\xE9\"\"\\xEA\"\"\"\n  \"\\xFE\"\"\\xED\"\", \\xF0\"\"\\xEF\"\"\\xEB\"\"\\xE9\"\"\\xF4\"\"\\xE9\"\"\\xEA\"\"\\xFE\"\"\\xED\"\" \\xEA\"\"\"\n  \"\\xE1\"\"\\xE9\"\" \\xE9\"\"\\xF3\"\"\\xF4\"\"\\xEF\"\"\\xF1\"\"\\xE9\"\"\\xEA\"\"\\xFE\"\"\\xED\"\" \\xF0\"\"\"\n  \"\\xE5\"\"\\xF1\"\"\\xE9\"\"\\xEF\"\"\\xF7\"\"\\xFE\"\"\\xED\"\", \\xE3\"\"\\xEB\"\"\\xF9\"\"\\xF3\"\"\\xF3\"\"\"\n  \"\\xFE\"\"\\xED\"\"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xF1\"\"\\xFE\"\"\\xF0\"\"\\xE7\"\"\"\n;\n\nconst char* kTeststr07 =      // aka ISO-8859-8-I Hebrew in logical order\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/he_wikipedia_org_clean__CP1255.txt\n  \" \\xF2\"\"\\xF8\"\"\\xEB\"\"\\xE9\"\"\\xED\"\" \\xF2\"\"\\xE6\"\"\\xF8\"\"\\xE4\"\": \\xF2\"\"\\xE6\"\"\\xF8\"\"\"\n  \"\\xE4\"\" - \\xF9\"\"\\xE0\"\"\\xEC\"\"\\xE5\"\"\\xFA\"\" \\xE5\"\"\\xFA\"\"\\xF9\"\"\\xE5\"\"\\xE1\"\"\\xE5\"\"\"\n  \"\\xFA\"\" - \\xEB\"\"\\xEC\"\" \\xE3\"\"\\xF4\"\"\\xE9\"\" \\xE4\"\"\\xF2\"\"\\xE6\"\"\\xF8\"\"\\xE4\"\" \"\n  \"- \\xE0\"\"\\xF8\"\"\\xE2\"\"\\xE6\"\" \\xE7\"\"\\xE5\"\"\\xEC\"\" \\xEC\"\"\\xF0\"\"\\xF1\"\"\\xE9\"\"\\xE5\"\"\"\n  \"\\xF0\"\"\\xE5\"\"\\xFA\"\" \\xF2\"\"\\xF8\"\"\\xE9\"\"\\xEB\"\"\\xE4\"\" \\xEE\"\"\\xFA\"\"\\xF7\"\"\\xF4\"\"\"\n  \"\\xFA\"\" \\xE0\"\"\\xE9\"\"\\xEB\"\"\\xE5\"\"\\xFA\"\" \\xE5\"\"\\xE9\"\"\\xF7\"\"\\xE9\"\"\\xF4\"\"\\xE3\"\"\"\n  \"\\xE9\"\"\\xE4\"\" \\xE4\"\"\\xF2\"\"\\xE1\"\"\\xF8\"\"\\xE9\"\"\\xFA\"\" \\xEE\"\"\\xF8\"\"\\xEB\"\"\\xE6\"\"\"\n  \"\\xFA\"\" \\xE1\"\"\\xE9\"\"\\xEE\"\"\\xE9\"\"\\xED\"\" \\xE0\"\"\\xEC\"\"\\xE4\"\" \\xEE\"\"\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E1\"\"\\xE4\"\"\\xE9\"\"\\xF1\"\"\\xE8\"\"\\xE5\"\"\"\n  \"\\xF8\"\"\\xE9\"\"\\xE4\"\" 1492 - \\xEB\"\"\\xF8\"\"\\xE9\"\"\\xF1\"\"\\xE8\"\"\\xE5\"\"\\xF4\"\"\\xF8\"\"\"\n  \" \\xF7\"\"\\xE5\"\"\\xEC\"\"\\xE5\"\"\\xEE\"\"\\xE1\"\"\\xE5\"\"\\xF1\"\" \\xEE\"\"\\xE2\"\"\\xEC\"\"\\xE4\"\"\"\n  \" \\xE0\"\"\\xFA\"\" \\xE9\"\"\\xE1\"\"\\xF9\"\"\\xFA\"\" \\xE0\"\"\\xEE\"\"\\xF8\"\"\\xE9\"\"\\xF7\"\"\\xE4\"\"\"\n  \" 1537 - \\xE1\"\"\\xEF\"\" \\xE6\"\"\\xEB\"\"\\xF8\"\" \\xF0\"\"\\xE5\"\"\\xEC\"\"\\xE3\"\" \\xEC\"\"\\xE4\"\"\"\n  \"\\xF0\"\"\\xF8\"\"\\xE9\"\" \\xE4\"\"\\xF9\"\"\\xEE\"\"\\xE9\"\"\\xF0\"\"\\xE9\"\" 1899 - \\xF4\"\"\\xE5\"\"\"\n  \"\\xF8\"\"\\xF6\"\"\\xFA\"\" \\xEE\"\"\\xEC\"\"\\xE7\"\"\\xEE\"\"\\xFA\"\" \\xE4\"\"\\xE1\"\"\\xE5\"\"\\xF8\"\"\"\n  \"\\xE9\"\"\\xED\"\" \\xE4\"\"\\xF9\"\"\\xF0\"\"\\xE9\"\"\\xE4\"\" \\xEC\"\"\\xE0\"\"\\xE7\"\"\\xF8\"\" \\xF9\"\"\"\n  \"\\xE4\"\"\\xE1\"\"\\xE5\"\"\\xF8\"\"\\xE9\"\"\\xED\"\"\"\n;\n\n\n// This is just the above text brute-force byte reversed.\nconst char* kTeststr07v =      // aka ISO-8859-8 Hebrew in visual order\n// Produced by stringify.cc on 2007-04-04 12:17 from file wikifiles/he_wikipedia_org_clean__visual.txt\n  \"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E1\"\" \\xFA\"\"\\xE6\"\"\\xEB\"\"\\xF8\"\"\\xEE\"\" \\xFA\"\"\\xE9\"\"\\xF8\"\"\"\n  \"\\xE1\"\"\\xF2\"\"\\xE4\"\" \\xE4\"\"\\xE9\"\"\\xE3\"\"\\xF4\"\"\\xE9\"\"\\xF7\"\"\\xE9\"\"\\xE5\"\" \\xFA\"\"\"\n  \"\\xE5\"\"\\xEB\"\"\\xE9\"\"\\xE0\"\" \\xFA\"\"\\xF4\"\"\\xF7\"\"\\xFA\"\"\\xEE\"\" \\xE4\"\"\\xEB\"\"\\xE9\"\"\"\n  \"\\xF8\"\"\\xF2\"\" \\xFA\"\"\\xE5\"\"\\xF0\"\"\\xE5\"\"\\xE9\"\"\\xF1\"\"\\xF0\"\"\\xEC\"\" \\xEC\"\"\\xE5\"\"\"\n  \"\\xE7\"\" \\xE6\"\"\\xE2\"\"\\xF8\"\"\\xE0\"\" - \\xE4\"\"\\xF8\"\"\\xE6\"\"\\xF2\"\"\\xE4\"\" \\xE9\"\"\\xF4\"\"\"\n  \"\\xE3\"\" \\xEC\"\"\\xEB\"\" - \\xFA\"\"\\xE5\"\"\\xE1\"\"\\xE5\"\"\\xF9\"\"\\xFA\"\"\\xE5\"\" \\xFA\"\"\\xE5\"\"\"\n  \"\\xEC\"\"\\xE0\"\"\\xF9\"\" - \\xE4\"\"\\xF8\"\"\\xE6\"\"\\xF2\"\" :\\xE4\"\"\\xF8\"\"\\xE6\"\"\\xF2\"\" \"\n  \"\\xED\"\"\\xE9\"\"\\xEB\"\"\\xF8\"\"\\xF2\"\" \"\n;\n\nconst char* kTeststr08 =      // aka ISO-8859-9\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/mus_wikipedia_org_clean__Latin5.txt\n  \" language and think it would be cool to have your own Encyclopedia then \"\n  \"you can make it. Go ahead. Translate this page and start working on your\"\n  \" Encyclopedia. For more information go to the main website Other wikis M\"\n  \"eta-Wikipedia/Meta-Vicipaedia | Wikitonary/Victionaria | Wikibooks/Vicil\"\n  \"ibraria | Wikiquote/Viciquotas | Wikisource | Wikitravel A\\xFE\"\"k Arkada\"\n  \"\\xFE\"\"l\\xFD\"\"k Dostluk \\xDE\"\"iirler sevgili Av Videolar\\xFD\"\" Av K\\xF6\"\"\"\n  \"pekleri Sat\\xFD\"\"l\\xFD\"\"k Av T\\xFC\"\"fekleri Bal\\xFD\"\"k Av\\xFD\"\" Tav\\xFE\"\"\"\n  \"an Av\\xFD\"\" Domuz Av\\xFD\"\" Av Oyunlar\\xFD\"\" A\\xFE\"\"k Arkada\\xFE\"\"l\\xFD\"\"\"\n  \"k Dostluk \\xDE\"\"iirler sevgili Retrieved from \\\"http://mus.wikipedia.org\"\n  \"/wiki/Main_Page\\\" Views Article Discussion Edit History Personal tools L\"\n  \"og in / create account if (window.isMSIE55) fixalpha(); Navigation Main \"\n  \"Page Community portal Current events Recent changes Random page Help Don\"\n  \"ations Search Toolbo\"\n;\n\n\nconst char* kTeststr10 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/ja_wikipedia_org_clean__EUC-JP.txt\n  \" \\xCB\"\"\\xCC\"\"\\xB3\"\"\\xA4\"\"\\xC6\"\"\\xBB\"\"\\xC6\"\"\\xFC\"\"\\xCB\"\"\\xDC\"\"\\xA5\"\"\\xCF\"\"\"\n  \"\\xA5\"\"\\xE0\"\"\\xA5\"\"\\xD5\"\"\\xA5\"\"\\xA1\"\"\\xA5\"\"\\xA4\"\"\\xA5\"\"\\xBF\"\"\\xA1\"\"\\xBC\"\"\"\n  \"\\xA5\"\"\\xBA\"\"\\xA4\"\"\\xAC\"\"\\xA5\"\"\\xBD\"\"\\xA5\"\"\\xD5\"\"\\xA5\"\"\\xC8\"\"\\xA5\"\"\\xD0\"\"\"\n  \"\\xA5\"\"\\xF3\"\"\\xA5\"\"\\xAF\"\"\\xA4\"\"\\xC8\"\"\\xA4\"\"\\xCE\"\"\\xA5\"\"\\xD7\"\"\\xA5\"\"\\xEC\"\"\"\n  \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\"\"\\xA5\"\"\\xAD\"\"\\xA5\"\"\\xE1\"\"\\xA5\"\"\\xC7\"\"\\xA5\"\"\\xA3\"\"\"\n  \"\\xA5\"\"\\xA2\"\"\\xA1\"\"\\xA6\"\"\\xA5\"\"\\xD7\"\"\\xA5\"\"\\xED\"\"\\xA5\"\"\\xB8\"\"\\xA5\"\"\\xA7\"\"\"\n  \"\\xA5\"\"\\xAF\"\"\\xA5\"\"\\xC8\"\" -\"\n;\n\nconst char* kTeststr11 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/ja_wikipedia_org_clean__SJS.txt\n  \" \\x96\"\"k\\x8A\"\"C\\x93\"\"\\xB9\"\"\\x93\"\"\\xFA\"\"\\x96\"\"{\\x83\"\"n\\x83\"\"\\x80\"\"\\x83\"\"t\"\n  \"\\x83\"\"@\\x83\"\"C\\x83\"\"^\\x81\"\"[\\x83\"\"Y\\x82\"\"\\xAA\"\"\\x83\"\"\\\\\\x83\"\"t\\x83\"\"g\\x83\"\"\"\n  \"o\\x83\"\"\\x93\"\"\\x83\"\"N\\x82\"\"\\xC6\"\"\\x82\"\"\\xCC\"\"\\x83\"\"v\\x83\"\"\\x8C\"\"\\x81\"\"[\\x83\"\"\"\n  \"I\\x83\"\"t\\x82\"\"\\xF0\"\"\\x90\"\"\\xA7\"\"\\x82\"\"\\xB5\"\"\\x81\"\"A25\\x94\"\"N\\x82\"\"\\xD4\"\"\"\n  \"\\x82\"\"\\xE8\"\"3\\x93\"\"x\\x96\"\"\\xDA\"\"\\x82\"\"\\xCC\"\"\\x83\"\"p\\x83\"\"V\\x83\"\"t\\x83\"\"B\"\n  \"\\x83\"\"b\\x83\"\"N\\x81\"\"E\\x83\"\"\\x8A\"\"\\x81\"\"[\\x83\"\"O\\x97\"\"D\\x8F\"\"\\x9F\"\"\\x81\"\"\"\n  \"B \\x96\"\"k\\x92\"\"\\xA9\"\"\\x91\"\"N\\x8A\"\"j\\x8E\"\"\\xC0\"\"\\x8C\"\"\\xB1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\"\"\\xE7\"\" - \\x97\"\"\\xF0\"\"\\x8E\"\"j \"\n  \"- \\x95\"\"\\x9F\"\"\\x8E\"\"\\x83\"\" - \\x88\"\"\\xE3\"\"\\x97\"\"\\xC3\"\" - \\x8E\"\"s\\x96\"\"\\xAF\"\"\"\n  \"\\x8A\"\"\\x88\"\"\\x93\"\"\\xAE\"\" - \\x95\"\"\\xBD\"\"\\x98\"\"a - \\x90\"\"\\xED\"\"\\x91\"\"\\x88\"\"\"\n  \" - \\x8C\"\"R\\x8E\"\"\\x96\"\" \\x8C\"\"|\\x8F\"\"p\\x82\"\"\\xC6\"\"\\x95\"\"\\xB6\"\"\\x89\"\"\\xBB\"\"\"\n  \" \\x90\"\"H - \\x8C\"\"\\xBE\"\"\\x8C\"\"\\xEA\"\" - \\x8F\"\"@\\x8B\"\"\\xB3\"\" - \\x8C\"\"|\\x94\"\"\"\n  \"\\\\ - \\x90\"\"\\xB6\"\"\\x8A\"\"\\x88\"\" - \\x8C\"\"\\xE2\"\"\\x8A\"\"y - \\x95\"\"\\xB6\"\"\\x8A\"\"\"\n  \"w - \\x89\"\"\\xB9\"\"\\x8A\"\"y - \\x94\"\"\\xFC\"\"\\x8F\"\"p - \\x95\"\"\\x91\"\"\\x91\"\"\\xE4\"\"\"\n  \"\\x8C\"\"|\\x8F\"\"p - \\x89\"\"f\\x89\"\"\\xE6\"\" - \\x96\"\"\\x9F\"\"\\x89\"\"\\xE6\"\" - \\x83\"\"\"\n  \"A\\x83\"\"j\\x83\"\"\\x81\"\" - \\x83\"\"X\\x83\"\"|\\x81\"\"[\\x83\"\"c - \\x83\"\"Q\\x81\"\"[\\x83\"\"\"\n  \"\\x80\"\" - \\x83\"\"\\x81\"\"\\x83\"\"f\\x83\"\"B\\x83\"\"A - \\x83\"\"e\\x83\"\"\\x8C\"\"\\x83\"\"r \"\n  \"- \\x83\"\"\\x89\"\"\\x83\"\"W\\x83\"\"I - \\x8F\"\"\\x91\"\"\\x95\"\"\\xA8\"\" - \\x95\"\"\\x97\"\"\\x91\"\"\"\n  \"\\xAD\"\" - \\x93\"\"`\\x8F\"\"\\xB3\"\" - \\x94\"\"N\\x92\"\"\\x86\"\"\\x8D\"\"s\\x8E\"\"\\x96\"\" \\x90\"\"\"\n  \"\\xA2\"\"\\x8A\"\"E \\x83\"\"A\\x83\"\"W\\x83\"\"A - \\x83\"\"A\\x83\"\"t\\x83\"\"\\x8A\"\"\\x83\"\"J \"\n  \"- \\x83\"\"I\\x83\"\"Z\\x83\"\"A\\x83\"\"j\\x83\"\"A - \\x96\"\"k\\x83\"\"A\\x83\"\"\\x81\"\"\\x83\"\"\"\n  \"\\x8A\"\"\\x83\"\"J - \\x93\"\"\\xEC\"\"\\x83\"\"A\\x83\"\"\\x81\"\"\\x83\"\"\\x8A\"\"\\x83\"\"J - \\x83\"\"\"\n  \"\\x88\"\"\\x81\"\"[\\x83\"\"\\x8D\"\"\\x83\"\"b\\x83\"\"p \\x93\"\"\\xFA\"\"\\x96\"\"{ \\x96\"\"k\\x8A\"\"\"\n  \"C\\x93\"\"\\xB9\"\" - \\x93\"\"\\x8C\"\"\\x96\"\"k - \\x8A\"\"\\xD6\"\"\\x93\"\"\\x8C\"\" - \\x92\"\"\\x86\"\"\"\n  \"\\x95\"\"\\x94\"\" - \\x8B\"\"\\xDF\"\"\\x8B\"\"E - \\x92\"\"\\x86\"\"\\x8D\"\"\\x91\"\" - \\x8E\"\"l\\x8D\"\"\"\n  \"\\x91\"\" - \\x8B\"\"\\xE3\"\"\\x8F\"\"B - \\x89\"\"\\xAB\"\"\\x93\"\"\\xEA\"\" \\x8E\"\"\\xA9\"\"\\x91\"\"\"\n  \"R \\x95\"\"\\xA8\"\"\\x8E\"\"\\xBF\"\" - \\x83\"\"G\\x83\"\"l\\x83\"\"\\x8B\"\"\\x83\"\"M\\x81\"\"[ - \"\n  \"\\x89\"\"F\\x92\"\"\\x88\"\" - \\x92\"\"n\\x8B\"\"\\x85\"\" - \\x8A\"\"\\xC2\"\"\\x8B\"\"\\xAB\"\" - \\x8B\"\"\"\n  \"C\\x8F\"\"\\xDB\"\" - \\x8D\"\"\\xD0\"\"\\x8A\"\"Q - \\x8A\"\"C\\x97\"\"m - \\x91\"\"\\xE5\"\"\\x97\"\"\"\n  \"\\xA4\"\"\\x81\"\"A\\x93\"\"\\x87\"\" - \\x90\"\"\\xB6\"\"\\x82\"\"\\xAB\"\"\\x95\"\"\\xA8\"\"\\x82\"\"\\xC6\"\"\"\n  \"\\x8E\"\"\\xA9\"\"\\x91\"\"R - \\x90\"\"A\\x95\"\"\\xA8\"\" - \\x93\"\"\\xAE\"\"\\x95\"\"\\xA8\"\" - \\x90\"\"\"\n  \"l\\x8A\"\"\\xD4\"\" - \\x8D\"\"z\\x95\"\"\\xA8\"\" \\x8B\"\"Z\\x8F\"\"p \\x83\"\"R\\x83\"\"\\x93\"\"\\x83\"\"\"\n  \"s\\x83\"\"\\x85\"\"\\x81\"\"[\\x83\"\"^ - \\x83\"\"C\\x83\"\"\\x93\"\"\\x83\"\"^\\x81\"\"[\\x83\"\"l\\x83\"\"\"\n  \"b\\x83\"\"g - \\x83\"\"G\\x83\"\"\\x8C\"\"\\x83\"\"N\\x83\"\"g\\x83\"\"\\x8D\"\"\\x83\"\"j\\x83\"\"N\\x83\"\"\"\n  \"X - \\x83\"\"o\\x83\"\"C\\x83\"\"I\\x83\"\"e\\x83\"\"N\\x83\"\"m\\x83\"\"\\x8D\"\"\\x83\"\"W\\x81\"\"[\"\n  \" - \\x8C\"\"\\xF0\"\"\\x92\"\"\\xCA\"\" - \\x93\"\"S\\x93\"\"\\xB9\"\" - \\x8E\"\"\\xA9\"\"\\x93\"\"\\xAE\"\"\"\n  \"\\x8E\"\"\\xD4\"\" - \\x8C\"\"\\x9A\"\"\\x92\"\"z - \\x8F\"\"\\xEE\"\"\\x95\"\"\\xF1\"\" - \\x92\"\"\\xCA\"\"\"\n  \"\\x90\"\"M - \\x8E\"\"\\x91\"\"\\x8C\"\"\\xB9\"\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"\"[\\x83\"\"\\x80\"\" - \\x8C\"\"\"\n  \"\\xBE\"\"\\x8C\"\"\\xEA\"\"\\x8A\"\"w - \\x83\"\"R\\x83\"\"\\x8A\"\"\\x83\"\"A - \\x83\"\"R\\x83\"\"\\x93\"\"\"\n  \"\\x83\"\"s\\x83\"\"\\x85\"\"\\x81\"\"[\\x83\"\"^ - \\x8D\"\"\\xD0\"\"\\x8A\"\"Q - \\x8E\"\"\\xA9\"\"\\x93\"\"\"\n  \"\\xAE\"\"\\x8E\"\"\\xD4\"\" - \\x90\"\"H - \\x90\"\"A\\x95\"\"\\xA8\"\" - \\x90\"\"_\\x93\"\"\\xB9\"\"\"\n  \" - \\x83\"\"X\\x83\"\"|\\x81\"\"[\\x83\"\"c - \\x90\"\"\\xB6\"\"\\x95\"\"\\xA8\"\"\\x8A\"\"w - \\x90\"\"\"\n  \"\\xA2\"\"\\x8A\"\"E\\x88\"\"\\xE2\"\"\\x8E\"\"Y - \\x90\"\"\\xED\"\"\\x91\"\"\\x88\"\" - \\x91\"\"\\xE6\"\"\"\n  \"\\x8E\"\"O\\x92\"\"\\xE9\"\"\\x8D\"\"\\x91\"\" - \\x91\"\"\\xE5\"\"\\x93\"\"\\x8C\"\"\\x88\"\"\\x9F\"\"\\x8B\"\"\"\n  \"\\xA4\"\"\\x89\"\"h\\x8C\"\"\\x97\"\" - \\x92\"\"n\\x8B\"\"\\x85\"\"\\x89\"\"\\xC8\"\"\\x8A\"\"w - \\x92\"\"\"\n  \"\\x86\"\"\\x8D\"\"\\x91\"\" - \\x92\"\"n\\x97\"\"\\x9D\"\"\\x8A\"\"w - \\x93\"\"N\\x8A\"\"w - \\x93\"\"\"\n  \"S\\x93\"\"\\xB9\"\" - \\x83\"\"e\\x83\"\"\\x8C\"\"\\x83\"\"r - \\x93\"\"V\\x95\"\"\\xB6\"\"\\x8A\"\"w \"\n  \"- \\x93\"\"\\xFA\"\"\\x96\"\"{ - \\x93\"\"\\xFA\"\"\\x96\"\"{\\x82\"\"\\xCC\"\"\\x93\"\"s\\x93\"\"\\xB9\"\"\"\n  \"\\x95\"\"{\\x8C\"\"\\xA7\"\" - \\x83\"\"o\\x83\"\"X - \\x94\"\"\\xFC\"\"\\x8F\"\"p - \\x95\"\"\\x91\"\"\"\n  \"\\x91\"\"\\xE4\"\"\\x8C\"\"|\\x8F\"\"p - \\x95\"\"\\xA7\"\"\\x8B\"\"\\xB3\"\" - \\x95\"\"\\xA8\"\"\\x97\"\"\"\n  \"\\x9D\"\"\\x8A\"\"w - \\x83\"\"t\\x83\"\"\\x89\"\"\\x83\"\"\\x93\"\"\\x83\"\"X - \\x95\"\"\\xB6\"\"\\x8A\"\"\"\n  \"w - \\x95\"\"\\xBD\"\"\\x98\"\"a - \\x96\"\"\\x9F\"\"\\x89\"\"\\xE6\"\" - \\x83\"\"\\x88\"\"\\x81\"\"[\"\n  \"\\x83\"\"\\x8D\"\"\\x83\"\"b\\x83\"\"p - \\x83\"\"\\x89\"\"\\x83\"\"W\\x83\"\"I - \\x97\"\"\\xF0\"\"\\x8E\"\"\"\n  \"j - \\x97\"\"\\xF0\"\"\\x8E\"\"j\\x94\"\"F\\x8E\"\"\\xAF\"\"\\x82\"\"\\xC6\"\"\\x90\"\"\\xED\"\"\\x8C\"\"\"\n  \"\\xE3\"\"\\x8F\"\"\\x88\"\"\\x97\"\"\\x9D\"\" \\x83\"\"J\\x83\"\"e\\x83\"\"S\\x83\"\"\\x8A\"\" \\x88\"\"\\xEA\"\"\"\n  \"\\x97\"\"\\x97\"\" - \\x83\"\"E\\x83\"\"B\\x83\"\"L\\x83\"\"y\\x83\"\"f\\x83\"\"B\\x83\"\"A - \\x83\"\"\"\n  \"E\\x83\"\"B\\x83\"\"L\\x83\"\"\\x81\"\"\\x83\"\"f\\x83\"\"B\\x83\"\"A\\x81\"\"E\\x83\"\"v\\x83\"\"\\x8D\"\"\"\n  \"\\x83\"\"W\\x83\"\"F\\x83\"\"N\\x83\"\"g -\"\n;\n\nconst char* kTeststr12 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/ja_wikipedia_org_clean__JIS.txt\n  \" \\x1B\"\"$BKL3$F;F|K\\\\%O%`%U%!%$%?!<%:$,%=%U%H%P%s%/$H$N%W%l!<%*%U$r@)$7!\\\"\"\n  \"\\x1B\"\"(B25\\x1B\"\"$BG/$V$j\\x1B\"\"(B3\\x1B\"\"$BEYL\\\\$N%Q%7%U%#%C%/!&%j!<%0M%>!\"\n  \"!#\\x1B\"\"(B \\x1B\"\"$BKLD+A/3K<B83$KBP$9$k7P:Q@):[$GF|K\\\\FH<+$NDI2C@):[$r7h\"\n  \"Dj!#\\x1B\"\"(B \\x1B\"\"$B%G%#!<%W%$%s%Q%/%H$,G/Fb$G0zB`$9$k$HH/I=!#\\\"*%&%#%-\"\n  \"%K%e!<%9\\x1B\"\"(B Google\\x1B\"\"$B$,\\x1B\"\"(BGoogle Docs & Spreadsheets\\x1B\"\"\"\n  \"$B!J\\x1B\"\"(BGoogle\\x1B\"\"$BHG!V\\x1B\"\"(BOffice\\x1B\"\"$B!W!\\\"%Y!<%?HG!K$NDs6\"\n  \"!$r3+;O!#\\x1B\"\"(B [\\x1B\"\"$B%&%#%-%K%e!<%9\\x1B\"\"(B] [\\x1B\"\"$B:G6a$N=PMh;v\"\n  \"A4J8\\x1B\"\"(B] \\x1B\"\"$BEjI<!&?dA&\\x1B\"\"(B \\x1B\"\"$B5(@a$NOCBj\\x1B\"\"(B \\x1B\"\"\"\n  \"$B=)\\x1B\"\"(B - \\x1B\"\"$B1?F02q\\x1B\"\"(B - \\x1B\"\"$B0r<Q2q\\x1B\"\"(B - \\x1B\"\"$\"\n  \"B%5%s%^\\x1B\"\"(B - \\x1B\"\"$B%V%I%&\\x1B\"\"(B - \\x1B\"\"$B%-%s%b%/%;%$\\x1B\"\"(B \"\n  \"- \\x1B\"\"$B$I$s$0$j\\x1B\"\"(B - \\x1B\"\"$B=i4'@c\\x1B\"\"(B - \\x1B\"\"$B=)$NM<>F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$BE7J83X\\x1B\"\"(B - \\x1B\"\"$BF|K\\\\\\x1B\"\"(B - \\x1B\"\"\"\n  \"$BF|K\\\\$NETF;I\\\\8)\\x1B\"\"(B - \\x1B\"\"$B%P%9\\x1B\"\"(B - \\x1B\"\"$BH~=Q\\x1B\"\"(B\"\n  \" - \\x1B\"\"$BIqBf7]=Q\\x1B\"\"(B - \\x1B\"\"$BJ)65\\x1B\"\"(B - \\x1B\"\"$BJ*M}3X\\x1B\"\"\"\n  \"(B - \\x1B\"\"$B%U%i%s%9\\x1B\"\"(B - \\x1B\"\"$BJ83X\\x1B\"\"(B - \\x1B\"\"$BJ?OB\\x1B\"\"\"\n  \"(B - \\x1B\"\"$BL!2h\\x1B\"\"(B - \\x1B\"\"$B%h!<%m%C%Q\\x1B\"\"(B - \\x1B\"\"$B%i%8%*\\x1B\"\"\"\n  \"(B - \\x1B\"\"$BNr;K\\x1B\"\"(B - \\x1B\"\"$BNr;KG'<1$H@o8e=hM}\\x1B\"\"(B \\x1B\"\"$B%\"\n  \"+%F%4%j\\x1B\"\"(B \\x1B\"\"$B0lMw\\x1B\"\"(B - \\x1B\"\"$B%&%#%-%Z%G%#%\\\"\\x1B\"\"(B -\"\n  \" \\x1B\"\"$B%&%#%-%a%G%#%\\\"!&%W%m%8%'%/%H\\x1B\"\"(B -\"\n;\n\nconst char* kTeststr13 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/zh-classical_wikipedia_org_clean__BIG5_HKSCS.txt\n  \" \\xA1\"\"E \\xA4\"\"V\\xB6\"\"q\\xBC\"\"\\xC6\"\"\\xA6\"\"r \\xA1\"\"E \\xB8\"\"U\\xB0\"\"\\xEA\"\"\\xA8\"\"\"\n  \"\\xF3\"\"\\xA7\"\"@ \\xA1\"\"E \\xAC\"\"\\xC9\"\"\\xAD\"\"\\xB1\"\"\\xC2\"\"\\xBD\"\"\\xC4\"\"\\xB6\"\" \\xB5\"\"\"\n  \"\\xB4\"\"\\xA7\"\"\\xAE\"\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xD4\"\"\\xC2\"\"1\\xBA\"\"\\xC5\"\"\\xD5\"\"\\xFD\"\"\\xCA\"\"\\xBD\"\"\\xB3\"\"\\xC9\"\"\\xC1\"\"\"\n  \"\\xA2\"\"\\xA1\"\"\\xA3\"\" \\xC5\"\"\\xB5\"\"\\xB1\"\"\\xB4\"\"\\xB6\"\"\\xFB\"\"\\xBD\"\"\\xB1\"\"\\xCE\"\"\"\n  \"\\xAF\"\"\\xD4\"\"\\xB1\"\"\\xBB\"\"\\xE1\"\"\\xD0\"\"\\xFB\"\"\\xB2\"\"\\xBC\"\"\\xC4\"\"\\xC3\"\"2006\\xC4\"\"\"\n  \"\\xEA\"\"\\xB6\"\"\\xC8\"\"\\xB8\"\"\\xF6\"\"\\xC5\"\"\\xB5\"\"\\xB1\"\"\\xB4\"\"\\xB6\"\"\\xFB\"\"\\xCE\"\"\"\n  \"\\xEF\"\"\\xC0\"\"\\xED\"\"\\xD1\"\"\\xA7\"\"\\xBD\"\"\\xB1\"\"\\xCA\"\"\\xDA\"\"\\xB2\"\"\\xA6\"\"\\xC1\"\"\"\n  \"\\xBD\"\"\\xCE\"\"\\xBB\"\"\\xC3\"\"\\xC0\"\"\\xB9\"\"\\xFA\"\"\\xBF\"\"\\xC6\"\"\\xD1\"\"\\xA7\"\"\\xBC\"\"\"\n  \"\\xD2\"\" John \"\n;\n\nconst char* kTeststr22 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/se_wikipedia_org_clean__UTF8.txt\n  \"tnegirjji gosa gii beare s\\xC3\"\"\\xA1\"\"htt\\xC3\"\"\\xA1\"\" \\xC4\"\"\\x8D\"\"\\xC3\"\"\"\n  \"\\xA1\"\"llit artihkkaliid. Maid don s\\xC3\"\"\\xA1\"\"ht\\xC3\"\"\\xA1\"\"t dievasmah\"\n  \"ttit ja divvut juo \\xC4\"\"\\x8D\"\"\\xC3\"\"\\xA1\"\"llojuvvon artihkkaliid dahje \"\n  \"\\xC4\"\"\\x8D\"\"\\xC3\"\"\\xA1\"\"lligoahttit aibbas o\\xC4\"\"\\x91\"\"\\xC4\"\"\\x91\"\"a ar\"\n  \"tihkkala muhtun f\\xC3\"\"\\xA1\"\"tt\\xC3\"\"\\xA1\"\"s. S\\xC3\"\"\\xA1\"\"megielat Wiki\"\n  \"pedias leat d\\xC3\"\"\\xA1\"\"l 1,042 artihkkala. Wikipedia v\\xC3\"\"\\xA1\"\"ldos\"\n  \"iiddus leat eambbo die\\xC4\"\"\\x91\"\"ut Mo don s\\xC3\"\"\\xA1\"\"ht\\xC3\"\"\\xA1\"\"t\"\n  \" veahkehit Wikipedia d\\xC3\"\"\\xA1\"\"rbba\\xC5\"\"\\xA1\"\"a du veahkki! Rukses l\"\n  \"i\\xC5\"\"\\x8B\"\"ka mearkka\\xC5\"\"\\xA1\"\"a dan, ahte f\\xC3\"\"\\xA1\"\"tt\\xC3\"\"\\xA1\"\"\"\n  \"s ii leat vel \\xC3\"\"\\xA1\"\"lgg\\xC3\"\"\\xA1\"\"huvvon artihkal. Don s\\xC3\"\"\\xA1\"\"\"\n  \"ht\\xC3\"\"\\xA1\"\"t veahkehit omd. nu ahte \\xC4\"\"\\x8D\"\"\\xC3\"\"\\xA1\"\"l\\xC3\"\"\\xA1\"\"\"\n  \"t artihkkala, muhtun siidus\\xC3\"\"\\xA1\"\"valdagain. \\xC3\"\"\\x81\"\"lgg\\xC3\"\"\\xA1\"\"\"\n  \"t o\\xC4\"\"\\x91\"\"\\xC4\"\"\\x91\"\"a artihkkala : Siida | Luossa | Durkkagiella \"\n  \"| Deatnu | M\\xC3\"\"\\xA1\"\"notbadji | Euro | Skandin\\xC3\"\"\\xA1\"\"vala\\xC5\"\"\\xA1\"\"\"\n  \" gielat | Rainier III | Ovttastuvvan N\\xC3\"\"\\xA1\"\"\\xC5\"\"\\xA1\"\"uvnnat | A\"\n  \"rthur Miller | John F. Kennedy Lasi artihkals\\xC3\"\"\\xA1\"\"valdagat \\xC3\"\"\"\n  \"\\x81\"\"igeguovdil Template:O\\xC4\"\"\\x91\"\"\\xC4\"\"\\x91\"\"asiiguin Loga lasi o\\xC4\"\"\"\n  \"\\x91\"\"\\xC4\"\"\\x91\"\"asiid golggotm\\xC3\"\"\\xA1\"\"nu 13. beaivi Template:Golgg\"\n  \"otm\\xC3\"\"\\xA1\"\"nu 13. Geah\\xC4\"\"\\x8D\"\"a ear\\xC3\"\"\\xA1\"\" beivviid Dihtetg\"\n  \"o, ahte... Template:Dihtetgo ahte Lasi unna die\\xC4\"\"\\x91\"\"ut Wikipediij\"\n  \"a ear\\xC3\"\"\\xA1\"\" gielain S\\xC3\"\"\\xA1\"\"meguovllu riikkaid gielain Girjed\"\n  \"\\xC3\"\"\\xA1\"\"rog\"\n;\n\nconst char* kTeststr25 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/ru-sib_wikipedia_org_clean__KOI8R.txt\n  \": \\xE1\"\"\\xCD\"\"\\xC9\"\"\\xD4\"\"\\xC1\"\"\\xCE\"\"\\xCF\"\"\\xDA\"\"\\xCE\"\"\\xC1\"\"\\xCA\"\"\\xD3\"\"\"\n  \"\\xD7\"\"\\xCF\"\" - \\xE4\"\"\\xC1\"\"\\xCC\"\"\\xC1\"\"\\xC5\"\"\\xDA\"\"\\xCE\"\"\\xC1\"\"\\xCA\"\"\\xD3\"\"\"\n  \"\\xD7\"\"\\xCF\"\" - \\xE4\"\"\\xCF\"\"\\xCD\"\"\\xCF\"\"\\xDA\"\"\\xCE\"\"\\xC1\"\"\\xCA\"\"\\xD3\"\"\\xD7\"\"\"\n  \"\\xCF\"\" - \\xF6\"\"\\xD9\"\"\\xD3\"\"\\xD4\"\"\\xC5\"\"\\xDA\"\"\\xCE\"\"\\xC1\"\"\\xCA\"\"\\xD3\"\"\\xD7\"\"\"\n  \"\\xCF\"\" - \\xFA\"\"\\xD7\"\"\\xD8\"\"\\xCF\"\"\\xDA\"\"\\xC4\"\"\\xCF\"\"\\xDA\"\"\\xCE\"\"\\xC1\"\"\\xCA\"\"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"\\xD7\"\"\\xCE\"\"\\xCF\"\"\"\n  \"\\xCA\"\"\"\n;\n\nconst char* kTeststr26 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/bg_wikipedia_org_clean__CP1251.txt\n  \" \\x96\"\" \\xD4\"\"\\xE8\"\"\\xEB\"\"\\xEE\"\"\\xF1\"\"\\xEE\"\"\\xF4\"\"\\xE8\"\"\\xFF\"\" \\x96\"\" \\xEE\"\"\"\n  \"\\xF9\"\"\\xE5\"\"... \\xD2\"\"\\xE5\"\"\\xF5\"\"\\xED\"\"\\xE8\"\"\\xF7\"\"\\xE5\"\"\\xF1\"\"\\xEA\"\"\\xE8\"\"\"\n  \" \\xE8\"\" \\xEF\"\"\\xF0\"\"\\xE8\"\"\\xEB\"\"\\xEE\"\"\\xE6\"\"\\xED\"\"\\xE8\"\" \\xEE\"\"\\xE1\"\"\\xEB\"\"\"\n  \"\\xE0\"\"\\xF1\"\"\\xF2\"\"\\xE8\"\" \\xC7\"\"\\xE5\"\"\\xEC\"\"\\xE5\"\"\\xE4\"\"\\xE5\"\"\\xEB\"\"\\xE8\"\"\"\n  \"\\xE5\"\" \\x96\"\" \\xC8\"\"\\xED\"\"\\xF2\"\"\\xE5\"\"\\xF0\"\"\\xED\"\"\\xE5\"\"\\xF2\"\" \\x96\"\" \\xCA\"\"\"\n  \"\\xEE\"\"\\xEC\"\"\\xF3\"\"\\xED\"\"\\xE8\"\"\\xEA\"\"\\xE0\"\"\\xF6\"\"\\xE8\"\"\\xE8\"\" \\x96\"\" \\xCC\"\"\"\n  \"\\xE5\"\"\\xE4\"\"\\xE8\"\"\\xF6\"\"\\xE8\"\"\\xED\"\"\\xE0\"\" \\x96\"\" \\xCE\"\"\\xE1\"\"\\xF0\"\"\\xE0\"\"\"\n  \"\\xE7\"\"\\xEE\"\"\\xE2\"\"\\xE0\"\"\\xED\"\"\\xE8\"\"\\xE5\"\" \\x96\"\" \\xCF\"\"\\xF0\"\"\\xE0\"\"\\xE2\"\"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"\\xE0\"\"\\xF2\"\"\"\n  \"\\xED\"\"\\xE8\"\" \\xE8\"\"\\xEB\"\"\\xE8\"\" \\xE4\"\"\\xF0\"\"\\xEE\"\"\\xE1\"\"\\xED\"\"\\xE8\"\" \\xED\"\"\"\n  \"\\xE0\"\" \\xE5\"\"\\xE4\"\"\\xE8\"\"\\xED\"\"\\xE8\"\"\\xF6\"\"\\xE8\"\"\\xF2\"\"\\xE5\"\".\"\n;\n\nconst char* kTeststr27 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/de_wikipedia_org_clean__CP1252.txt\n  \" auf der Computermesse Systems in M\\xFC\"\"nchen vertreten (Halle A3.542).\"\n  \" Artikel des Tages Das Weinbaugebiet Bordeaux, auf franz\\xF6\"\"sisch Bord\"\n  \"elais, ist das gr\\xF6\"\"\\xDF\"\"te zusammenh\\xE4\"\"ngende Anbaugebiet der We\"\n  \"lt f\\xFC\"\"r Qualit\\xE4\"\"tswein. Es gibt etwa 4000 Ch\\xE2\"\"teaux genannte\"\n  \" Weing\\xFC\"\"ter, die die weltber\\xFC\"\"hmten Weine erzeugen. Ein differen\"\n  \"ziertes System von subregionalen und kommunalen Appellationen und Klassi\"\n  \"fikationen schafft unter ihnen eine qualitative Hierarchie. Die einzelne\"\n  \"n Lagen spielen demgegen\\xFC\"\"ber eine untergeordnete Rolle. Ihre Stelle\"\n  \" nimmt das Ch\\xE2\"\"teau ein, zu dem sie geh\\xF6\"\"ren. Im Jahr 2002 wurde\"\n  \"n auf gut 120.000 Hektar Anbaufl\\xE4\"\"che insgesamt 5,74 Millionen Hekto\"\n  \"liter Qualit\\xE4\"\"tswein erzeugt. mehr Fr\\xFC\"\"here Artikel des Tages \\xB7\"\"\"\n  \" Weitere exzellente Artikel Was geschah am 13. Oktober? 1781 \\x96\"\" Jose\"\n  \"phinismus: Mit seinem Toleranzpatent hebt Joseph II. im Erzherzogtum \\xD6\"\"\"\n  \"sterreich das Glaubensmonopol der Katholischen Kirche auf. 1806 \\x96\"\" I\"\n  \"n Berlin wird die Preu\\xDF\"\"isch-K\\xF6\"\"nigliche Blindenanstalt unter Le\"\n  \"itung von Johann August Zeune er\\xF6\"\"ffnet \\x96\"\" Deutschlands erste Bl\"\n  \"indenschule. 1806 \\x96\"\" Otto Unverdorben, der 1826 Anilin, ein fl\\xFC\"\"\"\n  \"ssiges Zersetzungsprodukt von Indigo, entdecken wird, wird geboren. 1906\"\n  \" \\x96\"\" Karl Holzamer, Gr\\xFC\"\"ndungsintendant des ZDF, wird\"\n;\n\nconst char* kTeststr28 =\n// http://www.mon.gov.ua/books/ann.php?id=193\n// Produced by stringify.cc on 2007-04-10 14:21 from file koi8u.html\n  \"<html>\\n<head>\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; \"\n  \"charset=koi8-u\\\">\\n <title>\\xE1\"\"\\xCE\"\"\\xCF\"\"\\xD4\"\"\\xC1\"\"\\xC3\"\"\\xA6\"\"\\xD1\"\"\"\n  \" | \\xED\"\"i\\xCE\"\"i\\xD3\"\"\\xD4\"\"\\xC5\"\"\\xD2\"\"\\xD3\"\"\\xD4\"\"\\xD7\"\"\\xCF\"\" \\xCF\"\"\"\n  \"\\xD3\"\"\\xD7\"\"i\\xD4\"\"\\xC9\"\" \\xA6\"\" \\xCE\"\"\\xC1\"\"\\xD5\"\"\\xCB\"\"\\xC9\"\" \\xF5\"\"\\xCB\"\"\"\n  \"\\xD2\"\"\\xC1\"\"\\xA7\"\"\\xCE\"\"\\xC9\"\"</title>\\n<head>\\n<body>\\n\\xF0\"\"\\xCF\"\"\\xCC\"\"\"\n  \"\\xA6\"\"\\xDD\"\"\\xD5\"\"\\xCB\"\" \\xF7\"\". \\xF0\"\".<br><b>\\xE2\"\"\\xC4\"\"\\xD6\"\"\\xA6\"\"\\xCC\"\"\"\n  \"\\xD8\"\"\\xCE\"\"\\xC9\"\"\\xC3\"\"\\xD4\"\"\\xD7\"\"\\xCF\"\"</b><br><a\\nonClick=\\\"window.o\"\n  \"pen('/books/pub.php?id=5',,\\n'directories=no,height=200,location=no,menu\"\n  \"bar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,width=350');retu\"\n  \"rn false;\\\\\\ntarget=\\\"_blank\\\" href=\\\"/books/pub.php?id=5\\\">\\xF7\"\"\\xC9\"\"\"\n  \"\\xC4\"\"\\xC1\"\"\\xD7\"\"\\xCE\"\"\\xC9\"\"\\xC3\"\"\\xD4\"\"\\xD7\"\"\\xCF\"\" \\\"\\xF7\"\"\\xC9\"\"\\xDD\"\"\"\n  \"\\xC1\"\" \\xDB\"\"\\xCB\"\"\\xCF\"\"\\xCC\"\"\\xC1\"\"\\\"</a>, 2001 - 287c.<br><br>\\xF7\"\"\\xC9\"\"\"\n  \"\\xD3\"\"\\xD7\"\"\\xA6\"\"\\xD4\"\"\\xCC\"\"\\xC5\"\"\\xCE\"\"\\xCF\"\" \\xC7\"\"\\xCF\"\"\\xD3\"\"\\xD0\"\"\"\n  \"\\xCF\"\"\\xC4\"\"\\xC1\"\"\\xD2\"\"\\xD3\"\"\\xD8\"\"\\xCB\"\"\\xC5\"\" \\xDA\"\"\\xCE\"\"\\xC1\"\"\\xDE\"\"\"\n  \"\\xC5\"\"\\xCE\"\"\\xCE\"\"\\xD1\"\" \\xC2\"\"\\xC4\"\"\\xD6\"\"\\xA6\"\"\\xCC\"\"\\xD8\"\"\\xCE\"\"\\xC9\"\"\"\n  \"\\xC3\"\"\\xD4\"\"\\xD7\"\"\\xC1\"\", \\xCA\"\"\\xCF\"\"\\xC7\"\"\\xCF\"\" \\xD2\"\"\\xCF\"\"\\xDA\"\"\\xD7\"\"\"\n  \"\\xC9\"\"\\xD4\"\"\\xCF\"\"\\xCB\"\" \\xA6\"\" \\xD3\"\"\\xD5\"\"\\xDE\"\"\\xC1\"\"\\xD3\"\"\\xCE\"\"\\xC9\"\"\"\n  \"\\xCA\"\" \\xD3\"\"\\xD4\"\"\\xC1\"\"\\xCE\"\", \\xC2\"\"\\xA6\"\"\\xCF\"\"\\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"\"\\xD2\"\"\\xCF\"\"\\xC6\"\"\\xC5\"\"\\xD3\"\"\\xA6\"\"\\xCA\"\"\"\n  \"\\xCE\"\"\\xCF\"\"-\\xD4\"\"\\xC5\"\"\\xC8\"\"\\xCE\"\"\\xA6\"\"\\xDE\"\"\\xCE\"\"\\xC9\"\"\\xC8\"\" \\xCE\"\"\"\n  \"\\xC1\"\"\\xD7\"\"\\xDE\"\"\\xC1\"\"\\xCC\"\"\\xD8\"\"\\xCE\"\"\\xC9\"\"\\xC8\"\" \\xDA\"\"\\xC1\"\"\\xCB\"\"\"\n  \"\\xCC\"\"\\xC1\"\"\\xC4\"\"\\xA6\"\"\\xD7\"\".<p style=\\\"text-align: right; font-weight\"\n  \": bold;\\\">18\\n\\xC7\"\"\\xD2\"\"\\xCE\"\".</p></body>\\n</html>\"\n;\n\nconst char* kTeststr29 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/pl_wikipedia_org_clean__CP1250.txt\n  \"kroekonomicznej\\\". ( Wikinews) Bie\\xBF\"\"\\xB9\"\"ce wydarzenia: w Wikipedii\"\n  \", w Wikinews Aktualno\\x9C\"\"ci sportowe: w Wikipedii, w Wikinews Czy wies\"\n  \"z, \\xBF\"\"e... Z najnowszych artyku\\xB3\"\"\\xF3\"\"w Wikipedii: ... zdobywca \"\n  \"pierwszego polskiego medalu olimpijskiego Adam Kr\\xF3\"\"likiewicz zmar\\xB3\"\"\"\n  \" po wypadku na planie filmu Andrzeja Wajdy Popio\\xB3\"\"y? ... wydany w 19\"\n  \"99 album Tori Amos To Venus and Back by\\xB3\"\" pierwszym albumem tej arty\"\n  \"stki od 1992, kt\\xF3\"\"ry nie dosta\\xB3\"\" si\\xEA\"\" do pierwszej dziesi\\xB9\"\"\"\n  \"tki na brytyjskiej li\\x9C\"\"cie najpopularniejszych p\\xB3\"\"yt? ... emisja\"\n  \" audycji radiowej W Jezioranach rozpocz\\xEA\"\"\\xB3\"\"a si\\xEA\"\" w 1960? ..\"\n  \". w czasie bitwy w Sundzie holenderski 28-dzia\\xB3\"\"owy okr\\xEA\"\"t Breda\"\n  \" by\\xB3\"\" zdobyty dwukrotnie? ... tramwaje Tatra T6A2 u\\xBF\"\"ywane s\\xB9\"\"\"\n  \" mi\\xEA\"\"dzy innymi w w\\xEA\"\"gierskim mie\\x9C\"\"cie Szeged? Archiwum | Na\"\n  \"pisz nowy artyku\\xB3\"\" Wybrane rocznice 12 pa\\x9F\"\"dziernika: imieniny o\"\n  \"bchodz\\xB9\"\" Maksymilian, Serafin, Witolda 1492 - Krzysztof Kolumb dop\\xB3\"\"\"\n  \"yn\\xB9\"\"\\xB3\"\" do archipelagu Baham\\xF3\"\"w; oficjalna data odkrycia Amer\"\n  \"yki 1891 - urodzi\\xB3\"\"a si\\xEA\"\" Edyta Stein, znana jako \\x9C\"\"w. Teres\"\n  \"a Benedykta od Krzy\\xBF\"\"a, filozof, \\x9C\"\"wi\\xEA\"\"ta Ko\\x9C\"\"cio\\xB3\"\"a\"\n  \" rzymskokatolickiego 1920 - wojna polsko-bolszewicka: podpisanie rozejmu\"\n  \"; gen. Lucjan \\xAF\"\"eligowski zaj\\xB9\"\"\\xB3\"\" Wilno i proklamowa\\xB3\"\" u\"\n  \"tworzenie Litwy \\x8C\"\"rodkowej. 1924 - zmar\\xB3\"\" Anatole France, pisarz\"\n  \" francuski 1943 - rozpocz\\xEA\"\"\\xB3\"\"a si\\xEA\"\" bitwa pod Lenino Inne ro\"\n  \"cznice: 11 pa\\x9F\"\"dziernika - 12 pa\\x9F\"\"dziernika - 13 pa\\x9F\"\"dzierni\"\n  \"ka Archiwum | Kalendarium Artyku\\xB3\"\" na medal Wielka w\\xEA\"\"dr\\xF3\"\"wk\"\n  \"a lud\\xF3\"\"w \\x96\"\" okres masowych migracji plemion barbarzy\\xF1\"\"skich,\"\n  \" w szczeg\\xF3\"\"lno\\x9C\"\"ci Hun\\xF3\"\"w i German\\xF3\"\"w, na ziemie cesarst\"\n  \"wa rzymskiego u schy\\xB3\"\"ku staro\\xBF\"\"ytno\\x9C\"\"ci i w pocz\\xB9\"\"tkach\"\n  \" \\x9C\"\"redniowiecza (IV-VI wiek). Proces ten radykalnie odmieni\\xB3\"\" ob\"\n  \"raz kontynentu europejskiego \\x96\"\" doprowadzi\\xB3\"\" do zmian etnicznych\"\n  \" na du\\xBF\"\"ych obszarach, wyz\"\n;\n\nconst char* kTeststr32 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/lv_wikipedia_org_clean__CP1257.txt\n  \" neaizvietojamu materi\\xE2\"\"lu ar \\xEF\"\"oti pla\\xF0\"\"u pielietojumu. Dim\"\n  \"ants ir tradicion\\xE2\"\"li visv\\xE7\"\"rt\\xEE\"\"g\\xE2\"\"kais d\\xE2\"\"rgakmens.\"\n  \" Izcil\\xE2\"\"s fizik\\xE2\"\"l\\xE2\"\"s \\xEE\"\"pa\\xF0\"\"\\xEE\"\"bas padara dimantu\"\n  \" par lielisku abraz\\xEE\"\"vu \\x96\"\" vien\\xEE\"\"g\\xE2\"\"s vielas, ar kur\\xE2\"\"\"\n  \"m var ieskr\\xE2\"\"p\\xE7\"\"t dimantu, ir cits dimants, borazons, ultracieta\"\n  \"is fuller\\xEE\"\"ts vai dimanta nanostien\\xEE\"\"\\xF0\"\"i. Tas noz\\xEE\"\"m\\xE7\"\"\"\n  \" ar\\xEE\"\" to, ka dimants lieliski saglab\\xE2\"\" virsmas pul\\xE7\"\"jumu \\x96\"\"\"\n  \" savu izcilo sp\\xEE\"\"dumu. Las\\xEE\"\"t vair\\xE2\"\"k... Iepriek\\xF0\"\"\\xE7\"\"\"\n  \"jie raksti: Bizantijas imp\\xE7\"\"rija, Delartisk\\xE2\"\" kom\\xE7\"\"dija, Iro\"\n  \"nija, Naudas v\\xE7\"\"sture, 1905. gada revol\\xFB\"\"cija Vai tu zin\\xE2\"\"ji\"\n  \"... No latvie\\xF0\"\"u Vikip\\xE7\"\"dijas jaun\\xE2\"\"kajiem rakstiem: ... ka \"\n  \"viens no liel\\xE2\"\"kajiem v\\xE2\"\"rsm\\xE2\"\"s rakst\\xEE\"\"tajiem darbiem li\"\n  \"terat\\xFB\"\"ras v\\xE7\"\"stur\\xE7\"\" ir senindie\\xF0\"\"u eposs \\\"Mah\\xE2\"\"bh\\xE2\"\"\"\n  \"rata\\\"? ... ka v\\xE2\"\"rda \\\"ebrejs\\\" v\\xE7\"\"sturisk\\xE2\"\" noz\\xEE\"\"me ir\"\n  \" \\\"tie, kas klejo no vietas uz vietu\\\"? ... ka feni\\xED\"\"ie\\xF0\"\"i bija \"\n  \"pirmie, kas jau 598-595. g. p.m.\\xE7\"\". apku\\xEC\"\"oju\\xF0\"\"i apk\\xE2\"\"rt\"\n  \" \\xC2\"\"frikai, dom\\xE2\"\"dami gan, ka pieveiku\\xF0\"\"i tikai L\\xEE\"\"biju? \"\n  \"... ka nosaukums \\\"jaunlatvie\\xF0\"\"i\\\" pirm\\xE2\"\"s atmodas laik\\xE2\"\" ra\"\n  \"dies no V\\xE2\"\"cij\\xE2\"\" izveidoju\\xF0\"\"\\xE2\"\"s liter\\xE2\"\"tu liber\\xE2\"\"\"\n  \"listisk\\xE2\"\"s kust\\xEE\"\"bas \\\"Junges Deutschland\\\", kuras pamatidejas b\"\n  \"ija l\\xEE\"\"dz\\xEE\"\"gas jaunlatvie\\xF0\"\"u kust\\xEE\"\"bai? ... ka m\\xFB\"\"ra\"\n  \" \\xE7\"\"kas ar koka p\\xE2\"\"rsegumu Rietumeirop\\xE2\"\" s\\xE2\"\"ka b\\xFB\"\"v\\xE7\"\"\"\n  \"t Karolingu renesanses laik\\xE2\"\"? Vikip\\xE7\"\"dija cit\\xE2\"\"s valod\\xE2\"\"\"\n  \"s Vikip\\xE7\"\"dijas, kur\\xE2\"\"s i\"\n;\n\nconst char* kTeststr33 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/th_wikipedia_org_clean__ISO-8859-11.txt\n  \" \\xE0\"\"\\xBE\"\"\\xD7\"\"\\xE8\"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\"\\xD8\"\"\\xED\"\"\"\n  \"\\xDA\"\" \\xC3\"\"\\xE4\"\" \\xED\"\"\\xDF\"\"\\xCA\"\"\\xC8\"\" \\xC3\"\"\\xED\"\" \\xE3\"\"\\xDE\"\"\\xC7\"\"\"\n  \"\\xE1\"\": \\xDD\"\"\\xC7\"\"\\xE1\"\"\\xED\"\"\\xD6\"\"\\xDB\"\"\\xD8\"\" \\xDA\"\"\\xE1\"\"\\xEC\"\" \\\"\"\n  \"edit\\\" \\xE6\"\"\\xED\"\"\\xDF\"\"\\xCA\"\"\\xC8\"\"! \\xE1\"\"\\xE1\"\"\\xE3\"\"\\xD3\"\"\\xC7\"\"\\xDA\"\"\"\n  \"\\xCF\"\"\\xC9\"\" \\xC5\"\"\\xDE\"\"\\xD1\"\"\\xC3\"\" \\xC7\"\"\\xE1\"\"\\xE6\"\"\\xED\"\"\\xDF\"\"\\xED\"\"\"\n  \"\\xC8\"\"\\xED\"\"\\xCF\"\"\\xED\"\"\\xC7\"\" \\xC7\"\"\\xE1\"\"\\xDA\"\"\\xD1\"\"\\xC8\"\"\\xED\"\"\\xC9\"\"\"\n  \". Questa \\xE8\"\" la pagina principale di Wikipedia in lingua somala, un'e\"\n  \"nciclopedia libera in cui tutti possono scrivere articoli. Per vedere co\"\n;\n\nconst char* kTeststr42 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/ru-sib_wikipedia_org_clean__CP866.txt\n  \": \\x80\"\"\\xAC\"\"\\xA8\"\"\\xE2\"\"\\xA0\"\"\\xAD\"\"\\xAE\"\"\\xA7\"\"\\xAD\"\"\\xA0\"\"\\xA9\"\"\\xE1\"\"\"\n  \"\\xA2\"\"\\xAE\"\" - \\x84\"\"\\xA0\"\"\\xAB\"\"\\xA0\"\"\\xA5\"\"\\xA7\"\"\\xAD\"\"\\xA0\"\"\\xA9\"\"\\xE1\"\"\"\n  \"\\xA2\"\"\\xAE\"\" - \\x84\"\"\\xAE\"\"\\xAC\"\"\\xAE\"\"\\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\xAD\"\"\\xEF\"\" \\x88\"\"\\xA7\"\"\\xA4\"\"\\xA5\"\"\"\n  \"\\xEF\"\"\\xAD\"\"\\xA0\"\" \\xAD\"\"\\xAE\"\"\\xA2\"\"\\xA0\"\" \\xAA\"\"\\xE0\"\"\\xA0\"\"\\xE1\"\"\\xAE\"\"\"\n  \"\\xE2\"\"\\xA8\"\"\\xE8\"\"\\xE8\"\"\\xA0\"\" \\xA3\"\"\\xAE\"\"\\xAB\"\"\\xAE\"\"\\xA2\"\"\\xAD\"\"\\xAE\"\"\"\n  \"\\xA9\"\"\"\n;\n\nconst char* kTeststr44 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/av_wikipedia_org_clean__ISO-2022-KR.txt\n  \"\\x1B\"\"$)Ced for the creation of a Wikipedia in the Avar (\\x0E\"\",!,S,Q,b\\x0F\"\"\"\n  \") language. There are currently 150 articles (mostly stubs). \\x0E\"\",#,c,\"\n  \"V\\x0F\"\" \\x0E\"\",c,d,b,Q,_,Z,h,m\\x0F\"\" / All pages \\x0E\"\",%,Q,T,l,Z,c,d,Q,\"\n  \"_\\x0F\"\" \\x0E\"\",^,Q,T\\x0F\"\"I\\x0E\"\",Q,b,e,]\\x0F\"\" \\x0E\"\",^,Q,h\\x0F\"\"I \\x0E\"\"\"\n  \",^,Q,T\\x0F\"\"I\\x0E\"\",Q,b,e,],Q,]\\x0F\"\" \\x0E\"\",\\\",e,[,_,Q,g,l,c,\\\\\\x0F\"\" \\x0E\"\"\"\n  \",3,e,],Q,g,l\\x0F\"\" \\x0E\"\",8\\x0F\"\"I\\x0E\"\",`,R,`,\\\\,n\\x0F\"\" \\x0E\"\",\\\",Q,d,\"\n  \"Q,c,e,_,Q\\x0F\"\" \\x0E\"\",!,Y,V,b,R,Q,[,U,X,Q,_\\x0F\"\" \\x0E\"\",\\\",Q,\\\\,e\\x0F\"\"\"\n  \" \\x0E\"\",2,`,c,c,Z,q,],l,e,]\\x0F\"\" \\x0E\"\",6,V,U,V,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\" \\x0E\"\",d\\x0F\"\"I\\x0E\"\"\"\n  \",Q,U\\x0F\"\" \\x0E\"\",g\\x0F\"\"I\\x0E\"\",Q,],d\\x0F\"\"I\\x0E\"\",Z\\x0F\"\" \\x0E\"\",T,n,Q\"\n  \",R,Z,Y,V\\x0F\"\". If you come across pages that shouldn't be here, replace\"\n  \" their content with {{db|reasonfordeletion}} so that when someone who sp\"\n  \"eaks the language \\\"adopts\\\" the Avar Wikipedia t\"\n;\n\nconst char* kTeststr46 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/ksh_wikipedia_org_clean__GB18030.txt\n  \"nanie-du-Nord (Allemagne), dans certaines r\\xA8\"\"\\xA6\"\"gions de la Belgi\"\n  \"que et dans le sud-ouest des Pays-Bas. Hinweis f\\xA8\"\"\\xB9\"\"r alle, die \"\n  \"keine ripuarische Sprache sprechen: Dies ist die ripuarische Ausgabe der\"\n  \" Wikipedia. Ripuarisch wird in \\xA8\"\"\\xB9\"\"ber 100 Dialekten im weiteren\"\n  \" Umkreis von Aachen, Bonn, K\\x81\"\"0\\x8B\"\"2ln, D\\xA8\"\"\\xB9\"\"sseldorf, in \"\n  \"Belgien, den Niederlanden und im deutschen Rheinland von etwa einer Mill\"\n  \"ion Menschen gesprochen. Informatie voor iedereen die geen Ripuarisch sp\"\n  \"reekt: Dit is de Ripuarische versie van Wikipedia. Er zijn meer dan 100 \"\n  \"Ripuarische dialecten die worden gesproken door bijna twee miljoen mense\"\n  \"n in de omgeving van Aken, Bonn, Keulen en D\\xA8\"\"\\xB9\"\"sseldorf, in Bel\"\n  \"gi\\x81\"\"0\\x8A\"\"5, Nederland en het Duitse Rijnland. Informazione per chi\"\n  \" non parla un dialetto ripuario: Questa \\xA8\"\"\\xA8\"\" la versione in ripu\"\n  \"ario di Wikipedia. Pi\\xA8\"\"\\xB4\"\" di 100 dialetti ripuari sono parlati d\"\n  \"a oltre 1 milione di persone nelle seguenti regioni: Aquisgrana, Bonn, C\"\n  \"olonia, D\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\"\\xA7\"\"\\xD3\"\"\\xA7\"\"\\xD6\"\"\\xA7\"\"\\xE2\"\"\\xA7\"\"\\xDF\"\"\\xA7\"\"\"\n  \"\\xED\"\"\\xA7\"\"\\xDE\"\" \\xA7\"\"\\xB2\"\"\\xA7\"\"\\xD6\"\"\\xA7\"\"\\xDB\"\"\\xA7\"\"\\xDF\"\"-\\xA7\"\"\"\n  \"\\xA3\"\"\\xA7\"\"\\xD6\"\"\\xA7\"\"\\xE3\"\"\\xA7\"\"\\xE4\"\"\\xA7\"\"\\xE6\"\"\\xA7\"\"\\xD1\"\"\\xA7\"\"\"\n  \"\\xDD\"\"\\xA7\"\"\\xDA\"\"\\xA7\"\"\\xF1\"\", \\xA7\"\"\\xE3\"\"\\xA7\"\"\\xE2\"\"\\xA7\"\"\\xD6\"\"\\xA7\"\"\"\n  \"\\xD5\"\"\\xA7\"\"\\xE0\"\"\\xA7\"\"\\xDB\"\" \\xA7\"\"\\xA1\"\"\\xA7\"\"\\xD1\"\"\\xA7\"\"\\xE7\"\"\\xA7\"\"\"\n  \"\\xD6\"\"\\xA7\"\"\\xDF\"\"\\xA7\"\"\\xD1\"\", \\xA7\"\"\\xA2\"\"\\xA7\"\"\\xE0\"\"\\xA7\"\"\\xDF\"\"\\xA7\"\"\"\n  \"\\xDF\"\"\\xA7\"\"\\xD1\"\", \\xA7\"\"\\xAC\"\"\\xA7\"\"\\xD7\"\"\\xA7\"\"\\xDD\"\"\\xA7\"\"\\xEE\"\"\\xA7\"\"\"\n;\n\nconst char* kTeststr48 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/co_wikipedia_org_clean__ISO_2022_CN.txt\n  \"formatica - Ingenieria - Management - Farmacia - Robotica - Telecommunic\"\n  \"azione Vita quotidiana \\x1B\"\"$)A\\x0E\"\"((\\x0F\"\" distrazzione Automobile -\"\n  \" Bricolage - Cucina - Divertimentu - Giardinu - Ghjocu - Nutrizione - Sa\"\n  \"lute - Sessualit\\x0E\"\"($\\x0F\"\" - Sport - Televisione - Turisimu - Traspo\"\n  \"rtu Ricerca \\x0E\"\"((\\x0F\"\" navigazione Articuli di qualit\\x0E\"\"($\\x0F\"\" \"\n  \"- Indice alfabeticu - Indice tematicu - Pagine nuvelle - Radica di e cat\"\n  \"egurie Aiutate Wikipedia in lingua corsa! Par aiut\\x0E\"\"($\\x0F\"\" Wikiped\"\n  \"ia pudete: Scrive un articulu, o ancu s\\x0E\"\"((\\x0F\"\" voi truvete un sba\"\n  \"gliu, currighjitelu puru ! Scrivete in suttanacciu o in supranacciu, cum\"\n  \"e voi vulete: diversit\\x0E\"\"($\\x0F\"\" face ricchezza. Fate a sperienza: P\"\n  \"ruv\\x0E\"\"($\\x0F\"\" \\x0E\"\"($\\x0F\"\" scrive un articulu. Videte i cunsigli p\"\n  \"er scrive un articulu. U pi\\x0E\"\"(4\\x0F\"\" simplice per cuminci\\x0E\"\"($\\x0F\"\"\"\n  \" h\\x0E\"\"((\\x0F\"\" di cumplitt\\x0E\"\"($\\x0F\"\" un articulu. Videte l'articul\"\n  \"i da cumplitt\\x0E\"\"($\\x0F\"\". Si p\\x0E\"\"(0\\x0F\"\" din\\x0E\"\"(4\\x0F\"\" traduc\"\n  \"e un articulu, per esempiu da a wikipedia in sicilianu, talianu o france\"\n  \"se. Videte Articuli da traduce. Identific\\x0E\"\"($\\x0F\"\". S\\x0E\"\"((\\x0F\"\"\"\n  \" voi cunniscite u nomu di parechji pianti, fiori, arburi, o animali... c\"\n  \"hi mancanu, parmittar\\x0E\"\"($\\x0F\"\" dopu di cre\\x0E\"\"($\\x0F\"\" l'intrata \"\n  \"currispundenti. Ch\\x0E\"\"(,\\x0F\"\" sar\\x0E\"\"($\\x0F\"\" issu funzu, issu fior\"\n  \"i, issa pianta? Incaric\\x0E\"\"($\\x0F\"\" imagini o fot\\x0E\"\"(0\\x0F\"\". U meg\"\n  \"liu h\\x0E\"\"((\\x0F\"\" d'incaric\\x0E\"\"($\\x0F\"\" li annantu \\x0E\"\"($\\x0F\"\" Wi\"\n  \"kiCommons, parch\\x0E\"\"(,\\x0F\"\" pudarani serva dopu \\x0E\"\"($\\x0F\"\" tutti \"\n  \"i prugetti Wikipedia, \\x0E\"\"($\\x0F\"\" u Wikizziunariu,... T'avemu bisognu\"\n  \" d'una fot\\x0E\"\"(0\\x0F\"\" di tutti i paesi di Corsica (\\x0E\"\"((\\x0F\"\" din\"\n  \"\\x0E\"\"(0\\x0F\"\" di i pianti \\x0E\"\"((\\x0F\"\" di l'animali). Da leghja A ran\"\n  \"edda A Ranedda (o ranella) (Emys orbicularis) h\\x0E\"\"((\\x0F\"\" una cuppul\"\n  \"ata d'acqua d'Auropa. Si trova in i stagna, in i paduli, \\x0E\"\"((\\x0F\"\" \"\n  \"in i lava d'Auropa, d'Asia \\x0E\"\"((\\x0F\"\" di u Norduvestu di l'Africa. C\"\n  \"lassificazioni Esistini parechji 13 sottuspezii di ranedda, ch\\x0E\"\"(,\\x0F\"\"\"\n  \" s\\x0E\"\"(0\\x0F\"\" divisi in 5 gruppi: Emys orbicularis occidentalis Emys \"\n  \"orbicularis occidentalis (Fritz, 1994) Emys orbicularis hispanica (Fritz\"\n  \", Keller & Budde, 1996) Emys orbicularis fritzjuergenobsti (Fritz, 1993)\"\n  \" Emys orbicularis galloitalica Emys orbicularis galloitalica (Fritz, 199\"\n  \"5) Emys orbicularis lanzai (Fritz, 1995) Emys orbicularis capolongoi (Fr\"\n  \"itz, 1995) Emys orbicularis hellenica Emys orbicularis hellenica (Valenc\"\n  \"iennes, 1832) Emys orbicularis kurae (Fritz, 1994) Emys orbicularis orie\"\n  \"ntalis (Fritz\"\n;\n\nconst char* kTeststr53 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/oc_wikipedia_org_clean__MACINTOSH.txt\n  \"Sci\\x8E\"\"ncias exactas & naturalas Astronomia - Bioquimia - Biologia - B\"\n  \"otanica - Quimia - Criptologia - Matematicas - Medecina - Farmacia - Fis\"\n  \"ica - Zoologia Tecnologias Astronautica - Electricitat e Electronica - E\"\n  \"nergia - Industria - Informatica - Nanotecnologia - Robotica - Telecomun\"\n  \"icacions Mancam de fotografias per illustrar los articles. Pod\\x8F\"\"tz n\"\n  \"os ajudar, e nos senhalar d'imatges utils de melhorar. Proj\\x8F\"\"cte col\"\n  \"laboratiu de la setmana Lo subj\\x8F\"\"cte per aquesta setmana encara es p\"\n  \"as estat definit. Pod\\x8F\"\"tz crear lo penjador. Modificar O sabiatz ? P\"\n  \"ensatz, se o av\\x8F\"\"tz pas encara fach, de pla\\x8D\"\"ar los mod\\x8F\"\"ls \"\n  \"de Babel dins v\\x98\"\"stra pagina d'utilisator! Atal, v\\x98\"\"stres interl\"\n  \"ocutors eventuals saupr\\x88\"\"n quina lenga utilizar se vos v\\x98\"\"lon pa\"\n  \"rlar! Tanben, ser\\x88\"\" possible a un nov\\x8F\"\"l vengut de trobar de mon\"\n  \"de que parle sa lenga dins las categorias de locutors de las diferentas \"\n  \"lengas... Per aqu\\x98\"\", cal metre {{Babel-1}} se sab\\x8F\"\"tz pas qu'una\"\n  \" lenga, {{Babel-2}} se ne sab\\x8F\"\"tz doas...etc... seguit del(s) c\\x98\"\"\"\n  \"di(s) de la(s) lenga(s) e del niv\\x8F\"\"l qu'av\\x8F\"\"tz per l'(las)utiliz\"\n  \"ar (de 1 a 4 : del niv\\x8F\"\"l basic al niv\\x8F\"\"l exp\\x8F\"\"rt). Per exem\"\n  \"ple se v\\x98\"\"stra lenga mairala es l'occitan e que parlatz perfi\\x8F\"\"c\"\n  \"hament lo franc\\x8E\"\"s e pro corr\\x8F\"\"ctament lo catalan, metretz {{Bab\"\n  \"el-3|oc|fr 4|ca 3}}. Lo rendut dins v\\x98\"\"stra pagina de presentacion s\"\n  \"er\\x88\"\" aiceste: oc Aqueste utilisator parla occitan coma primi\\x8F\"\"ra\"\n  \" lenga. fr-4 Cet utilisateur parle fran\\x8D\"\"ais \\x88\"\" un niveau compar\"\n  \"able \\x88\"\" la langue maternelle . ca-3 Aquest usuari pot contribuir amb\"\n  \" un nivell avan\\x8D\"\"at de catal\\x88\"\". Per mai d'entre-senhas, veire: W\"\n  \"ikip\\x8F\"\"dia:Babel Archius | Modificar Actualitats e eveniments Efemeri\"\n  \"d del 12 d'octobre de 2006 12 d'octobre - Lo turc Orhan Pamuk es anoncia\"\n  \"t coma lo laurejat del Pr\\x8F\"\"mi Nobel de literatura del 2006 9 d'octob\"\n  \"re - La Cor\\x8F\"\"a del N\\x98\"\"rd an\\x97\"\"ncia qu'a efectuat un t\\x8F\"\"st\"\n  \" nuclear amb succ\\x8F\"\"s. 1 d'octobre, Brasil : Al primi\\x8F\"\"r torn de \"\n  \"l'eleccion presidenciala, Luiz In\\x87\"\"cio Lula da Silva, del Partit del\"\n  \"s Trabalhadors (PT) obten 48,6% dels sufragis, contra 41,6% de Geraldo A\"\n  \"lckmin, del Partit Social Democrata Brasilian (PSDB). A las eleccions re\"\n  \"gionalas, pel PT 4 governadors d'estat son elegits e pel PSDB 4 autres (\"\n  \"9 elegits d'autres partits). Lo segond torn presidencial, e tanben lo se\"\n  \"gond torn d'eleccion de governador en 10 estats, tendr\\x88\"\" lu\\x98\"\"c l\"\n  \"o 29 d'octobre. 29 de setembre, Brasil : gr\\x8F\"\"va collision d'un avion\"\n  \" Boeing 737-800 amb un jet executive mod\\x8F\"\"l Leg\"\n;\n\nconst char* kTeststr54 =\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/am_wikipedia_org_clean__UTF7.txt\n  \" +EsgS8A +EhgTSBJwEpsSzQ +EmYScw +EhgSOxMIEi0 +Eu0SfRILEgkTYg +EugScBIzE\"\n  \"nUTThLOEnUSlQ +EhgTABIYEi0S6w +EhgTIxMlE00 +EqgSpRKVEw0SChLdEpsSzQ +EsoS\"\n  \"qhNUEvUS6w +EmASGBJwEi0TEBId +EhsSRRIoEmU +Eu0SQBINEs4SdQ +Eu0SBhKTEg0TY\"\n  \"g +EqUTBRMN +EmUS2Q +EnUSLRMVEh0 +EhgTIxMlE04SfQ +EmISlhIpEpU +EggSoBIbE\"\n  \"i0SmxLN +EsoSqhNSEvIS6w +EhsS8BMN +EhgSDRKrEh0 +EhgSlRMIEvU +Eu0TIBItEws\"\n  \"SCRNi +EtsSLA +EhASGRI1E2M +EyUSRRIdEnU 2 +EkASlQ 1999 +EtMSGBJw +Eh0ShR\"\n  \"IoEnU +EpASzRNi +EugS2xIs +EkASlQ (+EqUSlRLw +EqASzRIuEzMSzRLrEpU +EqASR\"\n  \"hMjEyASLQ) 12 October, 2006 +EpASyRNi [+EggSGxI1EnASqxKoEg0] To download\"\n  \" an Amharic unicode font for correct display: Please see the font sectio\"\n  \"n for more information. [+EggSGxI1EnASqxKoEg0] +EmASrhIdE1ISzRJwEi0Szg +\"\n  \"EgsS7Q +EmASoBIbEi0Smw +EmASQBILEgk +EggSGxJAEpASYxJgEi0: +EggScBMoEhsSK\"\n  \"g +EhgSKBMD +EugSKBLzEnESlRNhEwgTPQ +EqUSYxKtEs4 +Eu0SGBIIEqgScQ! +EjUSC\"\n  \"A +Eh0SlQ +EggSGxLIEkU +Eu0TSBINEwk +EpASYBIt? +EgASIxJlEs4SlQ +EmAS2hIF\"\n  \" +EusSRRItEmETYg +EkASDRL2En0SlQ +EusSzRJDEgk? +EqUS2hIF +EgsS7Q +Eu0TKB\"\n  \"IdEik! +Eh0SLRMl +E0USERNOEn0 +EugTCRMNEg0 +EtMSLRIb \\\"+EwkTDRIN (Google\"\n  \") +EmA-1998 +EqU.+EqQ.+EqA. +EugTDRIIEjASZQ +EvUSLRMFEnU +EgYSlg +EpASzQ\"\n  \" +EugTABIYEigSzRNi +EugTCRMNEg0 +E00SCBML +EswSZRIzEu0SdRKV +EugSMBIrEs0\"\n  \" +EqUSkw +EugSGhLrEjUScBLzEvUSKBLN +Eu0SBBLN +EvUSLRMFEnU +EpASzRNi +Eug\"\n  \"TCRMNEg0 +EtMSCxIb +EugS0xIIEh0SlQ +EhgSKBMD +EggSGxIwEpMS8xJ1 +E2M +Egg\"\n  \"SGxJFEigSZRKT +EyASQxIa +EhsS9RIoEw0 +EpASzRNi +EtwSkw +EqUSKBNNEnU: +En\"\n  \"MSKhKt +EmAS2xIsEs0 +EqUSCBJ1 (October 12, 2006 +EqU.+EqQ.+EqA.): Wikipe\"\n  \"dia:+EnMSKhKrEso +EhsSNRJzEsgSOxLOEn0-/+EyUSRRIdEnU 2 +EhgS3RMIEmA +EtUS\"\n  \"zRJAEnU +EnUSHRIFEi0ScBNhEgISMxJlEpM +EqoSkBNhEyUSYBJlE2Y +EnUSHRIFEi0Sc\"\n  \"A +EgISMxJl - +EugS3RItEt0SLQ +EgISMxJl (+EqUSNRJzEnISNRJyEq0SNQ) - +Eug\"\n  \"SrhIdE1ISzRJwEi0TYRMlEpMSdQ - +EugSNhNNEnUSzBIt +EqASIBIrEi0 - +EugScBNI\"\n  \"EyUSLhNhEhUTDRMLEnU +EyUSkxJ1 (+E0oS2hKtEjU) - +EugSFRKVEzs +EyUSYBJl - \"\n  \"+EugSLRI7 +EnATDRJjEi0 - +EhgSABKVEvISNRKQEnU - +EhsTExMTEt0 - +Eh0TIxKU\"\n  \"E2ESABJlEnU - +EpUTDRL1 - +EhgTCBKTEps +EiUSkBNhE00TJRIoEnUSkw +EjMS7RKV\"\n  \"EjUTZg +EiUSkBNhE00TJRIoEnU - +EiUSkBNhEhUS7RLIEnU (+EmMS7hIOEwI) - +EnU\"\n  \"SHRIFEi0ScBNhEyQSkw - +EhUSrRIdEpM - +EugTJRKVEnATYRKVEyUSLQ +EyUSkxJ1 (\"\n  \"+EqwSGhI1EnUSKg) - +EiUSkBNhE0gSCBKt (+EqASNRJ1Ei4SlhIa) - +EugSGBIsEnU \"\n  \"+EyUSkxJ1 (+EwIS7hIOEwI) - +EhgSDRKtEtATYRIdEvUSLQ (+EwISzhMNEisTSg) - +\"\n  \"EnQSrRKWEs4SDhMC - +EugSMxLtEpUSNRKT +EugSGBKqEpMSzhJ9 +EnMSKhKt +EugShR\"\n  \"JlEigScBIgEmU +EyUSkxJ1EpM +E00SDRI1E00SkxNm +EugSMBLN +Eg0TBQ +EyUSkxJ1\"\n  \" - +EugSYxIVEg0 +EyUSkxJ1 (+EjYSMhLuEg4TAg) - +EnMSKhKt - +EugSSxKVEks +\"\n  \"EyUSkxJ1 - +EjUSyxIwEs0 - +EqASLRKsEuwSDhMC (+EiUSkBNhEkUSLRI1) - +EnUSH\"\n  \"RIFEi0SdQ - +E00SDRI1E00Skw - +EgMS7RIbEpYSdQ - +EugSJRKQE2ESDRJhEpM +En\"\n  \"USHRIFEi0SdQ - +EhUS3RJjEso +EwkS8xLuEn0 - +EugTVhIIEnISqw +EyUSkxJ1 - +\"\n  \"EhgSlRMNEiUSdQ - +EugSFRMN +EyUSZRJFEpM - +EugSZBJwEiASZRKT +EugSPRIbEn0\"\n  \" +EyUSkxJ2En0 - +EugSGBM7EhUTTRJ1 +EmQSdRKT +EugSGBIoEwM +EyUSkxJ1 +EmMS\"\n  \"FRINEpM +EiUSkA +EyUSYBJlE2Y +EqASlRL1Eh0Scw - +EqASYBIzEjASDQ - +Ey0TSB\"\n  \"Ir - +EhsTKxLIEns - +E0oSDRId - +EygSyxJzEs4SfQ - +EugTCBKQEnU +EqASIBIr\"\n  \"Ei0 - +EqUTAA +EyUSYBJl - +EwoS3A +EhsSMxIIE0oS6w - +EugSYBLTEgsSdQ +EkA\"\n  \"SlhJ9 - +EvUSKA +EwgTPQ +EhgSKBJl - +EiUSkA +Ez0SERNN - +EhkS2hJD - +Etg\"\n  \"TSBKV - +EjUS1RIN - +EqATSBNhEnMSKhKt\"\n;\n\n\n\n// NOTE: Unicode handled differently because of embedded NUL\n\n\nconst char kTeststr57[] =\n// This is UTF-16 little endian (note leading space)\n// Produced by stringify.cc on 2006-10-26 11:18 from file testfiles/new_wikipedia_org_clean__Unicode.txt\n  \" \\x00\"\"&\\t,\\tA\\t \\x00\"\"\\x14\"\"  \\x00\"\"5\\t?\\t\\x15\"\"\\t?\\t*\\t?\\t!\\t?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t>\\t\\t\\t(\\tM\\t!\\tG\"\n  \"\\t8\\t(\\t \\x00\"\"(\\t\\x02\"\"\\t \\x00\"\"9\\tK\\t8\\tM\\t\\x1F\"\"\\t \\x00\"\"/\\t>\\t(\\t>\\t\"\n  \" \\x00\"\"$\\t\\x17\"\"\\tA\\t \\x00\"\"&\\tA\\t|\\x00\"\" \\x00\"\"%\\tM\\t5\\t \\x00\"\"+\\t>\\t\\t\"\n  \"\\t(\\tM\\t!\\tG\\t8\\t(\\t \\x00\"\"\\x1B\"\"\\t\\x17\"\"\\tA\\t \\x00\"\"(\\t(\\t-\\x00\"\"*\\tM\\t\"\n  \"0\\tK\\t+\\t?\\t\\x1F\"\"\\t \\x00\"\"\\x17\"\"\\tA\\t%\\t?\\t \\x00\"\"\\x16\"\"\\t:\\x00\"\"|\\x00\"\"\"\n  \" \\x00\"\"%\\tM\\t5\\t \\x00\"\"\\x17\"\"\\tA\\t%\\t?\\t \\x00\"\"(\\t\\x02\"\"\\t \\x00\"\".\\tG\\t.\"\n  \"\\tG\\t\\x17\"\"\\tA\\t \\x00\"\"*\\t0\\t?\\t/\\tK\\t\\x1C\"\"\\t(\\t>\\t \\x00\"\"/\\t>\\t$\\t \\x00\"\"\"\n  \"(\\t\\x02\"\"\\t \\x00\"\"9\\tK\\t8\\tM\\t\\x1F\"\"\\t \\x00\"\"/\\t>\\t(\\t>\\t \\x00\"\"$\\t\\x17\"\"\"\n  \"\\tA\\t \\x00\"\"&\\tA\\t \\x00\"\":\\x00\"\" \\x00\"\"5\\t?\\t\\x15\"\"\\tM\\t8\\tM\\t(\\t0\\t@\\t\"\n;\n\nconst char kTeststr58[] =\n// This is UTF-16 big endian (note leading 00)\n  \"\\x00 \\x00<\\x00h\\x00t\\x00m\\x00l\\x00>\\x00\"\"f\\x00u\\x00\"\"b\\x00\"\"a\\x00r\"\n;\n\nconst char kTeststr59[] =\n// This is UTF-32 little endian (note leading space)\n  \" \\x00\\x00\\x00<\\x00\\x00\\x00h\\x00\\x00\\x00t\\x00\\x00\\x00m\\x00\\x00\\x00l\\x00\\x00\\x00\"\n  \">\\x00\\x00\\x00\"\"f\\x00\\x00\\x00u\\x00\\x00\\x00\"\"b\\x00\\x00\\x00\"\"a\\x00\\x00\\x00r\\x00\\x00\\x00\"\n;\n\nconst char kTeststr60[] =\n// This is UTF-32 big endian (note leading 00)\n  \"\\x00\\x00\\x00 \\x00\\x00\\x00<\\x00\\x00\\x00h\\x00\\x00\\x00t\\x00\\x00\\x00m\\x00\\x00\\x00l\"\n  \"\\x00\\x00\\x00>\\x00\\x00\\x00\"\"f\\x00\\x00\\x00u\\x00\\x00\\x00\"\"b\\x00\\x00\\x00\"\"a\\x00\\x00\\x00r\"\n;\n\nconst char kTeststr61[] =\n// This is binary pseudo-JPEG\n  \"\\xff\\xd8\\xff\\xe0\\x00\\x10JFIF foo bar baz\\xff\\xe1\\x00\\xa5\"\n  \"\\x01\\xd7\\xff\\x01\\x57\\x33\\x44\\x55\\x66\\x77\\xed\\xcb\\xa9\\x87\"\n  \"\\xff\\xd7\\xff\\xe0\\x00\\x10JFIF foo bar baz\\xff\\xe1\\x00\\xa5\"\n  \"\\x87\\x01\\xd7\\xff\\x01\\x57\\x33\\x44\\x55\\x66\\x77\\xed\\xcb\\xa9\"\n;\n\nconst char kTeststr62[] =\n// This is pseudo-HZ\n  \" ~{\\x54\\x42\\x31\\x7D\\x37\\x22\\x55\\x39\\x35\\x3D\\x3D\\x71~} abc\"\n;\n\nconst char kTeststr63[] =\n// This is pseudo-UTF8UTF8\n  \"Ice cream a l\\xc3\\x83\\xc2\\xa0 mode.\"\n;\n\n// This one is really JAGRAN, and \"www.amarujala.com\" matches JAGRAN\nconst char* kTestUrl52 = \"http://www.amarujala.com/today/default.asp\";\nconst char kTeststr52[] =\n// Produced by stringify.cc on 2007-04-10 12:07 from file amarujala_com.html\n  \"\\r<html>\\r<meta name='pregma' content='no-cache'>\\r<meta name='descripti\"\n  \"on' content= 'Amar Ujala online: Hindi news updates on business, politic\"\n  \"s, sports, fashion, hindi films, national and international news reports\"\n  \". News from northern India: Uttaranchal, UP, Punjab, Delhi, Haryana, Cha\"\n  \"ndigarh, Jammu and Kashmir, Himachal Pradesh'>\\r<meta name='keywords' co\"\n  \"ntent= 'hindi, news in hindi, hindi news, hindi newspaper, india, hindi \"\n  \"font, north india, regional news, India, Indian news, news from india, u\"\n  \"ttar\\r,indian newspapers, U.P., uttaranchal, uttar pradesh, Kashmir conf\"\n  \"lict, Pak, Pakistan, \\ramar ujala, amarujala, amar ujala online, India P\"\n  \"akistan news, bollywood, cricket, \\rbusiness, karobar, amar ujala karoba\"\n  \"r, India national news, Kashmir,\\rIndo-Pak, delhi, , fashion, movies, ci\"\n  \"nema, career, films, haryana,\\rchandigarh, Punjab, kashmir, jammu and  k\"\n  \"ashmir, \\rweather, election, india election, india pakistan news, \\relec\"\n  \"toral polls, free speech, astrology, horoscope, Congress, BJP, RSS, Jant\"\n  \"a Dal, union, legislative assembly, vidhan sabha, , MLA, Parliament, new\"\n  \" delhi, stocks, BSE Sensex, Sensex, NSE, stock market, arts, , cyber new\"\n  \"s, union budget, railway budget, himachal pradesh, hindi samachar, headl\"\n  \"ine news, breaking news, Hurriyat, Musharraf, almora, Almoda, haridwar, \"\n  \"dehra doon, dehra dun, dehradun, garhwal, gurdaspur, amritsar, hoshiyarp\"\n  \"ur\\r,kapurthala, jalandhar, firozpur, faridkot, moga, ludhiana, mohali, \"\n  \"gurgaon, faridabad, noida, NOIDA, ghaziabad, ambala, shimla'>\\r\\r<meta h\"\n  \"ttp-equiv='Content-Type' content='text/html; charset=iso-8859-1'>\\r\\r<he\"\n  \"ad>\\r<title>Amar Ujala - India's Leading Hindi Daily Newspaper</title>\\r\"\n  \"<style>\\ra {text-decoration :none}\\r</style>\\r<STYLE type=text/css>\\r<!-\"\n  \"- /* $WEFT -- Created by: Amarujala infotech on 05/12/01 --*/\\r@font-fac\"\n  \"e {\\rfont-family: au;\\rfont-style:  normal;\\rfont-weight: normal;\\rsrc: \"\n  \"url(../DBFNT0.eot);\\r}\\r-->\\r</STYLE>\\r<STYLE type=text/css>\\rTABLE.wind\"\n  \"ow{\\rBORDER-LEFT: #000000 1px solid;\\rBORDER-RIGHT: #000000 1px solid;\\r\"\n  \"BORDER-TOP: #000000 1px solid;\\rBORDER-BOTTOM: #000000 1px solid\\r}\\r</S\"\n  \"TYLE>\\r<script language='javascript'>\\rvar timeoutSecs = 20000\\rfunction\"\n  \" clearDiv()\\r{\\rpopwin.style.visibility=\\\"hidden\\\";\\r}\\rfunction setClea\"\n  \"rTimeout()\\r{\\rsetTimeout('clearDiv()',timeoutSecs);\\r}\\r<!--\\rfunction \"\n  \"sel()\\r{\\ri=document.amar.day.selectedIndex;\\rdd=document.amar.day(i).va\"\n  \"lue;\\rif (i==0)\\r{\\ralert('Please select a day');\\rreturn(0);\\r}\\ri=docu\"\n  \"ment.amar.month.selectedIndex;\\rmm=document.amar.month(i).value;\\ryy=doc\"\n  \"ument.amar.year.value;\\rif (yy == '2007'){\\rif (mm < '04')\\r{\\rlocation.\"\n  \"href = \\\"../archive/archive.asp?dd=\\\"+dd+\\\"&mm=\\\"+mm+\\\"&yy=\\\"+yy+\\\"\\\"\\rr\"\n  \"eturn(0);\\r}\\relse {\\rv='../'+dd+mm+yy+'/default.asp';\\rsdate=dd + '/' +\"\n  \" mm + '/' + yy;\\rcdate=\\\"10/04/2007\\\";\\rif (sdate==cdate)\\r{\\rv='../toda\"\n  \"y/default.asp';\\r}\\rwindow.open(v);\\r} }\\relse {\\ri=document.amar.day.se\"\n  \"lectedIndex;\\rdd=document.amar.day(i).value;\\ri=document.amar.month.sele\"\n  \"ctedIndex;\\rmm=document.amar.month(i).value;\\ryy=document.amar.year.valu\"\n  \"e;\\rlocation.href = \\\"../archive/archive.asp?dd=\\\"+dd+\\\"&mm=\\\"+mm+\\\"&yy=\"\n  \"\\\"+yy+\\\"\\\"\\rreturn(0);\\r}}\\r-->\\r</script>\\r<style>\\ra {text-decoration:\"\n  \"none}\\r</style>\\r</head>\\r<body bgcolor='#FFFFFF' leftmargin='0' topmarg\"\n  \"in='0' marginwidth='0' marginheight='0'>\\r<table width='100%' border='0'\"\n  \" cellspacing='0' cellpadding='0'>\\r<tr  align='left' valign='top'>\\r<td>\"\n  \"\\r<table width='760' border='0' cellspacing='0' cellpadding='0'>\\r<tr>\\r\"\n  \"<td width='100%' align='center'>\\r<table width='100%' border='0' cellspa\"\n  \"cing='0' cellpadding='3'>\\r<tr>\\r<td align=\\\"left\\\" width='25%'>\\r<font \"\n  \"face=\\\"au\\\" size=\\\"4\\\" color=\\\"blue\\\">\\r\\xDF\"\"\\xF0\"\"S\\xC5\"\"U\\xA7\"\"\\xA2\"\"\"\n  \"\\xC7\"\"U\\xE8\"\"\\xC1\"\"-87/3(14\\xA5\"\"\\xE6\"\"\\xF0\"\"\\xDF\"\"\\xDA\"\"U)UU<br>\\r\\n\\xDC\"\"\"\n  \"\\xE6\"\"\\xDA\"\"U\\xE6\"\"-10,\\xE2\"\"\\xDA\"\"U\\xDF\"\"\\xD9\"\"-8<br>\\r\\n\\xC1\"\"\\xE8\"\"\\xCC\"\"\"\n  \" \\xB7\"\"\\xA4\"\"\\xE6\"\" \\xDC\"\"\\xFF\"\"\\xD8\"\"-357\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\"\n  \"\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\n\\n\\r\"\n  \"\\n\\r\\n\\r\\n\\r\\n\\r\\n\\n\\r\\n\\n</font>\\r</td>\\r<td align=\\\"center\\\" width='50\"\n  \"%'><img src='' id=\\\"logo\\\" alt=\\\"Downloading\\\"><br><font face = 'au' siz\"\n  \"e = '4'>\\xD7\"\"\\xA2\"\"\\xBB\"\"\\xDC\"\"\\xDF\"\"\\xE6\"\"\\xDA\"\"</font>,&nbsp;<font fa\"\n  \"ce='verdana' size='2'>10</font>&nbsp;<font face = 'au' size = '4'>\\xA5\"\"\"\n  \"\\xC2\"\"\\xFD\"\"\\xF1\"\"\\xDC\"\"</font>&nbsp;<font face='verdana' size='2'>2007<\"\n  \"/font></td>\\r<td align=\\\"right\\\" width='25%'>\\r<a href='../Worldcup07/de\"\n  \"fault.asp' target=\\\"_new\\\"><img border='0' id=\\\"topright\\\" alt=\\\"Downloa\"\n  \"ding\\\" style=\\\"border: 1 solid #000000\\\"></a>\\r</td>\\r</tr>\\r</table>\\r<\"\n  \"/td>\\r</tr>\\r</table>\\r</td>\\r</tr>\\r</table>\\r<script language='javascr\"\n  \"ipt'>\\r</script>\\r<table border = '0' cellspacing = '0' cellpadding = '0\"\n  \"' width='760'>\\r<tr align='left'>\\r<td width = '100' valign='top' align=\"\n  \"'left'>\\r<b><font face='AU' color='#2C4FA0' size='4'>&nbsp;&nbsp;\\xCC\"\"\\xE6\"\"\"\n  \"\\xC1\"\"\\xE6\"\" \\xE2\"\"\\xD7\"\"\\xE6\"\"\\xBF\"\"\\xE6\"\"\\xDA\"\"</font></b>\\r</td>\\r<td\"\n  \" width='550'>\\r<SCRIPT language=JavaScript1.2 src='newticker1.js'></SCRI\"\n  \"PT><br>\\r</td>\\r<td width = '100' align='right' valign='top'>\\r<a href=\\\"\"\n  \"../aufont/aufont.asp\\\" target=\\\"new\\\"><img border='0' src='../images/fon\"\n  \"t.gif' border = '0'></a>\\r</td>\\r</tr>\\r</table>\\r<table width='760' bor\"\n  \"der='0' cellspacing='1' cellpadding='0' >\\r<tr align='left'>\\r<td>&nbsp;\"\n  \"</td>\\r<td>&nbsp;</td>\\r</tr>\\r</table>\\r<table width='760' border='0' c\"\n  \"ellspacing='0' cellpadding='0'>\\r<tr align='left'>\\r<td width='24%' bgco\"\n  \"lor='#DE000D'></td>\\r<td width='1%'><img src='../images/spacer.gif' heig\"\n  \"ht='3'></td>\\r<td width='50%' bgcolor='#000086'></td>\\r<td width='1%'></\"\n  \"td>\\r<td width='24%' bgcolor='#FEAD00'></td>\\r<tr>\\r<table>\\r<div align=\"\n  \"'left'>\\r<table border='0' width='760' cellspacing='0' cellpadding='0'>\\r\"\n  \"<tr align='left'>\\r<td align='left' width='130' bgcolor='#E5ECFD' valign\"\n  \" = 'top'>\\r<table border = '0' cellpadding = 0 cellspacing = 0>\\r<tr><td\"\n  \" width = '130' bgcolor = '#2C4FA0' align = 'center'><font face='au' colo\"\n  \"r='#ffffff' size='3'>\\xD7\"\"\\xE9\"\"\\x81\"\"\\xD8\"\" \\xBF\"\"\\xF1\"\"\\xD9\"\"\\xDC\"\"</\"\n  \"font></td></tr>\\r<tr align='center'>\\r<td width='123' valign = 'top'>\\r\\r\"\n  \"<table border='0' cellspacing='0' cellpadding='0' width='100%'>\\r<tr>\\r<\"\n  \"td height='5'></td>\\r</tr>\\r<tr>\\r<tr align='center'>\\r<td >\\r<table bor\"\n  \"der='0' cellspacing='0' cellpadding='0' width='100%'>\\r<tr>\\r<td height=\"\n  \"'1'></td>\\r</tr>\\r<tr>\\r<td width='15%'>&nbsp;&nbsp;<a href='../NRISpeci\"\n  \"al/default.asp' target='new'><font face='arial' size='2' color='black'>N\"\n  \"RI Special</a></font></td>\\r</tr>\\r<tr>\\r<td height='1'></td>\\r</tr>\\r<t\"\n  \"r>\\r<td width='15%'>&nbsp;&nbsp;<a href='../Cinema/default.asp' target='\"\n  \"new'><font face='au' size='4' color='black'>\\xE7\"\"\\xE2\"\"\\xD9\"\"\\xF0\"\"\\xD7\"\"\"\n  \"\\xE6\"\"</a></font></td>\\r</tr>\\r<tr>\\r<td height='1'></td>\\r</tr>\\r<tr>\\r\"\n  \"<td width='15%'>&nbsp;&nbsp;<a href='../Hotspot/default.asp' target='new\"\n  \"'><font face='au' size='4' color='black'>\\xE3\"\"\\xE6\"\"\\xF2\"\"\\xC5\"\" S\\xC2\"\"\"\n  \"\\xE6\"\"\\xF2\"\"\\xC5\"\" </a></font></td>\\r</tr>\\r<tr>\\r<td height='1'></td>\\r\"\n  \"</tr>\\r<tr>\\r<td width='15%'>&nbsp;&nbsp;<a href='../newcareer/default.a\"\n  \"sp' target='new'><font face='au' size='4' color='black'>\\xB7\"\"\\xF1\"\"\\xE7\"\"\"\n  \"\\xDA\"\"\\xD8\"\"\\xDA\"\"</a></font></td>\\r</tr>\\r<tr>\\r<td height='1'></td>\\r<\"\n  \"/tr>\\r<tr>\\r<td width='15%'>&nbsp;&nbsp;<a href='../Dharam/default.asp' \"\n  \"target='new'><font face='au' size='4' color='black'>\\xCF\"\"\\xD7\"\"\\xFC\"\"-\\xB7\"\"\"\n  \"\\xA4\"\"\\xD7\"\"\\xFC\"\"</a></font></td>\\r</tr>\\r<tr>\\r<td height='1'></td>\\r<\"\n  \"/tr>\\r<tr>\\r<td width='15%'>&nbsp;&nbsp;<a href='../Tourism/default.asp'\"\n  \" target='new'><font face='au' size='4' color='black'>\\xE2\"\"\\xF1\"\"\\xDA\"\" \"\n  \"\\xE2\"\"\\xC2\"\"\\xE6\"\"\\xC5\"\"\\xE6\"\"</a></font></td>\\r</tr>\\r<tr>\\r<td height=\"\n  \"'1'></td>\\r</tr>\\r<tr>\\r<td width='15%'>&nbsp;&nbsp;<a href='../Greeting\"\n  \"/default.asp' target='new'><font face='au' size='4' color='black'>\\xBB\"\"\"\n  \"\\xFD\"\"\\xE8\"\"\\xE7\"\"\\xC5\"\"\\xA2\"\"\\x82\"\"\\xE2\"\"</a></font></td>\\r</tr>\\r<tr>\\r\"\n  \"<td height='1'></td>\\r</tr>\\r<tr>\\r<td width='15%'>&nbsp;&nbsp;<a href='\"\n  \"../Ghar/default.asp' target='new'><font face='au' size='4' color='black'\"\n  \">\\x83\"\"\\xE6\"\"\\xDA\"\"-\\xC2\"\"\\xE7\"\"\\xDA\"\"\\xDF\"\"\\xE6\"\"\\xDA\"\"</a></font></td>\"\n  \"\\r</tr>\\r<tr>\\r<td height='1'></td>\\r</tr>\\r<tr>\\r<td width='15%'>&nbsp;\"\n  \"&nbsp;<a href='../Result/default.asp' target='new'><font face='au' size=\"\n  \"'4' color='black'>\\xE7\"\"\\xDA\"\"\\xC1\"\"\\xCB\"\"\\xC5\"\"</a></font></td>\\r</tr>\\r\"\n  \"<tr>\\r<td height='1'></td>\\r</tr>\\r</table>\\r</td></tr>\\r</table>\\r</td>\"\n  \"</tr>\\r</table>\\r</td>\\r<td Valign='top' align = 'center'>\\r<table width\"\n  \" = '98%' border = '0' cellpadding = '0'>\\r<tr><td width = '62%' valign =\"\n  \" 'top'>\\r<table width = '98%' border = '0' cellpadding = '0'>\\r<tr><td v\"\n  \"align='top' align='left' width='50' rowspan='2'>\\r<img border='0' src='s\"\n  \"sc.jpg' width='50' height='60'>\\r</td>\\r<td valign='top' align='left' wi\"\n  \"dth='9'>\\r<img border='0' src='../images/homepagenew/arrow.gif' width='8\"\n  \"' height='7' align='middle'>&nbsp;\\r</td><td valign='top' align='left' w\"\n  \"idth='413'>\\r<font face='AU' size='4'>\\r<p align='justify'><a href =home\"\n  \"news.asp?home=10am2.asp>\\xE2\"\"\\xE8\"\"\\xE7\"\"\\xDC\"\"\\xA2\"\"\\xBB\"\" \\xD7\"\"\\xF0\"\"\"\n  \"\\xB4\"\" \\xE7\"\"\\xC9\"\"\\xDC\"\"\\xE6\"\"\\xA7\"\"\\xFC\"\" \\xE2\"\"\\xF0\"\" \\xB7\"\"\\xE6\"\"\\xF0\"\"\"\n  \"\\xC5\"\"\\xFC\"\" \\xD9\"\"\\xE6\"\"\\xDA\"\"\\xE6\"\"\\xC1\"\"</a>\\r</td></tr>\\r<tr>\\r<td v\"\n  \"align='top' align='left' width='9'>&nbsp;</td>\\r<td valign='top' align='\"\n  \"left'><p align = 'justify'>\\r<font face='Wingdings' color='#C60000'>\\xA7\"\"\"\n  \"</font>&nbsp;<font face='au' size='4'>\\xE7\"\"\\xD9\"\"\\xCE\"\"\\xF0\"\"\\xFC\"\"\\xE0\"\"\"\n  \"\\xE6\"\"\\xE6\"\"\\xF0\"\"\\xB4\"\" \\xB7\"\"\\xE6\"\" \\xC2\"\"\\xE6\"\"\\xDC\"\"\\xD9\"\" \\xD9\"\" \\xB7\"\"\"\n  \"\\xDA\"\"\\xD9\"\"\\xF0\"\" \\xC2\"\"\\xDA\"\" \\xB0\"\"\\xF0\"\"\\xCC\"\"\\xDA\"\"\\xE6\"\"\\xC1\"\"</fo\"\n  \"nt><br>\\r<font face='Wingdings' color='#C60000'>\\xA7\"\"</font>&nbsp;<font\"\n  \" face='au' size='4'>\\xE7\"\"\\xCE\"\"\\xCB\"\"\\xDC\"\"\\xE8\"\" \\xB7\"\"\\xF0\"\" \\xC2\"\"\\xE9\"\"\"\n  \"\\xE7\"\"\\xDC\"\"\\xE2\"\" \\xB7\"\"\\xE7\"\"\\xD7\"\"\\xE0\"\"\\xD9\"\"\\xDA\"\" \\xCC\"\"\\xDC\"\"\\xD5\"\"\"\n  \"</font><br>\\r</font></p></td>\\r</tr>\\r<tr>\\r<td valign='top' align='left\"\n  \"' width='98%' colspan='3' background='../images/homepagenew/line.jpg'> <\"\n  \"/td>\\r</tr>\\r</table>\\r<table width = '98%' border = '0' cellpadding = '\"\n  \"0'>\\r<tr><td valign='top' align='left' width='50' rowspan='2'>\\r<img bor\"\n  \"der='0' src='mah.jpg' width='50' height='60'>\\r</td>\\r<td valign='top' a\"\n  \"lign='left' width='9'>\\r<img border='0' src='../images/homepagenew/arrow\"\n  \".gif' width='8' height='7' align='middle'>&nbsp;\\r</td><td valign='top' \"\n  \"align='left' width='413'>\\r<font face='AU' size='4'>\\r<p align='justify'\"\n  \"><a href =homenews.asp?home=10rm1.asp>\\xA5\"\"\\xA2\"\"\\xD5\"\"\\xF0\"\"\\xC7\"\"\\xB7\"\"\"\n  \"\\xDA\"\" \\xB7\"\"\\xE8\"\" \\xD7\"\"\\xEA\"\"\\xE7\"\"\\xCC\"\"\\xFC\"\" \\xE2\"\"\\xF0\"\" \\xC0\"\"\\xF0\"\"\"\n  \"\\xC7\"\"\\xB8\"\"\\xC0\"\"\\xE6\"\"\\xC7\"\"\\xB8\"\"</a>\\r</td></tr>\\r<tr>\\r<td valign='\"\n  \"top' align='left' width='9'>&nbsp;</td>\\r<td valign='top' align='left'><\"\n  \"p align = 'justify'>\\r<font face='Wingdings' color='#C60000'>\\xA7\"\"</fon\"\n  \"t>&nbsp;<font face='au' size='4'>\\xD7\"\"\\xE3\"\"\\xE6\"\"\\xDA\"\"\\xE6\"\"C\\xFE\"\" \\xB7\"\"\"\n  \"\\xF0\"\" \\xC1\"\"\\xE6\"\"\\xDC\"\"\\xD9\"\"\\xE6\"\" \\xB7\"\"\\xE6\"\" \\xD7\"\"\\xE6\"\"\\xD7\"\"\\xDC\"\"\"\n  \"\\xE6\"\"</font><br>\\r<font face='Wingdings' color='#C60000'>\\xA7\"\"</font>&\"\n  \"nbsp;<font face='au' size='4'>\\xA9\"\"\\xC2\"\"\\xBC\"\"\\xFD\"\"\\xDF\"\" \\xB7\"\"\\xF0\"\"\"\n  \" \\xD5\"\"\\xE6\"\"\\xCE\"\" \\xDC\"\"\\xBB\"\"\\xE6\"\" \\xB7\"\"\\x8D\"\"\\xD8\"\"\\xEA\"\"\\xFC\"\"</f\"\n  \"ont><br>\\r</font></p></td>\\r</tr>\\r<tr>\\r<td valign='top' align='left' w\"\n  \"idth='98%' colspan='3' background='../images/homepagenew/line.jpg'> </td\"\n  \">\\r</tr>\\r</table>\\r<table width = '99%' border = '1' cellpadding = '0' \"\n  \" cellspacing = '0' bgcolor='#FFFFFF' bordercolor='#BBDAFD'><tr><td>\\r<ta\"\n  \"ble width = '100%' border = '0' cellpadding = '1' >\\r<tr><td valign='top\"\n  \"' align='left' width='51' rowspan='2'>\\r<a href='../Vishesh/default.asp'\"\n  \" target=\\\"new\\\"><img border='0' src='10vish.jpg' width='50' height='60'>\"\n  \"</a></td>\\r<td valign='top' align='left' width='1'></td>\\r<td valign='to\"\n  \"p' bgcolor='#E7EEFC' width='208'><a href =homenews.asp?home=10homt2k.asp\"\n  \"><font color='#C60000' size='4' face='AU'>\\xE7\"\"\\xC2\"\"\\xCC\"\"\\xE6\"\" \\xD5\"\"\"\n  \"\\xD9\"\"\\xD9\"\"\\xF0\"\" \\xB7\"\"\\xE8\"\" \\xFF\"\"\\xE6\"\"\\xD7\"\"\\xCC\"\"\\xE6\"\" \\xB9\"\"\\xE6\"\"\"\n  \"\\xF0\"\" \\xDA\"\"\\xE3\"\"\\xF0\"\" \\xC2\"\"\\xE9\"\"L\\xE1\"\"</font></a>\\r</td>\\r<td val\"\n  \"ign='top' align='center' bgcolor='#2C4FA0' width='8' rowspan='2'><a href\"\n  \"=\\\"../Vishesh/Default.asp\\\" target=\\\"new\\\"><img  src='../images/homepage\"\n  \"new/visheshtd.gif' width='17' height='60' border='0'></a>\\r</td></tr>\\r<\"\n  \"tr>\\r<td valign='top' align='left'></td>\\r<td valign='top' align='left' \"\n  \"width='208'><p align = 'justify'><font face='au' size='4'>\\xC1\"\"\\xE8\"\"\\xDF\"\"\"\n  \"\\xD9\"\" \\xE0\"\"\\xE6\"\"\\xF1\"\"\\xDC\"\"\\xE8\"\" \\xD7\"\"\\xF0\"\"\\xB4\"\" \\xE7\"\"\\xCE\"\"\\xD9\"\"\"\n  \"\\xE6\"\"\\xF0\"\"\\xB4\"\"\\xE7\"\"\\xCE\"\"\\xD9\"\" \\xE3\"\"\\xE6\"\"\\xF0\"\" \\xDA\"\"\\xE3\"\"\\xF0\"\"\"\n  \" \\xD5\"\"\\xCE\"\"\\xDC\"\"\\xE6\"\"\\xDF\"\" \\xB7\"\"\\xE8\"\" \\xDF\"\"\\xC1\"\"\\xE3\"\" \\xE2\"\"\\xF0\"\"\"\n  \" \\xC2\"\"\\xE9\"\"L\\xE1\"\"\\xE6\"\"\\xF0\"\"\\xB4\"\" ...</font></P></td>\\r</tr>\\r</tab\"\n  \"le>\\r</td></tr></table>\\r<table width = '98%' border = '0' cellpadding =\"\n  \" '0'>\\r<tr>\\r<td valign='top' align='left' width='98%' colspan='3'> </td\"\n  \">\\r</tr>\\r</table>\\r</td>\\r<td width = '1%' style='border-left: 1 double\"\n  \" #808080' valign='top' align='right'>&nbsp;</td>\\r<td width = '37%' alig\"\n  \"n = 'left' valign = 'top'>\\r<div align='left'>\\r<table border = '0' cell\"\n  \"padding = '1' cellspacing='0' width = '98%'>\\r<tr><td align='left' width\"\n  \"='9'>\\r<img border='0' src='../images/homepagenew/arrow.gif' width='8' h\"\n  \"eight='7' align='middle'>\\r</td><td valign='top'>\\r<table cellSpacing='0\"\n  \"' cellPadding='1' width='99%' border='0'>\\r<tr>\\r<td vAlign='top' width=\"\n  \"'518' colSpan='4'>\\r<p align='justify'><a href =homenews.asp?home=10rm5.\"\n  \"asp><font face='au' size='4'>\\xC1\"\"\\xF0\"\"\\xC5\"\" \\xD9\"\"\\xF0\"\" \\xB0\"\"\\xD8\"\"\"\n  \"\\xDA\"\" \\xE2\"\"\\xE3\"\"\\xE6\"\"\\xDA\"\"\\xE6\"\" \\xB7\"\"\\xE6\"\"\\xF0\"\"\\xB9\"\"\\xDA\"\"\\xE8\"\"\"\n  \"\\xCE\"\"\\xE6\"\"</font></a></p>\\r</td>\\r</tr>\\r</table>\\r</td></tr>\\r<tr>\\r<\"\n  \"td>\\r</td><td valign='top'>\\r<font face='Wingdings' color='#C60000'>\\xA7\"\"\"\n  \"</font>&nbsp;<font face='AU' size='4'>\\xE2\"\"\\xE6\"\"\\xF1\"\"\\xCE\"\"\\xE6\"\" 180\"\n  \"0 \\xB7\"\"\\xDA\"\"\\xE6\"\"\\xF0\"\"\\xC7\"\"\\xB8\"\" L\\xC2\"\"\\xB0\"\" \\xD7\"\"\\xF0\"\"\\xB4\"\"<\"\n  \"/font><br>\\r<font face='Wingdings' color='#C60000'>\\xA7\"\"</font>&nbsp;<f\"\n  \"ont face='AU' size='4'>\\xA5\"\"\\x8B\"\"\\xD8\"\" \\xE0\"\"\\xE6\"\"\\xCC\"\"\\xE6\"\"\\xF0\"\"\"\n  \"Z \\xB7\"\"\\xE6\"\" \\xB9\"\"\\xE9\"\"\\xDC\"\"\\xE6\"\"\\xE2\"\"\\xE6\"\" \\xD9\"\"\\xE3\"\"\\xE8\"\"\\xB4\"\"\"\n  \"</font><br>\\r</td>\\r</tr>\\r<tr>\\r<td valign='top' align='left' width='98\"\n  \"%' colspan='3' background='../images/homepagenew/line.jpg'> </td>\\r</tr>\"\n  \"\\r<tr>\\r<td colspan='2' valign='top' align='left' height='5'>\\r</td>\\r</\"\n  \"tr>\\r<tr>\\r<td>\\r<img border='0' src='../images/homepagenew/arrow.gif' w\"\n  \"idth='8' height='7' align='middle'>\\r</td><td valign='top'>\\r<a href =ho\"\n  \"menews.asp?home=10am4.asp><font face='au' size='4'>\\xB7\"\"\\xF0\"\"\\xB7\"\" \\xC2\"\"\"\n  \"\\xDA\"\" \\xD2\"\"\\xE7\"\"\\xCC\"\"\\xDA\"\"\\xA2\"\"\\xBB\"\"\\xE6\"\"\\xD3\"\" \\xB7\"\"\\xE6\"\"\\xC5\"\"\"\n  \"\\xE6\"\"</font></a>\\r</td>\\r</tr>\\r<tr>\\r<td>\\r</td><td valign='top'>\\r<fo\"\n  \"nt face='Wingdings' color='#C60000'>\\xA7\"\"</font>&nbsp;<font face='au' s\"\n  \"ize='4'>\\xCC\"\"\\xF0\"\"\\xB4\"\"\\xCE\"\"\\xE9\"\"\\xDC\"\"\\xB7\"\"\\xA4\"\"\\xDA\"\"U \\xC2\"\"\\xDA\"\"\"\n  \"U \\xA5\"\"\\xE6\"\"\\xDA\"\"\\xE6\"\"\\xF0\"\"\\xC2\"\"</font><br>\\r<font face='Wingdings\"\n  \"' color='#C60000'>\\xA7\"\"</font>&nbsp;<font face='au' size='4'>\\xE2\"\"\\xDA\"\"\"\n  \"U\\xB7\"\"\\xA4\"\"\\xE6\"\"\\xDA\"\"U \\xB7\"\"\\xA4\"\"\\xDA\"\"U\\xE6\"\"\\xB0\"\"\\xBB\"\"\\xE8\"\" \\xC1\"\"\"\n  \"\\xE6\"\"\\xA2\"\"\\xBF\"\"</font><br>\\r</td>\\r</tr>\\r</tr>\\r<tr>\\r<td valign='to\"\n  \"p' align='left' width='98%' colspan='3' background='../images/homepagene\"\n  \"w/line.jpg'> </td>\\r</tr>\\r<tr>\\r<td colspan='2' valign='top' align='lef\"\n  \"t' height='4'>\\r</td>\\r</tr>\\r<tr>\\r<td>\\r<img border='0' src='../images\"\n  \"/homepagenew/arrow.gif' width='8' height='7' align='middle'>\\r</td><td>\\r\"\n  \"<a href =homenews.asp?home=10am9.asp><font face='au' color='blue' size='\"\n  \"4'>\\xA5\"\"\\xE6\"\"\\xC6\"\" \\xA9\"\"\\xCB\"\"\\xC8\"\"\\xE6\"\" \\xA5\"\"\\xE6\"\"\\xCC\"\"\\xA2\"\"\\xB7\"\"\"\n  \"\\xE8\"\" \\xC9\"\"\\xF0\"\"\\xDA\"\"</font></a>\\r</td>\\r</tr>\\r<tr>\\r<td>\\r</td><td\"\n  \">\\r<font face='Wingdings' color='#C60000'>\\xA7\"\"</font>&nbsp;<font face=\"\n  \"'au' size='4'>\\xA5\"\"L\\x87\"\"\\xE6\"\"\\xE6\"\"\\xBF\"\"\\xDC\"\" \\xC2\"\"\\xFD\"\"\\xCE\"\"\\xF0\"\"\"\n  \"\\xE0\"\"\\xE6\"\" \\xB7\"\"\\xE8\"\" \\x83\"\"\\xE6\"\"\\xC5\"\"\\xD9\"\"\\xE6\"\"</font><br>\\r<fo\"\n  \"nt face='Wingdings' color='#C60000'>\\xA7\"\"</font>&nbsp;<font face='au' s\"\n  \"ize='4'>\\xCE\"\"\\xE6\"\"\\xF0\"\" \\xD7\"\"\\xE7\"\"\\xE3\"\"\\xDC\"\"\\xE6\"\" \\xA5\"\"\\xE6\"\"\\xCC\"\"\"\n  \"\\xA2\"\"\\xB7\"\"\\xE8\"\" \\xE0\"\"\\xE6\"\"\\xE6\"\"\\xE7\"\"\\xD7\"\"\\xDC\"\"</font><br>\\r</td\"\n  \">\\r</tr>\\r<tr>\\r<td colspan='2' height='3'>\\r</td>\\r</tr>\\r</table>\\r</d\"\n  \"iv>\\r</table>\\r</td>\\r<td align='left' width='130' valign = 'top'>\\r<tab\"\n  \"le border = 0 cellpadding = 0 cellspacing = 1>\\r<tr><td width = 130 bgco\"\n  \"lor = '#2C4FA0' align = center><a href=\\\"../news_gallery/default.asp\\\" t\"\n  \"arget=\\\"new\\\"><font face='AU' color='#ffffff' size='3'>\\xE7\"\"\\xBF\"\"\\x98\"\"\"\n  \"\\xE6\"\" \\xCE\"\"\\xE8\"\"\\x83\"\"\\xE6\"\"\\xE6\"\"\\xFC\"\"</font></a></td></tr>\\r<tr>\\r\"\n  \"<td width='123' valign = 'top' >\\r<!--for caption-->\\r<a href=# onclick=\"\n  \"\\\"javascript:window.open('phome.asp','win2','top=50,left=250,width=370,h\"\n  \"eight=460,scrollbars=yes');\\\"><img border=0 src='' id=\\\"phome\\\" width='1\"\n  \"27' height='145'></a><br>\\r<div align='justify'><font face='au' color='#\"\n  \"cb2828'>\\xE2\"\"\\xE6\"\"\\xF1\"\"\\xB4\"\"\\xCE\"\"\\xD8\"\"\\xFC\"\"\\xD0\"\" \\xD7\"\"\\xE9\"\"\\xA2\"\"\"\n  \"\\xD5\"\"\\xA7\"\"\\xFC\"\" \\xD7\"\"\\xF0\"\"\\xB4\"\" \\xC2\"\"\\xFD\"\"\\xF0\"\"\\xE2\"\" \\xB7\"\"\\xE6\"\"\"\n  \"\\xA2\"\"\\xC8\"\"\\xFD\"\"\\xF0\"\"\\xE2\"\" \\xB7\"\"\\xF0\"\" ...</font>&nbsp;<a href=\\\"#\\\"\"\n  \" onclick=\\\"javascript:window.open('phome.asp','win2','top=50,left=250,wi\"\n  \"dth=370,height=460,scrollbars=yes');\\\"><font face='Wingdings' color='#cb\"\n  \"2828'>\\xF0\"\"</font></a></div>\\r</td></tr>\\r</table>\\r</td>\\r</tr>\\r</tab\"\n  \"le>\\r<table width='760' border='0' cellspacing='0' cellpadding='0'>\\r<tr\"\n  \" align='left'>\\r<td width='130' valign='top' rowspan='2' bgcolor='#F6F6F\"\n  \"7'>\\r<table width='100%' border='0' cellspacing='0' cellpadding='0' >\\r<\"\n  \"tr><td height='1'></td></tr>\\r<tr><td> \\r<table width='100%' border='0' \"\n  \"cellspacing='1' cellpadding='1' bgcolor = '#2C4FA0'>\\r<tr>\\r<td bgcolor=\"\n  \"'#6807D5' align='center' ><a href=\\\"edit.asp\\\"><font face='AU' size='3' \"\n  \"color='#FFFFFF'>\\xE2\"\"\\xA2\"\"\\xC2\"\"\\xE6\"\"\\xCE\"\"\\xB7\"\"\\xE8\"\"\\xD8\"\"</font><\"\n  \"/a></td>\\r</tr>\\r<tr>\\r<td bgcolor='#F3F3F4' align='right' height='0'></\"\n  \"td>\\r</tr>\\r<tr>\\r<td bgcolor='#E4E5FF' valign='top'>\\r<table width='100\"\n  \"%' border='0' cellspacing='0' cellpadding='0' height='160'>\\r<tr>\\r<td w\"\n  \"idth='1%' valign='top' >\\r&nbsp;<img src='../images/arrow.gif'>&nbsp;</t\"\n  \"d><td  width='99%' >\\r<a href=\\\"editnews.asp?edit=9c3.asp\\\"><font face='\"\n  \"AU' size='3' color='#000000'>\\xC5\"\"\\xB7\"\"\\xDA\"\"\\xE6\"\"\\xDF\"\" \\xE2\"\"\\xF0\"\"\"\n  \" \\xD5\"\"\\xE7\"\"\\xBF\"\"\\xB0\"\"</font></a>\\r</td></tr><tr>\\r<td width='1%' val\"\n  \"ign='top' >\\r&nbsp;<img src='../images/arrow.gif'>&nbsp;</td><td  width=\"\n  \"'99%' >\\r<a href=\\\"editnews.asp?edit=9c3a.asp\\\"><font face='AU' size='3'\"\n  \" color='#000000'>\\xD5\"\"\\xE6\"\"\\xC2\"\" \\xD5\"\"\\xC7\"\"\\xB8\"\"\\xE6\"\" \\xE7\"\"\\xB7\"\"\"\n  \" \\xC2\"\"\\xF1\"\"\\xE2\"\"\\xE6\"\"</font></a>\\r</td></tr><tr>\\r<td width='1%' val\"\n  \"ign='top' >\\r&nbsp;<img src='../images/arrow.gif'>&nbsp;</td><td  width=\"\n  \"'99%' >\\r<a href=\\\"editnews.asp?edit=8.asp\\\"><font face='AU' size='3' co\"\n  \"lor='#000000'>\\xE3\"\"\\xDA\"\" \\xD5\"\"\\xE6\"\"\\xDA\"\" v\\xD8\"\"\\xF4\"\"\\xB4\"\" \\xE3\"\"\"\n  \"\\xE6\"\"\\xDA\"\" \\xC1\"\"\\xE6\"\"\\xCC\"\"\\xE6\"\" \\xE3\"\"\\xF1\"\" \\xC1\"\"{\\xD7\"\"\\xEA\"\"-\\xB7\"\"\"\n  \"\\xE0\"\"\\xD7\"\"\\xE8\"\"\\xDA\"\"?</font></a>\\r</td></tr><tr>\\r<td width='1%' val\"\n  \"ign='top' >\\r&nbsp;<img src='../images/arrow.gif'>&nbsp;</td><td  width=\"\n  \"'99%' >\\r<a href=\\\"editnews.asp?edit=8c.asp\\\"><font face='AU' size='3' c\"\n  \"olor='#000000'>\\xA5\"\"\\xE6\"\"\\xE7\"\"\\xB9\"\"\\xDA\"\" \\xE7\"\"\\xB7\"\"\\xCF\"\"\\xDA\"\" \\xC1\"\"\"\n  \"\\xE6\"\"\\xB0\"\" \\xD7\"\"\\xE9\"\"\\xE2\"\"\\xE7\"\"\\xDC\"\"\\xD7\"\" \\xD7\"\"\\xCC\"\"\\xCE\"\"\\xE6\"\"\"\n  \"\\xCC\"\"\\xE6\"\"</font></a>\\r</td></tr><tr>\\r<td width='1%' valign='top' >\\r\"\n  \"&nbsp;<img src='../images/arrow.gif'>&nbsp;</td><td  width='99%' >\\r<a h\"\n  \"ref=\\\"editnews.asp?edit=8c1.asp\\\"><font face='AU' size='3' color='#00000\"\n  \"0'>\\xE2\"\"\\xE6\"\"\\xE2\"\", \\xD5\"\"\\xE3\"\"\\xEA\"\" \\xA5\"\"\\xE6\"\"\\xF1\"\"\\xDA\"\" \\xE7\"\"\"\n  \"\\xB7\"\"\\xFD\"\"\\xB7\"\"\\xF0\"\"\\xC5\"\"</font></a>\\r</td></tr><tr>\\r</td>\\r</tr>\\r\"\n  \"</table>\\r</td>\\r</tr>\\r</table>\\r</td></tr><tr><td height='2'>\\r</td></\"\n  \"tr><tr><td>\\r<table border='0' bgcolor='#F6F3E0'>\\r<tr><td>\\r<table widt\"\n  \"h='100%' border='0' cellspacing='1' cellpadding='1' bgcolor='#FFBC00'>\\r\"\n  \"<tr>\\r<td bgcolor='brown' align='center'><font face='AU' size='4' color=\"\n  \"'#ffFFFF'><b>\\xD6\"\"\\xE7\"\"\\xDF\"\"c\\xD8\"\"\\xC8\"\"\\xDC\"\" \\xC1\"\"\\xE6\"\"\\xD9\"\"\\xF0\"\"\"\n  \"\\xB4\"\"</b></font></a></td>\\r</tr>\\r<tr>\\r<td >\\r<table width='100%' bord\"\n  \"er='0' cellspacing='0' cellpadding='0'>\\r<tr><td height='10'></td></tr>\\r\"\n  \"<tr>\\r<td width='1%' valign='top' ALIGN='center' bgcolor='#FFBC00'>\\r<sc\"\n  \"ript>\\rfunction formmonthsubmit()\\r{\\rselect_futurename = document.mform\"\n  \".select_fname.value\\rmfuture = document.mform.mfuture.value\\rwindow.open\"\n  \"('../future/monthlyfuture1.asp?fm='+ mfuture + '&nm=' + select_futurenam\"\n  \"e,'win','width=400 height=300 scrollbars=yes')\\r}\\rfunction dothis()\\r{\\r\"\n  \"mform.mfuture.value=0;\\r}\\r</script>\\r<form name=\\\"mform\\\" method=\\\"post\"\n  \"\\\" action=\\\"\\\">\\r<select name=\\\"select_fname\\\" style=\\\"FONT-SIZE: 17px; \"\n  \" WIDTH: 90px;  FONT-FAMILY: au\\\" onchange=\\\"dothis();\\\">\\r<option value=\"\n  \"'wb' selected>\\xE2\"\"\\xE6\"\"\\x8C\"\"\\xCC\"\"\\xE6\"\"\\xE7\"\"\\xE3\"\"\\xB7\"\"</option>\\r\"\n  \"<option value='yb'>\\xDF\"\"\\xE6\"\"\\xE7\"\"\\xE1\"\"\\xFC\"\"\\xB7\"\" </option>\\r</sel\"\n  \"ect>\\r<select name=\\\"mfuture\\\" style=\\\"FONT-SIZE: 17px; WIDTH: 90px; FON\"\n  \"T-FAMILY: au\\\" onchange=\\\"formmonthsubmit();\\\">\\r<option value='0' selec\"\n  \"ted>\\xDA\"\"\\xE6\"\"\\xE7\"\"\\xE0\"\"\\xE6\"\"\\xD8\"\"\\xE6\"\"\\xA2\"\"</option>\\r<option v\"\n  \"alue='1'>\\xD7\"\"\\xF0\"\"\\xE1\"\"</option>\\r<option value='2'>\\xDF\"\"\\xEB\"\"\\xE1\"\"\"\n  \" </option>\\r<option value='3'>\\xE7\"\"\\xD7\"\"\\xCD\"\"\\xE9\"\"\\xD9\"\" </option>\\r\"\n  \"<option value='4'>\\xB7\"\"\\xB7\"\"\\xFC\"\" </option>\\r<option value='5'>\\xE7\"\"\"\n  \"\\xE2\"\"\\xA2\"\"\\xE3\"\" </option>\\r<option value='6'>\\xB7\"\"\\x8B\"\"\\xD8\"\"\\xE6\"\"\"\n  \" </option>\\r<option value='7'>\\xCC\"\"\\xE9\"\"\\xDC\"\"\\xE6\"\" </option>\\r<optio\"\n  \"n value='8'>\\xDF\"\"\\xEB\"\"\\xE7\"\"\\xE0\"\"\\xBF\"\"\\xB7\"\"\\xA4\"\" </option>\\r<optio\"\n  \"n value='9'>\\xCF\"\"\\xD9\"\"\\xE9\"\" </option>\\r<option value='10'>\\xD7\"\"\\xB7\"\"\"\n  \"\\xDA\"\" </option>\\r<option value='11'>\\xB7\"\"\\xE9\"\"\\xA2\"\"\\xD6\"\" </option>\\r\"\n  \"<option value='12'>\\xD7\"\"\\xE8\"\"\\xD9\"\" </option>\\r</select>\\r</FORM>\\r</t\"\n  \"d>\\r</tr>\\r</table>\\r</td>\\r</tr>\\r</table>\\r</td></tr>\\r</table>\\r</td>\"\n  \"</tr><tr><td height='2'>\\r</td></tr><tr><td>\\r<table width='100%' border\"\n  \"='0' cellspacing='1' cellpadding='1' bgcolor = '#2C4FA0'>\\r<tr>\\r<td bgc\"\n  \"olor='#2C4FA0' align='center'><font face='AU' size='4' color='#FFFFFF'>\\xE7\"\"\"\n  \"\\xC1\"\"\\x99\"\"\\xE6\"\"\\xE6\"\"\\xE2\"\"\\xE6\"\"</font></td>\\r</tr>\\r<tr>\\r<td bgcol\"\n  \"or='#F3F3F4' align='right' height='0'></td>\\r</tr>\\r<tr>\\r<td bgcolor='#\"\n  \"EDF2FD' >\\r<table width='100%' border='0' cellspacing='0' cellpadding='0\"\n  \"' align='center' >\\r<tr>\\r<td valign='top' width='1%' >&nbsp;<img src='.\"\n  \"./images/arrow.gif' border='0'>&nbsp;</TD>\\r<td width='98%'><font face='\"\n  \"AU' size='3' color='#04135E'><a href=\\\"../future/fullmain.asp?id=113\\\">\\xD5\"\"\"\n  \"\\xE3\"\"\\xE9\"\"\\xCC\"\" \\xBF\"\"\\xD7\"\"\\x88\"\"\\xB7\"\"\\xA4\"\"\\xE6\"\"\\xDA\"\"\\xE8\"\" \\xE3\"\"\"\n  \"\\xF4\"\"\\xCC\"\"\\xF0\"\" \\xE3\"\"\\xF1\"\"\\xB4\"\"\\xE7\"\"\\xC2\"\"\\xDA\"\"\\xE6\"\"\\xE7\"\"\\xD7\"\"\"\n  \"\\xC7\"\"</a></font></td>\\r</tr>\\r<tr>\\r<td valign='top' width='1%' >&nbsp;\"\n  \"<img src='../images/arrow.gif' border='0'>&nbsp;</TD>\\r<td width='98%'><\"\n  \"font face='AU' size='3' color='#04135E'><a href=\\\"../future/fullmain.asp\"\n  \"?id=111\\\">\\xB7\"\"\\xE9\"\"\\xA4\"\"\\xDC\"\"\\xBB\"\"\\xE9\"\"L\\xA4\"\" \\xB7\"\"\\xA4\"\"\\xE6\"\"\"\n  \" \\xE2\"\"{\\xD7\"\"\\xE6\"\"\\xD9\"\" \\xB7\"\"\\xA4\"\"\\xDA\"\"\\xF0\"\"\\xB4\"\", \\xDC\"\"\\xE6\"\"\\xD6\"\"\"\n  \" \\xE3\"\"\\xF4\"\"\\xBB\"\"..</a></font></td>\\r</tr>\\r<tr>\\r<td valign='top' wid\"\n  \"th='1%' >&nbsp;<img src='../images/arrow.gif' border='0'>&nbsp;</TD>\\r<t\"\n  \"d width='98%'><font face='AU' size='3' color='#04135E'><a href=\\\"../futu\"\n  \"re/fullmain.asp?id=97\\\">\\xDF\"\"\\xE6\"\"S\\xCC\"\"\\xE9\"\" \\xD7\"\"\\xF0\"\"\\xB4\"\" \\xC2\"\"\"\n  \"\\xA2\"\"\\xBF\"\" \\xCC\"\"\\x88\"\"\\xDF\"\"\\xF4\"\"\\xB4\"\" \\xB7\"\"\\xA4\"\"\\xE6\"\" \\xD7\"\"\\xE3\"\"\"\n  \"\\x88\"\"\\xDF\"\"</a></font></td>\\r</tr>\\r</table>\\r</td>\\r</tr>\\r</table>\\r<\"\n  \"/td></tr><tr><td height='3'>\\r</td></tr><tr><td>\\r<table width='100%' bo\"\n  \"rder='0' cellspacing='1' cellpadding='1' bgcolor = '#2C4FA0'>\\r<tr>\\r<td\"\n  \" bgcolor='#2C4FA0' align='center'><font face='AU' size='4' color='#FFFFF\"\n  \"F'>\\xC8\"\"\\xF1\"\"\\xE0\"\"\\xE6\"\"\\xD9\"\" \\xBB\"\"\\xF1\"\"\\xDC\"\"\\xDA\"\"\\xE8\"\"</font><\"\n  \"/td>\\r</tr>\\r<tr>\\r<td bgcolor='#F3F3F4' align='right' height='0'></td>\\r\"\n  \"</tr>\\r<tr>\\r<td bgcolor='#FFFFFF' align='left'>\\r<table width='98%' bor\"\n  \"der='0' cellspacing='2' cellpadding='6' align='center'>\\r<tr>\\r<td><div \"\n  \"align='justify'>\\r<a href=\\\"../news_gallery/detail.asp?sectionid=61&cate\"\n  \"id=181&id=2297&fldname=20070410&imgname=MDF87887.jpg&wpaper=1&capt=\\xDF\"\"\"\n  \"\\xF0\"\"\\xB4\"\"\\xC7\"\"\\xDC\"\" \\xDA\"\"\\xE6\"\"\\xE7\"\"\\xC7\"\"\\xB7\"\" \\xB7\"\"\\xF0\"\" \\xC2\"\"\"\n  \"\\xE7\"\"\\xDA\"\"\\xCF\"\"\\xE6\"\"\\xD9\"\"\\xE6\"\"\\xF0\"\"\\xB4\"\" \\xB7\"\"\\xE6\"\" \\xC2\"\"\\xFD\"\"\"\n  \"\\xCE\"\"\\xE0\"\"\\xE6\"\"\\xFC\"\"\\xD9\"\" \\xB7\"\"\\xDA\"\"\\xCC\"\"\\xE8\"\" \\xD7\"\"\\xE6\"\"\\xF2\"\"\"\n  \"\\xC7\"\"\\xDC\"\"\\xD0\"\"\\\" target=\\\"new\\\"> \\r<img src=\\\"../news_gallery/200704\"\n  \"10/MDF87887.jpg\\\" align='center' border='0'>\\r</a>\\r</td>\\r</tr>\\r</tabl\"\n  \"e>\\r</td>\\r</tr>\\r</table>\\r</td></tr><tr><td height='3'>\\r</td></tr><tr\"\n  \"><td>\\r<table width='100%' border='0' cellspacing='1' cellpadding='1' bg\"\n  \"color = '#2C4FA0'>\\r<tr>\\r<td bgcolor='#9148fb' align='center'><a href=\\\"\"\n  \"../gaurtalab/default.asp\\\" target=\\\"new\\\"><font face='AU' size='4' color\"\n  \"='#FFFFFF'>\\xBB\"\"\\xF5\"\"\\xDA\"\"\\xCC\"\"\\xDC\"\"\\xD5\"\"</font></td>\\r</tr>\\r<tr>\"\n  \"\\r<td bgcolor='#F3F3F4' align='right' height='0'></td>\\r</tr>\\r<tr>\\r<td\"\n  \" bgcolor='#f5f0fd' align='left'>\\r<table width='99%' border='0' cellspac\"\n  \"ing='1' cellpadding='0'>\\r<tr>\\r<td width='1%' valign='top'>&nbsp;<img s\"\n  \"rc='../images/arrow.gif' border='0'>&nbsp;</td>\\r<td width='98%'><a href\"\n  \"=\\\"../gaurtalab/detail.asp?id=505\\\" target=\\\"new\\\" ><font face='au' colo\"\n  \"r='black'><div align='justify'>\\xBB\"\"\\xCE\"\"\\xDA\"\" \\xB7\"\"\\xF0\"\" \\xC2\"\"\\xE9\"\"\"\n  \"\\xDA\"\"\\xF4\"\"\\xCF\"\"\\xE6\"\"</div></font></a>\\r</td></tr>\\r<tr>\\r<td width='\"\n  \"1%' valign='top'>&nbsp;<img src='../images/arrow.gif' border='0'>&nbsp;<\"\n  \"/td>\\r<td width='98%'><a href=\\\"../gaurtalab/detail.asp?id=506\\\" target=\"\n  \"\\\"new\\\" ><font face='au' color='black'><div align='justify'>\\xBB\"\"\\xFD\"\"\"\n  \"\\xE6\"\"\\xD7\"\"\\xE8\"\"\\x87\"\"\\xE6\"\"\\xE6\"\"\\xF0\"\"\\xB4\"\" \\xB7\"\"\\xE8\"\" S\\xD7\"\"\\xEB\"\"\"\n  \"\\xE7\"\"\\xCC\"\" \\xD7\"\"\\xF0\"\"\\xB4\"\" \\xD7\"\"\\xA2\"\"\\xBB\"\"\\xDC\"\" \\xC2\"\"\\xE6\"\"\\xA2\"\"\"\n  \"\\xC7\"\"\\xF0\"\"</div></font></a>\\r</td></tr>\\r<tr>\\r<td width='1%' valign='\"\n  \"top'>&nbsp;<img src='../images/arrow.gif' border='0'>&nbsp;</td>\\r<td wi\"\n  \"dth='98%'><a href=\\\"../gaurtalab/detail.asp?id=507\\\" target=\\\"new\\\" ><fo\"\n  \"nt face='au' color='black'><div align='justify'>\\xB7\"\"\\xE6\"\"\\xDA\"\"\\xCC\"\"\"\n  \"\\xEA\"\"\\xE2\"\" \\xCC\"\"\\xF4\"\" \\xD7\"\"\\xE3\"\"\\xC1\"\" \\xB0\"\"\\xB7\"\" \\xD5\"\"\\xE3\"\"\\xE6\"\"\"\n  \"\\xD9\"\"\\xE6\"\" \\xCD\"\"\\xE6\"\"</div></font></a>\\r</td></tr>\\r</table>\\r</td>\\r\"\n  \"</tr>\\r</table>\\r</td></tr><tr><td height='4'>\\r</td></tr><tr><td align=\"\n  \"'center'>\\r<table width='100%' border='0' cellspacing='0' cellpadding='0\"\n  \"' align='center'>\\r<tr><td align='center'><a href=\\\"../future/ques.asp\\\"\"\n  \" onclick=\\\"window.open('../future/form.asp','win','top=50 left=50 width=\"\n  \"500 height=320 scrollbars=yes')\\\" target=\\\"new\\\"><img src=\\\"../future/im\"\n  \"age/futureques2.gif\\\" border=\\\"0\\\"></a></td></tr>\\r<tr><td height='2'></\"\n  \"td></tr>\\r<tr>\\r<td width='100%' align='center'><a href=\\\"../HCjudgment0\"\n  \"7/Default.asp\\\" target=\\\"new\\\" ><img src=\\\"../image/HCjudgment07.gif\\\" a\"\n  \"lign='center' style='border : 1 solid #000000'height='60' width='125'></\"\n  \"a>\\r</td></tr>\\r<tr><td height='2'></td></tr>\\r</table>\\r</td></tr></tab\"\n  \"le>\\r</td>\\r<td align='center' valign='top'>\\r<table width='99%' border=\"\n  \"'0' cellspacing='0' cellpadding='0'>\\r<tr>\\r<td align='center' backgroun\"\n  \"d='images/line.jpg'> </td>\\r</tr>\\r<tr>\\r<td align='center'></td>\\r</tr>\"\n  \"\\r</table>\\r<table width='99%' border='0' cellspacing='0' cellpadding='0\"\n  \"'>\\r<tr><td colspan=3 align='center'>\\r</td></tr>\\r<tr>\\r<td height='4'>\"\n  \"<img src='../images/spacer.gif' width='1' height='1'></td>\\r</tr>\\r</tab\"\n  \"le>\\r<table width='98%' border='0' cellspacing='0' cellpadding='0' >\\r<t\"\n  \"r>\\r<td valign='top' width='49%'>\\r<table border='0' cellspacing='0' cel\"\n  \"lpadding='0' width='100%'>\\r<tr><td colspan='2'>\\r<table border = \\\"0\\\" \"\n  \"width = \\\"100%\\\" cellspacing = \\\"0\\\" cellpadding = \\\"0\\\">\\r             \"\n  \"   <tr><td width = \\\"30%\\\" align = \\\"left\\\"><a href=\\\"National.asp\\\"><im\"\n  \"g src='../images/homepagenew/deshb.gif' border='0'></a></td>\\r          \"\n  \"          <td width = \\\"70%\\\" align = \\\"right\\\"><a href=\\\"../UPElection0\"\n  \"7/default.asp\\\" target = \\\"new\\\"><img src='../image/tlink_UPElection07.g\"\n  \"if' border='0'></a></td>\\r                </tr>\\r            </table>\\r<\"\n  \"/td></tr>\\r<tr>\\r<td width='7%'><img src='../images/arrow.gif' width='4'\"\n  \" height='7'><br></td>\\r<td><font face='au' size = '3'> <a href =natnews.\"\n  \"asp?nat=10desh1.asp >\\xC0\"\"}\\xE6\"\"\\xE8\"\"\\xE2\"\"\\xBB\"\"\\xC9\"\"\\xB8\"\" \\xD7\"\"\\xF0\"\"\"\n  \"\\xB4\"\" \\xDC\"\"\\xEA\"\" \\xB7\"\"\\xE6\"\" \\xB7\"\"\\xE3\"\"\\xDA\"\" \\xE0\"\"\\xE6\"\"\\xE9\"\"M<\"\n  \"/a></font>\\r</td>\\r</tr>\\r<tr>\\r<td width='7%'><img src='../images/arrow\"\n  \".gif' width='4' height='7'><br></td>\\r<td><font face='au' size = '3'> <a\"\n  \" href =natnews.asp?nat=10desh1a.asp >\\xB7\"\"\\xF0\"\"\\xDA\"\"\\xDC\"\" \\xD1\"\" \\xC2\"\"\"\n  \"\\xF0\"\"\\x8C\"\"\\xE2\"\"\\xE8\"\" \\xB7\"\"\\xE6\"\"\\xF0\"\" \\xA9\"\"\\x88\"\"\\xC2\"\"\\xE6\"\"\\xCE\"\"\"\n  \"\\xD9\"\" \\xB7\"\"\\xE8\"\" \\xA5\"\"\\xD9\"\"\\xE9\"\"\\xD7\"\"\\xE7\"\"\\xCC\"\"</a></font>\\r</t\"\n  \"d>\\r</tr>\\r<tr>\\r<td width='7%'><img src='../images/arrow.gif' width='4'\"\n  \" height='7'><br></td>\\r<td><font face='au' size = '3'> <a href =natnews.\"\n  \"asp?nat=10desh1b.asp >\\xC2\"\"\\xFD\"\"\\x87\"\"\\xE6\"\"\\xDF\"\" \\xD7\"\"\\xE9\"\"\\xB9\"\"\\xC1\"\"\"\n  \"\\xE8\"\"\\xFC\"\" \\xB7\"\"\\xE6\"\"\\xF0\"\" \\xA5\"\"S\\xC2\"\"\\xCC\"\"\\xE6\"\"\\xDC\"\" \\xE2\"\"\\xF0\"\"\"\n  \" \\xC0\"\"\\xE9\"\"^\\xE8\"\"</a></font>\\r</td>\\r</tr>\\r<tr>\\r<td width='7%'><img\"\n  \" src='../images/arrow.gif' width='4' height='7'><br></td>\\r<td><font fac\"\n  \"e='au' size = '3'> <a href =natnews.asp?nat=10desh1c.asp >\\xE7\"\"\\xD5\"\"\\xE3\"\"\"\n  \"\\xE6\"\"\\xDA\"\" \\xD1\"\" \\xD2\"\"\\x8C\"\"\\xD8\"\"\\xE6\"\"\\xE2\"\"\\xF0\"\"\\xD3\"\" \\xBB\"\"\\xE6\"\"\"\n  \"\\xA2\"\"\\xDF\"\" \\xD7\"\"\\xF0\"\"\\xB4\"\" \\xE3\"\"\\xF1\"\"\\xB4\"\"\\xC7\"\" \\xC2\"\"\\xA2\"\"\\xC2\"\"\"\n  \" \\xBB\"\"\\xC7\"\"\\xB8\"\"\\xE6\"\"</a></font>\\r</td>\\r</tr>\\r<tr>\\r<td colspan=\\\"\"\n  \"2\\\" height = '22'> </td>\\r</tr>\\r<tr>\\r<td colspan='2'>\\r<table border =\"\n  \" \\\"0\\\" width = \\\"100%\\\" cellspacing = \\\"0\\\" cellpadding = \\\"0\\\">\\r      \"\n  \"          <tr><td width = \\\"30%\\\" align = \\\"left\\\"><a href=\\\"Sports.asp\\\"\"\n  \"><img src='../images/homepagenew/sportb.gif' border='0'></a></td>\\r     \"\n  \"               <td width = \\\"70%\\\" align = \\\"right\\\"><a href=\\\"#\\\" oncli\"\n  \"ck=\\\"javascript:window.open('../Games/game.htm','Games','toolbar=no,dire\"\n  \"ctories=no, resize=no, menubar=no,location=no,scrollbars=no,width=440,he\"\n  \"ight=380,maximize=no,minimize=no,left=100,top=50')\\\"><img src='../image/\"\n  \"tlink_game.gif' border='0'></a></td>\\r                </tr>\\r           \"\n  \" </table>\\r</td></tr>\\r<tr>\\r<td width='7%'><img src='../images/arrow.gi\"\n  \"f' width='4' height='7'></td>\\r<td><font face='au' size='3'> <a href =sp\"\n  \"tnews.asp?spt=10am7a.asp >\\xA7\"\"\\xA2\"\"\\xC1\"\"\\xD7\"\"\\xE6\"\"\\xD7\"\" \\xDF\"\" \\xC2\"\"\"\n  \"\\xE8\"\"\\xE2\"\"\\xE8\"\"\\xD5\"\"\\xE8\"\" \\xE2\"\"\\xF0\"\" \\xC1\"\"\\xE6\"\"\\xA2\"\"\\xBF\"\" \\xE2\"\"\"\n  \"\\xE7\"\"\\xD7\"\"\\xE7\"\"\\xCC\"\" \\xE2\"\"\\xA2\"\"\\xCC\"\"\\xE9\"\"C \\xD9\"\"\\xE3\"\"\\xE8\"\"\\xB4\"\"\"\n  \"<br></a></font></td>\\r</tr>\\r<tr>\\r<td width='7%'><img src='../images/ar\"\n  \"row.gif' width='4' height='7'></td>\\r<td><font face='au' size='3'> <a hr\"\n  \"ef =sptnews.asp?spt=10am7.asp >\\xA5\"\"\\xE6\"\"\\xF2\"\"S\\xC5\"\"\\xF0\"\"\\xFE\"\"\\xE7\"\"\"\n  \"\\xDC\"\"\\xD8\"\"\\xE6\"\" \\xE2\"\"\\xF0\"\" \\xE2\"\"\\xE8\"\"\\xB9\"\" \\xDC\"\"\\xF0\"\" \\xA7\"\"\\xA2\"\"\"\n  \"\\x82\"\"\\xDC\"\"\\xF1\"\"\\xB4\"\"\\xC7\"\" \\xD1\"\" x\\xDC\"\"\\xF0\"\"\\xB4\"\"\\xBF\"\"\\xDA\"\"<br\"\n  \"></a></font></td>\\r</tr>\\r<tr>\\r<td width='7%'><img src='../images/arrow\"\n  \".gif' width='4' height='7'></td>\\r<td><font face='au' size='3'> <a href \"\n  \"=sptnews.asp?spt=9sport1.asp >\\xE7\"\"\\xB7\"\"\\xE7\"\"\\xDF\"\"\\xD8\"\"\\xE6\"\"\\xF0\"\"\"\n  \"\\xB4\"\" \\xD9\"\"\\xF0\"\" \\xA5\"\"\\xE6\"\"\\xD8\"\"\\xDA\"\"\\xDC\"\"\\xF1\"\"\\xB4\"\"\\xC7\"\" \\xB7\"\"\"\n  \"\\xE6\"\"\\xF0\"\" \\xE3\"\"\\xDA\"\"\\xE6\"\"\\xD8\"\"\\xE6\"\"<br></a></font></td>\\r</tr>\\r\"\n  \"<tr>\\r<td width='7%'><img src='../images/arrow.gif' width='4' height='7'\"\n  \"></td>\\r<td><font face='au' size='3'> <a href =sptnews.asp?spt=09sportc.\"\n  \"asp >\\xE2\"\"\\xE9\"\"\\xC2\"\"\\xDA\"\"-4\\xD1\"\" \\xB7\"\"\\xE6\"\"\\xF1\"\"\\xD9\"\" \\xE3\"\"\\xE6\"\"\"\n  \"\\xF0\"\"\\xBB\"\"\\xE8\"\" \\xBF\"\"\\xF5\"\"\\xCD\"\"\\xE8\"\" \\xC5\"\"\\xE8\"\"\\xD7\"\"?<br></a><\"\n  \"/font></td>\\r</tr>\\r</table>\\r</td>\\r<td width='2%' valign='top'>&nbsp;<\"\n  \"/td>\\r<td valign='top' width='49%'>\\r<table width='100%' border='0' cell\"\n  \"spacing='0' cellpadding='0'>\\r<tr><td colspan='2'>\\r<table border = \\\"0\\\"\"\n  \" width = \\\"100%\\\" cellspacing = \\\"0\\\" cellpadding = \\\"0\\\">\\r            \"\n  \"    <tr><td width = \\\"30%\\\" align = \\\"left\\\"><a href=\\\"Int.asp\\\"><img sr\"\n  \"c='../images/homepagenew/videshb.gif' border='0'></a></td>\\r            \"\n  \"        <td width = \\\"70%\\\" align = \\\"right\\\"><a href=\\\"../Takraar07/def\"\n  \"ault.asp\\\" target = \\\"new\\\"><img src='../image/tlink_Takraar07.gif' bord\"\n  \"er='0'></a></td>\\r                </tr>\\r            </table>\\r</td></tr\"\n  \">\\r<tr>\\r<td width='7%'><img src='../images/arrow.gif' width='4' height=\"\n  \"'7'><br></td>\\r<td><font face='au' size = '3'> <a href =intnews.asp?int=\"\n  \"10am6c.asp >\\xD6\"\"\\xE6\"\"\\xDA\"\"\\xCC\"\"-\\xC2\"\"\\xE6\"\"\\xB7\"\" \\xB7\"\"\\xF0\"\" \\xA5\"\"\"\n  \"\\xE6\"\"\\xE7\"\"\\xCD\"\"\\xFC\"\"\\xB7\"\" \\xE7\"\"\\xDA\"\"\\xE0\"\"\\xCC\"\"\\xF0\"\" \\xD7\"\"\\xF0\"\"\"\n  \"\\xB4\"\" \\xD7\"\"\\xC1\"\"\\xD5\"\"\\xEA\"\"\\xCC\"\"\\xE8\"\"</a></font>\\r</td>\\r</tr>\\r<t\"\n  \"r>\\r<td width='7%'><img src='../images/arrow.gif' width='4' height='7'><\"\n  \"br></td>\\r<td><font face='au' size = '3'> <a href =intnews.asp?int=10am6\"\n  \"b.asp >\\xD2\"\"\\xE2\"\"\\xE9\"\"\\xDA\"\"\\xFF\"\"\\xE6\"\"\\xE6\"\" \\xC2\"\"\\xE7\"\"\\xDA\"\"\\xE1\"\"\"\n  \"\\xCE\"\" \\xB7\"\"\\xF0\"\" \\xC2\"\"\\xFD\"\"S\\xCC\"\"\\xE6\"\"\\xDF\"\" \\xB7\"\"\\xE6\"\" \\xC2\"\"\\xE6\"\"\"\n  \"\\xDC\"\"\\xD9\"\" \\xB7\"\"\\xDA\"\"\\xF0\"\" \\xA7\"\"\\xFC\"\"\\xDA\"\"\\xE6\"\"\\xD9\"\"\\xD3\"\"</a>\"\n  \"</font>\\r</td>\\r</tr>\\r<tr>\\r<td width='7%'><img src='../images/arrow.gi\"\n  \"f' width='4' height='7'><br></td>\\r<td><font face='au' size = '3'> <a hr\"\n  \"ef =intnews.asp?int=10am6a.asp >\\xD9\"\"\\xF0\"\"\\xC2\"\"\\xE6\"\"\\xDC\"\"\\xE8\"\" \\xE2\"\"\"\n  \"\\xF0\"\"\\xD9\"\"\\xE6\"\" \\xD9\"\"\\xF0\"\" \\xE3\"\"\\xE7\"\"\\xCD\"\"\\xD8\"\"\\xE6\"\"\\xDA\"\" \\xC1\"\"\"\n  \"\\xD7\"\"\\xE6\"\" \\xB7\"\"\\xDA\"\"\\xE6\"\"\\xB0\"\"</a></font>\\r</td>\\r</tr>\\r<tr>\\r<t\"\n  \"d width='7%'><img src='../images/arrow.gif' width='4' height='7'><br></t\"\n  \"d>\\r<td><font face='au' size = '3'> <a href =intnews.asp?int=10am6.asp >\"\n  \"\\xB0\"\"\\xC5\"\"\\xD7\"\"\\xE8\"\" \\xE7\"\"\\xDF\"\"\\xDF\"\"\\xE6\"\"\\xCE\"\" \\xB7\"\"\\xE6\"\" \\xE3\"\"\"\n  \"\\xDC\"\" \\xDF\"\"\\xE6\"\"\\xCC\"\"\\xE6\"\"\\xFC\"\" \\xE2\"\"\\xF0\"\" \\xE2\"\"\\xA2\"\"\\xD6\"\"\\xDF\"\"\"\n  \" \\xD1\"\" \\xA5\"\"\\xD7\"\"\\xF0\"\"\\xE7\"\"\\xDA\"\"\\xB7\"\"\\xE6\"\"</a></font>\\r</td>\\r</\"\n  \"tr>\\r<tr>\\r<td colspan=\\\"2\\\" height = '22'> </td>\\r</tr>\\r<tr>\\r<td cols\"\n  \"pan='2' width='231' >\\r<table border = \\\"0\\\" width = \\\"100%\\\" cellspacin\"\n  \"g = \\\"0\\\" cellpadding = \\\"0\\\">\\r                <tr><td width = \\\"30%\\\" \"\n  \"align = \\\"left\\\"><a href=\\\"Business.asp\\\"><img src='../images/homepagene\"\n  \"w/businessb.gif' border='0'></a></td>\\r                    <td width = \\\"\"\n  \"70%\\\" align = \\\"right\\\"><a href=\\\"../Budget07/default.asp\\\" target=\\\"new\"\n  \"\\\"><img src='../image/tlink_Budget.gif' border='0'></a></td>\\r          \"\n  \"      </tr>\\r            </table>\\r</td></tr>\\r<tr>\\r<td width='7%'><img\"\n  \" src='../images/arrow.gif' width='4' height='7'></td>\\r<td>\\r<font face=\"\n  \"'au' size='3'><a href =businews.asp?busi=10am8a.asp>\\xA5\"\"\\xE6\"\"\\xA7\"\"\\xFC\"\"\"\n  \"\\xE2\"\"\\xE8\"\"\\xA5\"\"\\xE6\"\"\\xA7\"\"\\xFC\"\"\\xE2\"\"\\xE8\"\"\\xA5\"\"\\xE6\"\"\\xA7\"\"\\xFC\"\"\"\n  \" \\xD5\"\"\\xF1\"\"\\xB4\"\"\\xB7\"\" \\xB7\"\"\\xE6\"\" \\xB7\"\"\\xE6\"\"\\xF0\"\"-\\xD5\"\"\\xFD\"\"\\xE6\"\"\"\n  \"\\xA2\"\"\\xC7\"\"\\xF0\"\"\\xC7\"\" \\xB7\"\"\\xE6\"\"\\xC7\"\"\\xFC\"\"</a></font></td>\\r</tr>\"\n  \"\\r<tr>\\r<td width='7%'><img src='../images/arrow.gif' width='4' height='\"\n  \"7'></td>\\r<td>\\r<font face='au' size='3'><a href =businews.asp?busi=10am\"\n  \"8.asp>\\xD5\"\"\\xF1\"\"\\xB4\"\"\\xB7\"\"\\xE6\"\"\\xF0\"\"\\xB4\"\" \\xB7\"\"\\xE6\"\"\\xF0\"\" \\xDC\"\"\"\n  \"\\xF0\"\"\\xD9\"\"\\xE6\"\" \\xE3\"\"\\xE6\"\"\\xF0\"\"\\xBB\"\"\\xE6\"\" L\\xC2\"\"\\xB0\"\" \\xB7\"\"\\xF0\"\"\"\n  \" \\xB9\"\"\\xA2\"\"\\xC7\"\" \\xDF\"\"\\xE6\"\"\\xDC\"\"\\xF0\"\" \\xBF\"\"\\xF0\"\"\\xB7\"\"</a></fon\"\n  \"t></td>\\r</tr>\\r<tr>\\r<td width='7%'><img src='../images/arrow.gif' widt\"\n  \"h='4' height='7'></td>\\r<td>\\r<font face='au' size='3'><a href =businews\"\n  \".asp?busi=10mobi2.asp>\\xC2\"\"\\xA2\"\"\\xBC\"\"\\xFD\"\"\\xE3\"\" \\xE2\"\"\\xE6\"\"\\xF1\"\" \"\n  \"\\xD7\"\"\\xF0\"\"\\xB4\"\" \\xE7\"\"\\xD7\"\"\\xDC\"\"\\xF0\"\"\\xB4\"\"\\xBB\"\"\\xF0\"\" \\xB7\"\"\\xF1\"\"\"\n  \"\\xD7\"\"\\xDA\"\"\\xE6\"\" \\xDF\"\"\\xE6\"\"\\xDC\"\"\\xF0\"\" \\xD7\"\"\\xE6\"\"\\xF0\"\"\\xD5\"\"\\xE6\"\"\"\n  \"\\xA7\"\"\\xDC\"\"</a></font></td>\\r</tr>\\r<tr>\\r<td width='7%'><img src='../i\"\n  \"mages/arrow.gif' width='4' height='7'></td>\\r<td>\\r<font face='au' size=\"\n  \"'3'><a href =businews.asp?busi=10busi2d.asp>\\xA5\"\"\\xE6\"\"\\xA7\"\"\\xFC\"\"\\xC5\"\"\"\n  \"\\xE8\"\" \\xE7\"\"\\xD9\"\"\\xDF\"\"\\xF0\"\"\\xE0\"\"\\xE6\"\"\\xB7\"\"\\xF4\"\"\\xB4\"\" \\xB7\"\"\\xF4\"\"\"\n  \" \\xD9\"\"\\xE9\"\"\\xB7\"\"\\xE2\"\"\\xE6\"\"\\xD9\"\" \\xB7\"\"\\xE8\"\" \\xA5\"\"\\xE6\"\"\\xE0\"\"\\xE6\"\"\"\n  \"\\xA2\"\"\\xB7\"\"\\xE6\"\"</a></font></td>\\r</tr>\\r</table>\\r</td>\\r</tr>\\r</tab\"\n  \"le><BR>\\r<table border='0' cellspacing='0' cellpadding='1' width='98%' a\"\n  \"lign='center' valign='top'>\\r<tr><td align='center'>\\r<a href='gkp.asp'>\"\n  \"<img src=\\\"../image/gorakhpur.gif\\\" width=\\\"468\\\" height=\\\"49\\\" border=\\\"\"\n  \"0\\\"></a>\\r</td></tr>\\r<tr><td><img border='0' src='../images/homepagenew\"\n  \"/citynews.gif'></td></tr>\\r<tr bgcolor='ffffff'>\\r<td valign='center'>\\r\"\n  \"<table border=0  cellspacing=0 cellpadding=0 width='100%' align=center v\"\n  \"align='top' style='border-bottom: 1 solid #0058B0' height='117'>\\r<tr>\\r\"\n  \"<td width='25%' height='24' valign='top'>\\r<font face='AU' size='4' colo\"\n  \"r='#B90000'>\\xD9\"\"\\xA7\"\"\\xFC\"\" \\xE7\"\"\\xCE\"\"\\xCB\"\"\\xDC\"\"\\xE8\"\"</font>\\r</\"\n  \"td><td width='2%' align='center' height='24' valign='top'>\\r<b><font col\"\n  \"or='#B90000'>:</font></b>\\r</td><td width='73%' height='24' valign='top'\"\n  \">\\r<a href =delnews.asp?city=10uenhyy5.asp><font face='au' size='4'>\\xC2\"\"\"\n  \"\\xE9\"\"\\xE7\"\"\\xDC\"\"\\xE2\"\" \\xE2\"\"\\xE9\"\"\\xCF\"\"\\xE6\"\"\\xDA\"\" \\xB7\"\"\\xF0\"\"\\xA5\"\"\"\n  \"\\xE6\"\"\\xCE\"\"\\xF0\"\"\\xE0\"\"\\xE6\"\" \\xD9\"\" \\xD7\"\"\\xE6\"\"\\xD9\"\"\\xD9\"\"\\xF0\"\" \\xC2\"\"\"\n  \"\\xDA\"\" \\xA5\"\"\\xC7\"\"\\xB8\"\"\\xF0\"\" \\xC2\"\"\\xFD\"\"\\xCE\"\"\\xF0\"\"\\xE0\"\"\\xE6\"\"</fo\"\n  \"nt></a>\\r</td>\\r</tr>\\r<td width='25%' height='24' valign='top'>\\r<font \"\n  \"face='AU' size='4' color='#B90000'>\\xD9\"\"\\xF4\"\"\\xB0\"\"\\xC7\"\"\\xE6\"\"</font>\"\n  \"\\r</td><td width='2%' align='center' height='24' valign='top'>\\r<b><font\"\n  \" color='#B90000'>:</font></b>\\r</td><td width='73%' height='24' valign='\"\n  \"top'>\\r<a href =bulnews.asp?city=10buld2.asp><font face='au' size='4'>\\xDA\"\"\"\n  \"\\xF1\"\"\\xDC\"\"\\xE8\"\" \\xB7\"\"\\xF0\"\" \\xE7\"\"\\xDC\"\"\\xB0\"\" \\xD9\"\"\\xE3\"\"\\xE8\"\"\\xB4\"\"\"\n  \" \\xE7\"\"\\xD7\"\"\\xDC\"\" \\xDA\"\"\\xE3\"\"\\xF0\"\" \\xE3\"\"\\xF1\"\"\\xB4\"\" \\xDC\"\"\\xE6\"\"\\xF0\"\"\"\n  \"\\xBB\"\"</font></a>\\r</td>\\r</tr>\\r<td width='25%' height='24' valign='top\"\n  \"'>\\r<font face='AU' size='4' color='#B90000'>\\xBB\"\"\\xE6\"\"\\xF0\"\"\\xDA\"\"\\xB9\"\"\"\n  \"\\xC2\"\"\\xE9\"\"\\xDA\"\"</font>\\r</td><td width='2%' align='center' height='24\"\n  \"' valign='top'>\\r<b><font color='#B90000'>:</font></b>\\r</td><td width='\"\n  \"73%' height='24' valign='top'>\\r<a href =gkpnews.asp?city=10ilaha4.asp><\"\n  \"font face='au' size='4'>\\xE3\"\"\\xDA\"\" \\xE2\"\"\\xE6\"\"\\xA2\"\"\\xE2\"\" \\xB7\"\"\\xF0\"\"\"\n  \" \\xE2\"\"\\xE6\"\"\\xCD\"\" \\xDC\"\"\\xF0\"\"\\xCC\"\"\\xF0\"\" \\xE3\"\"\\xF1\"\"\\xB4\"\" \\xC1\"\"\\xE3\"\"\"\n  \"\\xDA\"\"</font></a>\\r</td>\\r</tr>\\r<td width='25%' height='24' valign='top\"\n  \"'>\\r<font face='AU' size='4' color='#B90000'>\\x9F\"\"\\xE6\"\"\\xE8\"\"\\xD9\"\"\\xBB\"\"\"\n  \"\\xDA\"\"</font>\\r</td><td width='2%' align='center' height='24' valign='to\"\n  \"p'>\\r<b><font color='#B90000'>:</font></b>\\r</td><td width='73%' height=\"\n  \"'24' valign='top'>\\r<a href =srinews.asp?city=10juda3.asp><font face='au\"\n  \"' size='4'>\\xB7\"\"\\xE0\"\"\\xD7\"\"\\xE8\"\"\\xDA\"\" \\xB7\"\"\\xF0\"\" \\xB7\"\"\\xE9\"\"\\xC0\"\"\"\n  \" \\xA5\"\"\\xD9\"\"\\xC0\"\"\\xE9\"\"\\xB0\"\" S\\xCD\"\"\\xDC\"\" \\xE3\"\"\\xF4\"\"\\xB4\"\"\\xBB\"\"\\xF0\"\"\"\n  \" \\xC2\"\"\\xD8\"\"\\xFC\"\"\\xC5\"\"\\xD9\"\" \\xB7\"\"\\xF0\"\"\\xB4\"\"\\xBC\"\"\\xFD\"\"</font></a\"\n  \">\\r</td>\\r</tr>\\r<td width='25%' height='24' valign='top'>\\r<font face='\"\n  \"AU' size='4' color='#B90000'>\\xE2\"\"\\xE6\"\"\\xE7\"\"\\xE3\"\"\\xD5\"\"\\xE6\"\"\\xD5\"\"\\xE6\"\"\"\n  \"\\xCE\"\"</font>\\r</td><td width='2%' align='center' height='24' valign='to\"\n  \"p'>\\r<b><font color='#B90000'>:</font></b>\\r</td><td width='73%' height=\"\n  \"'24' valign='top'>\\r<a href =gbdnews.asp?city=10kioui2.asp><font face='a\"\n  \"u' size='4'>\\xB0\"\"\\xB7\"\" \\xE3\"\"\\xE8\"\" \\xE7\"\"\\xCE\"\"\\xD9\"\" \\xE7\"\"\\xD9\"\"\\xB7\"\"\"\n  \"\\xE6\"\"\\xE3\"\", \\xCC\"\"\\xDC\"\"\\xE6\"\"\\xB7\"\" \\xA5\"\"\\xE6\"\"\\xF1\"\"\\xDA\"\" \\xE7\"\"\\xC8\"\"\"\n  \"\\xDA\"\" \\xE7\"\"\\xD9\"\"\\xB7\"\"\\xE6\"\"\\xE3\"\"</font></a>\\r</td>\\r</tr>\\r</table>\"\n  \"\\r</td>\\r</tr>\\r</table>\\r<table border='0' width = '98%' cellspacing='0\"\n  \"' cellpadding='0' align='center' valign='top'>\\r<tr>\\r<td width='50%'>\\r\"\n  \"        <table border='0' width = '100%' cellspacing='2' cellpadding='1'\"\n  \" align='center' valign='top'>\\r        <tr>\\r        <td width='49%' ali\"\n  \"gn='center'>\\r            <table border='0' width = '100%' cellspacing='\"\n  \"2' cellpadding='0' align='center' valign='top'>\\r                <tr><td\"\n  \" align='center'><img src='../image/future_article.jpg' border='0'></td><\"\n  \"/tr>\\r                <tr><td>\\r<a href='../future/ques.asp?id=4095' tar\"\n  \"get='new'><font face='au' color='black'>&nbsp;<img src='../images/arrow.\"\n  \"gif' border='0'>&nbsp;\\xD7\"\"\\xF0\"\"\\xDA\"\"U\\xE6\"\" \\xE7\"\"\\xDF\"\"\\xDF\"\"\\xE6\"\"\"\n  \"\\xE3\"\"U \\xB7\"\"\\xA4\"\"\\xD5\"\" \\xCC\"\"\\xB7\"\"\\xA4\"\" \\xE3\"\"U\\xE6\"\"\\xF0\"\"\\xBB\"\"\\xE6\"\"\"\n  \"? </font></a><font face='au' color='brown'>-\\xD9\"\"\\xDA\"\"\\xF0\"\"U\\xE0\"\"\\xE6\"\"\"\n  \"</font><br>\\r<a href='../future/ques.asp?id=4094' target='new'><font fac\"\n  \"e='au' color='black'>&nbsp;<img src='../images/arrow.gif' border='0'>&nb\"\n  \"sp;\\xD7\"\"\\xE9\"\"\\xDB\"\"\\xE6\"\"\\xF0\"\" \\xD9\"\"\\xE6\"\"\\xF1\"\"\\xB7\"\"\\xA4\"\"\\xDA\"\"U\\xE8\"\"\"\n  \" \\xB7\"\"\\xA4\"\"\\xD5\"\" \\xCC\"\"\\xB7\"\"\\xA4\"\" \\xE7\"\"\\xD7\"\"\\xDC\"\"\\xF0\"\"\\xBB\"\"\\xE8\"\"\"\n  \"? </font></a><font face='au' color='brown'>-\\xE0\"\"\\xE6\"\"\\xE6\"\"\\xCE\"\"\\xE6\"\"\"\n  \"\\xD5\"\"</font><br>\\r<a href='../future/ques.asp?id=4093' target='new'><fo\"\n  \"nt face='au' color='black'>&nbsp;<img src='../images/arrow.gif' border='\"\n  \"0'>&nbsp;\\xD7\"\"\\xE9\"\"\\xDB\"\"\\xE6\"\"\\xF0\"\" \\xC1\"\"\\xE6\"\"\\xF2\"\"\\xD5\"\" \\xB7\"\"\\xA4\"\"\"\n  \"\\xD5\"\" \\xCC\"\"\\xB7\"\"\\xA4\"\" \\xE7\"\"\\xD7\"\"\\xDC\"\"\\xF0\"\"\\xBB\"\"\\xE8\"\"? </font><\"\n  \"/a><font face='au' color='brown'>-\\xE7\"\"\\xD9\"\"\\xCC\"\"\\xF0\"\"\\xE0\"\"\\xE6\"\"</\"\n  \"font><br>\\r<a href='../future/ques.asp?id=4092' target='new'><font face=\"\n  \"'au' color='black'>&nbsp;<img src='../images/arrow.gif' border='0'>&nbsp\"\n  \";\\xD7\"\"\\xE9\"\"\\xDB\"\"\\xE6\"\"\\xF0\"\" \\xCE\"\"\\xEA\"\"\\xE2\"\"\\xDA\"\"U\\xE8\"\" \\xD9\"\"\\xE6\"\"\"\n  \"\\xF1\"\"\\xB7\"\"\\xA4\"\"\\xDA\"\"U\\xE8\"\" \\xB7\"\"\\xA4\"\"\\xD5\"\" \\xE7\"\"\\xD7\"\"\\xDC\"\"\\xF0\"\"\"\n  \"\\xBB\"\"\\xE8\"\"? </font></a><font face='au' color='brown'>-\\xD9\"\"\\xDF\"\"\\xE8\"\"\"\n  \"\\xD9\"\"</font><br>\\r<a href='../future/ques.asp?id=4091' target='new'><fo\"\n  \"nt face='au' color='black'>&nbsp;<img src='../images/arrow.gif' border='\"\n  \"0'>&nbsp;\\xE7\"\"\\xDF\"\"\\xCE\"\"\\xF0\"\"\\xE0\"\"\\xE6\"\" \\xD8\"\"\\xE6\"\"\\x98\"\"\\xE6\"\"\\xE6\"\"\"\n  \" \\xB7\"\"\\xA4\"\"\\xE6\"\" \\xD8\"\"\\xE6\"\"\\xF0\"\"\\xBB\"\" \\xB7\"\"\\xA4\"\"\\xD5\"\" \\xCC\"\"\\xB7\"\"\"\n  \"\\xA4\"\"? </font></a><font face='au' color='brown'>-\\xE2\"\"\\xA2\"\"\\xC1\"\"\\xD8\"\"\"\n  \"</font><br>\\r<a href='../future/ques.asp?id=4089' target='new'><font fac\"\n  \"e='au' color='black'>&nbsp;<img src='../images/arrow.gif' border='0'>&nb\"\n  \"sp;\\xDF\"\"\\xF1\"\"\\xDF\"\"\\xE6\"\"\\xE7\"\"\\xE3\"\"U\\xB7\"\"\\xA4\"\" \\xC1\"\"\\xE8\"\"\\xDF\"\"\\xD9\"\"\"\n  \" \\xB7\"\"\\xF1\"\"\\xA4\"\"\\xE2\"\"\\xE6\"\" \\xE3\"\"U\\xE6\"\"\\xF0\"\"\\xBB\"\"\\xE6\"\"? </font>\"\n  \"</a><font face='au' color='brown'>-\\xC2\"\"\\xE9\"\"\\xD9\"\"\\xE8\"\"\\xCC\"\"</font>\"\n  \"<br>\\r<a href='../future/ques.asp?id=4088' target='new'><font face='au' \"\n  \"color='black'>&nbsp;<img src='../images/arrow.gif' border='0'>&nbsp;\\xD7\"\"\"\n  \"\\xF0\"\"\\xDA\"\"U\\xE6\"\" \\xE7\"\"\\xDF\"\"\\xDF\"\"\\xE6\"\"\\xE3\"\"U \\xB7\"\"\\xA4\"\"\\xD5\"\" \\xCC\"\"\"\n  \"\\xB7\"\"\\xA4\"\" \\xE3\"\"U\\xE6\"\"\\xF0\"\"\\xBB\"\"\\xE6\"\"? </font></a><font face='au'\"\n  \" color='brown'>-\\xDA\"\"U\\xE6\"\"\\xE3\"\"\\xE9\"\"U\\xDC\"\"</font><br>\\r           \"\n  \"    <br> </td></tr>\\r             </table>\\r        </td>\\r        <td w\"\n  \"idth='2%' valign='top'><img src='../image/line.jpg' border='0'></td>\\r  \"\n  \"      <td width='49%' valign='top'>\\r            <table border='0' width\"\n  \" = '100%' cellspacing='0' cellpadding='0' align='center' valign='top'>\\r\"\n  \"                <tr><td>\\r<table border = \\\"0\\\" width = \\\"100%\\\" cellspa\"\n  \"cing = \\\"0\\\" cellpadding = \\\"0\\\">\\r                <tr><td width = \\\"30%\"\n  \"\\\" align = \\\"left\\\"><a href=\\\"../Jokes/default.asp\\\" target=\\\"new\\\"><img\"\n  \" src='../images/homepagenew/jokesb.gif' border='0'></a></td>\\r          \"\n  \"          <td width = \\\"70%\\\" align = \\\"right\\\"><a href=\\\"../yearlyfutur\"\n  \"e07/default.asp\\\" target=\\\"new\\\" ><img src='../image/tlink_yearlyfuture0\"\n  \"7.gif' border='0'></a>'\\r</td>\\r                </tr>\\r            </tab\"\n  \"le>\\r                </td></tr>\\r                <tr><td>\\r<a href='../j\"\n  \"okes/default.asp'  onclick=\\\"javascript:window.open('../jokes/detail.asp\"\n  \"?id=5845','','toolbars=no,height=430,width=510,top=0,left=100,resizable=\"\n  \"yes,scrollbars=yes')\\\"><font face='au' size='4' color='red'>\\xBF\"\"\\xD7\"\"\"\n  \"\\x88\"\"\\xB7\"\"\\xE6\"\"\\xDA\"\"...</font></a><br>\\r<img src='../jokes/images/10\"\n  \"042007/homelatifa.jpg' border='0' align='left'>\\r<font face='au' color='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xE3\"\"\\xE6\"\"\\xF0\"\"\\xBB\"\"\\xE6\"\"\\xD0\"\"\\xD3\"\"\\xD6\"\"v\\xCC\"\" \\xD5\"\"\\xE6\"\"\\xF0\"\"\"\n  \"\\xDC\"\"\\xE6\"\"- \\xD2\"\"\\xD5\"\"\\xE6\"\"\\xD5\"\"\\xE6\"\", \\xA7\"\"\\xE2\"\"\\xE2\"\"\\xF0\"\" \\xCC\"\"\"\n  \"\\xE6\"\"\\xF0\"\" \\xA5\"\"\\x91\"\"\\xC0\"\"\\xE6\"\" \\xE3\"\"\\xE6\"\"\\xF0\"\"\\xCC\"\"\\xE6\"\" \\xE7\"\"\"\n  \"\\xB7\"\" \\xA5\"\"\\xE6\"\"\\xC2\"\" 500 L\\xC2\"\"\\xB0\"\" \\xB7\"\"\\xE6\"\" \\xB0\"\"\\xB7\"\" \\xD9\"\"\"\n  \"\\xE6\"\"\\xF0\"\"\\xC5\"\" \\xE7\"\"\\xD9\"\"\\xB7\"\"\\xE6\"\"&nbsp;...</font>\\r</td></tr>\\r\"\n  \"            </table>\\r        </td>\\r        </tr>\\r        </table>\\r</\"\n  \"td>\\r</tr>\\r</table>\\r<table border='0' width = '98%' cellspacing='0' ce\"\n  \"llpadding='0' align='center' valign='top'>\\r<tr>\\r<td width='50%'>\\r    \"\n  \"    <table border='0' width = '100%' cellspacing='0' cellpadding='0' ali\"\n  \"gn='center' valign='top'>\\r        <tr>\\r        <td width='49%' align='\"\n  \"center' valign='top'>\\r            <table border='0' width = '100%' cell\"\n  \"spacing='0' cellpadding='0' align='center' valign='top'>\\r              \"\n  \"  <tr><td align='center'><a href=\\\"../ghar/advise.asp\\\" target=\\\"new\\\"><\"\n  \"img src=\\\"../image/gharmash.jpg\\\" border='0'></a></td></tr>\\r           \"\n  \"     <tr><td valign='top'>\\r<a href=\\\"../ghar/advise.asp#201\\\" target=\\\"\"\n  \"new\\\"><font face='au' color='red'>\\xC2\"\"\\xFD\"\"\\xE0\"\"\\xD9\"\"-</font><font \"\n  \"face='au' color='#000000'>\\xD7\"\"\\xF1\"\"\\xB4\"\"\\xD9\"\"\\xF0\"\" \\xC8\"\"\\xEA\"\"\\xC7\"\"\"\n  \" \\xC5\"\"\\xF0\"\"v\\xD9\"\"\\xF4\"\"\\xDC\"\"\\xE6\"\"\\xF2\"\"\\xC1\"\"\\xE8\"\" \\xD7\"\"\\xF0\"\"\\xB4\"\"\"\n  \" \\xB0\"\"\\xD7\"\"\\xB0\"\"\\xE2\"\"\\xE2\"\"\\xE8\"\" \\xE7\"\"\\xB7\"\"\\xD8\"\"\\xE6\"\" \\xE3\"\"\\xF1\"\"\"\n  \"\\xD0\"\" \\xA5\"\"\\xD5\"\" \\xD7\"\"\\xF1\"\"\\xB4\"\" \\xC8\"\"\\xEA\"\"\\xC7\"\" \\xC5\"\"\\xF0\"\"v\\xD9\"\"\"\n  \"\\xF4\"\"\\xDC\"\"\\xE6\"\"\\xF2\"\"\\xC1\"\"\\xE8\"\" \\xD7\"\"\\xF0\"\"\\xA2\"\"\\xB4\"\" \\xB0\"\"\\xD7\"\"\"\n  \"\\xC5\"\"\\xF0\"\"\\xB7\"\" &nbsp;..</font></a>\\r<font face='au' color='black'>\\r\"\n  \"</font><br>\\r<a href=\\\"../ghar/advise.asp#200\\\" target=\\\"new\\\"><font fac\"\n  \"e='au' color='red'>\\xC2\"\"\\xFD\"\"\\xE0\"\"\\xD9\"\"-</font><font face='au' color\"\n  \"='#000000'>\\xD7\"\"\\xF1\"\"\\xB4\"\" M\\xDA\"\"\\xDC\"\" \\xC7\"\"\\xF0\"\"\\xDF\"\"\\xDC\"\"\\xC2\"\"\"\n  \"\\xD7\"\"\\xF0\"\"\\xB4\"\"\\xC5\"\" \\xB7\"\"\\xE6\"\"\\xF0\"\"\\xE2\"\"\\xF0\"\"\\xFC\"\" \\xB7\"\"\\xF0\"\"\"\n  \"  \\xD5\"\"\\xE6\"\"\\xDA\"\"\\xF0\"\" \\xD7\"\"\\xF0\"\"\\xB4\"\" \\xC1\"\"\\xE6\"\"\\xD9\"\"\\xD9\"\"\\xE6\"\"\"\n  \" \\xBF\"\"\\xE6\"\"\\xE3\"\"\\xCC\"\"\\xE6\"\" \\xE3\"\"\\xEA\"\"\\xA2\"\"\\xD0\"\" \\xA7\"\"\\xE2\"\" \\xB7\"\"\"\n  \"\\xE6\"\"\\xF0\"\"\\xE2\"\"\\xFC\"\" \\xD7\"\"\\xF0\"\"\\xB4\"\" \\xA5\"\"\\xE6\"\"\\xDF\"\"\\xF0\"\"\\xCE\"\"\"\n  \"\\xD9\"\" &nbsp;..</font></a>\\r<font face='au' color='black'>\\r</font><br>\\r\"\n  \"<a href=\\\"../ghar/advise.asp#199\\\" target=\\\"new\\\"><font face='au' color=\"\n  \"'red'>\\xC2\"\"\\xFD\"\"\\xE0\"\"\\xD9\"\"-</font><font face='au' color='#000000'>v\\xD8\"\"\"\n  \"\\xE6\"\" \\xDA\"\"v\\xCC\"\"\\xCE\"\"\\xE6\"\"\\xD9\"\" \\xB7\"\"\\xDA\"\"\\xD9\"\"\\xF0\"\" \\xE2\"\"\\xF0\"\"\"\n  \" \\xE2\"\"\\xA2\"\"\\xB7\"\"\\xFD\"\"\\xE6\"\"\\xD7\"\"\\xB7\"\"  \\xD5\"\"\\xE8\"\"\\xD7\"\"\\xE6\"\"\\xE7\"\"\"\n  \"\\xDA\"\"\\xD8\"\"\\xE6\"\"\\xA2\"\" \\xE3\"\"\\xF4\"\"\\xD9\"\"\\xF0\"\" \\xB7\"\"\\xE6\"\" \\xB9\"\"\\xCC\"\"\"\n  \"\\xDA\"\"\\xE6\"\" \\xD5\"\"\\xC9\"\"\\xB8\"\" \\xC1\"\"\\xE6\"\"\\xCC\"\"\\xE6\"\" \\xE3\"\"\\xF1\"\"\\xD0\"\"\"\n  \" \\xA7\"\"\\xE2\"\" \\xD5\"\"\\xE6\"\"\\xDA\"\"\\xF0\"\" &nbsp;..</font></a>\\r<font face='\"\n  \"au' color='black'>\\r</font><br>\\r                </td></tr>\\r           \"\n  \"  </table>\\r        </td>\\r        <td width='2%' valign='top'><img src=\"\n  \"'../image/line.jpg' border='0'></td>\\r        <td width='49%' valign='to\"\n  \"p'>\\r            <table border='0' width = '100%' cellspacing='0' cellpa\"\n  \"dding='0' align='center' valign='top'>\\r                <tr><td>\\r<table\"\n  \" border = \\\"0\\\" width = \\\"100%\\\" cellspacing = \\\"0\\\" cellpadding = \\\"0\\\"\"\n  \">\\r                <tr><td width = \\\"30%\\\" align = \\\"left\\\"><a href=\\\"..\"\n  \"/newcareer/default.asp\\\" target='new'><img border='0' src='../images/hom\"\n  \"epagenew/career.gif'></a></td>\\r                    <td width = \\\"70%\\\" \"\n  \"align = \\\"center\\\">\\r<a href=\\\"../result/default.asp\\\" target=\\\"new\\\"><i\"\n  \"mg src='../image/tlink_result.gif' border='0'></a>\\r                    \"\n  \" </td>\\r                </tr>\\r            </table>\\r                </t\"\n  \"d></tr>\\r                <tr><td>\\r<a href='../newcareer/detail.asp?sec_\"\n  \"id=1 & 505' ><font face='AU' size='4' color='#FF0000'>\\xC2\"\"\\xFD\"\"\\xE0\"\"\"\n  \"\\xD9\"\" \\xD7\"\"\\xF0\"\"\\xB4\"\" \\xE3\"\"\\xE8\"\" \\xE7\"\"\\xC0\"\"\\xC2\"\"\\xE6\"\" \\xE3\"\"\\xF1\"\"\"\n  \" \\xE3\"\"\\xDC\"\"</font></a><br>\\r<img src='../newcareer/image/20070405/queh\"\n  \"ome.jpg' border='0' align='left' width='50' height='60'>\\r<font face='au\"\n  \"' color='black' size='3'>\\xA7\"\"\\xA2\"\"\\xC1\"\"\\xE8\"\"\\xE7\"\"\\xD9\"\"\\xD8\"\"\\xE7\"\"\"\n  \"\\xDA\"\"\\xA2\"\"\\xBB\"\" \\xB0\"\"\\xB7\"\" \\xB0\"\"\\xF0\"\"\\xE2\"\"\\xE6\"\" \\xC8\"\"\\xE8\"\"\\xCB\"\"\"\n  \"\\xC7\"\" \\xE3\"\"\\xF1\"\", \\xE7\"\"\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"\" \\xB7\"\"\\xDA\"\"\\xD9\"\"\\xF0\"\"</font><font face='arial'>..\"\n  \".</font>\\r                </td></tr>\\r            </table>\\r        </td\"\n  \">\\r        </tr>\\r        </table>\\r</td>\\r</tr>\\r</table>\\r</td>\\r<td w\"\n  \"idth='130' valign='top' rowspan='2'>\\r<table border='0' width='100%'><tr\"\n  \"><td>\\r<table width='100%' border='0' cellspacing='1' cellpadding='1' bg\"\n  \"color = '#2C4FA0' >\\r<tr>\\r<td bgcolor = '#0b61c2' align='center' height\"\n  \"='10'><a href=\\\"../shubh/section.asp?sec=3\\\" target=\\\"new\\\"><font face='\"\n  \"AU' size='4' color='#FFFFFF'>\\xD9\"\"\\xB0\"\" \\xA9\"\"\\x88\"\"\\xC2\"\"\\xE6\"\"\\xCE\"\"\"\n  \"</font></a></td>\\r</tr>\\r<tr>\\r<td bgcolor='#F3F3F4' align='right' heigh\"\n  \"t='0'></td>\\r</tr>\\r<tr>\\r<td bgcolor='#DDECFD' align='left' valign='top\"\n  \"'>\\r<table width='99%' border='0' cellspacing='0' cellpadding='0' >\\r<tr\"\n  \">\\r<td valign='top' width='1%'>&nbsp;<img src='../image/arrow.gif' borde\"\n  \"r='0'>&nbsp;</td><td width='98%' align='left'><a href=\\\"../shubh/fullmai\"\n  \"n.asp?sid=1&filename=new&foldername=20070408&sec=3\\\" target=\\\"new\\\"><fon\"\n  \"t face='AU' size='3' color='#04135E'>\\xD7\"\"\\xF1\"\"v\\xE2\"\" \\xC8\"\"\\xF1\"\"\\xA4\"\"\"\n  \"v\\xC5\"\"U\\xDA\"\"U \\xB0\"\"\\xC1\"\" \\xE7\"\"\\xDA\"\"U\\x8B\"\"\\xD8\"\"\\xEA\"\"</font></a>\\r\"\n  \"</td>\\r</tr>\\r<tr>\\r<td valign='top' width='1%'>&nbsp;<img src='../image\"\n  \"/arrow.gif' border='0'>&nbsp;</td><td width='98%' align='left'><a href=\\\"\"\n  \"../shubh/fullmain.asp?sid=1&filename=new&foldername=20070401&sec=3\\\" tar\"\n  \"get=\\\"new\\\"><font face='AU' size='3' color='#04135E'>\\xC5\"\"U\\xE6\"\"\\xA7\"\"\"\n  \"\\xD7\"\"\\xF0\"\"v\\xE2\"\" \\xB7\"\"\\xA4\"\"\\xE8\"\" \\xE7\"\"\\xCE\"\"\\xE0\"\"\\xE6\"\"\\xE6\"\" \\x99\"\"\"\n  \"\\xE6\"\"\\xE6\"\"\\xD9\"\" \\xCE\"\"\\xF0\"\"\\xD9\"\"\\xF0\"\" \\xDF\"\"\\xE6\"\"\\xDC\"\"\\xE8\"\" ..<\"\n  \"/font></a>\\r</td>\\r</tr>\\r<tr>\\r<td valign='top' width='1%'>&nbsp;<img s\"\n  \"rc='../image/arrow.gif' border='0'>&nbsp;</td><td width='98%' align='lef\"\n  \"t'><a href=\\\"../shubh/fullmain.asp?sid=1&filename=new&foldername=2007031\"\n  \"8&sec=3\\\" target=\\\"new\\\"><font face='AU' size='3' color='#04135E'>\\xB0\"\"\"\n  \"v\\xE0\"\"\\xE6\"\"\\xD9\"\" \\xB7\"\"\\xF0\"\"\\xA4\"\" \\xE3\"\"U\\xCB\"\"\\xB7\"\"\\xF0\"\"\\xA4\"\" \\xE2\"\"\"\n  \"\\xF1\"\"\\xB4\"\"\\xC7\"\"U\\xDC\"\"</font></a>\\r</td>\\r</tr>\\r<tr>\\r<td valign='to\"\n  \"p' width='1%'>&nbsp;<img src='../image/arrow.gif' border='0'>&nbsp;</td>\"\n  \"<td width='98%' align='left'><a href=\\\"../shubh/fullmain.asp?sid=1&filen\"\n  \"ame=new&foldername=20070311&sec=3\\\" target=\\\"new\\\"><font face='AU' size=\"\n  \"'3' color='#04135E'>\\xE2\"\"\\xE6\"\"\\xF0\"\"\\xD9\"\"\\xE8\"\" \\xB7\"\"\\xA4\"\"\\xE6\"\" \\xC2\"\"\"\n  \"\\xF1\"\"\\xD9\"\"\\xDC\"\" \\xC2\"\"\\xE8\"\"\\xE2\"\"\\xE8\"\"</font></a>\\r</td>\\r</tr>\\r</\"\n  \"table>\\r</td>\\r</tr>\\r</table>\\r</td></tr>\\r<tr><td valign='top'>\\r<tabl\"\n  \"e width='100%' border='0' cellspacing='1' cellpadding='1' bgcolor='#FFBC\"\n  \"00'>\\r<tr>\\r<td bgcolor='brown' align='center'><a href=\\\"../Wallpaper/De\"\n  \"fault.asp\\\" Target=\\\"new\\\"><font face='AU' size='4' color='#FFFFFF'><b>\\xDF\"\"\"\n  \"\\xE6\"\"\\xF2\"\"\\xDC\"\"\\xC2\"\"\\xF0\"\"\\xC2\"\"\\xDA\"\"</b></font></a></td>\\r</tr>\\r<\"\n  \"tr>\\r<td >\\r<table width='100%' border='0' cellspacing='0' cellpadding='\"\n  \"0' >\\r<tr>\\r<td  valign='top' ALIGN='center' bgcolor='#FFBC00' height=96\"\n  \">\\r<a href='../wallpaper/default.asp' target='new'><img border='0' src='\"\n  \"../image/wall.gif' align='center' width=124 height=100></a></td>\\r</tr>\\r\"\n  \"</td>\\r</tr>\\r</table>\\r</td>\\r</tr>\\r</table>\\r</td></tr>\\r<tr><td vali\"\n  \"gn='top'>\\r<table width='100%' border='0' cellspacing='1' cellpadding='1\"\n  \"' bgcolor = '#2C4FA0' height='150' align='top'>\\r<tr>\\r<td bgcolor='#316\"\n  \"5CE' align='center'><a href=\\\"../Jaika/default.asp\\\" target=\\\"new\\\"><fon\"\n  \"t face='AU' size='4' color='#FFFFFF'>\\xC1\"\"\\xE6\"\"\\xD8\"\"\\xB7\"\"\\xE6\"\"</fon\"\n  \"t></a></td>\\r</tr>\\r<tr>\\r<td bgcolor='#F3F3F4' align='right' height='0'\"\n  \"></td>\\r</tr>\\r<tr>\\r<td bgcolor='#F3F3F4' align='left' valign='top'>\\r<\"\n  \"table width='98%' border='0' cellspacing='2' cellpadding='0' align='cent\"\n  \"er' bgcolor='#F3F3F4'>\\r<tr>\\r<td>\\r<a href=\\\"../jaika/detail.asp?folder\"\n  \"name=20041106&heading=\\xB7\"\"\\xE6\"\"\\xC1\"\"\\xEA\"\"-\\xD7\"\"\\xB9\"\"\\xE6\"\"\\xD9\"\"\\xF0\"\"\"\n  \" \\xDF\"\"\\xE6\"\"\\xDC\"\"\\xE6\"\" \\xD9\"\"\\xD7\"\"\\xB7\"\"\\xE8\"\"\\xD9\"\"&sid=3\\\" target=\"\n  \"\\\"new\\\"><font face='AU' size='3' color='blue'>\\xB7\"\"\\xE6\"\"\\xC1\"\"\\xEA\"\"-\\xD7\"\"\"\n  \"\\xB9\"\"\\xE6\"\"\\xD9\"\"\\xF0\"\" \\xDF\"\"\\xE6\"\"\\xDC\"\"\\xE6\"\" \\xD9\"\"\\xD7\"\"\\xB7\"\"\\xE8\"\"\"\n  \"\\xD9\"\"</font></a>\\r<div align='justify'><font face='AU' size='3' color='\"\n  \"#04135E'>\\xD7\"\"\\xF1\"\"\\xCE\"\"\\xE6\"\" \\xD7\"\"\\xF0\"\"\\xB4\"\" \\xBB\"\"\\xDA\"\"\\xD7\"\" \"\n  \"\\x83\"\"\\xE6\"\"\\xE8\"\" \\xB7\"\"\\xE6\"\" \\xD7\"\"\\xE6\"\"\\xF0\"\"\\xD8\"\"\\xD9\"\" \\xC7\"\"\\xE6\"\"\"\n  \"\\xDC\"\"\\xF0\"\"\\xB4\"\"\\xD0\"\" \\xA9\"\"\\xE2\"\"\\xD7\"\"\\xF0\"\"\\xB4\"\" \\xE2\"\"\\xEA\"\"\\xC1\"\"\"\n  \"\\xE8\"\", \\xC2\"\"\\xE9\"\"\\xCE\"\"\\xE8\"\"\\xD9\"\"\\xE6\"\", \\xD9\"\"\\xD7\"\"\\xB7\"\", \\xA5\"\"\"\n  \"\\xC1\"\"\\xDF\"\"\\xE6\"\"\\xD8\"\"\\xD9\"\" \\xE2\"\"\\xD6\"\"\\xE8\"\" \\xA5\"\"\\x91\"\"\\xC0\"\"\\xE8\"\"\"\n  \" \\xCC\"\"\\xDA\"\"\\xE3\"\" \\xE7\"\"\\xD7\"\"\\xDC\"\"\\xE6\"\"\\xB0\"\"\\xA2\"\" \\xA5\"\"\\xE6\"\"\\xF1\"\"\"\n  \"\\xDA\"\" \\xC2\"\"\\xEA\"\"\\xDA\"\"\\xE8\"\" \\xD5\"\"\\xF0\"\"\\xDC\"\"\\xD9\"\"\\xF0\"\" </font>\\r\"\n  \"</div></td>\\r</tr>\\r</table>\\r</td>\\r</tr>\\r</table>\\r</td></tr>\\r<tr><t\"\n  \"d valign='top'>\\r<table width='100%' border='0' cellspacing='1' cellpadd\"\n  \"ing='1' bgcolor = '#2C4FA0' >\\r<tr>\\r<td bgcolor='#0286bd' align='center\"\n  \"' height='10'><a href=\\\"../Aakhar/default.asp\\\" target=\\\"new\\\"><font fac\"\n  \"e='AU' size='4' color='#FFFFFF'>\\xA5\"\"\\xE6\"\"\\xB9\"\"\\xDA\"\"</font></a></td>\"\n  \"\\r</tr>\\r<tr>\\r<td bgcolor='#F3F3F4' align='right' height='0'></td>\\r</t\"\n  \"r>\\r<tr>\\r<td bgcolor='#eaf8fe' align='left' valign='top'>\\r<table width\"\n  \"='99%' border='0' cellspacing='2' cellpadding='0' align='center' >\\r<tr>\"\n  \"\\r<td width='98%'>\\r<a href=\\\"../Aakhar/detail.asp?section_id=1&id=362\\\"\"\n  \" target=\\\"new\\\"><font face='AU' size='3' color='blue'>\\xE7\"\"\\xC8\"\"\\xDA\"\"\"\n  \" \\xD9\"\"\\xE6\"\"\\xDA\"\"\\xE8\"\" \\xB7\"\"\\xE6\"\" \\xCE\"\"\\xCE\"\"\\xFC\"\" \\xA9\"\"\\xB7\"\"\\xF0\"\"\"\n  \"\\xDA\"\"\\xD9\"\"\\xF0\"\" \\xD7\"\"\\xF0\"\"\\xB4\"\" \\xC1\"\"\\xE9\"\"\\xC5\"\"\\xE8\"\"\\xA2\"\" </f\"\n  \"ont></a><br>\\r<div align='justify'><font face='AU' size='3' color='#0000\"\n  \"00'> \\xB7\"\"\\xC5\"\"\\xF7\"\"\\xC5\"\"\\xDA\"\"\\xC2\"\"\\xA2\"\"\\xE7\"\"\\xCD\"\"\\xD8\"\"\\xF4\"\"\\xB4\"\"\"\n  \" \\xC2\"\"\\xDA\"\" \\xE7\"\"\\xC5\"\"\\x8C\"\"\\xC2\"\"\\x87\"\"\\xE6\"\"\\xE8\"\" \\xB7\"\"\\xE8\"\" \\xDF\"\"\"\n  \"\\xC1\"\"\\xE3\"\" \\xE2\"\"\\xF0\"\" \\xD5\"\"\\xE6\"\"\\xA2\"\"\\x82\"\"\\xDC\"\"\\xE6\"\"\\xCE\"\"\\xF0\"\"\"\n  \"\\xE0\"\"\\xE6\"\" \\xE2\"\"\\xF0\"\" \\xE7\"\"\\xD9\"\"\\xDF\"\"\\xE6\"\"\\xFC\"\"\\xE2\"\"\\xD9\"\" \\xDB\"\"\"\n  \"\\xE6\"\"\\xF0\"\"\\xDC\"\" \\xDA\"\"\\xE3\"\"\\xE8\"\" \\xDC\"\"\\xF0\"\"\\xE7\"\"\\xB9\"\"\\xB7\"\"\\xE6\"\"\"\n  \" </font></div>\\r</td>\\r</tr>\\r</table>\\r</td>\\r</tr>\\r</table>\\r</td></t\"\n  \"r>\\r<tr><td valign='top'>\\r</td>\\r</tr>\\r</table>\\r<table width='100%' b\"\n  \"order='0' cellspacing='0' cellpadding='0'>\\r<tr align='center' >\\r<td bg\"\n  \"color = '#2C4FA0' height='5'><font face='AU' color='#FFFFFF' size='3'>\\xA5\"\"\"\n  \"\\xD7\"\"\\xDA\"\" \\xA9\"\"\\xC1\"\"\\xE6\"\"\\xDC\"\"\\xE6\"\" \\xC1\"\"\\xD9\"\"\\xD7\"\"\\xCC\"\"</fo\"\n  \"nt></td>\\r</tr>\\r<tr>\\r<td>\\r<TABLE border=0 cellPadding=0 cellSpacing=0\"\n  \" width=128  bgcolor='#F3F3F4' colspan=3>\\r<tr>\\r<td height='5' bgcolor='\"\n  \"#ffffff'></td>\\r</tr>\\r<form method=post action='http://www.amarujala.co\"\n  \"m/poll/pollhindi.asp' TARGET='win1'>\\r<tr><td width='2' height='2' bgcol\"\n  \"or='#ffffff'></td></tr>\\r<tr><TD align=center vAlign=center colspan=2><t\"\n  \"able width=100%>\\r<tr><td colspan=2>\\r\\n<TABLE width=\\\"100%\\\">\\r\\n\\t<TR>\"\n  \"\\r\\n\\t\\t<TD colspan=\\\"4\\\" valign=\\\"top\\\"><div align=\\\"justify\\\"><font fa\"\n  \"ce=\\\"au\\\">v\\xD8\"\"\\xE6\"\" \\xE2\"\"\\xE7\"\"\\xBF\"\"\\xD9\"\" \\xCC\"\"\\xF0\"\"\\xB4\"\"\\xCE\"\"\"\n  \"\\xE9\"\"\\xDC\"\"\\xB7\"\"\\xA4\"\"\\xDA\"\" m\\xE6\"\"\\xDA\"\"\\xE6\"\" \\xB7\"\"\\xF0\"\"\\xA4\"\"\\xB7\"\"\"\n  \"\\xA4\"\"\\xA4\"\"\\xC2\"\"\\xDA\"\" \\xD5\"\"\\xD9\"\"\\xE6\"\" \\xE7\"\"\\xCC\"\"\\xDA\"\"\\xA2\"\"\\xBB\"\"\"\n  \"\\xE6\"\" \\xB7\"\"\\xA4\"\"\\xE6\"\"\\xC5\"\"\\xD9\"\"\\xE6\"\" \\xB7\"\"\\xA4\"\"\\xDA\"\"\\xE6\"\"\\xF0\"\"\"\n  \"\\xC7\"\"\\xB8\"\"\\xE6\"\"\\xF0\"\"\\xB4\"\" \\xD6\"\"\\xE6\"\"\\xDA\"\"\\xCC\"\"\\xE8\"\"\\xD8\"\"\\xE6\"\"\"\n  \"\\xF0\"\"\\xB4\"\" \\xB7\"\"\\xA4\"\"\\xE6\"\" \\xA5\"\"\\xC2\"\"\\xD7\"\"\\xE6\"\"\\xD9\"\" \\xB7\"\"\\xA4\"\"\"\n  \"\\xE3\"\"\\xE6\"\" \\xC1\"\"\\xE6\"\"\\xD9\"\"\\xE6\"\" \\xBF\"\"\\xE6\"\"\\xE7\"\"\\xE3\"\"\\xB0\"\"?</f\"\n  \"ont></div>\\r\\n\\t\\t</TD>\\r\\n\\t</TR>\\r\\n\\t<tr>\\r\\n\\t\\t\\r\\n\\t\\t<td bgcolor=\"\n  \"\\\"#dddddd\\\" align=\\\"center\\\" valign=\\\"top\\\"><input type=\\\"radio\\\" name=\\\"\"\n  \"ans\\\" value=\\\"1\\\"><br>\\r\\n\\t\\t\\t<font face=\\\"au\\\">\\r\\n\\t\\t\\t\\t\\xE3\"\"\\xE6\"\"\"\n  \"\\xA1\"\"\\r\\n\\t\\t\\t</font>\\r\\n\\t\\t</td>\\r\\n\\t\\t\\r\\n\\t\\t<td bgcolor=\\\"#ddddd\"\n  \"d\\\" align=\\\"center\\\" valign=\\\"top\\\"><input type=\\\"radio\\\" name=\\\"ans\\\" v\"\n  \"alue=\\\"2\\\"><br>\\r\\n\\t\\t\\t<font face=\\\"au\\\">\\r\\n\\t\\t\\t\\t\\xD9\"\"\\xE3\"\"\\xE8\"\"\"\n  \"\\xB4\"\"\\r\\n\\t\\t\\t</font>\\r\\n\\t\\t</td>\\r\\n\\t\\t\\r\\n\\t\\t<td bgcolor=\\\"#ddddd\"\n  \"d\\\" align=\\\"center\\\" valign=\\\"top\\\"><input type=\\\"radio\\\" name=\\\"ans\\\" v\"\n  \"alue=\\\"3\\\"><br>\\r\\n\\t\\t\\t<font face=\\\"au\\\">\\r\\n\\t\\t\\t\\t\\xC2\"\"\\xCC\"\"\\xE6\"\"\"\n  \" \\xD9\"\"\\xE3\"\"\\xE8\"\"\\r\\n\\t\\t\\t</font>\\r\\n\\t\\t</td>\\r\\n\\t\\t\\r\\n\\t</tr>\\r\\n\"\n  \"\\t<tr>\\r\\n\\t\\t\\r\\n\\t</tr>\\r\\n</TABLE>\\r\\n</td></tr>\\r<tr><td align=cente\"\n  \"r colspan=2>\\r<input name=submit onclick=\\\" newwin=window.open('','win1'\"\n  \",'toolbar=no,directories=no, resize=no, menubar=no,location=no,scrollbar\"\n  \"s=no,width=510,height=400,maximize=no,minimize=no');\\\" style=\\\"color:#ff\"\n  \"ffff;background:#3366CC;FONT-FAMILY: au; font-size: small;\\\" type=submit\"\n  \" value=\\\"\\xA5\"\"\\xE6\"\"\\xC2\"\"\\xB7\"\"\\xE6\"\" \\xD7\"\"\\xCC\"\"\\\"></td></tr></form>\"\n  \"\\r<tr><td align=right>\\r<a href='#' onclick=\\\"javascript:window.open('ht\"\n  \"tp://www.amarujala.com/poll/previoushindi.asp','win1','toolbar=no,direct\"\n  \"ories=no, resize=no, menubar=no,location=no,scrollbars=no,width=320,heig\"\n  \"ht=350,maximize=no,minimize=no');\\\"><font color='#0058B0' face='au' size\"\n  \"='3'><p align='center'>\\xE7\"\"\\xC2\"\"\\xC0\"\"\\xDC\"\"\\xE6\"\" \\xE2\"\"\\xDF\"\"\\xF0\"\"\"\n  \"\\xFC\"\"\\xFF\"\"\\xE6\"\"\\x87\"\"\\xE6\"\"</p></font></a></td></tr>\\r</table>\\r</td>\"\n  \"</tr>\\r</table>\\r</table>\\r</td>\\r</tr>\\r<tr><td>\\r<script language='jav\"\n  \"ascript'>\\rvar sURL='default.asp';\\rfunction ticker()\\r{\\rsetTimeout('ti\"\n  \"ckerupdate()',600*1000);\\r}\\rfunction tickerupdate()\\r{\\rwindow.location\"\n  \".href=sURL;\\r}\\r</script>\\r<script language='javascript'>\\rticker();\\r</\"\n  \"script>\\r<table border='0' cellspacing='1' cellpadding='1' width='98%' a\"\n  \"lign='center' valign='top'>\\r<tr>\\r<td align='center'>\\r<html>\\r\\n\\r\\n<h\"\n  \"ead>\\r\\n<meta http-equiv=\\\"Content-Language\\\" content=\\\"en-us\\\">\\r\\n<met\"\n  \"a http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=windows-1252\\\"\"\n  \">\\r\\n<meta name=\\\"GENERATOR\\\" content=\\\"Microsoft FrontPage 4.0\\\">\\r\\n<m\"\n  \"eta name=\\\"ProgId\\\" content=\\\"FrontPage.Editor.Document\\\">\\r\\n<title>New\"\n  \" Page 1</title>\\r\\n</head>\\r\\n\\r\\n<body topmargin=\\\"0\\\" leftmargin=\\\"0\\\"\"\n  \">\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n<div align=\\\"center\\\">\\r\\n  <table border=\\\"0\\\" wid\"\n  \"th=\\\"468\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\">\\r\\n    <tr>\\r\\n      <td\"\n  \" valign=\\\"top\\\" align=\\\"left\\\"><map name=\\\"FPMap0\\\"><area href=\\\"#\\\" onc\"\n  \"lick=\\\"javascript:window.open('../smsivr/sms.htm','sms','top=50,left=150\"\n  \",width=520,height=450,scrollbars=yes')\\\" style=\\\"cursor:hand\\\" shape=\\\"r\"\n  \"ect\\\" coords=\\\"359, 48, 386, 59\\\"><area href=\\\"#\\\" onclick=\\\"javascript:\"\n  \"window.open('../smsivr/ivr.htm','ivr','top=50,left=150,width=520,height=\"\n  \"450,scrollbars=yes')\\\" style=\\\"cursor:hand\\\" shape=\\\"rect\\\" coords=\\\"394\"\n  \", 49, 440, 59\\\"></map><img border=\\\"0\\\" src=\\\"../smsivr/banner_468x60.gi\"\n  \"f\\\" usemap=\\\"#FPMap0\\\" width=\\\"468\\\" height=\\\"60\\\" style=\\\"border: 1 sol\"\n  \"id #000000\\\"></td>\\r\\n    </tr>\\r\\n  </table>\\r\\n</div>\\r\\n\\r\\n\\r\\n\\r\\n\\r\"\n  \"\\n</body>\\r\\n\\r\\n</html>\\r\\n\\r</td>\\r</tr>\\r</table>\\r<A href = 'archive\"\n  \"'>\\r<table border='0' cellspacing='1' cellpadding='1' width='98%' align=\"\n  \"'center' valign='top'>\\r<tr bgcolor='ffffff'>\\r<td valign='center' bgcol\"\n  \"or='#9977ff'>\\r<table border=0 cellspacing=0 cellpadding=4 width='100%' \"\n  \"align=center valign=top>\\r<form name='amar'>\\r<tr>\\r<TD bgcolor='#3366CC\"\n  \"' align=center width='20%'><font face=au size=3 color='#ffffff'>\\xE7\"\"\\xC2\"\"\"\n  \"\\xC0\"\"\\xDC\"\"\\xF0\"\" \\xA5\"\"\\xA2\"\"\\xB7\"\"\\xA4\"\"</font></td>\\r<TD bgcolor='#f\"\n  \"fffeb' align=center width='20'><font face=au size=3>&nbsp;&nbsp;\\xCC\"\"\\xE6\"\"\"\n  \"\\xDA\"\"\\xE8\"\"\\xB9\"\"</font></td>\\r<TD bgcolor='#ffffeb' align=center width\"\n  \"='20%'><font face='arial' size=1><select name=day style='font-family: au\"\n  \";font-size=16'>\\r<option value=''>\\xCC\"\"\\xE6\"\"\\xDA\"\"\\xE8\"\"\\xB9\"\" &nbsp;&\"\n  \"nbsp;&nbsp;&nbsp;</option>\\r<option value= 10 selected>10</option>\\r<opt\"\n  \"ion value=01 >1</option>\\r<option value=02 >2</option>\\r<option value=03\"\n  \" >3</option>\\r<option value=04 >4</option>\\r<option value=05 >5</option>\"\n  \"\\r<option value=06 >6</option>\\r<option value=07 >7</option>\\r<option va\"\n  \"lue=08 >8</option>\\r<option value=09 >9</option>\\r<option value=10 >10</\"\n  \"option>\\r<option value=11 >11</option>\\r<option value=12 >12</option>\\r<\"\n  \"option value=13 >13</option>\\r<option value=14 >14</option>\\r<option val\"\n  \"ue=15 >15</option>\\r<option value=16 >16</option>\\r<option value=17 >17<\"\n  \"/option>\\r<option value=18 >18</option>\\r<option value=19 >19</option>\\r\"\n  \"<option value=20 >20</option>\\r<option value=21 >21</option>\\r<option va\"\n  \"lue=22 >22</option>\\r<option value=23 >23</option>\\r<option value=24 >24\"\n  \"</option>\\r<option value=25 >25</option>\\r<option value=26 >26</option>\\r\"\n  \"<option value=27 >27</option>\\r<option value=28 >28</option>\\r<option va\"\n  \"lue=29 >29</option>\\r<option value=30 >30</option>\\r<option value=31 >31\"\n  \"</option>\\r</select></font></td>\\r<TD bgcolor='#ffffeb' valign=middle wi\"\n  \"dth='10%'><font face=au size=3>\\xD7\"\"\\xE6\"\"\\xE3\"\"</font></td>\\r<TD bgcol\"\n  \"or='#ffffeb' valign=middle width='15%'><font face='arial' size=1>\\r<sele\"\n  \"ct name='month' style='font-family:au; font-size=16'>\\r<option value='12\"\n  \"'>\\xE7\"\"\\xCE\"\"\\xE2\"\"{\\xD5\"\"\\xDA\"\"</option>\\r<option value='11'>\\xD9\"\"\\xDF\"\"\"\n  \"{\\xD5\"\"\\xDA\"\"</option>\\r<option value='10'>\\xA5\"\"v\\xCC\"\"\\xEA\"\"\\xD5\"\"\\xDA\"\"\"\n  \"</option>\\r<option value='09'>\\xE7\"\"\\xE2\"\"\\xCC\"\"{\\xD5\"\"\\xDA\"\"</option>\\r\"\n  \"<option value='08'>\\xA5\"\"\\xBB\"\"S\\xCC\"\"</option>\\r<option value='07'>\\xC1\"\"\"\n  \"\\xE9\"\"\\xDC\"\"\\xE6\"\"\\xA7\"\"\\xFC\"\"</option>\\r<option value='06'>\\xC1\"\"\\xEA\"\"\"\n  \"\\xD9\"\"</option>\\r<option value='05'>\\xD7\"\"\\xA7\"\"\\xFC\"\"</option>\\r<option\"\n  \" value='04'Selected>\\xA5\"\"\\xC2\"\"\\xFD\"\"\\xF1\"\"\\xDC\"\"</option>\\r<option val\"\n  \"ue='03'>\\xD7\"\"\\xE6\"\"\\xBF\"\"\\xFC\"\"</option>\\r<option value='02'>\\xC8\"\"\\xDA\"\"\"\n  \"\\xDF\"\"\\xDA\"\"\\xE8\"\"</option>\\r<option value='01'>\\xC1\"\"\\xD9\"\"\\xDF\"\"\\xDA\"\"\"\n  \"\\xE8\"\"</option>\\r</select></font></td>\\r<TD bgcolor='#ffffeb' align=cent\"\n  \"er width='10%'><font face=au size=3>\\xDF\"\"\\xE1\"\"\\xFC\"\"</font></td>\\r<TD \"\n  \"bgcolor='#ffffeb' align=center width='20%'><font face='arial' size=1>\\r<\"\n  \"select name='year'>\\r<option value='2007' Selected>2007&nbsp;</option>\\r\"\n  \"<option value='2006'>2006&nbsp;</option>\\r<option value='2005'>2005&nbsp\"\n  \";</option>\\r<option value='2004'>2004&nbsp;</option>\\r<option value='200\"\n  \"3'>2003&nbsp;</option>\\r<option value='2002'>2002&nbsp;</option>\\r<optio\"\n  \"n value='2001'>2001&nbsp;</option>\\r</font>\\r</select></td>\\r<TD bgcolor\"\n  \"='#ffffeb' valign=center width='10%'><img src='../image/go1.gif' onclick\"\n  \"='sel()'></td>\\r</tr>\\r</form>\\r</table>\\r</td></tr>\\r</table>\\r</a>\\r</\"\n  \"td></tr>\\r</table>\\r<table border='0' cellpadding='0' width='760' cellsp\"\n  \"acing='0' >\\r<tr align='left'>\\r<td height='2'></td>\\r</tr>\\r<tr>\\r<td h\"\n  \"eight='2'></td>\\r</tr>\\r<tr>\\r<td bgcolor='#949c9c'align='center'> <a hr\"\n  \"ef='http://www.amarujala.com/aboutus/aboutus.htm'><font size='1' face='A\"\n  \"rial' color='#ffffff'>About us</font></a><font size='1' face='Arial' col\"\n  \"or='#ffffff'> | </font><a href='http://www.amarujala.com/aboutus/contact\"\n  \"us.htm'><font size='1' face='Arial' color='#ffffff'>Contactus</font></a>\"\n  \"<font size='1' face='Arial' color='#ffffff'> | </font><a href='http://ww\"\n  \"w.amarujala.com/aboutus/mediakit.htm'><font size='1' face='Arial' color=\"\n  \"'#ffffff'>Mediakit</font></a><font size='1' face='Arial' color='#ffffff'\"\n  \"> | </font><a href='http://www.amarujala.com/sitemap/default.asp'><font \"\n  \"size='1' face='Arial' color='#ffffff'>Site Map</font></a>\\r</tr>\\r<tr>\\r\"\n  \"<td height='2'></td>\\r</tr>\\r<tr>\\r<td bgcolor='#cb2828'align='center'> \"\n  \"<font color='#ffffff' size='1' face='Arial'>\\xA9\"\"AmarUjala.com\\r2007</f\"\n  \"ont></td>\\r</tr>\\r</table>\\r  </center>\\r<script language=\\\"javascript\\\"\"\n  \">\\rlogo.src = \\\"../image/au_main.gif\\\";\\rtopright.src=\\\"../image/worldcu\"\n  \"p07.gif\\\";\\rphome.src = \\\"10home.jpg\\\";\\r</script>\\r<script type='text/j\"\n  \"avascript' src='10e_var6_home.js'></script>\\r<script type='text/javascri\"\n  \"pt' src='../menu_com.js'></script>\\r<script language='javascript'>\\rwind\"\n  \"ow.open('../bharatmatrimony/bm_amarujala-genu-may17_300x300.html','bhara\"\n  \"tmatri','width=300,height=300,top=280,left=5,resize=yes')\\r</script>\\r<s\"\n  \"cript language='javascript'>\\rwindow.open('../shopping/Current/index.htm\"\n  \"','shopping_Nov','width=425,height=189,top=280,left=320,resize=yes')\\r</\"\n  \"script>\\r</body>\\r</html>\\r\"\n;\n\n\n\n// This one is really UTF-8, even though \"www.jagran.com\" matches JAGRAN\nconst char* kTestUrl52b = \"http://www.jagran.com/default.aspx\";\nconst char kTeststr52b[] =\n// Produced by stringify.cc on 2007-04-10 12:49 from file jagran_com.html\n  \"\\r\\n\\r\\n<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\"\"\n  \" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\">\\r\\n\\r\\n<ht\"\n  \"ml xmlns=\\\"http://www.w3.org/1999/xhtml\\\" >\\r\\n<head><title>\\r\\n\\tJagran\"\n  \".com - World's Largest Hindi Portal\\r\\n</title>\\r\\n<STYLE TYPE=\\\"text/cs\"\n  \"s\\\">\\r\\n<!-- /* $WEFT -- Created by: Webmaster (webmaster@jagran.com) on\"\n  \" 9/5/2006 -- */\\r\\n  @font-face {\\r\\n    font-family: Jagran;\\r\\n    fon\"\n  \"t-style:  normal;\\r\\n    font-weight: 700;\\r\\n    src: url(JAGRAN9.eot);\"\n  \"\\r\\n  }\\r\\n  @font-face {\\r\\n    font-family: Jagran;\\r\\n    font-style:\"\n  \"  normal;\\r\\n    font-weight: normal;\\r\\n    src: url(JAGRAN10.eot);\\r\\n\"\n  \"  }\\r\\n-->\\r\\n</STYLE>\\r\\n\\r\\n<script type=\\\"text/javascript\\\" language=\"\n  \"\\\"JavaScript1.2\\\" src=\\\"menu/stmenu.js\\\"></script>\\r\\n<script type=\\\"tex\"\n  \"t/javascript\\\" language=\\\"javascript\\\">\\r\\n\\r\\nfunction editor()\\r\\n{\\r\\n\"\n  \"window.open(\\\"http://www3.jagran.com/editor/editor.asp\\\",\\\"editor\\\",\\\"to\"\n  \"p=0,left=20,height=560,width=510,status=no,toolbar=no,menubar=no,locatio\"\n  \"n=no\\\",\\\"1\\\");\\r\\n}\\r\\nfunction jagranjobs()\\r\\n{\\r\\nwindow.open(\\\"http:\"\n  \"//www.jagran.com/jagranjobs.htm\\\",\\\"jagranjobs\\\",\\\"top=0,left=20,height=\"\n  \"460,width=560,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes\"\n  \"\\\",\\\"1\\\");\\r\\n}\\r\\nfunction banner()\\r\\n{\\r\\nwindow.open(\\\"\\\",\\\"bannerji\"\n  \"\\\",\\\"width=700,height=500,toolbar=no,location=no,directories=no,menubar=\"\n  \"no,scrollbars=yes,status=no,resizable=yes\\\",\\\"1\\\");\\r\\n}\\r\\n\\tfunction f\"\n  \"riend()\\r\\n\\t{\\r\\n\\twindow.open(\\\"\\\",\\\"abc\\\",\\\"height=380,width=400,stat\"\n  \"us=no,toolbar=no,menubar=no,location=no\\\",\\\"1\\\");\\r\\n\\t}\\r\\n\\tfunction M\"\n  \"M_preloadImages() {\\r\\n\\tvar d=document; if(d.images){ if(!d.MM_p) d.MM_\"\n  \"p=new Array();\\r\\n\\tvar i,j=d.MM_p.length,a=MM_preloadImages.arguments; \"\n  \"for(i=0; i<a.length; i++)\\r\\n\\tif (a[i].indexOf(\\\"#\\\")!=0){ d.MM_p[j]=ne\"\n  \"w Image; d.MM_p[j++].src=a[i];}}\\r\\n\\tinitGroup('sample')\\r\\n\\t}\\r\\n\\tva\"\n  \"r t1=new Image(7,7); t1.src=\\\"images/tag1r.gif\\\";\\r\\n\\tfunction pic(str)\"\n  \"\\r\\n\\t{\\r\\n\\t\\twindow.open(str,\\\"pic\\\",\\\"top=10,left=10,width=700,toolba\"\n  \"r=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resi\"\n  \"zable=yes\\\",\\\"1\\\");\\r\\n\\t}\\r\\n\\t\\tfunction pic1(str)\\r\\n\\t{\\r\\n\\t\\twindo\"\n  \"w.open(str,\\\"pic\\\",\\\"top=10,left=10,height=250,width=600,toolbar=no,loca\"\n  \"tion=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=yes\"\n  \"\\\",\\\"1\\\");\\r\\n\\t}\\r\\n\\tfunction openwindow()\\r\\n\\t{\\r\\n\\twindow.open(\\\"\\\"\"\n  \",\\\"abc\\\",\\\"top=0,left=0,height=300,width=300,status=no,toolbar=no,menuba\"\n  \"r=no,location=no\\\",\\\"1\\\");\\r\\n\\t}\\r\\n-->\\r\\n  </script>\\r\\n<script langu\"\n  \"age=javascript>\\r\\nfunction changestyle()\\r\\n{\\r\\nvar lt = document.getE\"\n  \"lementsByTagName('link');\\r\\nvar agt=navigator.userAgent.toLowerCase();\\r\"\n  \"\\nvar is_ie     = ((agt.indexOf(\\\"msie\\\") != -1) && (agt.indexOf(\\\"opera\"\n  \"\\\") == -1));\\r\\n    if (is_ie==false)\\r\\n    {\\r\\n        lt[0].href=\\\"n\"\n  \"ews/news.css\\\"\\r\\n    }\\r\\n}\\r\\n</script> \\r\\n\\r\\n    <link type=\\\"text/\"\n  \"css\\\" rel=\\\"Stylesheet\\\" href=\\\"news/Jagran.css\\\" /></head>\\r\\n<body bac\"\n  \"kground=\\\"images/bg.gif\\\" leftmargin=0 topmargin=0 onload=\\\"changestyle(\"\n  \")\\\">\\r\\n<table width=100% cellpadding=0 cellspacing=0 border=0>\\r\\n<tr><\"\n  \"td width=\\\"24%\\\">\\r\\n<table border=\\\"0\\\" cellPadding=\\\"0\\\" cellSpacing=\\\"\"\n  \"0\\\" width=\\\"100%\\\" align=\\\"left\\\">\\r\\n  <tr>\\r\\n    <td vAlign=\\\"top\\\">\\r\"\n  \"\\n      <table align=\\\"left\\\" background=\\\"images/logobg.gif\\\" style=\\\"b\"\n  \"ackground-repeat:no-repeat\\\" border=\\\"0\\\" cellPadding=\\\"0\\\" cellSpacing=\"\n  \"\\\"0\\\" width=\\\"100%\\\">\\r\\n        <tr><td align=\\\"left\\\" vAlign=\\\"top\\\"><\"\n  \"img align=absmiddle border=\\\"0\\\" src=\\\"images/logoimg.gif\\\" width=\\\"143\\\"\"\n  \" height=\\\"75\\\" alt=\\\"\\\">\\r\\n        <font face=arial></font><font face=\\\"\"\n  \"Jagran\\\" size=\\\"3\\\" color=darkblue><b><br />&nbsp;&nbsp;\\xE0\"\"\\xA4\"\"\\x86\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\x85\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\x86\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\xAA\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB8\"\"</b></font>\\r\\n        </td></tr>\\r\\n\"\n  \"      </table>\\r\\n    </td>\\r\\n  </tr>\\r\\n</table>\\r\\n</td><td valign=to\"\n  \"p height=\\\"75\\\" width=60%>\\r\\n<!-- Banner & Ticker Table -->    \\r\\n<tab\"\n  \"le border=\\\"0\\\" cellPadding=\\\"0\\\" cellSpacing=\\\"0\\\" width=\\\"100%\\\" align\"\n  \"=\\\"left\\\">\\r\\n  <tr><td align=\\\"left\\\" vAlign=\\\"top\\\"><img alt=\\\"\\\" bord\"\n  \"er=\\\"0\\\" height=\\\"2\\\" src=\\\"images/spacer.gif\\\" width=\\\"8\\\"></td></tr>\\r\"\n  \"\\n  <tr>\\r\\n    <td valign=bottom align=\\\"left\\\">\\r\\n<a href=\\\"http://sh\"\n  \"opping.jagran.com/\\\" target=_blank><img alt=\\\"\\\" src=\\\"images/shopbane1.\"\n  \"gif\\\" border=0 >    </td>\\r\\n  </tr>\\r\\n  <tr><td align=\\\"left\\\" vAlign=\"\n  \"\\\"top\\\"><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"2\\\" src=\\\"images/spacer.gif\\\"\"\n  \" width=\\\"8\\\"></td></tr>\\r\\n  <tr>\\r\\n\\t<th align=\\\"center\\\" valign=botto\"\n  \"m>\\r\\n\\t\\r\\n   <img alt=\\\"\\\" border=\\\"0\\\" src=\\\"images/news.gif\\\" width=\"\n  \"\\\"62\\\" height=\\\"15\\\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font face=\\\"Ja\"\n  \"gran\\\" color=\\\"blue\\\" size=\\\"3\\\"><marquee bgcolor=\\\"white\\\" align=\\\"midd\"\n  \"le\\\" width=\\\"82%\\\" scrollamount=\\\"3\\\">\\r\\n        \\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xB0\"\"\\xC2\"\"\\xA0\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB8\"\" \\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" \\xE0\"\"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A4\"\"\"\n  \"\\xAD\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xAF\"\" \\xE0\"\"\\xA4\"\"\\x85\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\x97\"\": \\xE0\"\"\\xA4\"\"\"\n  \"\\x96\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x82\"\"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/bulet1.\"\n  \"gif' align=bottom >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\r\\n \"\n  \"       \\r\\n</marquee></font></th>\\r\\n  </tr>\\r\\n</table></td>\\r\\n<td val\"\n  \"ign=top width=16%>\\r\\n<table border=\\\"0\\\" cellPadding=\\\"0\\\" cellSpacing=\"\n  \"\\\"0\\\" width=\\\"100%\\\" align=\\\"left\\\">\\r\\n  <tr><td height=3></td></tr>\\r\\n\"\n  \"  <tr>\\r\\n    <td valign=middle align=right>\\r\\n    <a href=\\\"http://www\"\n  \"1.jagran.com/ir\\\" target=_blank><img alt=\\\"\\\" border=\\\"0\\\" src=\\\"http://\"\n  \"www1.jagran.com/investor.gif\\\"></a>\\r\\n    </td></tr>    \\r\\n</table>\\r\\n\"\n  \"</td></tr>\\r\\n<tr><td colspan=3><!--font face=arial>Menu Bar</font-->\\r\\n\"\n  \"<script type=\\\"text/javascript\\\" language=\\\"JavaScript1.2\\\" src=\\\"menu/m\"\n  \"enu.js\\\"></script>\\r\\n</td></tr>\\r\\n</table>\\r\\n<script language=\\\"JavaS\"\n  \"cript\\\">\\r\\nfunction winClose()\\r\\n{\\r\\ndocument.all.Bannerc7.style.visi\"\n  \"bility=\\\"hidden\\\";\\r\\n\\r\\n}\\r\\n</script>\\r\\n<div id='Bannerc7' style='po\"\n  \"sition:absolute;visibility:visible;background-color:transparent; width: \"\n  \"230; height: 40; top: 140px; left: 420px'> \\r\\n  <object classid='clsid:\"\n  \"D27CDB6E-AE6D-11cf-96B8-444553540000'   codebase=\\\"'http://download.macr\"\n  \"omedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'\\\"  widt\"\n  \"h=230 height=40 id=OBJECT1 VIEWASTEXT>\\r\\n    <param name=movie value='h\"\n  \"ttp://www1.jagran.com/images/shadi230x40.swf'>\\r\\n    <param name=menu v\"\n  \"alue=false>\\r\\n    <param name=quality value=autolow>\\r\\n    <param name\"\n  \"=bgcolor value=transparent>\\r\\n    <param name=wmode value=transparent>\\r\"\n  \"\\n  </object>\\r\\n</div>\\r\\n<script language=\\\"Javascript\\\">setTimeout('w\"\n  \"inClose()',10000);</script>\\r\\n<table width=100% align=center border=0 c\"\n  \"ellspacing=0 cellpadding=0><tr>\\r\\n<td width=\\\"18%\\\" valign=TOP>\\r\\n\\r\\n\"\n  \"<!--table width=100% border=0 cellpadding=0 cellspacing=0>\\r\\n<tr><td wi\"\n  \"dth=18>&nbsp;</td><td align=\\\"left\\\" vAlign=\\\"top\\\"><img alt=\\\"\\\" border\"\n  \"=\\\"0\\\" height=\\\"1\\\" src=\\\"images/spacer.gif\\\" width=\\\"2\\\"></td></tr>\\r\\n\"\n  \"<tr><td width=18>&nbsp;</td><td align=\\\"left\\\" vAlign=\\\"top\\\">\\r\\n\\r\\n</\"\n  \"td></tr>\\r\\n<tr><td width=18>&nbsp;</td><td align=\\\"left\\\" vAlign=\\\"top\\\"\"\n  \"><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"1\\\" src=\\\"images/spacer.gif\\\" width\"\n  \"=\\\"2\\\"></td></tr>\\r\\n</table-->\\r\\n<table width=100% border=0 cellpaddin\"\n  \"g=0 cellspacing=0>\\r\\n<tr><td width=10>&nbsp;</td><td colspan=2><font fa\"\n  \"ce=\\\"Jagran\\\" size=\\\"4\\\">&nbsp;<b>\\xE0\"\"\\xA4\"\"\\x9A\"\"\\xE0\"\"\\xA5\"\"\\x88\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB8\"\"</b></\"\n  \"font></td></tr>\\r\\n<tr><td width=10>&nbsp;</td><td colspan=2 vAlign=\\\"to\"\n  \"p\\\" height=\\\"1\\\"><img alt=\\\"\\\" border=\\\"0\\\" src=\\\"images/line.gif\\\" heig\"\n  \"ht=\\\"1\\\"></td></tr>\\r\\n\\r\\n\\r\\n    \\r\\n    \\r\\n            <tr>\\r\\n<td w\"\n  \"idth=10>&nbsp;</td>\\r\\n<th><img src=images/bulet1.gif /></th><th align=l\"\n  \"eft><font face=jagran size=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl00_HyperLink\"\n  \"1\\\" title=\\\"Home Page\\\" href=\\\"/default.aspx\\\">\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x81\"\"\\xE0\"\"\\xA4\"\"\\x96\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\xAA\"\"\\xE0\"\"\\xA5\"\"\\x83\"\"\\xE0\"\"\\xA4\"\"\\xB7\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xA0\"\"</a></font></th></tr>\\r\\n            \\r\\n            <tr>\\r\\n<td w\"\n  \"idth=10>&nbsp;</td>\\r\\n<th><img src=images/bulet1.gif /></th><th align=l\"\n  \"eft><font face=jagran size=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl01_HyperLink\"\n  \"1\\\" title=\\\"News\\\" href=\\\"/news\\\">\\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x9A\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"</a></\"\n  \"font></th></tr>\\r\\n            \\r\\n            <tr>\\r\\n<td width=10>&nbs\"\n  \"p;</td>\\r\\n<th><img src=images/bulet1.gif /></th><th align=left><font fa\"\n  \"ce=jagran size=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl02_HyperLink1\\\" title=\\\"\"\n  \"Panchang\\\" href=\\\"/rashi2007\\\">\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x9A\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\x97\"\" 2007<\"\n  \"/a></font></th></tr>\\r\\n            \\r\\n            <tr>\\r\\n<td width=10\"\n  \">&nbsp;</td>\\r\\n<th><img src=images/bulet1.gif /></th><th align=left><fo\"\n  \"nt face=jagran size=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl03_HyperLink1\\\" tit\"\n  \"le=\\\"Religion\\\" href=\\\"/religion\\\">\\xE0\"\"\\xA4\"\"\\xA7\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"</a></font></th></tr>\\r\\n\"\n  \"            \\r\\n            <tr>\\r\\n<td width=10>&nbsp;</td>\\r\\n<th><img\"\n  \" src=images/bulet1.gif /></th><th align=left><font face=jagran size=3>\\r\"\n  \"\\n<a id=\\\"BottomNavRepeat_ctl04_HyperLink1\\\" title=\\\"Junior Jagran\\\" hre\"\n  \"f=\\\"/junior\\\">\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA5\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" \\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\"</a></\"\n  \"font></th></tr>\\r\\n            \\r\\n            <tr>\\r\\n<td width=10>&nbs\"\n  \"p;</td>\\r\\n<th><img src=images/bulet1.gif /></th><th align=left><font fa\"\n  \"ce=jagran size=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl05_HyperLink1\\\" title=\\\"\"\n  \"Jagran Mobile Services\\\" href=\\\"/7272\\\">7272</a></font></th></tr>\\r\\n   \"\n  \"         \\r\\n            <tr>\\r\\n<td width=10>&nbsp;</td>\\r\\n<th><img sr\"\n  \"c=images/bulet1.gif /></th><th align=left><font face=jagran size=3>\\r\\n<\"\n  \"a id=\\\"BottomNavRepeat_ctl06_HyperLink1\\\" title=\\\"News with difference\\\"\"\n  \" href=\\\"/hatke\\\">\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \"\n  \"\\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA4\"\"\\x9F\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\"\n  \"</a></font></th></tr>\\r\\n            \\r\\n            <tr>\\r\\n<td width=1\"\n  \"0>&nbsp;</td>\\r\\n<th><img src=images/bulet1.gif /></th><th align=left><f\"\n  \"ont face=jagran size=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl07_HyperLink1\\\" ti\"\n  \"tle=\\\"Jagran Greetings\\\" href=\\\"/navigation.aspx?id=1\\\">\\xE0\"\"\\xA4\"\"\\x9C\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\x9F\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB8\"\"</a></font></th></tr>\\r\\n           \"\n  \" \\r\\n            <tr>\\r\\n<td width=10>&nbsp;</td>\\r\\n<th><img src=images\"\n  \"/bulet1.gif /></th><th align=left><font face=jagran size=3>\\r\\n<a id=\\\"B\"\n  \"ottomNavRepeat_ctl08_HyperLink1\\\" title=\\\"Jagran Sahitya\\\" href=\\\"/sahit\"\n  \"ya\\\">\\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"</a></font></th></\"\n  \"tr>\\r\\n            \\r\\n            <tr>\\r\\n<td width=10>&nbsp;</td>\\r\\n<\"\n  \"th><img src=images/bulet1.gif /></th><th align=left><font face=jagran si\"\n  \"ze=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl09_HyperLink1\\\" title=\\\"Jagran Radio\"\n  \"\\\" href=\\\"/radio\\\">\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\" \\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA1\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\"\n  \"</a></font></th></tr>\\r\\n            \\r\\n            <tr>\\r\\n<td width=1\"\n  \"0>&nbsp;</td>\\r\\n<th><img src=images/bulet1.gif /></th><th align=left><f\"\n  \"ont face=jagran size=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl10_HyperLink1\\\" ti\"\n  \"tle=\\\"Epaper\\\" href=\\\"/navigation.aspx?id=2\\\">\\xE0\"\"\\xA4\"\"\\x88\"\"-\\xE0\"\"\\xA4\"\"\"\n  \"\\xAA\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"</a></font><\"\n  \"/th></tr>\\r\\n            \\r\\n            <tr>\\r\\n<td width=10>&nbsp;</td\"\n  \">\\r\\n<th><img src=images/bulet1.gif /></th><th align=left><font face=jag\"\n  \"ran size=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl11_HyperLink1\\\" title=\\\"Jagran\"\n  \" Sakhi\\\" href=\\\"/sakhi\\\">\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\" \\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x96\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"</a></font></th></tr>\\r\\n            \\r\\n       \"\n  \"     <tr>\\r\\n<td width=10>&nbsp;</td>\\r\\n<th><img src=images/bulet1.gif \"\n  \"/></th><th align=left><font face=jagran size=3>\\r\\n<a id=\\\"BottomNavRepe\"\n  \"at_ctl12_HyperLink1\\\" title=\\\"Jagran Forum\\\" href=\\\"/navigation.aspx?id=\"\n  \"3\\\">\\xE0\"\"\\xA4\"\"\\x86\"\"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\xAC\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"</a></font></th><\"\n  \"/tr>\\r\\n            \\r\\n            <tr>\\r\\n<td width=10>&nbsp;</td>\\r\\n\"\n  \"<th><img src=images/bulet1.gif /></th><th align=left><font face=jagran s\"\n  \"ize=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl13_HyperLink1\\\" title=\\\"Jagran Yatr\"\n  \"a\\\" href=\\\"/yatra\\\">\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\" \\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\"\n  \"</a></font></th></tr>\\r\\n            \\r\\n            <tr>\\r\\n<td width=1\"\n  \"0>&nbsp;</td>\\r\\n<th><img src=images/bulet1.gif /></th><th align=left><f\"\n  \"ont face=jagran size=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl14_HyperLink1\\\" ti\"\n  \"tle=\\\"Jagran Cricket\\\" href=\\\"/cricket\\\">\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x9F\"\"</a></font></th></tr>\\r\\n           \"\n  \" \\r\\n            <tr>\\r\\n<td width=10>&nbsp;</td>\\r\\n<th><img src=images\"\n  \"/bulet1.gif /></th><th align=left><font face=jagran size=3>\\r\\n<a id=\\\"B\"\n  \"ottomNavRepeat_ctl15_HyperLink1\\\" title=\\\"Cinema\\\" href=\\\"/cinemazaa\\\">\\xE0\"\"\"\n  \"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\"\n  \"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x9B\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"</a></font></th></tr>\\r\\n\"\n  \"            \\r\\n            <tr>\\r\\n<td width=10>&nbsp;</td>\\r\\n<th><img\"\n  \" src=images/bulet1.gif /></th><th align=left><font face=jagran size=3>\\r\"\n  \"\\n<a id=\\\"BottomNavRepeat_ctl16_HyperLink1\\\" title=\\\"My Jagran\\\" href=\\\"\"\n  \"/navigation.aspx?id=4\\\">\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\"</a></font></th></tr>\\r\\n     \"\n  \"       \\r\\n            <tr>\\r\\n<td width=10>&nbsp;</td>\\r\\n<th><img src=\"\n  \"images/bulet1.gif /></th><th align=left><font face=jagran size=3>\\r\\n<a \"\n  \"id=\\\"BottomNavRepeat_ctl17_HyperLink1\\\" title=\\\"Jagran Matrimony Classif\"\n  \"ieds\\\" href=\\\"/navigation.aspx?id=5\\\">\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x83\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"</a></font></th></tr>\\r\\n           \"\n  \" \\r\\n            <tr>\\r\\n<td width=10>&nbsp;</td>\\r\\n<th><img src=images\"\n  \"/bulet1.gif /></th><th align=left><font face=jagran size=3>\\r\\n<a id=\\\"B\"\n  \"ottomNavRepeat_ctl18_HyperLink1\\\" title=\\\"Jagran Josh\\\" href=\\\"/josh\\\">\\xE0\"\"\"\n  \"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xA3\"\" \\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\xB6\"\"</a><\"\n  \"/font></th></tr>\\r\\n            \\r\\n            <tr>\\r\\n<td width=10>&nb\"\n  \"sp;</td>\\r\\n<th><img src=images/bulet1.gif /></th><th align=left><font f\"\n  \"ace=jagran size=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl19_HyperLink1\\\" title=\\\"\"\n  \"Rashiphal\\\" href=\\\"/news/rashi.aspx\\\">\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB6\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xAB\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\"\n  \"</a></font></th></tr>\\r\\n            \\r\\n            <tr>\\r\\n<td width=1\"\n  \"0>&nbsp;</td>\\r\\n<th><img src=images/bulet1.gif /></th><th align=left><f\"\n  \"ont face=jagran size=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl20_HyperLink1\\\" ti\"\n  \"tle=\\\"Humour\\\" href=\\\"/gudgudee\\\">\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA5\"\"\\x81\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA5\"\"\\x81\"\"\\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x80\"\"</a></font></th></tr>\\r\\n            \\r\\n            <tr>\\r\\n\"\n  \"<td width=10>&nbsp;</td>\\r\\n<th><img src=images/bulet1.gif /></th><th al\"\n  \"ign=left><font face=jagran size=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl21_Hype\"\n  \"rLink1\\\" title=\\\"Khanakhazana\\\" href=\\\"/khanakhazana\\\">\\xE0\"\"\\xA4\"\"\\x96\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\x96\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\"\n  \"</a></font></th></tr>\\r\\n            \\r\\n            <tr>\\r\\n<td width=1\"\n  \"0>&nbsp;</td>\\r\\n<th><img src=images/bulet1.gif /></th><th align=left><f\"\n  \"ont face=jagran size=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl22_HyperLink1\\\" ti\"\n  \"tle=\\\"Jagran Shopping\\\" href=\\\"/navigation.aspx?id=6\\\">\\xE0\"\"\\xA4\"\"\\x9C\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\xB6\"\"\\xE0\"\"\\xA5\"\"\\x89\"\"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"</a></font></th></tr>\\r\\n           \"\n  \" \\r\\n            <tr>\\r\\n<td width=10>&nbsp;</td>\\r\\n<th><img src=images\"\n  \"/bulet1.gif /></th><th align=left><font face=jagran size=3>\\r\\n<a id=\\\"B\"\n  \"ottomNavRepeat_ctl23_HyperLink1\\\" title=\\\"Jagran Special\\\" href=\\\"/speci\"\n  \"al\\\">\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA3\"\" \\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xB6\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\xB7\"\"</a></font></th></tr>\\r\\n           \"\n  \" \\r\\n            <tr>\\r\\n<td width=10>&nbsp;</td>\\r\\n<th><img src=images\"\n  \"/bulet1.gif /></th><th align=left><font face=jagran size=3>\\r\\n<a id=\\\"B\"\n  \"ottomNavRepeat_ctl24_HyperLink1\\\" title=\\\"Photogallery\\\" href=\\\"/jagrani\"\n  \"mage\\\">\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\" \\xE0\"\"\\xA4\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x9C\"\"</a></font></th></tr>\\r\\n            \\r\\n       \"\n  \"     <tr>\\r\\n<td width=10>&nbsp;</td>\\r\\n<th><img src=images/bulet1.gif \"\n  \"/></th><th align=left><font face=jagran size=3>\\r\\n<a id=\\\"BottomNavRepe\"\n  \"at_ctl25_HyperLink1\\\" title=\\\"Mandi\\\" href=\\\"/news/mandi.aspx\\\">\\xE0\"\"\\xA4\"\"\"\n  \"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xA1\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xAF\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"</a></font></th></tr>\\r\\n     \"\n  \"       \\r\\n            <tr>\\r\\n<td width=10>&nbsp;</td>\\r\\n<th><img src=\"\n  \"images/bulet1.gif /></th><th align=left><font face=jagran size=3>\\r\\n<a \"\n  \"id=\\\"BottomNavRepeat_ctl26_HyperLink1\\\" title=\\\"Academic Results\\\" href=\"\n  \"\\\"/navigation.aspx?id=7\\\">\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\x9F\"\"</a></font><\"\n  \"/th></tr>\\r\\n            \\r\\n            <tr>\\r\\n<td width=10>&nbsp;</td\"\n  \">\\r\\n<th><img src=images/bulet1.gif /></th><th align=left><font face=jag\"\n  \"ran size=3>\\r\\n<a id=\\\"BottomNavRepeat_ctl27_HyperLink1\\\" title=\\\"Jagran\"\n  \" Matrimony\\\" href=\\\"/navigation.aspx?id=8\\\">\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x9F\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x89\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xA8\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"</a></font></th></tr>\\r\\n            \\r\\n<tr><td\"\n  \" width=10>&nbsp;</td><th valign=\\\"top\\\"><img src=images/bulet1.gif align\"\n  \"=\\\"absMiddle\\\" valign=\\\"top\\\" /></th><td><font color=\\\"black\\\" face=\\\"Ja\"\n  \"gran\\\" ><b>\\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\x9F\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x80\"\" \\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\"</b></font><br><a target=\\\"_parent\\\" href=\\\"http\"\n  \"://city.jagran.com/kanpur.asp\\\" style=\\\"TEXT-DECORATION: none\\\"><font co\"\n  \"lor=\\\"black\\\" face=\\\"Jagran\\\" >&nbsp;(\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA5\"\"\\x81\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\"\n  \")</font></a><br><a target=\\\"_parent\\\" href=\\\"http://city.jagran.com/delh\"\n  \"i.asp\\\" style=\\\"TEXT-DECORATION: none\\\"><font color=\\\"black\\\" face=\\\"Jag\"\n  \"ran\\\" >&nbsp;(\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\x88\"\" \\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x80\"\")</font></a><br><a target=\\\"_parent\\\" href=\\\"http://city.jag\"\n  \"ran.com/lucknow/default.asp\\\" style=\\\"TEXT-DECORATION: none\\\"><font colo\"\n  \"r=\\\"black\\\" face=\\\"Jagran\\\" >&nbsp;(\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA4\"\"\\x96\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\x8A\"\")</font></a></td></tr>\\r\\n\\t\\t<tr><t\"\n  \"d align=\\\"left\\\" vAlign=\\\"top\\\"><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"8\\\" \"\n  \"src=\\\"images/spacer.gif\\\" width=\\\"8\\\"></td></tr>\\r\\n</table><br />\\r\\n  \"\n  \"    <table border=\\\"0\\\" cellPadding=\\\"0\\\" cellSpacing=\\\"0\\\" width=\\\"95%\\\"\"\n  \" align=left>\\r\\n        <tr>\\r\\n          <td colSpan=\\\"3\\\">&nbsp;&nbsp;\"\n  \"&nbsp;&nbsp;<img alt=\\\"\\\" align=\\\"absMiddle\\\" border=\\\"0\\\" height=\\\"31\\\"\"\n  \" src=\\\"images/weathericon.gif\\\" width=\\\"34\\\"><img alt=\\\"\\\" border=\\\"0\\\" \"\n  \"height=\\\"17\\\" src=\\\"images/mausam.gif\\\" width=\\\"35\\\"></td></tr>\\r\\n     \"\n  \"   <tr>\\r\\n          <td align=\\\"left\\\" vAlign=\\\"bottom\\\">&nbsp;&nbsp;<i\"\n  \"mg alt=\\\"\\\" border=\\\"0\\\" height=\\\"12\\\" src=\\\"images/cty.gif\\\" width=\\\"25\"\n  \"\\\"></td>\\r\\n          <td align=\\\"center\\\" vAlign=\\\"top\\\"><img alt=\\\"\\\" \"\n  \"border=\\\"0\\\" height=\\\"30\\\" src=\\\"images/maxtemicon.gif\\\" width=\\\"20\\\"></\"\n  \"td>\\r\\n          <td align=\\\"center\\\" vAlign=\\\"top\\\"><img alt=\\\"\\\" borde\"\n  \"r=\\\"0\\\" height=\\\"30\\\" src=\\\"images/mintemicon.gif\\\" width=\\\"20\\\"></td>\\r\"\n  \"\\n        </tr>\\r\\n        \\r\\n        \\r\\n        <tr>\\r\\n          <td\"\n  \" align=\\\"left\\\" vAlign=\\\"bottom\\\">&nbsp;&nbsp;<font face=jagran size=3>\\xE0\"\"\"\n  \"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"</font></td>\\r\\n        \"\n  \"  <td align=\\\"center\\\" vAlign=\\\"bottom\\\"><font face=arial size=1>34.2</f\"\n  \"ont></td>\\r\\n          <td align=\\\"center\\\" vAlign=\\\"bottom\\\"><font face\"\n  \"=arial size=1>26.3</font></td>\\r\\n        </tr>\\r\\n        \\r\\n        <\"\n  \"tr>\\r\\n          <td align=\\\"left\\\" vAlign=\\\"bottom\\\">&nbsp;&nbsp;<font \"\n  \"face=jagran size=3>\\xE0\"\"\\xA4\"\"\\x9A\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\x88\"\"</font></td>\\r\\n  \"\n  \"        <td align=\\\"center\\\" vAlign=\\\"bottom\\\"><font face=arial size=1>3\"\n  \"4.2</font></td>\\r\\n          <td align=\\\"center\\\" vAlign=\\\"bottom\\\"><fon\"\n  \"t face=arial size=1>21.2</font></td>\\r\\n        </tr>\\r\\n        \\r\\n   \"\n  \"     <tr>\\r\\n          <td align=\\\"left\\\" vAlign=\\\"bottom\\\">&nbsp;&nbsp;\"\n  \"<font face=jagran size=3>\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\x88\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\xA6\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB2\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"</font></td>\\r\\n          <td align=\\\"center\\\" v\"\n  \"Align=\\\"bottom\\\"><font face=arial size=1>35.2</font></td>\\r\\n          <\"\n  \"td align=\\\"center\\\" vAlign=\\\"bottom\\\"><font face=arial size=1>21.3</font\"\n  \"></td>\\r\\n        </tr>\\r\\n        \\r\\n        <tr>\\r\\n          <td ali\"\n  \"gn=\\\"left\\\" vAlign=\\\"bottom\\\">&nbsp;&nbsp;<font face=jagran size=3>\\xE0\"\"\"\n  \"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x81\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xAC\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x88\"\"</font></td>\\r\\n          <td align=\\\"center\\\" vAlign=\\\"bott\"\n  \"om\\\"><font face=arial size=1>33.2</font></td>\\r\\n          <td align=\\\"c\"\n  \"enter\\\" vAlign=\\\"bottom\\\"><font face=arial size=1>23.2</font></td>\\r\\n  \"\n  \"      </tr>\\r\\n        \\r\\n<tr>\\r\\n    <td align=\\\"left\\\" vAlign=\\\"top\\\"\"\n  \" colspan=\\\"3\\\"><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"8\\\" src=\\\"images/spac\"\n  \"er.gif\\\" width=\\\"8\\\"></td></tr>\\r\\n        <tr>\\r\\n      <td colSpan=\\\"3\"\n  \"\\\">&nbsp;&nbsp;&nbsp;&nbsp;<img alt=\\\"\\\" align=\\\"absMiddle\\\" border=\\\"0\\\"\"\n  \" height=\\\"31\\\" src=\\\"images/stockicon.gif\\\" width=\\\"34\\\"><img alt=\\\"\\\" b\"\n  \"order=\\\"0\\\" height=\\\"17\\\" src=\\\"images/stock.gif\\\" width=\\\"68\\\"></td></t\"\n  \"r>\\r\\n    <tr>\\r\\n      <td align=\\\"left\\\" vAlign=\\\"bottom\\\">&nbsp;&nbsp\"\n  \";</td>\\r\\n      <td align=\\\"center\\\" vAlign=\\\"bottom\\\"><img alt=\\\"\\\" bor\"\n  \"der=\\\"0\\\" height=\\\"24\\\" src=\\\"images/stcloseicon.gif\\\" width=\\\"24\\\"></td\"\n  \">\\r\\n      <td align=\\\"center\\\" vAlign=\\\"bottom\\\"><img alt=\\\"\\\" border=\\\"\"\n  \"0\\\" height=\\\"24\\\" src=\\\"images/stchicon.gif\\\" width=\\\"22\\\"></td>\\r\\n    \"\n  \"</tr>\\r\\n        \\r\\n        \\r\\n        <tr>\\r\\n          <td align=\\\"l\"\n  \"eft\\\" vAlign=\\\"bottom\\\">&nbsp;&nbsp;<font face=jagran size=3>\\xE0\"\"\\xA4\"\"\"\n  \"\\x8F\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\x8F\"\"\\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x88\"\"</font></td>\\r\\n          <td align=\\\"center\\\" vAlign=\\\"bottom\\\"><\"\n  \"font face=arial size=1>3848.15        </font></td>\\r\\n          <td alig\"\n  \"n=\\\"center\\\" vAlign=\\\"bottom\\\"><font face=arial size=1>+4.65          </\"\n  \"font></td>\\r\\n        </tr>\\r\\n        \\r\\n        <tr>\\r\\n          <td\"\n  \" align=\\\"left\\\" vAlign=\\\"bottom\\\">&nbsp;&nbsp;<font face=jagran size=3>\\xE0\"\"\"\n  \"\\xA4\"\"\\xAC\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\x8F\"\"\\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x88\"\"</font></td>\\r\\n          <td align=\\\"center\\\" vAlign=\\\"bott\"\n  \"om\\\"><font face=arial size=1>13182.49       </font></td>\\r\\n          <t\"\n  \"d align=\\\"center\\\" vAlign=\\\"bottom\\\"><font face=arial size=1>+4.75      \"\n  \"    </font></td>\\r\\n        </tr>\\r\\n        \\r\\n   <tr>\\r\\n    <td alig\"\n  \"n=\\\"left\\\" vAlign=\\\"top\\\" colspan=\\\"3\\\"><img alt=\\\"\\\" border=\\\"0\\\" heigh\"\n  \"t=\\\"8\\\" src=\\\"images/spacer.gif\\\" width=\\\"8\\\"></td></tr>\\r\\n        <tr>\"\n  \"\\r\\n      <td colSpan=\\\"3\\\">&nbsp;&nbsp;&nbsp;&nbsp;<img alt=\\\"\\\" align=\"\n  \"\\\"absMiddle\\\" border=\\\"0\\\"  src=\\\"images/money.gif\\\"><img alt=\\\"\\\" borde\"\n  \"r=\\\"0\\\"  src=\\\"images/mudra.gif\\\"></td></tr>\\r\\n    <tr>\\r\\n      <td al\"\n  \"ign=\\\"left\\\" vAlign=\\\"middle\\\">&nbsp;</td>\\r\\n      <td align=\\\"center\\\"\"\n  \" vAlign=\\\"top\\\"><img alt=\\\"\\\" border=\\\"0\\\" src=\\\"images/buy.gif\\\" ></td>\"\n  \"\\r\\n      <td align=\\\"center\\\" vAlign=\\\"top\\\"><img alt=\\\"\\\" border=\\\"0\\\"\"\n  \" src=\\\"images/sell.gif\\\"></td>\\r\\n    </tr>\\r\\n         \\r\\n        \\r\\n\"\n  \"        <tr>\\r\\n          <td align=\\\"left\\\" vAlign=\\\"bottom\\\">&nbsp;&nb\"\n  \"sp;<font face=jagran size=3>\\xE0\"\"\\xA4\"\"\\xA1\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB2\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"</font></td>\\r\\n          <td align=\\\"center\\\" v\"\n  \"Align=\\\"top\\\"><font face=arial size=1>42.72</font></td>\\r\\n          <td\"\n  \" align=\\\"center\\\" vAlign=\\\"top\\\"><font face=arial size=1>43.11</font></t\"\n  \"d>\\r\\n        </tr>\\r\\n        \\r\\n        <tr>\\r\\n          <td align=\\\"\"\n  \"left\\\" vAlign=\\\"bottom\\\">&nbsp;&nbsp;<font face=jagran size=3>\\xE0\"\"\\xA4\"\"\"\n  \"\\xAA\"\"\\xE0\"\"\\xA5\"\"\\x8C\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xA1\"\"</font></td>\"\n  \"\\r\\n          <td align=\\\"center\\\" vAlign=\\\"top\\\"><font face=arial size=\"\n  \"1>83.94</font></td>\\r\\n          <td align=\\\"center\\\" vAlign=\\\"top\\\"><fo\"\n  \"nt face=arial size=1>84.93</font></td>\\r\\n        </tr>\\r\\n        \\r\\n \"\n  \"       <tr>\\r\\n          <td align=\\\"left\\\" vAlign=\\\"bottom\\\">&nbsp;&nbs\"\n  \"p;<font face=jagran size=3>\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xA8\"\"</font></td>\\r\\n          <td align=\\\"center\\\" vAlign=\\\"top\\\"><fon\"\n  \"t face=arial size=1>35.81</font></td>\\r\\n          <td align=\\\"center\\\" \"\n  \"vAlign=\\\"top\\\"><font face=arial size=1>36.60</font></td>\\r\\n        </tr\"\n  \">\\r\\n        \\r\\n        <tr>\\r\\n          <td align=\\\"left\\\" vAlign=\\\"b\"\n  \"ottom\\\">&nbsp;&nbsp;<font face=jagran size=3>\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"</font></td>\\r\\n          <td \"\n  \"align=\\\"center\\\" vAlign=\\\"top\\\"><font face=arial size=1>57.24</font></td\"\n  \">\\r\\n          <td align=\\\"center\\\" vAlign=\\\"top\\\"><font face=arial size\"\n  \"=1>57.98</font></td>\\r\\n        </tr>\\r\\n        \\r\\n<tr>\\r\\n<td colspan\"\n  \"=3>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\\\"http://\"\n  \"ind.jagran.com/up07\\\" target=_blank><img src=\\\"http://ind.jagran.com/up0\"\n  \"7.gif \\\" border=0></a></td></tr>   \\r\\n    </table>\\r\\n</td>\\r\\n<td widt\"\n  \"h=\\\"66%\\\"><!--font face=arial>Center Table</font-->\\r\\n<!-- Section 1 --\"\n  \">\\r\\n<table width=100%>\\r\\n<tr><td><table align=\\\"left\\\" border=\\\"0\\\" ce\"\n  \"llPadding=\\\"0\\\" cellSpacing=\\\"0\\\" width=\\\"62%\\\">\\r\\n\\t        <tr><td ba\"\n  \"ckground=\\\"images/boxbg.gif\\\" colspan=\\\"2\\\" valign=\\\"top\\\"><img alt=\\\"\\\"\"\n  \" align=\\\"top\\\" border=\\\"0\\\" height=\\\"20\\\" src=\\\"images/boxcurve1.gif\\\" w\"\n  \"idth=\\\"20\\\"><b><font color=\\\"#000000\\\" face=\\\"Jagran\\\" size=\\\"4\\\"><a tar\"\n  \"get=\\\"_parent\\\" href=\\\"news\\\" style=\\\"TEXT-DECORATION: none\\\">\\xE0\"\"\\xA4\"\"\"\n  \"\\xB8\"\"\\xE0\"\"\\xA5\"\"\\x81\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x96\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x82\"\"</a></font></b> <font face=\\\"arial\\\" size=\\\"1\\\">&nbsp;&nbsp;&nbsp;\"\n  \"&nbsp;Last Updated : 4/11/2007 1:17:10 AM</font>\\r\\n\\t       \\r\\n\\t     \"\n  \"   </td></tr>\\r\\n\\t        <!--<tr><td colspan=2><img src=\\\"images/space\"\n  \"r.gif\\\" width=1 height=\\\"30\\\"></td></tr>-->\\r\\n        \\r\\n        \\r\\n \"\n  \"                   <tr><td vAlign=\\\"top\\\" width=\\\"3%\\\"><font color=\\\"tom\"\n  \"ato\\\" face=\\\"verdana\\\" size=\\\"3\\\"><b>&nbsp;&nbsp;O&nbsp;</b></font></td>\"\n  \"\\r\\n            <th align=left><font face=jagran size=3><a id=\\\"Repeater\"\n  \"1_ctl00_HyperLink1\\\" href=\\\"news/details.aspx?id=3271941\\\">\\xE0\"\"\\xA4\"\"\\xAD\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"-\\xE0\"\"\\xA4\"\"\\xAA\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x95\"\" \\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB6\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\x82\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\x86\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA6\"\" \\xE0\"\"\\xA4\"\"\\x9A\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB7\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"</a></font></th></tr>\\r\\n        \\r\\n\"\n  \"                    <tr><td vAlign=\\\"top\\\" width=\\\"3%\\\"><font color=\\\"to\"\n  \"mato\\\" face=\\\"verdana\\\" size=\\\"3\\\"><b>&nbsp;&nbsp;O&nbsp;</b></font></td\"\n  \">\\r\\n            <th align=left><font face=jagran size=3><a id=\\\"Repeate\"\n  \"r1_ctl01_HyperLink1\\\" href=\\\"news/details.aspx?id=3271560\\\">\\xE0\"\"\\xA4\"\"\"\n  \"\\xA8\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB2\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x82\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA1\"\"\\xE0\"\"\\xA4\"\"\\xBC\"\"\\xE0\"\"\\xA5\"\"\\x80\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xAC\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x80\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\x85\"\"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB9\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\"</a></font></th></tr>\\r\\n     \"\n  \"   \\r\\n                    <tr><td vAlign=\\\"top\\\" width=\\\"3%\\\"><font col\"\n  \"or=\\\"tomato\\\" face=\\\"verdana\\\" size=\\\"3\\\"><b>&nbsp;&nbsp;O&nbsp;</b></fo\"\n  \"nt></td>\\r\\n            <th align=left><font face=jagran size=3><a id=\\\"\"\n  \"Repeater1_ctl02_HyperLink1\\\" href=\\\"news/details.aspx?id=3271429\\\">\\xE0\"\"\"\n  \"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x81\"\"\\xE0\"\"\\xA4\"\"\\xA0\"\"\\xE0\"\"\\xA4\"\"\\xAD\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA5\"\"\\x9C\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x82\"\" \\xE0\"\"\\xA4\"\"\\x86\"\"\\xE0\"\"\\xA4\"\"\\xA0\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x9F\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\x9F\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" \\xE0\"\"\"\n  \"\\xA4\"\"\\x89\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xAB\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\x89\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x80\"\" \\xE0\"\"\\xA4\"\"\\xA2\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"</a><\"\n  \"/font></th></tr>\\r\\n        \\r\\n                    <tr><td vAlign=\\\"top\"\n  \"\\\" width=\\\"3%\\\"><font color=\\\"tomato\\\" face=\\\"verdana\\\" size=\\\"3\\\"><b>&n\"\n  \"bsp;&nbsp;O&nbsp;</b></font></td>\\r\\n            <th align=left><font fa\"\n  \"ce=jagran size=3><a id=\\\"Repeater1_ctl03_HyperLink1\\\" href=\\\"news/detail\"\n  \"s.aspx?id=3271427\\\">\\xE0\"\"\\xA4\"\"\\x9A\"\"\\xE0\"\"\\xA5\"\"\\x81\"\"\\xE0\"\"\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\" size=\\\"3\\\">\"\n  \"<b>&nbsp;&nbsp;O&nbsp;</b></font></td>\\r\\n            <th align=left><fo\"\n  \"nt face=jagran size=3><a id=\\\"Repeater1_ctl04_HyperLink1\\\" href=\\\"news/d\"\n  \"etails.aspx?id=3271420\\\">\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x95\"\" \\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\" \\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x88\"\"\\xE0\"\"\\xA4\"\"\\xB8\"\" \\xE0\"\"\\xA4\"\"\\xAC\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x9F\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x87\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x82\"\"\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA5\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x80\"\" \\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"</a></font></th></tr>\\r\\n    \"\n  \"    \\r\\n\\r\\n        \\r\\n        \\r\\n                    <tr><td vAlign=\\\"\"\n  \"top\\\" width=\\\"3%\\\"><font color=\\\"tomato\\\" face=\\\"verdana\\\" size=\\\"3\\\"><b\"\n  \">&nbsp;&nbsp;O&nbsp;</b></font></td>\\r\\n            <th align=left><font\"\n  \" face=jagran size=3 color=blue><a id=\\\"Repeater2_ctl00_HyperLink1\\\" href\"\n  \"=\\\"news/details.aspx?id=3271376\\\" style=\\\"color:Blue;\\\">\\xE0\"\"\\xA4\"\"\\xB8\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\x97\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\x82\"\" \\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA5\"\"\\x80\"\" \\xE0\"\"\\xA4\"\"\\xAA\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x81\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xB8\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x81\"\"\\xE0\"\"\\xA4\"\"\\x96\"\" \\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xAC\"\"</a></th></tr>\\r\\n        \\r\\n                    <tr>\"\n  \"<td vAlign=\\\"top\\\" width=\\\"3%\\\"><font color=\\\"tomato\\\" face=\\\"verdana\\\" \"\n  \"size=\\\"3\\\"><b>&nbsp;&nbsp;O&nbsp;</b></font></td>\\r\\n            <th ali\"\n  \"gn=left><font face=jagran size=3 color=blue><a id=\\\"Repeater2_ctl01_Hype\"\n  \"rLink1\\\" href=\\\"news/details.aspx?id=3271375\\\" style=\\\"color:Blue;\\\">\\xE0\"\"\"\n  \"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\" \\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\"\n  \"\\xA4\"\"\\x8F\"\"\\xE0\"\"\\xA4\"\"\\x95\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA5\"\"\\x9C\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\xA5\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x87\"\": \\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x96\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"</a></th></tr>\\r\\n        \\r\\n            \"\n  \"        <tr><td vAlign=\\\"top\\\" width=\\\"3%\\\"><font color=\\\"tomato\\\" face=\"\n  \"\\\"verdana\\\" size=\\\"3\\\"><b>&nbsp;&nbsp;O&nbsp;</b></font></td>\\r\\n       \"\n  \"     <th align=left><font face=jagran size=3 color=blue><a id=\\\"Repeater\"\n  \"2_ctl02_HyperLink1\\\" href=\\\"news/details.aspx?id=3271354\\\" style=\\\"color\"\n  \":Blue;\\\">\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\x8F\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB8\"\"\\xE0\"\"\\xA4\"\"\\x8F\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x80\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\x95\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\xAA\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB7\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xA3\"\" 23 \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"</a></th></tr>\\r\\n        \"\n  \"\\r\\n<tr><td vAlign=\\\"top\\\" width=\\\"3%\\\">&nbsp;</td><td align=\\\"left\\\">\\r\"\n  \"\\n</td></tr>\\r\\n\\r\\n\\t\\t</table>\\r\\n\\r\\n \\r\\n    \\r\\n        \\t\\t\\r\\n   \"\n  \"   <table border=\\\"0\\\" cellPadding=\\\"0\\\" cellSpacing=\\\"0\\\" width=\\\"38%\\\"\"\n  \" align=\\\"left\\\">\\r\\n      <tr><td>&nbsp;</td><td align=\\\"center\\\" backgr\"\n  \"ound=\\\"images/boxbg.gif\\\" vAlign=\\\"top\\\" width=\\\"100%\\\"><b><font color=\\\"\"\n  \"#000000\\\" face=\\\"Jagran\\\" size=\\\"4\\\">&nbsp;&nbsp;&nbsp;<a href=\\\"jagrani\"\n  \"mage\\\" style=\\\"TEXT-DECORATION: none\\\" target=\\\"_blank\\\">\\xE0\"\"\\xA4\"\"\\x9C\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x9C\"\"\"\n  \"</a></font></b></td></tr>\\r\\n      <tr><td align=\\\"center\\\" vAlign=\\\"top\"\n  \"\\\" colspan=2>\\r\\n     \\r\\n        <a href='jagranimage/inner.aspx?subcat\"\n  \"gid=23&count=1&mainphotoid=36239'>\\r\\n        <img border=1 src=http://i\"\n  \"mg.jagran.com/jagranimage/pimages/11aprct307t.jpg ><br /><b>\\r\\n        \"\n  \"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA5\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB8\"\" \\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" \\xE0\"\"\\xA4\"\"\\x9C\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" </b>\\r\\n        </a>\\r\\n        \\r\\n\"\n  \"       </td></tr></table>\\t\\t\\r\\n</td></tr> </table>       \\r\\n\\r\\n  <!-\"\n  \"- Banners-->      \\r\\n <table width=100%>\\r\\n\\r\\n<tr><td align=\\\"left\\\" \"\n  \"bgColor=\\\"#ffe8d9\\\" vAlign=\\\"top\\\"><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"1\"\n  \"\\\" src=\\\"images/spacer.gif\\\" \\r\\nwidth=\\\"2\\\"></td></tr>\\r\\n\\r\\n<!--tr><t\"\n  \"d align=\\\"center\\\">\\r\\n<table border=0 width=100%>\\r\\n<tr>\\r\\n<td align=\"\n  \"\\\"center\\\" width=\\\"33%\\\"><a class=\\\"pg\\\" href=\\\"#\\\" onclick=\\\"javascript\"\n  \":pic1('http://www1.jagran.com/flash/default.asp')\\\"><img src=\\\"images/an\"\n  \"im.gif\\\" border=\\\"0\\\"></td>\\r\\n<td align=\\\"center\\\" width=\\\"33%\\\"><a hre\"\n  \"f=\\\"http://www.shaadi.com/matrimonials/hindi-matrimonial?ptnr=jntxt\\\" ta\"\n  \"rget=_blank><font face=Jagran size=4 color=\\\"blue\\\"><b>\\xE0\"\"\\xA4\"\"\\x9C\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xB8\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA5\"\"\\xE0\"\"\\xA5\"\"\\x80\"\" \\xE0\"\"\\xA4\"\"\\x9A\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x81\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x87\"\"</b></font></a></td>\\r\\n<td align=\\\"center\\\" width=\\\"3\"\n  \"3%\\\"><a href=\\\"http://bmser.bharatmatrimony.com/cgi-bin/tracking.php?sec\"\n  \"tion=Innerpage_468x60&siteurlsite=Jagran&domain=15&landing=partnerlandin\"\n  \"g-basketball.shtml&creative=bm_basket_sept05_468x60&referredby=80510800\\\"\"\n  \" target=_blank><font face=Jagran size=4 color=\\\"blue\\\"><b>\\xE0\"\"\\xA4\"\"\\xAD\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x9F\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x89\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x80\"\".\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x89\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\"\n  \"</b></font></a></td>\\r\\n</tr>\\r\\n</table> \\r\\n</td></tr>\\r\\n<tr><td alig\"\n  \"n=\\\"left\\\" bgColor=\\\"#ffe8d9\\\" vAlign=\\\"top\\\"><img alt=\\\"\\\" border=\\\"0\\\"\"\n  \" height=\\\"1\\\" src=\\\"images/spacer.gif\\\" width=\\\"17\\\"></td></tr-->\\r\\n<tr\"\n  \"><td align=\\\"center\\\">\\r\\n\\r\\n        \\r\\n            <a href='http://ww\"\n  \"w4.jagran.com/cricketnew/livescore.htm' target=_blank>\\r\\n            <f\"\n  \"ont color=\\\"red\\\" face=\\\"Jagran\\\" size=\\\"4\\\"><b>\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x87\"\"\\xE0\"\"\\x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E0\"\"\\xA4\"\"\\xB0\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\x8F\"\" \\xE0\"\"\\xA4\"\"\\xAF\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x82\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\"\n  \"\\xC2\"\"\\xA0\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x82\"\"</b></font> </a>\\r\\n        \\r\\n          </td></tr>\\r\\n    \"\n  \"   \\r\\n<tr><td align=\\\"center\\\" width=\\\"75%\\\"><a href=\\\"http://www1.jagr\"\n  \"an.com/forum\\\" target=_blank><font face=Jagran size=4 color=blue><b>\\xE0\"\"\"\n  \"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\x9A\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\" \\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA5\"\"\\x88\"\" \\xE0\"\"\"\n  \"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\" \\xE0\"\"\"\n  \"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\xAB\"\"\\xE0\"\"\\xA5\"\"\\x88\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"?</b></font></a></td></t\"\n  \"r>\\r\\n\\r\\n<!-- Section 2 -->\\r\\n</table>\\r\\n\\r\\n<table width=100% align=\"\n  \"left>\\r\\n<tr><td align=\\\"left\\\" bgColor=\\\"#ffe8d9\\\" vAlign=\\\"top\\\"><img \"\n  \"alt=\\\"\\\" border=\\\"0\\\" height=\\\"1\\\" src=\\\"images/spacer.gif\\\" width=\\\"17\\\"\"\n  \"></td></tr>\\r\\n<tr>\\r\\n    <td align=\\\"left\\\" vAlign=\\\"top\\\">\\r\\n    \\r\\n\"\n  \"      <table border=\\\"0\\\" cellPadding=\\\"0\\\" cellSpacing=\\\"0\\\" width=\\\"49\"\n  \"%\\\" align=\\\"left\\\">\\r\\n          <tr><td align=\\\"left\\\" background=\\\"ima\"\n  \"ges/boxbg.gif\\\" vAlign=\\\"top\\\" width=\\\"50%\\\"><b><font color=\\\"#000000\\\" \"\n  \"face=\\\"Jagran\\\" size=\\\"4\\\">&nbsp;<a target=\\\"_parent\\\" href=\\\"cricket\\\">\"\n  \"\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA3\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x9F\"\"\"\n  \"</a></font></b></td></tr>\\r\\n          <tr><td align=\\\"left\\\" vAlign=\\\"t\"\n  \"op\\\">\\r\\n         \\r\\n        \\r\\n            <a href='cricket/cinner.as\"\n  \"px?newsid=4853'>\\r\\n            <table id=\\\"Repeater11_ctl00_Table1\\\" ce\"\n  \"llpadding=\\\"2\\\" align=\\\"left\\\">\\r\\n\\t<tr>\\r\\n\\t\\t<td><img id=\\\"Repeater1\"\n  \"1_ctl00_Image1\\\" src=\\\"http://img.jagran.com/cricket/images/shastri2t.jp\"\n  \"g\\\" align=\\\"left\\\" style=\\\"border-width:3px;border-style:Outset;height:1\"\n  \"00px;width:100px;\\\" /></td>\\r\\n\\t</tr>\\r\\n</table>\\r\\n\\r\\n            <f\"\n  \"ont color=\\\"black\\\" face=\\\"Jagran\\\" size=\\\"4\\\"><b>\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xA8\"\" \\xE0\"\"\\xA4\"\"\\xB9\"\"\\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\\r\\n\\t\\t\\t</td></tr></table>\\r\\n<!-- Spacer Table -->\\r\\n\\t\\t\\t<table b\"\n  \"order=\\\"0\\\" cellPadding=\\\"0\\\" cellSpacing=\\\"0\\\" width=\\\"1%\\\" align=\\\"lef\"\n  \"t\\\">\\r\\n\\t\\t\\t<tr><td><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"1\\\" src=\\\"imag\"\n  \"es/spacer.gif\\\" width=\\\"1\\\"></td></tr>\\r\\n\\t\\t\\t</table>\\r\\n<!-- Spacer \"\n  \"Table Ends -->\\r\\n      <table border=\\\"0\\\" cellPadding=\\\"0\\\" cellSpacin\"\n  \"g=\\\"0\\\" width=\\\"49%\\\" align=\\\"left\\\">\\r\\n        <tr><td align=\\\"center\\\"\"\n  \" background=\\\"images/boxbg.gif\\\" vAlign=\\\"top\\\" width=\\\"95%\\\"><b><font c\"\n  \"olor=\\\"#000000\\\" face=\\\"Jagran\\\" size=\\\"4\\\">&nbsp;&nbsp;&nbsp;<a  href=\\\"\"\n  \"gudgudee\\\" style=\\\"TEXT-DECORATION: none\\\" target=\\\"_blank\\\">\\xE0\"\"\\xA4\"\"\"\n  \"\\x97\"\"\\xE0\"\"\\xA5\"\"\\x81\"\"\\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x81\"\"\\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"</a></font></b></td><td><img a\"\n  \"lt=\\\"\\\" align=\\\"top\\\" border=\\\"0\\\" src=\\\"images/boxcurve2.gif\\\" WIDTH=\\\"\"\n  \"20\\\" HEIGHT=\\\"20\\\"></td></tr>\\r\\n        <tr><td colspan=2>\\r\\n         \"\n  \"\\r\\n        \\r\\n            <table cellpadding=2 align=left><tr><td><img\"\n  \" id=\\\"Repeater10_ctl00_Image2\\\" src=\\\"http://img.jagran.com/gudgudee/gim\"\n  \"ages/joke2.jpg\\\" align=\\\"left\\\" style=\\\"border-width:3px;border-style:Ou\"\n  \"tset;height:100px;width:100px;\\\" /></td></tr></table>\\r\\n            <a \"\n  \"href='gudgudee'>\\r\\n            <font color=\\\"black\\\" face=\\\"Jagran\\\" si\"\n  \"ze=\\\"4\\\"><b>\\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xBE\"\"</b> (\\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\xB9\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA8\"\" \\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA5\"\"\\x87\"\")-  \\xE0\"\"\\xA4\"\"\\xAC\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x9F\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\", \\xE0\"\"\\xA4\"\"\\x85\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" \\xE0\"\"\\xA4\"\"\\xB8\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA4\"\" \\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\" \\xE0\"\"\\xA4\"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\"\"\n  \"\\xAF\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\xB8\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x87\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xC2\"\"\\xA0\"\"\\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA5\"\"\\x80\"\" \\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA5\"\"\\x88\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\xA4\"\" &nbsp;<img alt=\\\"\\\" align=\\\"absmiddle\\\" src=\\\"images/\"\n  \"more.gif\\\" border=\\\"0\\\" WIDTH=\\\"15\\\" HEIGHT=\\\"6\\\"></font> </a>\\r\\n      \"\n  \"  \\r\\n          </td></tr></table>\\r\\n    </td></tr>\\r\\n<tr><td align=\\\"\"\n  \"left\\\" bgColor=\\\"#ffe8d9\\\" vAlign=\\\"top\\\"><img alt=\\\"\\\" border=\\\"0\\\" hei\"\n  \"ght=\\\"1\\\" src=\\\"images/spacer.gif\\\" width=\\\"17\\\"></td></tr>\\t\\t   \\r\\n\\r\"\n  \"\\n<tr>\\r\\n    <td align=\\\"left\\\" vAlign=\\\"top\\\">\\r\\n      <table border=\"\n  \"\\\"0\\\" cellPadding=\\\"0\\\" cellSpacing=\\\"0\\\" width=\\\"50%\\\" align=\\\"left\\\">\\r\"\n  \"\\n        <tr><td align=\\\"left\\\" background=\\\"images/boxbg.gif\\\" vAlign=\"\n  \"\\\"top\\\"><b><font color=\\\"#000000\\\" face=\\\"Jagran\\\" size=\\\"4\\\">&nbsp;<a h\"\n  \"ref=\\\"sakhi\\\" style=\\\"TEXT-DECORATION: none\\\" target=\\\"_blank\\\">\\xE0\"\"\\xA4\"\"\"\n  \"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xA3\"\" \\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA4\"\"\\x96\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"</a></font>\"\n  \"</b></td><td align=\\\"left\\\" background=\\\"images/boxbg.gif\\\" vAlign=\\\"top\"\n  \"\\\">&nbsp;</td></tr>\\r\\n        <tr><td align=\\\"left\\\" vAlign=\\\"top\\\" wid\"\n  \"th=\\\"95%\\\">\\r\\n        \\r\\n       \\r\\n        \\r\\n            <table id=\"\n  \"\\\"Repeater4_ctl00_Table2\\\" cellpadding=\\\"2\\\" align=\\\"left\\\">\\r\\n\\t<tr>\\r\"\n  \"\\n\\t\\t<td><img id=\\\"Repeater4_ctl00_Image1\\\" src=\\\"http://img.jagran.com\"\n  \"/sakhi/images/sak3498T.jpg\\\" align=\\\"left\\\" style=\\\"border-width:3px;bor\"\n  \"der-style:Outset;\\\" /></td>\\r\\n\\t</tr>\\r\\n</table>\\r\\n\\r\\n            <a\"\n  \" href='sakhi/sinner.aspx?idsection=1&amp;idarticle=3498&amp;idedition=74\"\n  \"'><font color=\\\"black\\\" face=\\\"Jagran\\\" size=\\\"4\\\"><b><b>\\xE0\"\"\\xA4\"\"\\x95\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" \\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\x9F\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\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x80\"\" \\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA5\"\"\\x80\"\" \\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xB7\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"&nbsp;<img alt=\\\"\\\" align=\\\"absmiddle\\\" sr\"\n  \"c=\\\"images/more.gif\\\" border=\\\"0\\\" WIDTH=\\\"15\\\" HEIGHT=\\\"6\\\"></font></a>\"\n  \"</a>\\r\\n        \\r\\n</td><td>&nbsp;</td>\\r\\n         </tr></table>\\r\\n\\t\"\n  \"\\t<table align=\\\"left\\\" border=\\\"0\\\" cellPadding=\\\"0\\\" cellSpacing=\\\"0\\\"\"\n  \" width=\\\"50%\\\">\\r\\n        <tr><td>&nbsp;</td><td align=\\\"center\\\" backg\"\n  \"round=\\\"images/boxbg.gif\\\" vAlign=\\\"top\\\" width=\\\"95%\\\"><!--<img alt=\\\"\\\"\"\n  \" align=\\\"top\\\" border=\\\"0\\\" height=\\\"20\\\" src=\\\"images/boxcurve1.gif\\\" w\"\n  \"idth=\\\"20\\\">--><b><font color=\\\"#000000\\\" face=\\\"Jagran\\\" size=\\\"4\\\">&nb\"\n  \"sp;&nbsp;&nbsp;<a  href=\\\"cinemazaa\\\" style=\\\"TEXT-DECORATION: none\\\" ta\"\n  \"rget=\\\"_blank\\\">\\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"</a><\"\n  \"/font></b></td><td background=\\\"images/boxbg.gif\\\">&nbsp;&nbsp;</td></tr\"\n  \">\\r\\n        <tr><td>&nbsp;</td><td align=\\\"left\\\" vAlign=\\\"top\\\" colspa\"\n  \"n=2>\\r\\n        \\r\\n               \\r\\n        \\r\\n            <table id\"\n  \"=\\\"Repeater5_ctl00_Table3\\\" cellpadding=\\\"2\\\" align=\\\"left\\\">\\r\\n\\t<tr>\\r\"\n  \"\\n\\t\\t<td><img id=\\\"Repeater5_ctl00_Image1\\\" src=\\\"http://img.jagran.com\"\n  \"/cinemazaa/images/bg0005t.jpg\\\" align=\\\"left\\\" style=\\\"border-width:3px;\"\n  \"border-style:Outset;\\\" /></td>\\r\\n\\t</tr>\\r\\n</table>\\r\\n\\r\\n           \"\n  \" <a href='cinemazaa/BollywoodBuzzDesc.aspx?BuzzCode=BB1023'>\\r\\n        \"\n  \"    <font face=\\\"Jagran\\\" size=\\\"4\\\"><b>'\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x88\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x9F\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\"\n  \"' \\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA5\"\"\\x88\"\"\\xE0\"\"\\xA4\"\"\\x82\"\" \\xE0\"\"\\xA4\"\"\\xAA\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBF\"\" \\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\x9F\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"!\\r\\n </b></font><br><font face=\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\xA8\"\"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\xB6\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x96\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x80\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\xB5\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\xA4\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"&nbsp;<img alt=\\\"\\\" align=\\\"absmiddle\\\" src=\\\"im\"\n  \"ages/more.gif\\\" border=\\\"0\\\" WIDTH=\\\"15\\\" HEIGHT=\\\"6\\\"></font></a>\\r\\n  \"\n  \"      \\r\\n          </td></tr></table>\\r\\n          </td></tr>\\r\\n\\r\\n  \"\n  \"         <tr><td align=\\\"left\\\" bgColor=\\\"#ffe8d9\\\" vAlign=\\\"top\\\"><img \"\n  \"alt=\\\"\\\" border=\\\"0\\\" height=\\\"1\\\" src=\\\"images/spacer.gif\\\" width=\\\"17\\\"\"\n  \"></td></tr>\\r\\n  <tr>\\r\\n    <td align=\\\"left\\\" vAlign=\\\"top\\\">\\r\\n\\r\\n \"\n  \"     <table border=\\\"0\\\" cellPadding=\\\"0\\\" cellSpacing=\\\"0\\\" width=\\\"50%\"\n  \"\\\" align=\\\"left\\\">\\r\\n        <tr><td align=\\\"left\\\" background=\\\"images\"\n  \"/boxbg.gif\\\" vAlign=\\\"top\\\"><b><font color=\\\"#000000\\\" face=\\\"Jagran\\\" s\"\n  \"ize=\\\"4\\\">&nbsp;<a href=\\\"khanakhazana\\\" style=\\\"TEXT-DECORATION: none\\\"\"\n  \" target=\\\"_blank\\\">\\xE0\"\"\\xA4\"\"\\x96\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\x96\"\"\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"</a></font></b></td><td align=\\\"left\"\n  \"\\\" background=\\\"images/boxbg.gif\\\" vAlign=\\\"top\\\">&nbsp;</td></tr>\\r\\n  \"\n  \"      <tr><td align=\\\"left\\\" vAlign=\\\"top\\\" width=\\\"95%\\\">\\r\\n        \\r\"\n  \"\\n               \\r\\n        \\r\\n            <table id=\\\"Repeater6_ctl00\"\n  \"_Table4\\\" cellpadding=\\\"2\\\" align=\\\"left\\\">\\r\\n\\t<tr>\\r\\n\\t\\t<td><img id\"\n  \"=\\\"Repeater6_ctl00_Image1\\\" src=\\\"http://img.jagran.com/khanakhazana/ima\"\n  \"ges/kk255t.jpg\\\" align=\\\"left\\\" style=\\\"border-width:3px;border-style:Ou\"\n  \"tset;\\\" /></td>\\r\\n\\t</tr>\\r\\n</table>\\r\\n\\r\\n            <a href='khana\"\n  \"khazana'>\\r\\n            <font face=\\\"Jagran\\\" size=\\\"4\\\"><b>\\xE0\"\"\\xA4\"\"\"\n  \"\\xB8\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"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A4\"\"\\xB2\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" \\xE0\"\"\\xA4\"\"\\xA4\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x81\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\xA4\"\" &nbsp;<img alt=\\\"\\\" align=\\\"absmiddle\\\" src=\\\"images/\"\n  \"more.gif\\\" border=\\\"0\\\" WIDTH=\\\"15\\\" HEIGHT=\\\"6\\\"></font></a>\\r\\n       \"\n  \" \\r\\n</td><td>&nbsp;</td>\\r\\n         </tr></table>\\r\\n         \\r\\n    \"\n  \"    <table border=\\\"0\\\" cellPadding=\\\"0\\\" cellSpacing=\\\"0\\\" width=\\\"50%\\\"\"\n  \" align=\\\"left\\\">\\r\\n          <tr><td colspan=2 align=\\\"center\\\" backgro\"\n  \"und=\\\"images/boxbg.gif\\\" vAlign=\\\"top\\\"><b><font color=\\\"#000000\\\" face=\"\n  \"\\\"Jagran\\\" size=\\\"4\\\"><a target=\\\"_parent\\\" href=\\\"josh\\\">\\xE0\"\"\\xA4\"\"\\x9C\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\xB6\"\"</a></font></b></\"\n  \"td></tr>\\r\\n          <tr><td align=\\\"left\\\" vAlign=\\\"top\\\" width=\\\"95%\\\"\"\n  \">\\r\\n               \\r\\n        \\r\\n            <table id=\\\"Repeater7_ct\"\n  \"l00_Table5\\\" cellpadding=\\\"2\\\" align=\\\"left\\\">\\r\\n\\t<tr>\\r\\n\\t\\t<td><img\"\n  \" id=\\\"Repeater7_ctl00_Image1\\\" src=\\\"http://img.jagran.com/josh/images/1\"\n  \"1apriallead07t.jpg\\\" align=\\\"left\\\" style=\\\"border-width:3px;border-styl\"\n  \"e:Outset;\\\" /></td>\\r\\n\\t</tr>\\r\\n</table>\\r\\n\\r\\n            <a href='j\"\n  \"osh/inner1new.aspx?idarticle=2588&idedition=217&idcategory=1'>\\r\\n      \"\n  \"      <font face=\\\"Jagran\\\" size=\\\"4\\\"><b>\\xE0\"\"\\xA4\"\"\\x96\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\xB8\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB7\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x80\"\" '\\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xBF\"\"\\xE0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xE0\"\"\\xA5\"\"\\x88\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\xA4\"\" \\xE0\"\"\\xA4\"\"\\x86\"\"\\xE0\"\"\\xA4\"\"\\x9C\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"&nbs\"\n  \"p;<img alt=\\\"\\\" align=\\\"absmiddle\\\" src=\\\"images/more.gif\\\" border=\\\"0\\\"\"\n  \" WIDTH=\\\"15\\\" HEIGHT=\\\"6\\\"></font></a>\\r\\n        </td><td>&nbsp;</td>\\r\"\n  \"\\n         </tr>\\r\\n\\t\\t\\t</table>\\r\\n\\t\\t\\t</td></tr>\\r\\n           <tr\"\n  \"><td align=\\\"left\\\" bgColor=\\\"#ffe8d9\\\" vAlign=\\\"top\\\"><img alt=\\\"\\\" bor\"\n  \"der=\\\"0\\\" height=\\\"1\\\" src=\\\"images/spacer.gif\\\" width=\\\"17\\\"></td></tr>\"\n  \"\\r\\n           \\t\\t\\t<tr><td align=center><script type=\\\"text/javascript\"\n  \"\\\"><!--\\r\\ngoogle_ad_client = \\\"pub-2902991337334079\\\";\\r\\ngoogle_ad_wid\"\n  \"th = 468;\\r\\ngoogle_ad_height = 60;\\r\\ngoogle_ad_format = \\\"468x60_as\\\";\"\n  \"\\r\\ngoogle_ad_type = \\\"text_image\\\";\\r\\ngoogle_ad_channel =\\\"\\\";\\r\\n//--\"\n  \"></script>\\r\\n<script type=\\\"text/javascript\\\"\\r\\n  src=\\\"http://pagead2\"\n  \".googlesyndication.com/pagead/show_ads.js\\\">\\r\\n</script></td></tr>\\r\\n<\"\n  \"!-- josh & hatke -->\\r\\n<tr><td align=\\\"left\\\" bgColor=\\\"#ffe8d9\\\" vAlig\"\n  \"n=\\\"top\\\"><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"1\\\" src=\\\"images/spacer.gi\"\n  \"f\\\" width=\\\"17\\\"></td></tr>\\r\\n  <tr>\\r\\n    <td align=\\\"left\\\" vAlign=\\\"\"\n  \"top\\\">\\r\\n\\r\\n      <table border=\\\"0\\\" cellPadding=\\\"0\\\" cellSpacing=\\\"\"\n  \"0\\\" width=\\\"50%\\\" align=\\\"left\\\">\\r\\n        <tr><td align=\\\"left\\\" back\"\n  \"ground=\\\"images/boxbg.gif\\\" vAlign=\\\"top\\\"><b><font color=\\\"#000000\\\" fa\"\n  \"ce=\\\"Jagran\\\" size=\\\"4\\\">&nbsp;<a target=\\\"_parent\\\" href=\\\"hatke\\\">\\xE0\"\"\"\n  \"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x9F\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"</a></font></b></td><td\"\n  \" align=\\\"left\\\" background=\\\"images/boxbg.gif\\\" vAlign=\\\"top\\\">&nbsp;</t\"\n  \"d></tr>\\r\\n        <tr><td colspan=2>\\r\\n        <table border=0 width=1\"\n  \"00% cellspacing=\\\"0\\\" cellpadding=\\\"0\\\">\\r\\n                       \\r\\n \"\n  \"       \\r\\n        <tr><td valign=baseline width=\\\"3%\\\"><font color=\\\"to\"\n  \"mato\\\" face=\\\"verdana\\\" size=\\\"3\\\"><b>&nbsp;&nbsp;O&nbsp;</b></font></td\"\n  \">\\r\\n        <th align=left><a href='hatke/InnerStory.aspx?StoryId=398'>\"\n  \"<font face=\\\"Jagran\\\" size=\\\"3\\\">..\\xE0\"\"\\xA4\"\"\\x85\"\"\\xE0\"\"\\xA4\"\"\\xAC\"\" \"\n  \"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xA7\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\" \\xE0\"\"\\xA4\"\"\\xAD\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\x85\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB6\"\" </font></a></th><\"\n  \"/tr>\\r\\n        \\r\\n        <tr><td valign=baseline width=\\\"3%\\\"><font c\"\n  \"olor=\\\"tomato\\\" face=\\\"verdana\\\" size=\\\"3\\\"><b>&nbsp;&nbsp;O&nbsp;</b></\"\n  \"font></td>\\r\\n        <th align=left><a href='hatke/InnerStory.aspx?Stor\"\n  \"yId=397'><font face=\\\"Jagran\\\" size=\\\"3\\\">..\\xE0\"\"\\xA4\"\"\\x94\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB0\"\" \\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xA8\"\"\\xE0\"\"\\xA5\"\"\\x80\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\xAA\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x80\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\xB9\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x87\"\" </font></a></th></tr>\\r\\n        \\r\\n        <tr><td valign=basel\"\n  \"ine width=\\\"3%\\\"><font color=\\\"tomato\\\" face=\\\"verdana\\\" size=\\\"3\\\"><b>&\"\n  \"nbsp;&nbsp;O&nbsp;</b></font></td>\\r\\n        <th align=left><a href='ha\"\n  \"tke/InnerStory.aspx?StoryId=396'><font face=\\\"Jagran\\\" size=\\\"3\\\">\\xE0\"\"\"\n  \"\\xA4\"\"\\x89\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" 120\\xC2\"\"\"\n  \"\\xA0\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB7\"\", 48\\xC2\"\"\\xA0\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB7\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\" \\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA5\"\"\\x80\"\" \\xE0\"\"\\xA4\"\"\\xA8\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\x82\"\" </font></a></th><\"\n  \"/tr>\\r\\n        \\r\\n        <tr><td valign=baseline width=\\\"3%\\\"><font c\"\n  \"olor=\\\"tomato\\\" face=\\\"verdana\\\" size=\\\"3\\\"><b>&nbsp;&nbsp;O&nbsp;</b></\"\n  \"font></td>\\r\\n        <th align=left><a href='hatke/InnerStory.aspx?Stor\"\n  \"yId=395'><font face=\\\"Jagran\\\" size=\\\"3\\\">\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\x9F\"\"\\xE0\"\"\\xA5\"\"\\x80\"\" \\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\" \\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" \\xE0\"\"\\xA4\"\"\\x85\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\x96\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" </font></a></th></tr>\\r\\n        \\r\\n        <t\"\n  \"r><td valign=baseline width=\\\"3%\\\"><font color=\\\"tomato\\\" face=\\\"verdana\"\n  \"\\\" size=\\\"3\\\"><b>&nbsp;&nbsp;O&nbsp;</b></font></td>\\r\\n        <th alig\"\n  \"n=left><a href='hatke/InnerStory.aspx?StoryId=394'><font face=\\\"Jagran\\\"\"\n  \" size=\\\"3\\\">\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x88\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x82\"\" \\xE0\"\"\\xA4\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x9F\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x9F\"\" \\xE0\"\"\\xA4\"\"\\xAC\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\"\n  \"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xA8\"\" </font></a></th></tr>\\r\\n        \\r\\n        <tr><td valign\"\n  \"=baseline width=\\\"3%\\\"><font color=\\\"tomato\\\" face=\\\"verdana\\\" size=\\\"3\\\"\"\n  \"><b>&nbsp;&nbsp;O&nbsp;</b></font></td>\\r\\n        <th align=left><a hre\"\n  \"f='hatke/InnerStory.aspx?StoryId=393'><font face=\\\"Jagran\\\" size=\\\"3\\\">\\xE0\"\"\"\n  \"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\x8A\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\", \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xB0\"\" \\xE0\"\"\\xA4\"\"\\x85\"\"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x82\"\" \\xE0\"\"\\xA4\"\"\\x94\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x82\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\x98\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\x82\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x82\"\" </font></a></th></tr>\\r\\n        \\r\\n    \"\n  \"        </table>\\r\\n            </td></tr>\\r\\n        </table>\\r\\n      \"\n  \"   \\r\\n        <table border=\\\"0\\\" cellPadding=\\\"0\\\" cellSpacing=\\\"0\\\" w\"\n  \"idth=\\\"50%\\\" align=\\\"left\\\">\\r\\n          <tr><td colspan=2 align=\\\"cent\"\n  \"er\\\" background=\\\"images/boxbg.gif\\\" vAlign=\\\"top\\\"><b><font color=\\\"#00\"\n  \"0000\\\" face=\\\"Jagran\\\" size=\\\"4\\\"><a href=\\\"radio\\\" style=\\\"TEXT-DECORAT\"\n  \"ION: none\\\" target=\\\"_blank\\\">\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA3\"\" \\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\xA1\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x8B\"\" </a></font></b></td></tr>\\r\\n\\t\\t                       \\r\\n\"\n  \"        \\r\\n        <tr><td valign=baseline width=\\\"3%\\\"><font color=\\\"t\"\n  \"omato\\\" face=\\\"verdana\\\" size=\\\"3\\\"><b>&nbsp;&nbsp;O&nbsp;</b></font></t\"\n  \"d>\\r\\n        <th align=left ><a href='/radio'><font face=\\\"Jagran\\\" siz\"\n  \"e=\\\"3\\\">\\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x80\"\" \\xE0\"\"\\xA4\"\"\\x86\"\"\\xE0\"\"\\xA4\"\"\\x88\"\" \\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x87\"\"...</font></a></th></tr>\\r\\n        \\r\\n        <tr><td valign=bas\"\n  \"eline width=\\\"3%\\\"><font color=\\\"tomato\\\" face=\\\"verdana\\\" size=\\\"3\\\"><b\"\n  \">&nbsp;&nbsp;O&nbsp;</b></font></td>\\r\\n        <th align=left ><a href=\"\n  \"'/radio'><font face=\\\"Jagran\\\" size=\\\"3\\\">\\xE0\"\"\\xA4\"\"\\xAD\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB6\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"</font></a></th></tr>\\r\\n        \\r\\n        <tr\"\n  \"><td valign=baseline width=\\\"3%\\\"><font color=\\\"tomato\\\" face=\\\"verdana\\\"\"\n  \" size=\\\"3\\\"><b>&nbsp;&nbsp;O&nbsp;</b></font></td>\\r\\n        <th align=\"\n  \"left ><a href='/radio'><font face=\\\"Jagran\\\" size=\\\"3\\\">\\xE0\"\"\\xA4\"\"\\x9A\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\" \\xE0\"\"\\xA4\"\"\\xA5\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA1\"\"\\xE0\"\"\\xA4\"\"\\xBC\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\xB0\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x80\"\" \\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\" \\xE0\"\"\\xA4\"\"\\x9C\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x8F\"\"..</font></a></th></tr>\\r\\n        \\r\"\n  \"\\n        <tr><td valign=baseline width=\\\"3%\\\"><font color=\\\"tomato\\\" fa\"\n  \"ce=\\\"verdana\\\" size=\\\"3\\\"><b>&nbsp;&nbsp;O&nbsp;</b></font></td>\\r\\n    \"\n  \"    <th align=left ><a href='/radio'><font face=\\\"Jagran\\\" size=\\\"3\\\">\\xE0\"\"\"\n  \"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\" \\xE0\"\"\"\n  \"\\xA4\"\"\\x86\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\x82\"\" \\xE0\"\"\"\n  \"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"..</font></a></th></tr>\\r\\n        \\r\\n   \"\n  \"     <tr><td valign=baseline width=\\\"3%\\\"><font color=\\\"tomato\\\" face=\\\"\"\n  \"verdana\\\" size=\\\"3\\\"><b>&nbsp;&nbsp;O&nbsp;</b></font></td>\\r\\n        <\"\n  \"th align=left ><a href='/radio'><font face=\\\"Jagran\\\" size=\\\"3\\\">\\xE0\"\"\\xA4\"\"\"\n  \"\\xAF\"\"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB6\"\" \\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA5\"\"\\x88\"\" \\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x80\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\" \\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\x82\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\".</font></a></th></tr>\\r\\n        \\r\\n        <t\"\n  \"r><td valign=baseline width=\\\"3%\\\"><font color=\\\"tomato\\\" face=\\\"verdana\"\n  \"\\\" size=\\\"3\\\"><b>&nbsp;&nbsp;O&nbsp;</b></font></td>\\r\\n        <th alig\"\n  \"n=left ><a href='/radio'><font face=\\\"Jagran\\\" size=\\\"3\\\">\\xE0\"\"\\xA4\"\"\\x9D\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA4\"\"\\x95\"\" 2006</font></a></th></tr>\\r\\n      \"\n  \"  \\r\\n\\t\\t\\t</table>\\r\\n          </td></tr>\\r\\n<!-- josh and hatke -->\\t\"\n  \"\\t\\t\\r\\n<!-- Bottom Banner -->\\r\\n <tr><td align=\\\"left\\\" bgColor=\\\"#ffe\"\n  \"8d9\\\" vAlign=\\\"top\\\"><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"1\\\" src=\\\"image\"\n  \"s/spacer.gif\\\" width=\\\"6\\\"></td></tr>\\r\\n<tr align=center>\\r\\n<td bgcolo\"\n  \"r=\\\"#FFFFFF\\\" valign=top align=center>\\r\\n </td></tr>\\r\\n\\r\\n <!--tr><td\"\n  \" align=\\\"center\\\" vAlign=\\\"top\\\">\\r\\n<a href=\\\"worldcup/tez.htm\\\" target\"\n  \"=_blank><img src=\\\"images/tez.gif\\\" border=0></a>\\r\\n</td></tr-->  \\r\\n<\"\n  \"tr><td align=\\\"left\\\" vAlign=\\\"top\\\"><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"\"\n  \"9\\\" src=\\\"images/spacer.gif\\\" width=\\\"6\\\"></td></tr>\\r\\n<tr><td align=\\\"\"\n  \"center\\\">\\r\\n  <map name=\\\"FPMap1\\\">\\r\\n  <area alt=\\\"\\\" href=\\\"http://w\"\n  \"ww.jagran.com/about/about.htm\\\" shape=\\\"rect\\\" coords=\\\"15,3,49,15\\\">\\r\\n\"\n  \"  <area alt=\\\"\\\" href=\\\"mailto:webmaster@jagran.com?subject=feedback/sug\"\n  \"gestions\\\" shape=\\\"rect\\\" coords=\\\"64,5,133,17\\\">\\r\\n  <area alt=\\\"\\\" hr\"\n  \"ef=\\\"mailto:webmaster@jagran.com?subject=feedback/suggestions\\\" shape=\\\"\"\n  \"rect\\\" coords=\\\"152,4,208,16\\\">\\r\\n  <area alt=\\\"\\\" href=\\\"http://www.ja\"\n  \"gran.com/friend/sendpage.asp\\\" onclick=\\\"javascript:friend()\\\" target=ab\"\n  \"c shape=\\\"rect\\\" coords=\\\"224,2,275,16\\\">\\r\\n  </map><img alt=\\\"\\\" borde\"\n  \"r=\\\"0\\\" height=\\\"19\\\" src=\\\"images/channel1.jpg\\\" useMap=\\\"#FPMap1\\\" wid\"\n  \"th=\\\"292\\\"></td></tr>\\r\\n  <tr><td align=\\\"center\\\" vAlign=\\\"top\\\"><font\"\n  \" face=\\\"Verdana\\\" size=\\\"1\\\">\\xC2\"\"\\xA9\"\" Jagran Infotech Ltd. 2006-08</\"\n  \"font></td></tr></table>       \\r\\n\\r\\n</td>\\r\\n<td width=\\\"16%\\\" valign=\"\n  \"top align=center>\\r\\n<a href=\\\"news/font.zip\\\"><img src=news/images/font\"\n  \"down.gif border=0 /></a>\\r\\n<br />\\r\\n\\r\\n<table width=100% border=0 ali\"\n  \"gn=center>\\r\\n\\r\\n<tr><td align=\\\"left\\\" vAlign=\\\"top\\\" bgColor=\\\"#fffff\"\n  \"f\\\"><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"2\\\" src=\\\"images/spacer.gif\\\" wi\"\n  \"dth=\\\"2\\\"></td></tr>\\r\\n<tr bgColor=\\\"#ffffff\\\"><td><a target=\\\"_blank\\\"\"\n  \" href=\\\"http://www.shaadi.com/ptnr.php?ptnr=zl6uv\\\"><img alt=\\\"\\\" src=\\\"\"\n  \"images/shadinew125x125.gif\\\" border=0></a></td></tr>\\r\\n<tr><td align=\\\"\"\n  \"left\\\" vAlign=\\\"top\\\" bgColor=\\\"#ffffff\\\"><img alt=\\\"\\\" border=\\\"0\\\" hei\"\n  \"ght=\\\"2\\\" src=\\\"images/spacer.gif\\\" width=\\\"2\\\"></td></tr>\\r\\n\\r\\n<tr><t\"\n  \"d align=\\\"left\\\" vAlign=\\\"top\\\" bgcolor=\\\"#ffffff\\\"  align=center>\\r\\n<!\"\n  \"-- Shaadi -->\\r\\n<table width=125 border=0 cellpadding=0 cellspacing=0 a\"\n  \"lign=center>\\r\\n<form method=\\\"post\\\" action=\\\"http://www.shaadi.com/par\"\n  \"tner_search/matrimonial_search/searchresults.php?ptnr=jnbnr\\\" target=\\\"_\"\n  \"blank\\\">\\r\\n<input type=\\\"hidden\\\" name=\\\"photograph\\\" value=\\\"Yes\\\">\\r\\n\"\n  \"<input type=\\\"hidden\\\" name=\\\"mothertongue\\\" value=\\\"Hindi\\\">\\r\\n\\t<tr>\\r\"\n  \"\\n\\t\\t<td>\\r\\n\\t\\t\\t<object classid=\\\"clsid:d27cdb6e-ae6d-11cf-96b8-4445\"\n  \"53540000\\\" codebase=\\\"http://download.macromedia.com/pub/shockwave/cabs/\"\n  \"flash/swflash.cab#version=7,0,0,0\\\" width=\\\"125\\\" height=\\\"148\\\" id=\\\"12\"\n  \"5\\\" align=\\\"middle\\\">\\r\\n<param name=\\\"allowScriptAccess\\\" value=\\\"sameD\"\n  \"omain\\\" />\\r\\n<param name=\\\"movie\\\" value=\\\"images/125.swf\\\" />\\r\\n<para\"\n  \"m name=\\\"quality\\\" value=\\\"high\\\" />\\r\\n<param name=\\\"bgcolor\\\" value=\\\"\"\n  \"#ffffff\\\" />\\r\\n<embed src=\\\"images/125.swf\\\" quality=\\\"high\\\" bgcolor=\\\"\"\n  \"#ffffff\\\" width=\\\"125\\\" height=\\\"148\\\" name=\\\"125\\\" align=\\\"middle\\\" all\"\n  \"owScriptAccess=\\\"sameDomain\\\" type=\\\"application/x-shockwave-flash\\\" plu\"\n  \"ginspage=\\\"http://www.macromedia.com/go/getflashplayer\\\" />\\r\\n</object>\"\n  \"</td>\\r\\n\\t</tr>\\r\\n\\t<tr>\\r\\n\\t\\t<td background=\\\"images/searchbg.gif\\\"\"\n  \" width=125 height=73 align=center><b style=\\\"font: bold 12px arial;\\\" al\"\n  \"ign=center>Search now</b><br>\\r\\n\\t\\t\\t<select name=\\\"gender\\\" style=\\\"f\"\n  \"ont: normal 11px tahoma; color: #000000; width: 85px; margin-top:5px;\\\">\"\n  \"\\r\\n\\t\\t\\t\\t<option value=\\\"female\\\" selected>Bride</option>\\r\\n\\t\\t\\t\\t\"\n  \"<option value=\\\"male\\\">Groom</option>\\r\\n\\t\\t\\t</select><br><select name\"\n  \"=\\\"age\\\" style=\\\"font:normal 11px tahoma; color: #000000; width: 85px; m\"\n  \"argin-top:8px;\\\">\\r\\n\\t\\t\\t\\t<option value=\\\"18 - 24\\\" selected>18 - 24<\"\n  \"/option>\\r\\n\\t\\t\\t\\t<option value=\\\"25 - 30\\\">25 - 30</option>\\r\\n\\t\\t\\t\"\n  \"\\t<option value=\\\"31 - 35\\\">31 - 35</option>\\r\\n\\t\\t\\t\\t<option value=\\\"\"\n  \"36 - 45\\\">36 - 45</option>\\r\\n\\t\\t\\t\\t<option value=\\\"46 - 50\\\">46 - 50<\"\n  \"/option>\\r\\n\\t\\t\\t\\t<option value=\\\"51 - 99\\\">50+</option>\\r\\n\\t\\t\\t\\t</\"\n  \"select></td>\\r\\n\\t</tr>\\r\\n\\t<tr>\\r\\n\\t\\t<td><input type=\\\"image\\\" src=\\\"\"\n  \"images/search.gif\\\" width=125 height=29 border=0></td>\\r\\n\\t</tr></form>\"\n  \"\\r\\n</table><!--shaadi -->\\r\\n</td></tr>\\r\\n<tr><td align=\\\"left\\\" vAlig\"\n  \"n=\\\"top\\\" bgColor=\\\"#ffffff\\\"><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"2\\\" sr\"\n  \"c=\\\"images/spacer.gif\\\" width=\\\"2\\\"></td></tr>\\r\\n<tr><td align=\\\"center\"\n  \"\\\" vAlign=\\\"top\\\" bgcolor=\\\"#ffffff\\\">\\r\\n<img src=\\\"images/textshopping\"\n  \".gif\\\" width=\\\"120\\\" height=\\\"120\\\" usemap=\\\"#Maptext\\\" border=\\\"0\\\"> \\r\"\n  \"\\n<map name=\\\"Maptext\\\">\\r\\n  <area shape=\\\"rect\\\" coords=\\\"0,3,118,28\\\"\"\n  \" href=\\\"http://shopping.jagran.com/Product_Details.aspx?ItemId=10873\\\" t\"\n  \"arget=_blank>\\r\\n  <area shape=\\\"rect\\\" coords=\\\"10,43,109,79\\\" href=\\\"h\"\n  \"ttp://shopping.jagran.com/Product_Details.aspx?ItemId=9997\\\" target=_bla\"\n  \"nk>\\r\\n  <area shape=\\\"rect\\\" coords=\\\"12,91,108,113\\\" href=\\\"http://sho\"\n  \"pping.jagran.com/product_price.aspx?div=193&divname=Home%20Appliances\\\" \"\n  \"target=_blank>\\r\\n</map>\\r\\n<br>\\r\\n<a href=\\\"http://ind.jagran.com/irel\"\n  \"and/\\\" target=_blank><img alt=\\\"\\\" border=\\\"0\\\" src=\\\"http://ind.jagran.\"\n  \"com/images/irelandban.gif\\\"></a>\\r\\n<br>\\r\\n<a href=\\\"http://www.jagranc\"\n  \"ityplus.com\\\" target=_blank><img alt=\\\"\\\" border=\\\"0\\\" src=\\\"images/City\"\n  \"Plusban3.gif\\\"></a>\\r\\n</td></tr>\\r\\n<tr><td align=\\\"left\\\" vAlign=\\\"top\"\n  \"\\\" bgColor=\\\"#ffffff\\\"><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"2\\\" src=\\\"ima\"\n  \"ges/spacer.gif\\\" width=\\\"2\\\"></td></tr>\\r\\n<tr><td align=\\\"left\\\" vAlign\"\n  \"=\\\"top\\\" bgColor=\\\"#ffffff\\\"><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"2\\\" src\"\n  \"=\\\"images/spacer.gif\\\" width=\\\"2\\\"></td></tr>\\r\\n<tr><td align=\\\"center\\\"\"\n  \" vAlign=\\\"top\\\" bgColor=\\\"#ffffff\\\"><a href=\\\"http://www1.jagran.com/kat\"\n  \"hputli/default.asp\\\" target=_blank><img alt=\\\"\\\" src=\\\"images/kathputli.\"\n  \"gif\\\" border=0></a></td></tr>\\r\\n<tr><td align=\\\"left\\\" vAlign=\\\"top\\\" b\"\n  \"gColor=\\\"#ffffff\\\"><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"2\\\" src=\\\"images/\"\n  \"spacer.gif\\\" width=\\\"2\\\"></td></tr>\\r\\n<tr><td align=\\\"center\\\" vAlign=\\\"\"\n  \"top\\\" bgcolor=\\\"#ffffff\\\"><a href=\\\"http://www6.jagran.com/jagranimage/D\"\n  \"efault.aspx?subcatgid=62\\\" target=_blank><img alt=\\\"\\\" border=\\\"0\\\" src=\"\n  \"\\\"images/art.gif\\\"></a></td></tr>\\t\\t\\r\\n<tr><td align=\\\"left\\\" vAlign=\\\"\"\n  \"top\\\" bgColor=\\\"#ffffff\\\"><img alt=\\\"\\\" border=\\\"0\\\" height=\\\"2\\\" src=\\\"\"\n  \"images/spacer.gif\\\" width=\\\"2\\\"></td></tr>\\r\\n<!-- Link-->\\r\\n\\r\\n\\t\\t<t\"\n  \"r><td align=left bgcolor=\\\"#ffffff\\\" valign=\\\"top\\\">\\r\\n\\t\\t<table borde\"\n  \"r=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" width=\\\"100%\\\" background=\\\"\"\n  \"images/line11.gif\\\">\\r\\n\\t\\t<tr>\\r\\n          <td bgcolor=\\\"#FFB780\\\"><i\"\n  \"mg alt=\\\"\\\" border=\\\"0\\\" src=\\\"images/spacer.gif\\\" width=\\\"1\\\" height=\\\"\"\n  \"2\\\"></td>\\r\\n        </tr>\\r\\n        <tr><th width=\\\"100%\\\" align=\\\"cen\"\n  \"ter\\\"><a href=\\\"javascript:editor()\\\"><font face=\\\"Jagran\\\" color=\\\"blue\"\n  \"\\\" size=\\\"4\\\"><b>\\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA4\"\"\\x95\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\"\n  \"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\" \\xE0\"\"\"\n  \"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"</b></\"\n  \"font></a></th></tr>\\r\\n        <tr><td bgcolor=\\\"#FFB780\\\"><img alt=\\\"\\\"\"\n  \" border=\\\"0\\\" src=\\\"images/spacer.gif\\\" width=\\\"1\\\" height=\\\"2\\\"></td></\"\n  \"tr>\\r\\n        <tr><th width=\\\"100%\\\" align=\\\"center\\\"><a href=\\\"japan/d\"\n  \"efault.aspx\\\" target=_blank><font face=\\\"Jagran\\\" color=\\\"blue\\\" size=\\\"\"\n  \"4\\\"><b>\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\"\n  \"\\x80\"\" \\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\" \\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xA4\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"</b></font><\"\n  \"/a></th></tr>\\r\\n        <tr><td bgcolor=\\\"#FFB780\\\"><img alt=\\\"\\\" borde\"\n  \"r=\\\"0\\\" src=\\\"images/spacer.gif\\\" width=\\\"1\\\" height=\\\"2\\\"></td></tr>\\r\\n\"\n  \"        <tr><th width=\\\"100%\\\" align=\\\"center\\\"><a href=\\\"http://www1.ja\"\n  \"gran.com/newsletter/registration.asp\\\" onclick=\\\"javascript:friend()\\\" t\"\n  \"arget=abc><font face=\\\"Jagran\\\" color=\\\"blue\\\" size=\\\"4\\\"><b>\\xE0\"\"\\xA4\"\"\"\n  \"\\xA8\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA5\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\x9C\"\" \\xE0\"\"\\xA4\"\"\\xB2\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x9F\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xB0\"\"</b></font></a></th></tr>\\r\\n        <tr><td bgcolor=\\\"#FFB780\\\"><\"\n  \"img alt=\\\"\\\" border=\\\"0\\\" src=\\\"images/spacer.gif\\\" width=\\\"1\\\" height=\\\"\"\n  \"2\\\"></td></tr>\\r\\n        <tr><th width=\\\"100%\\\" align=\\\"center\\\"><a hre\"\n  \"f=\\\"nri/default.aspx\\\" target=\\\"_blank\\\"><font face=\\\"Jagran\\\" color=\\\"b\"\n  \"lue\\\" size=\\\"4\\\"><b>\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\xAD\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"</b></font></a></th></tr>\\r\\n       \"\n  \" <tr><td bgcolor=\\\"#FFB780\\\"><img alt=\\\"\\\" border=\\\"0\\\" src=\\\"images/spa\"\n  \"cer.gif\\\" width=\\\"1\\\" height=\\\"2\\\"></td></tr>\\r\\n        <tr><th width=\\\"\"\n  \"100%\\\" align=\\\"center\\\"><a href=\\\"opgupta/default.aspx\\\" target=\\\"_blank\"\n  \"\\\"><font face=\\\"Jagran\\\" color=\\\"blue\\\" size=\\\"4\\\"><b>\\xE0\"\"\\xA4\"\"\\xA7\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\x95\"\" \\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xA5\"\" \\xE0\"\"\\xA4\"\"\\x94\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB0\"\" \\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA5\"\"\\x82\"\" \\xE0\"\"\\xA4\"\"\\xB8\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x9C\"\"</b></font></a></t\"\n  \"h></tr>\\r\\n        <tr><td bgcolor=\\\"#FFB780\\\"><img alt=\\\"\\\" border=\\\"0\\\"\"\n  \" src=\\\"images/spacer.gif\\\" width=\\\"1\\\" height=\\\"2\\\"></td></tr>\\r\\n      \"\n  \"  <tr><th width=\\\"100%\\\" align=\\\"center\\\"><a href=\\\"http://www1.jagran.c\"\n  \"om/nmg/default.htm\\\" target=\\\"_blank\\\"><font face=\\\"Jagran\\\" color=\\\"blu\"\n  \"e\\\" size=\\\"4\\\"><b>\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\xA6\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\"\\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\"\n  \" - \\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA5\"\"\\x83\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\" \\xE0\"\"\\xA4\"\"\\xB6\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB7\"\"</b></font></a></th></tr>\\r\\n        <tr><td bgcolor=\\\"\"\n  \"#FFB780\\\"><img alt=\\\"\\\" border=\\\"0\\\" src=\\\"images/spacer.gif\\\" width=\\\"1\"\n  \"\\\" height=\\\"2\\\"></td></tr>\\r\\n        </table>\\r\\n\\t\\t</td></tr>\\r\\n\\t\\t\"\n  \"<!--Link-->\\r\\n<tr><td>\\r\\n<form action=\\\"http://www6.jagran.com/news/ja\"\n  \"nmat/poll.asp\\\" id=\\\"form2\\\" method=\\\"post\\\" name=\\\"form2\\\" target=\\\"_bl\"\n  \"ank\\\">\\r\\n<table border=0  bgColor=\\\"#ffe8d9\\\" width=100%> \\r\\n<tr>\\r\\n<\"\n  \"td align=\\\"left\\\" bgColor=\\\"#ff6601\\\" vAlign=\\\"top\\\">\\r\\n<font face=\\\"Ja\"\n  \"gran\\\" size=\\\"4\\\">&nbsp;\\xE0\"\"\\xA4\"\"\\x9C\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\"\n  \"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"</font> </td></tr>\\r\\n\\t        \\r\\n\\r\\n\\r\\n\\t<t\"\n  \"r><td><font face=\\\"Jagran\\\" size=\\\"4\\\">\\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xAF\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\xBF\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"\\xE0\"\"\\xA4\"\"\\x97\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\xB8\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\x96\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x87\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x87\"\"\\xE0\"\"\\xA4\"\"\\x95\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA5\"\"\\x8B\"\" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\x9F\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\xB0\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xB7\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\x9F\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB0\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\xAF\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\xA7\"\"\\xE0\"\"\\xA5\"\"\\x8D\"\"\\xE0\"\"\\xA4\"\"\\xB5\"\"\\xE0\"\"\\xA4\"\"\\x9C\"\"\"\n  \" \\xE0\"\"\\xA4\"\"\\x95\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\\x85\"\"\\xE0\"\"\\xA4\"\"\\xAA\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xAE\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\xA8\"\" \\xE0\"\"\\xA4\"\"\\xB9\"\"\"\n  \"\\xE0\"\"\\xA5\"\"\\x88\"\"?</font></td></tr>\\r\\n\\t\\t\\t<tr><td align=\\\"left\\\">&nb\"\n  \"sp;<input type=\\\"radio\\\" value=\\\"Y\\\" style=\\\"width:auto\\\" checked name=\\\"\"\n  \"vote\\\">&nbsp;&nbsp;<font face=\\\"Jagran\\\" size=\\\"4\\\">\\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\"\n  \"\\xA4\"\"\\xBE\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"</font></td></tr>\\r\\n\\t\\t\\t<tr><td align=\\\"\"\n  \"left\\\">&nbsp;<input type=\\\"radio\\\" value=\\\"N\\\" style=\\\"width:auto\\\" name\"\n  \"=\\\"vote\\\">&nbsp;&nbsp;<font face=\\\"Jagran\\\" size=\\\"4\\\">\\xE0\"\"\\xA4\"\"\\xA8\"\"\"\n  \"\\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"</font></td></tr>\\r\"\n  \"\\n\\t\\t\\t<tr><td align=\\\"left\\\">&nbsp;<input type=\\\"radio\\\" value=\\\"C\\\" s\"\n  \"tyle=\\\"width:auto\\\" name=\\\"vote\\\">&nbsp;&nbsp;<font face=\\\"Jagran\\\" size\"\n  \"=\\\"4\\\">\\xE0\"\"\\xA4\"\"\\xAA\"\"\\xE0\"\"\\xA4\"\"\\xA4\"\"\\xE0\"\"\\xA4\"\"\\xBE\"\" \\xE0\"\"\\xA4\"\"\"\n  \"\\xA8\"\"\\xE0\"\"\\xA4\"\"\\xB9\"\"\\xE0\"\"\\xA5\"\"\\x80\"\"\\xE0\"\"\\xA4\"\"\\x82\"\"</font></td>\"\n  \"</tr>\\r\\n\\t\\t\\t<tr><td valign=\\\"middle\\\" align=\\\"center\\\"><input type=\\\"\"\n  \"hidden\\\" name=\\\"qid\\\" value='2717'>\\r\\n\\t\\t\\t<input style=\\\"width:auto\\\"\"\n  \" type=\\\"image\\\" src=\\\"images/vote.gif\\\" name=\\\"Vote\\\"></td></tr>\\r\\n    \"\n  \"    \\r\\n</table>\\r\\n</form>\\r\\n</td></tr>\\r\\n</table>\\r\\n\\r\\n</td>\\r\\n</\"\n  \"tr>\\r\\n</table>\\r\\n</body>\\r\\n</html>\\r\\n\"\n;\n\n\n// This one is a mixture of UTF-8, CP1252, and UTF8UTF8\nconst char* kTeststr99 =\n// 1252\n  \" auf der Computermesse Systems in M\\xFC\"\"nchen vertreten (Halle A3.542).\"\n  \" Artikel des Tages Das Weinbaugebiet Bordeaux, auf franz\\xF6\"\"sisch Bord\"\n  \"elais, ist das gr\\xF6\"\"\\xDF\"\"te zusammenh\\xE4\"\"ngende Anbaugebiet der We\"\n  \"lt f\\xFC\"\"r Qualit\\xE4\"\"tswein. Es gibt etwa 4000 Ch\\xE2\"\"teaux genannte\"\n// UTF8\n  \"tnegirjji gosa gii beare s\\xC3\"\"\\xA1\"\"htt\\xC3\"\"\\xA1\"\" \\xC4\"\"\\x8D\"\"\\xC3\"\"\"\n  \"\\xA1\"\"llit artihkkaliid. Maid don s\\xC3\"\"\\xA1\"\"ht\\xC3\"\"\\xA1\"\"t dievasmah\"\n  \"ttit ja divvut juo \\xC4\"\"\\x8D\"\"\\xC3\"\"\\xA1\"\"llojuvvon artihkkaliid dahje \"\n  \"\\xC4\"\"\\x8D\"\"\\xC3\"\"\\xA1\"\"lligoahttit aibbas o\\xC4\"\"\\x91\"\"\\xC4\"\"\\x91\"\"a ar\"\n// UTF8UTF8\n  \"Ice cream a l\\xc3\\x83\\xc2\\xa0 mode.\"\n// 1252\n  \" Weing\\xFC\"\"ter, die die weltber\\xFC\"\"hmten Weine erzeugen. Ein differen\"\n  \"ziertes System von subregionalen und kommunalen Appellationen und Klassi\"\n  \"fikationen schafft unter ihnen eine qualitative Hierarchie. Die einzelne\"\n  \"n Lagen spielen demgegen\\xFC\"\"ber eine untergeordnete Rolle. Ihre Stelle\"\n// UTF8UTF8\n  \"Ice cream \\xC3\\x83\\xC2\\xA9 mode.\"\n  \"Ice cream \\xC3\\xA2\\xE2\\x82\\xAC\\xCB\\x9C mode.\"\n// UTF8\n  \"tnegirjji gosa gii beare s\\xC3\"\"\\xA1\"\"htt\\xC3\"\"\\xA1\"\" \\xC4\"\"\\x8D\"\"\\xC3\"\"\"\n  \"\\xA1\"\"llit artihkkaliid. Maid don s\\xC3\"\"\\xA1\"\"ht\\xC3\"\"\\xA1\"\"t dievasmah\"\n  \"ttit ja divvut juo \\xC4\"\"\\x8D\"\"\\xC3\"\"\\xA1\"\"llojuvvon artihkkaliid dahje \"\n  \"\\xC4\"\"\\x8D\"\"\\xC3\"\"\\xA1\"\"lligoahttit aibbas o\\xC4\"\"\\x91\"\"\\xC4\"\"\\x91\"\"a ar\"\n// 1252\n  \" nimmt das Ch\\xE2\"\"teau ein, zu dem sie geh\\xF6\"\"ren. Im Jahr 2002 wurde\"\n  \"n auf gut 120.000 Hektar Anbaufl\\xE4\"\"che insgesamt 5,74 Millionen Hekto\"\n  \"liter Qualit\\xE4\"\"tswein erzeugt. mehr Fr\\xFC\"\"here Artikel des Tages \\xB7\"\"\"\n  \" Weitere exzellente Artikel Was geschah am 13. Oktober? 1781 \\x96\"\" Jose\"\n;\n\nconst char kTestStrNoUTF8UTF8[] =\n   \"&quot;If management is an art, then surely Jack Welch has proved \"\n    \"himself a master painter.&quot; - BusinessWeek&lt;p&gt;Boardroom \"\n    \"legend Jack Welch is widely regarded as one of the most effective CEOs \"\n    \"in business history. Welch’s groundbreaking programs—including Six \"\n    \"Sigma and Work-Out—along with his numerous strategies on business \"\n    \"leadership have helped transform GE into the global benchmark for \"\n    \"maximized productivity and labor efficiency. &lt;p&gt;Now, The GE Way \"\n    \"Fieldbook explains how you can implement the same programs that helped \"\n    \"turn GE into a $100 billion juggernaut. Drawing from his unprecedented \"\n    \"access to GE’s top-level corridors of power—including a \"\n    \"never-before-published full-length interview with Jack Welch—veteran \"\n    \"business author Robert Slater packs innovative strategies, easy-to-use \"\n    \"diagnostic exercises, detailed questionnaires, and more into the \"\n    \"most hands-on, applications-oriented book ever written on General \"\n    \"Electric. Only in The GE Way Fieldbook will you find:&lt;br&gt; \"\n    \"*&quot;The Boca Raton Speeches&quot;—Never-before-seen excerpts \"\n    \"taken from Jack Welch’s internal speeches to GE employees &lt;br&gt; \"\n    \"*More than 100 exercises, overheads, and exhibits from the files \"\n    \"of Jack Welch and GE &lt;br&gt; *The most complete treatment of \"\n    \"GE’s Six Sigma program ever published&lt;br&gt; *Step-by-step \"\n    \"action plans that are blueprints for implementing Six Sigma and \"\n    \"Work-Out—and creating the boundaryless organization&lt;p&gt;The \"\n    \"fieldbook has become one of today’s most popular, effective teaching \"\n    \"tools—but never before has one focused on the inner workings and \"\n    \"strategies of a specific company. Let The GE Way Fieldbook give you \"\n    \"an inside look at the stunningly successful Jack Welch era at GE, \"\n    \"provide the techniques and tools you need to focus every worker in \"\n    \"your organization on progress and growth, and outline a strategic \"\n    \"roadmap for implementing GE’s business practices—and removing \"\n    \"the boundaries to success—within your own organization.\";\n\nconst char kUTF16LEChomsky[] =\n// generated by stringify.cc\n  \"\"\"\\xff\"\"\"\"\\xfe\"\"<\"\"\\x00\"\"h\"\"\\x00\"\"t\"\"\\x00\"\"m\"\"\\x00\"\"l\"\"\\x00\"\" \"\"\\x00\"\"\"\n  \"x\"\"\\x00\"\"m\"\"\\x00\"\"l\"\"\\x00\"\"n\"\"\\x00\"\"s\"\"\\x00\"\":\"\"\\x00\"\"v\"\"\\x00\"\"=\"\n  \"\"\"\\x00\"\"\"\"\\x22\"\"\"\"\\x00\"\"u\"\"\\x00\"\"r\"\"\\x00\"\"n\"\"\\x00\"\":\"\"\\x00\"\"s\"\"\\x00\"\"c\"\n  \"\"\"\\x00\"\"h\"\"\\x00\"\"e\"\"\\x00\"\"m\"\"\\x00\"\"a\"\"\\x00\"\"s\"\"\\x00\"\"-\"\"\\x00\"\"m\"\n  \"\"\"\\x00\"\"i\"\"\\x00\"\"c\"\"\\x00\"\"r\"\"\\x00\"\"o\"\"\\x00\"\"s\"\"\\x00\"\"o\"\"\\x00\"\"f\"\n  \"\"\"\\x00\"\"t\"\"\\x00\"\"-\"\"\\x00\"\"c\"\"\\x00\"\"o\"\"\\x00\"\"m\"\"\\x00\"\":\"\"\\x00\"\"v\"\n  \"\"\"\\x00\"\"m\"\"\\x00\"\"l\"\"\\x00\"\"\"\"\\x22\"\"\"\"\\x00\"\"\"\"\\x0a\"\"\"\"\\x00\"\"x\"\"\\x00\"\"m\"\n  \"\"\"\\x00\"\"l\"\"\\x00\"\"n\"\"\\x00\"\"s\"\"\\x00\"\":\"\"\\x00\"\"o\"\"\\x00\"\"=\"\"\\x00\"\"\"\"\\x22\"\"\"\n  \"\"\"\\x00\"\"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x00\"\" \"\"\\x00\"\"n\"\"\\x00\"\"a\"\"\\x00\"\"m\"\"\\x00\"\"e\"\"\\x00\"\"=\"\n  \"\"\"\\x00\"\"P\"\"\\x00\"\"r\"\"\\x00\"\"o\"\"\\x00\"\"g\"\"\\x00\"\"I\"\"\\x00\"\"d\"\"\\x00\"\" \"\n  \"\"\"\\x00\"\"c\"\"\\x00\"\"o\"\"\\x00\"\"n\"\"\\x00\"\"t\"\"\\x00\"\"e\"\"\\x00\"\"n\"\"\\x00\"\"t\"\n  \"\"\"\\x00\"\"=\"\"\\x00\"\"W\"\"\\x00\"\"o\"\"\\x00\"\"r\"\"\\x00\"\"d\"\"\\x00\"\".\"\"\\x00\"\"D\";\n\nnamespace {\n\nclass CompactEncDetTest : public testing::Test {\n protected:\n  // Objects declared here can be used by all tests in the test case for Foo.\n\n  // Convert str to UTF-8, returning as function result\n  // Name is just for debug output\n  Encoding TestCompactEncDetWithURL(const char* str, int len,\n                                    const char* url, const char* name,\n                                    bool* is_reliable) {\n    int bytes_consumed;\n\n    if (FLAGS_enc_detect_detail) {\n      fprintf(stderr, \"(Unit test %s) start-detail\\n\", PsStr(name).c_str());\n    }\n\n    Encoding enc = CompactEncDet::DetectEncoding(\n        str, len,\n        url,                                // url hint\n        NULL,                               // http hint\n        NULL,                               // meta hint\n        UNKNOWN_ENCODING,                   // enc hint\n        UNKNOWN_LANGUAGE,  // lang hint\n        CompactEncDet::WEB_CORPUS,\n        false,  // Include 7-bit encodings\n        &bytes_consumed, is_reliable);\n\n    if (FLAGS_enc_detect_detail) {\n      fprintf(stderr, \"() end-detail\\n\\n\");\n    }\n    return enc;\n  }\n\n  // Name is just for debug output\n  // Same as above with is_reliable supplied and then ignored\n  Encoding TestCompactEncDetWithURL(const char* str, int len,\n                                    const char* url, const char* name) {\n    bool is_reliable;\n    return TestCompactEncDetWithURL(str, len, NULL, name, &is_reliable);\n  }\n\n  // Name is just for debug output\n  Encoding TestCompactEncDetWithReliable(const char* str, int len,\n                                         const char* name, bool* is_reliable) {\n    return TestCompactEncDetWithURL(str, len, NULL, name, is_reliable);\n  }\n\n  // Name is just for debug output\n  Encoding TestCompactEncDet(const char* str, int len, const char* name) {\n    return TestCompactEncDetWithURL(str, len, NULL, name);\n  }\n\n  // Name is just for debug output\n  Encoding TestCompactEncDet(const char* str, const char* name) {\n    return TestCompactEncDetWithURL(str, strlen(str), NULL, name);\n  }\n  // Every string that is detected as UTF8UTF8 when --ced_allow_utf8utf=true\n  // should be detected as some other encoding when --ced_allow_utf8utf8=false.\n  void TestUTF8UTF8(const char* str, Encoding other, const char* name) {\n    Encoding encoding;\n#if defined(HTML5_MODE)\n    encoding = ASCII_7BIT;\n#else\n    encoding = UTF8UTF8;\n#endif\n    {\n      VarSetter<bool> utf8utf8(&FLAGS_ced_allow_utf8utf8, true);\n      EXPECT_EQ(encoding, TestCompactEncDet(str, name));\n    }\n    {\n      VarSetter<bool> noutf8utf8(&FLAGS_ced_allow_utf8utf8, false);\n      EXPECT_EQ(other, TestCompactEncDet(str, name));\n    }\n  }\n};    // end class CompactEncDetTest\n\n\nTEST_F(CompactEncDetTest, ZeroLength) {\n  // The spec (.h file) says that DetectEncoding returns ASCII\n  // (ISO_8859_1) when the text_length is 0. It doesn't require that\n  // the text actually *have* a length of 0. In particular, we want to\n  // allow the case where the text is actually NULL.  This shows up\n  // in a unit test, caribou/medley/internal/parser_impl_test, which\n  // uses StringPiece() and calls the .data() method, which returns\n  // NULL, and the .size() method, which returns 0. Without the test\n  // for for length == 0, we segfaulted.\n  //\n  // For completeness, test all three cases:\n  // Empty string\n  EXPECT_EQ(ISO_8859_1, TestCompactEncDet(\"\", 0, \"ISO_8859_1\"));\n  // Non-empty string\n  EXPECT_EQ(ISO_8859_1, TestCompactEncDet(\"abcdef\", 0, \"ISO_8859_1\"));\n  // Null string\n  EXPECT_EQ(ISO_8859_1, TestCompactEncDet(NULL, 0, \"ISO_8859_1\"));\n}\n\n// NOTE: strlen will not work for UTF-16 and UTF-32 strings with embedded NUL\n\nTEST_F(CompactEncDetTest, EasyTests) {\n  // One-byte\n  EXPECT_EQ(ISO_8859_1,\n            TestCompactEncDet(kTeststr00, strlen(kTeststr00), \"ISO_8859_1\"));\n  // By design, Latin4 is the most sensitive test of the bunch,\n  // most likely to fail with minor changes in the detector probabilities\n  EXPECT_EQ(ISO_8859_4,\n            TestCompactEncDet(kTeststr03, strlen(kTeststr03), \"ISO_8859_4\"));\n  EXPECT_EQ(ISO_8859_5,\n            TestCompactEncDet(kTeststr04, strlen(kTeststr04), \"ISO_8859_5\"));\n  EXPECT_EQ(ISO_8859_6,\n            TestCompactEncDet(kTeststr05, strlen(kTeststr05), \"ISO_8859_6\"));\n  // This text is in fact CP1253, previously mis-detected as Greek.\n  // 0xA2 = U+0386 Alpha with Tonos\n  EXPECT_EQ(MSFT_CP1253,\n            TestCompactEncDet(kTeststr06, strlen(kTeststr06), \"ISO_8859_7 => 1253\"));\n  EXPECT_EQ(MSFT_CP1255,    // Logical (modern browsers) order\n            TestCompactEncDet(kTeststr07, strlen(kTeststr07), \"ISO_8859_8_I\"));\n  EXPECT_EQ(ISO_8859_8,     // Visual (original 1994 browsers) order\n            TestCompactEncDet(kTeststr07v, strlen(kTeststr07v), \"ISO_8859_8\"));\n  EXPECT_EQ(ISO_8859_9,\n            TestCompactEncDet(kTeststr08, strlen(kTeststr08), \"ISO_8859_9\"));\n\n  // Two-byte Japanese\n  EXPECT_EQ(JAPANESE_SHIFT_JIS,\n            TestCompactEncDet(kTeststr11, strlen(kTeststr11), \"JAPANESE_SHIFT_JIS\"));\n\n  // Two-byte Chinese\n  EXPECT_EQ(CHINESE_GB,\n            TestCompactEncDet(kTeststr14, strlen(kTeststr14), \"CHINESE_GB\"));\n  EXPECT_EQ(GB18030,\n            TestCompactEncDet(kTeststr46, strlen(kTeststr46), \"GB18030\"));\n\n  // Two-byte Chinese-T\n  EXPECT_EQ(CHINESE_BIG5,\n            TestCompactEncDet(kTeststr13, strlen(kTeststr13), \"CHINESE_BIG5\"));\n\n  // Two-byte Korean\n  //KOREAN_EUC_KR,    // 16: Teragram KSC\n\n  // UTF-8\n  EXPECT_EQ(UTF8,\n            TestCompactEncDet(kTeststr22, strlen(kTeststr22), \"UTF8\"));\n\n  // More one-byte\n  EXPECT_EQ(ISO_8859_11,\n            TestCompactEncDet(kTeststr33, strlen(kTeststr33), \"ISO_8859_11\"));\n  EXPECT_EQ(RUSSIAN_KOI8_R,\n            TestCompactEncDet(kTeststr25, strlen(kTeststr25), \"RUSSIAN_KOI8_R\"));\n  EXPECT_EQ(RUSSIAN_KOI8_RU,\n            TestCompactEncDet(kTeststr28, strlen(kTeststr28), \"RUSSIAN_KOI8_RU\"));\n  EXPECT_EQ(RUSSIAN_CP1251,\n            TestCompactEncDet(kTeststr26, strlen(kTeststr26), \"RUSSIAN_CP1251\"));\n  EXPECT_EQ(MSFT_CP1252,\n            TestCompactEncDet(kTeststr27, strlen(kTeststr27), \"MSFT_CP1252\"));\n  EXPECT_EQ(MSFT_CP1250,\n            TestCompactEncDet(kTeststr29, strlen(kTeststr29), \"MSFT_CP1250\"));\n  EXPECT_EQ(MSFT_CP1257,\n            TestCompactEncDet(kTeststr32, strlen(kTeststr32), \"MSFT_CP1257\"));\n  EXPECT_EQ(MSFT_CP1256,\n            TestCompactEncDet(kTeststr35, strlen(kTeststr35), \"MSFT_CP1256\"));\n  EXPECT_EQ(RUSSIAN_CP866,\n            TestCompactEncDet(kTeststr42, strlen(kTeststr42), \"RUSSIAN_CP866\"));\n  EXPECT_EQ(MACINTOSH_ROMAN,\n            TestCompactEncDet(kTeststr53, strlen(kTeststr53), \"MACINTOSH_ROMAN\"));\n\n  // Ascii7 and seven-bit CJK and Unicode encodings\n  EXPECT_EQ(JAPANESE_JIS,\n            TestCompactEncDet(kTeststr12, strlen(kTeststr12), \"JAPANESE_JIS\"));\n#if defined(HTML5_MODE)\n  EXPECT_EQ(ASCII_7BIT,\n            TestCompactEncDet(kTeststr44, strlen(kTeststr44), \"ASCII_7BIT\"));\n  EXPECT_EQ(ASCII_7BIT,\n            TestCompactEncDet(kTeststr48, strlen(kTeststr48), \"ASCII_7BIT\"));\n  EXPECT_EQ(ASCII_7BIT,\n            TestCompactEncDet(kTeststr54, strlen(kTeststr54), \"ASCII_7BIT\"));\n  EXPECT_EQ(ASCII_7BIT,\n            TestCompactEncDet(kTeststr62, strlen(kTeststr62), \"ASCII_7BIT\"));\n#else\n  EXPECT_EQ(ISO_2022_KR,\n            TestCompactEncDet(kTeststr44, strlen(kTeststr44), \"ISO_2022_KR\"));\n  EXPECT_EQ(ISO_2022_CN,\n            TestCompactEncDet(kTeststr48, strlen(kTeststr48), \"ISO_2022_CN\"));\n  EXPECT_EQ(UTF7,\n            TestCompactEncDet(kTeststr54, strlen(kTeststr54), \"UTF7\"));\n  EXPECT_EQ(HZ_GB_2312,\n            TestCompactEncDet(kTeststr62, strlen(kTeststr62), \"HZ_GB_2312\"));\n#endif\n\n  TestUTF8UTF8(kTeststr63, UTF8, \"UTF8UTF8\");\n\n  // Unicode and other embedded NUL bytes\n  Encoding encoding_UTF16LE;\n  Encoding encoding_UTF16BE;\n#if defined(HTML5_MODE)\n    encoding_UTF16LE = ASCII_7BIT;\n    encoding_UTF16BE = ASCII_7BIT;\n#else\n    encoding_UTF16LE = UTF16LE;\n    encoding_UTF16BE = UTF16BE;\n#endif\n\n  EXPECT_EQ(encoding_UTF16LE,\n            TestCompactEncDet(kTeststr57, sizeof(kTeststr57), \"UTF16LE\"));\n  EXPECT_EQ(encoding_UTF16LE,\n            TestCompactEncDet(kUTF16LEChomsky,\n                              sizeof(kUTF16LEChomsky),\n                              \"UTF16LE\"));\n  EXPECT_EQ(encoding_UTF16LE,\n            TestCompactEncDet(kUTF16LEFltrs,\n                              sizeof(kUTF16LEFltrs),\n                              \"UTF16LE\"));\n  EXPECT_EQ(encoding_UTF16BE,\n            TestCompactEncDet(kTeststr58, sizeof(kTeststr58), \"UTF16BE\"));\n  EXPECT_EQ(UTF32LE,\n            TestCompactEncDet(kTeststr59, sizeof(kTeststr59), \"UTF32LE\"));\n  EXPECT_EQ(UTF32BE,\n            TestCompactEncDet(kTeststr60, sizeof(kTeststr60), \"UTF32BE\"));\n#if defined(HTML5_MODE)\n  EXPECT_EQ(ASCII_7BIT,\n            TestCompactEncDet(kTeststr61, sizeof(kTeststr61), \"BINARYENC\"));\n#else\n  EXPECT_EQ(BINARYENC,\n            TestCompactEncDet(kTeststr61, sizeof(kTeststr61), \"ASCII_7BIT\"));\n#endif\n  // Indic. Detection requires a full URL hint\n  // dsites 2007.10.10 NO LONGER DETECTED. Will return some LatinX result\n  EXPECT_EQ(ISO_8859_10, TestCompactEncDetWithURL(kTeststr52,\n                                                  strlen(kTeststr52),\n                                                  kTestUrl52, \"Indic JAGRAN\"));\n  EXPECT_EQ(UTF8, TestCompactEncDetWithURL(kTeststr52b, strlen(kTeststr52b),\n                                           kTestUrl52b, \"Indic UTF8\"));\n\n  // dsites 2011.11.07 remove mixed encoding UTF8CP1252 -- it was a bad idea\n  // Mixed UTF-8 and CP1252 and UTF8UTF8\n  //// TestUTF8UTF8(kTeststr99, MSFT_CP1252, \"UTF8CP1252\");\n\n}\n\nTEST_F(CompactEncDetTest, LangHintTests) {\n  // Make sure the Tier1 language hints are plausible\n  EXPECT_EQ(ASCII_7BIT, CompactEncDet::TopEncodingOfLangHint(\"English\"));\n  EXPECT_EQ(ISO_8859_1, CompactEncDet::TopEncodingOfLangHint(\"Spanish\"));\n  EXPECT_EQ(ISO_8859_1, CompactEncDet::TopEncodingOfLangHint(\"German\"));\n  EXPECT_EQ(ISO_8859_1, CompactEncDet::TopEncodingOfLangHint(\"French\"));\n  EXPECT_EQ(JAPANESE_SHIFT_JIS, CompactEncDet::TopEncodingOfLangHint(\"Japanese\"));\n  EXPECT_EQ(ISO_8859_1, CompactEncDet::TopEncodingOfLangHint(\"Portuguese_B\"));\n  EXPECT_EQ(CHINESE_GB, CompactEncDet::TopEncodingOfLangHint(\"Chinese\"));\n  EXPECT_EQ(ISO_8859_1, CompactEncDet::TopEncodingOfLangHint(\"Italian\"));\n  EXPECT_EQ(ASCII_7BIT, CompactEncDet::TopEncodingOfLangHint(\"Dutch\"));\n  EXPECT_EQ(ISO_8859_9, CompactEncDet::TopEncodingOfLangHint(\"Turkish\"));\n  EXPECT_EQ(ISO_8859_2, CompactEncDet::TopEncodingOfLangHint(\"Polish\"));\n  EXPECT_EQ(ISO_8859_11, CompactEncDet::TopEncodingOfLangHint(\"Thai\"));\n  EXPECT_EQ(CHINESE_BIG5, CompactEncDet::TopEncodingOfLangHint(\"ChineseT\"));\n  EXPECT_EQ(MSFT_CP1256, CompactEncDet::TopEncodingOfLangHint(\"Arabic\"));\n  EXPECT_EQ(RUSSIAN_CP1251, CompactEncDet::TopEncodingOfLangHint(\"Russian\"));\n  EXPECT_EQ(KOREAN_EUC_KR, CompactEncDet::TopEncodingOfLangHint(\"Korean\"));\n}\n\n\nTEST_F(CompactEncDetTest, TLDHintTests) {\n  // Make sure the Tier1 domain hints are plausible\n  EXPECT_EQ(ISO_8859_1, CompactEncDet::TopEncodingOfTLDHint(\"de\"));\n  EXPECT_EQ(ASCII_7BIT, CompactEncDet::TopEncodingOfTLDHint(\"au\"));\n  EXPECT_EQ(ASCII_7BIT, CompactEncDet::TopEncodingOfTLDHint(\"ca\"));\n  EXPECT_EQ(ASCII_7BIT, CompactEncDet::TopEncodingOfTLDHint(\"in\"));\n  EXPECT_EQ(ASCII_7BIT, CompactEncDet::TopEncodingOfTLDHint(\"uk\"));\n  EXPECT_EQ(ISO_8859_1, CompactEncDet::TopEncodingOfTLDHint(\"es\"));\n  EXPECT_EQ(ISO_8859_1, CompactEncDet::TopEncodingOfTLDHint(\"mx\"));\n  EXPECT_EQ(ISO_8859_1, CompactEncDet::TopEncodingOfTLDHint(\"fr\"));\n  EXPECT_EQ(ISO_8859_1, CompactEncDet::TopEncodingOfTLDHint(\"it\"));\n  EXPECT_EQ(JAPANESE_SHIFT_JIS, CompactEncDet::TopEncodingOfTLDHint(\"jp\"));\n  EXPECT_EQ(KOREAN_EUC_KR, CompactEncDet::TopEncodingOfTLDHint(\"kr\"));\n  EXPECT_EQ(ASCII_7BIT, CompactEncDet::TopEncodingOfTLDHint(\"nl\"));\n  EXPECT_EQ(ISO_8859_2, CompactEncDet::TopEncodingOfTLDHint(\"pl\"));\n  EXPECT_EQ(ISO_8859_1, CompactEncDet::TopEncodingOfTLDHint(\"br\"));\n  EXPECT_EQ(RUSSIAN_CP1251, CompactEncDet::TopEncodingOfTLDHint(\"ru\"));\n  EXPECT_EQ(ISO_8859_11, CompactEncDet::TopEncodingOfTLDHint(\"th\"));\n  EXPECT_EQ(ISO_8859_9, CompactEncDet::TopEncodingOfTLDHint(\"tr\"));\n  EXPECT_EQ(CHINESE_GB, CompactEncDet::TopEncodingOfTLDHint(\"cn\"));\n  EXPECT_EQ(CHINESE_BIG5, CompactEncDet::TopEncodingOfTLDHint(\"tw\"));\n}\n\n\n\nTEST_F(CompactEncDetTest, CharsetHintTests) {\n  // Make sure official encoding names give that encoding, or sub/superset\n  EXPECT_EQ(ISO_8859_1, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-8859-1\"));   // ASCII_7BIT ok\n  EXPECT_EQ(ISO_8859_2, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-8859-2\"));\n  EXPECT_EQ(ISO_8859_3, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-8859-3\"));   // ASCII_7BIT bug\n  EXPECT_EQ(ISO_8859_4, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-8859-4\"));   // MSFT_CP1257 bug\n  EXPECT_EQ(ISO_8859_5, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-8859-5\"));\n  EXPECT_EQ(ISO_8859_6, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-8859-6\"));   // ASCII_7BIT bug\n  EXPECT_EQ(ISO_8859_7, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-8859-7\"));\n  EXPECT_EQ(ISO_8859_8, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-8859-8\"));\n  EXPECT_EQ(ISO_8859_9, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-8859-9\"));\n  EXPECT_EQ(ISO_8859_10, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-8859-10\")); // ASCII_7BIT  bug\n\n  EXPECT_EQ(JAPANESE_EUC_JP, CompactEncDet::TopEncodingOfCharsetHint(\"EUC-JP\"));\n  EXPECT_EQ(JAPANESE_SHIFT_JIS, CompactEncDet::TopEncodingOfCharsetHint(\"Shift-JIS\"));\n  EXPECT_EQ(JAPANESE_JIS, CompactEncDet::TopEncodingOfCharsetHint(\"JIS\"));        // JAPANESE_SHIFT_JIS ok\n  EXPECT_EQ(CHINESE_BIG5, CompactEncDet::TopEncodingOfCharsetHint(\"Big5\"));\n  EXPECT_EQ(CHINESE_GB, CompactEncDet::TopEncodingOfCharsetHint(\"GB\"));\n  EXPECT_EQ(CHINESE_EUC_CN, CompactEncDet::TopEncodingOfCharsetHint(\"EUC-CN\"));   // CHINESE_GB ok\n  EXPECT_EQ(KOREAN_EUC_KR, CompactEncDet::TopEncodingOfCharsetHint(\"EUC-KR\"));\n  // Never return UNICODE; return UTF-16BE or lE instead\n  // EXPECT_EQ(UNICODE, CompactEncDet::TopEncodingOfCharsetHint(\"Unicode\"));         // ASCII_7BIT\n  EXPECT_EQ(CHINESE_EUC_DEC, CompactEncDet::TopEncodingOfCharsetHint(\"EUC-DEC\")); // UNKNOWN_ENCODING ok\n  EXPECT_EQ(CHINESE_CNS, CompactEncDet::TopEncodingOfCharsetHint(\"CNS\"));         // UNKNOWN_ENCODING ok\n\n  EXPECT_EQ(CHINESE_BIG5_CP950, CompactEncDet::TopEncodingOfCharsetHint(\"windows-950\"));// CHINESE_BIG5 ok\n  EXPECT_EQ(JAPANESE_CP932, CompactEncDet::TopEncodingOfCharsetHint(\"windows-932\"));    // JAPANESE_EUC_JP ok\n  EXPECT_EQ(UTF8, CompactEncDet::TopEncodingOfCharsetHint(\"UTF8\"));\n  // Never return \"unknown\"\n  // EXPECT_EQ(ASCII_7BIT, CompactEncDet::TopEncodingOfCharsetHint(\"unknown\"));// JAPANESE_SHIFT_JIS bug\n  EXPECT_EQ(ASCII_7BIT, CompactEncDet::TopEncodingOfCharsetHint(\"ASCII\"));        // UNKNOWN_ENCODING bug\n  EXPECT_EQ(ASCII_7BIT, CompactEncDet::TopEncodingOfCharsetHint(\"US-ASCII\"));     // UNKNOWN_ENCODING bug\n  EXPECT_EQ(RUSSIAN_KOI8_R, CompactEncDet::TopEncodingOfCharsetHint(\"KOI8R\"));\n  EXPECT_EQ(RUSSIAN_CP1251, CompactEncDet::TopEncodingOfCharsetHint(\"windows-1251\"));\n  EXPECT_EQ(MSFT_CP1252, CompactEncDet::TopEncodingOfCharsetHint(\"windows-1252\"));      // ASCII_7BIT ok\n  EXPECT_EQ(RUSSIAN_KOI8_RU, CompactEncDet::TopEncodingOfCharsetHint(\"KOI8U\"));\n  EXPECT_EQ(MSFT_CP1250, CompactEncDet::TopEncodingOfCharsetHint(\"windows-1250\"));\n\n  EXPECT_EQ(ISO_8859_15, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-8859-15\"));\n  EXPECT_EQ(MSFT_CP1254, CompactEncDet::TopEncodingOfCharsetHint(\"windows-1254\"));      // ISO_8859_9 ok\n  EXPECT_EQ(MSFT_CP1257, CompactEncDet::TopEncodingOfCharsetHint(\"windows-1257\"));\n  EXPECT_EQ(ISO_8859_11, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-8859-11\"));\n  EXPECT_EQ(MSFT_CP874, CompactEncDet::TopEncodingOfCharsetHint(\"win-874\"));        // UNKNOWN_ENCODING bug\n  EXPECT_EQ(MSFT_CP1256, CompactEncDet::TopEncodingOfCharsetHint(\"windows-1256\"));\n  EXPECT_EQ(MSFT_CP1255, CompactEncDet::TopEncodingOfCharsetHint(\"windows-1255\"));  // UNKNOWN_ENCODING\n  // Always map ISO-8859-8-I to MSFT_CP1255\n  EXPECT_EQ(MSFT_CP1255, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-8859-8-I\")); // MSFT_CP1255\n  // Always map Visual Hebrew to ISO_8859_8\n  EXPECT_EQ(ISO_8859_8, CompactEncDet::TopEncodingOfCharsetHint(\"Visual\"));       // ISO_8859_8 ok\n  EXPECT_EQ(CZECH_CP852, CompactEncDet::TopEncodingOfCharsetHint(\"windows-852\"));\n\n  EXPECT_EQ(CZECH_CSN_369103, CompactEncDet::TopEncodingOfCharsetHint(\"CSN-369103\"));\n  EXPECT_EQ(MSFT_CP1253, CompactEncDet::TopEncodingOfCharsetHint(\"windows-1253\"));      // UTF8\n  EXPECT_EQ(RUSSIAN_CP866, CompactEncDet::TopEncodingOfCharsetHint(\"windows-866\"));\n  EXPECT_EQ(ISO_8859_13, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-8859-13\")); // MSFT_CP1257 ok\n  EXPECT_EQ(ISO_2022_KR, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-2022-KR\")); // KOREAN_EUC_KR ok\n  EXPECT_EQ(GBK, CompactEncDet::TopEncodingOfCharsetHint(\"GBK\"));                 // CHINESE_GB ok\n  EXPECT_EQ(GB18030, CompactEncDet::TopEncodingOfCharsetHint(\"GB18030\"));         // CHINESE_GB  ok\n  EXPECT_EQ(BIG5_HKSCS, CompactEncDet::TopEncodingOfCharsetHint(\"BIG5-HKSCS\"));   // CHINESE_BIG5 ok\n  EXPECT_EQ(ISO_2022_CN, CompactEncDet::TopEncodingOfCharsetHint(\"ISO-2022-CN\")); // CHINESE_GB  ok\n  EXPECT_EQ(TSCII, CompactEncDet::TopEncodingOfCharsetHint(\"TSCII\"));             // UNKNOWN_ENCODING\n\n  EXPECT_EQ(TAMIL_MONO, CompactEncDet::TopEncodingOfCharsetHint(\"TAM\"));          // UNKNOWN_ENCODING\n  EXPECT_EQ(TAMIL_BI, CompactEncDet::TopEncodingOfCharsetHint(\"TAB\"));            // UNKNOWN_ENCODING\n  EXPECT_EQ(JAGRAN, CompactEncDet::TopEncodingOfCharsetHint(\"JAGRAN\"));           // UNKNOWN_ENCODING\n  EXPECT_EQ(MACINTOSH_ROMAN, CompactEncDet::TopEncodingOfCharsetHint(\"MacRoman\"));// ASCII_7BIT\n  EXPECT_EQ(UTF7, CompactEncDet::TopEncodingOfCharsetHint(\"UTF-7\"));              // ASCII_7BIT\n  EXPECT_EQ(BHASKAR, CompactEncDet::TopEncodingOfCharsetHint(\"BHASKAR\"));         // UNKNOWN_ENCODING\n  EXPECT_EQ(HTCHANAKYA, CompactEncDet::TopEncodingOfCharsetHint(\"HTCHANAKYA\"));   // UNKNOWN_ENCODING\n  EXPECT_EQ(UTF16BE, CompactEncDet::TopEncodingOfCharsetHint(\"UTF-16BE\"));        // ASCII_7BIT\n  EXPECT_EQ(UTF16LE, CompactEncDet::TopEncodingOfCharsetHint(\"UTF-16LE\"));        // UNKNOWN_ENCODING\n  EXPECT_EQ(UTF32BE, CompactEncDet::TopEncodingOfCharsetHint(\"UTF-32BE\"));        // UNKNOWN_ENCODING\n\n  EXPECT_EQ(UTF32LE, CompactEncDet::TopEncodingOfCharsetHint(\"UTF-32LE\"));        // UNKNOWN_ENCODING\n  EXPECT_EQ(BINARYENC, CompactEncDet::TopEncodingOfCharsetHint(\"binary\"));        // UNKNOWN_ENCODING\n  EXPECT_EQ(HZ_GB_2312, CompactEncDet::TopEncodingOfCharsetHint(\"HZ-GB-2312\"));   // GBK\n  EXPECT_EQ(UTF8UTF8, CompactEncDet::TopEncodingOfCharsetHint(\"utf8utf8\"));       // UNKNOWN_ENCODING\n}\n\nTEST_F(CompactEncDetTest, UTF8UTF8Tests) {\n  // Present subset of all 128 possible UTF8-UTF8 double-conversions and\n  // make sure they are properly detected.\n  TestUTF8UTF8(\"\\xC3\\xA2\\xE2\\x80\\x9A\\xC2\\xAC\", UTF8, \"UTF8UTF8 80\");\n  TestUTF8UTF8(\"\\xC3\\x82\\xC2\\x81\", UTF8, \"UTF8UTF8 81\");\n  TestUTF8UTF8(\"\\xC3\\x86\\xE2\\x80\\x99\", UTF8, \"UTF8UTF8 83\");\n  TestUTF8UTF8(\"\\xC3\\xA2\\xE2\\x82\\xAC\\xE2\\x84\\xA2\", UTF8, \"UTF8UTF8 92\");\n  TestUTF8UTF8(\"\\xC3\\x8B\\xC5\\x93\", UTF8, \"UTF8UTF8 98\");\n  TestUTF8UTF8(\"\\xC3\\x83\\xC6\\x92\", UTF8, \"UTF8UTF8 C3\");\n  TestUTF8UTF8(\"\\xC3\\x83\\xCB\\x86\", UTF8, \"UTF8UTF8 C8\");\n  TestUTF8UTF8(\"\\xC3\\x83\\xC2\\xBF\", UTF8, \"UTF8UTF8 FF\");\n\n  // These are bare-byte extra conversions to UTF-8\n  TestUTF8UTF8(\"\\xc3\\x85\\xc2\\x8f:\\xc3\\x8c\\xc2\\x95:\"\n               \"\\xc3\\x85\\xc2\\x8f:\\xc3\\x8a\\xc2\\xbe:\"\n               \"\\xc3\\x85\\xc2\\x8f:\\xc3\\x85\\xc2\\xad:\"\n               \"\\xc3\\x8a\\xc2\\xbb:\\xc3\\x85\\xc2\\x8f:\"\n               \"\\xc3\\xa7\\xc2\\x92\\xc2\\xb0\",\n               UTF8,\n               \"UTF8UTF8 bytes1\");\n  TestUTF8UTF8(\"\\x20\\x20\\xc3\\xa7\\xc2\\x92\\xc2\\xb0\"\n               \"\\xc3\\xa5\\xc2\\xa2\\xc2\\x83\\xc3\\xa3\"\n               \"\\xc2\\x83\\xc2\\xbb\\xc3\\xa5\\xc2\\x85\"\n               \"\\xc2\\xac\\xc3\\xa5\\xc2\\xae\\xc2\\xb3\"\n               \"\\xc3\\xa3\\xc2\\x80\\xc2\\x80\\xc3\\xa4\"\n               \"\\xc2\\xba\\xc2\\x8b\\xc3\\xa5\\xc2\\x85\"\n               \"\\xc2\\xb8\",\n               UTF8,\n               \"UTF8UTF8 bytes2\");\n}\n\nTEST_F(CompactEncDetTest, NoUTF8UTF8) {\n  VarSetter<bool> utf8utf8(&FLAGS_ced_allow_utf8utf8, true);\n\n  if (FLAGS_enc_detect_detail) {\n    const char* name = \"NoUTF8UTF8\";\n    fprintf(stderr, \"(Unit test %s) start-detail\\n\", PsStr(name).c_str());\n  }\n\n  int bytes_consumed = 0;\n  bool confidence = false;\n  Encoding encoding = CompactEncDet::DetectEncoding(\n      kTestStrNoUTF8UTF8, strlen(kTestStrNoUTF8UTF8),\n      NULL,              // No url hint.\n      NULL,              // No charset_hint,\n      NULL,              // No meta_charset hint.\n      UNKNOWN_ENCODING,  // No encoding hint (setting this to UTF8\n                         // decreased the detection accuracy although\n                         // the content of 'text' is always UTF8\n                         // encoded).\n      UNKNOWN_LANGUAGE,  // Just like encoding, this too lowers\n                                          // the accuracy.\n      CompactEncDet::QUERY_CORPUS, true, &bytes_consumed, &confidence);\n\n  if (FLAGS_enc_detect_detail) {\n    fprintf(stderr, \"() end-detail\\n\\n\");\n  }\n\n  EXPECT_EQ(UTF8, encoding);\n}\n\nconst char kTestShiftJISNoHint[] =\n  \"\\x82\\xa0\\x82\\xaf\\x82\\xdc\\x82\\xb5\\x82\\xc4\\x82\\xa8\\x82\\xdf\\x82\\xc5\"\n  \"\\x82\\xc6\\x82\\xa4\\x82\\xb2\\x82\\xb4\\x82\\xa2\\x82\\xdc\\x82\\xb7\\x82\\xb1\"\n  \"\\x82\\xc6\\x82\\xb5\\x82\\xe0\\x82\\xe6\\x82\\xeb\\x82\\xb5\\x82\\xad\\x82\\xa8\"\n  \"\\x82\\xcb\\x82\\xaa\\x82\\xa2\\x82\\xa2\\x82\\xbd\\x82\\xb5\\x82\\xa0\\x82\\xaf\"\n  \"\\x82\\xdc\\x82\\xb5\\x82\\xc4\\x82\\xa8\\x82\\xdf\\x82\\xc5\\x82\\xc6\\x82\\xa4\"\n  \"\\x82\\xb2\\x82\\xb4\\x82\\xa2\\x82\\xdc\\x82\\xb7\\x82\\xb1\\x82\\xc6\\x82\\xb5\"\n  \"\\x82\\xe0\\x82\\xe6\\x82\\xeb\\x82\\xb5\\x82\\xad\\x82\\xa8\\x82\\xcb\\x82\\xaa\"\n  \"\\x82\\xa2\\x82\\xa2\\x82\\xbd\\x82\\xb5\\x82\\xa0\\x82\\xaf\\x82\\xdc\\x82\\xb5\"\n  \"\\x82\\xc4\\x82\\xa8\\x82\\xdf\\x82\\xc5\\x82\\xc6\\x82\\xa4\\x82\\xb2\\x82\\xb4\"\n  \"\\x82\\xa2\\x82\\xdc\\x82\\xb7\\x82\\xb1\\x82\\xc6\\x82\\xb5\\x82\\xe0\\x82\\xe6\"\n  \"\\x82\\xeb\\x82\\xb5\\x82\\xad\\x82\\xa8\\x82\\xcb\\x82\\xaa\\x82\\xa2\\x82\\xa2\"\n  \"\\x82\\xbd\\x82\\xb5\\x82\\xa0\\x82\\xaf\\x82\\xdc\\x82\\xb5\\x82\\xc4\\x82\\xa8\"\n  \"\\x82\\xdf\\x82\\xc5\\x82\\xc6\\x82\\xa4\\x82\\xb2\\x82\\xb4\\x82\\xa2\\x82\\xdc\"\n  \"\\x82\\xb7\\x82\\xb1\\x82\\xc6\\x82\\xb5\\x82\\xe0\\x82\\xe6\\x82\\xeb\\x82\\xb5\"\n  \"\\x82\\xad\\x82\\xa8\\x82\\xcb\\x82\\xaa\\x82\\xa2\\x82\\xa2\\x82\\xbd\\x82\\xb5\"\n  \"\\x82\\xa0\\x82\\xaf\\x82\\xdc\\x82\\xb5\\x82\\xc4\\x82\\xa8\\x82\\xdf\\x82\\xc5\"\n  \"\\x82\\xc6\\x82\\xa4\\x82\\xb2\\x82\\xb4\\x82\\xa2\\x82\\xdc\\x82\\xb7\\x82\\xb1\"\n  \"\\x82\\xc6\\x82\\xb5\\x82\\xe0\\x82\\xe6\\x82\\xeb\\x82\\xb5\\x82\\xad\\x82\\xa8\"\n  \"\\x82\\xcb\\x82\\xaa\\x82\\xa2\\x82\\xa2\\x82\\xbd\\x82\\xb5\\x82\\xa0\\x82\\xaf\"\n  \"\\x82\\xdc\\x82\\xb5\\x82\\xc4\\x82\\xa8\\x82\\xdf\\x82\\xc5\\x82\\xc6\\x82\\xa4\"\n  \"\\x82\\xb2\\x82\\xb4\\x82\\xa2\\x82\\xdc\\x82\\xb7\\x82\\xb1\\x82\\xc6\\x82\\xb5\"\n  \"\\x82\\xe0\\x82\\xe6\\x82\\xeb\\x82\\xb5\\x82\\xad\\x82\\xa8\\x82\\xcb\\x82\\xaa\"\n  \"\\x82\\xa2\\x82\\xa2\\x82\\xbd\\x82\\xb5\\x82\\xa0\\x82\\xaf\\x82\\xdc\\x82\\xb5\"\n  \"\\x82\\xc4\\x82\\xa8\\x82\\xdf\\x82\\xc5\\x82\\xc6\\x82\\xa4\\x82\\xb2\\x82\\xb4\"\n  \"\\x82\\xa2\\x82\\xdc\\x82\\xb7\\x82\\xb1\\x82\\xc6\\x82\\xb5\\x82\\xe0\\x82\\xe6\"\n  \"\\x82\\xeb\\x82\\xb5\\x82\\xad\\x82\\xa8\\x82\\xcb\\x82\\xaa\\x82\\xa2\\x82\\xa2\"\n  \"\\x82\\xbd\\x82\\xb5\\x82\\xa0\\x82\\xaf\\x82\\xdc\\x82\\xb5\\x82\\xc4\\x82\\xa8\"\n  \"\\x82\\xdf\\x82\\xc5\\x82\\xc6\\x82\\xa4\\x82\\xb2\\x82\\xb4\\x82\\xa2\\x82\\xdc\"\n  \"\\x82\\xb7\\x82\\xb1\\x82\\xc6\\x82\\xb5\\x82\\xe0\\x82\\xe6\\x82\\xeb\\x82\\xb5\"\n  \"\\x82\\xad\\x82\\xa8\\x82\\xcb\\x82\\xaa\\x82\\xa2\\x82\\xa2\\x82\\xbd\\x82\\xb5\"\n  \"\\x82\\xa0\\x82\\xaf\\x82\\xdc\\x82\\xb5\\x82\\xc4\\x82\\xa8\\x82\\xdf\\x82\\xc5\"\n  \"\\x82\\xc6\\x82\\xa4\\x82\\xb2\\x82\\xb4\\x82\\xa2\\x82\\xdc\\x82\\xb7\\x82\\xb1\"\n  \"\\x82\\xc6\\x82\\xb5\\x82\\xe0\\x82\\xe6\\x82\\xeb\\x82\\xb5\\x82\\xad\\x82\\xa8\"\n  \"\\x82\\xcb\\x82\\xaa\\x82\\xa2\\x82\\xa2\\x82\\xbd\\x82\\xb5\\x82\\xa0\\x82\\xaf\"\n  \"\\x82\\xdc\\x82\\xb5\\x82\\xc4\\x82\\xa8\\x82\\xdf\\x82\\xc5\\x82\\xc6\\x82\\xa4\"\n  \"\\x82\\xb2\\x82\\xb4\\x82\\xa2\\x82\\xdc\\x82\\xb7\\x82\\xb1\\x82\\xc6\\x82\\xb5\"\n  \"\\x82\\xe0\\x82\\xe6\\x82\\xeb\\x82\\xb5\\x82\\xad\\x82\\xa8\\x82\\xcb\\x82\\xaa\"\n  \"\\x82\\xa2\\x82\\xa2\\x82\\xbd\\x82\\xb5\\x82\\xa0\\x82\\xaf\\x82\\xdc\\x82\\xb5\"\n  \"\\x82\\xc4\\x82\\xa8\\x82\\xdf\\x82\\xc5\\x82\\xc6\\x82\\xa0\\x82\\xaf\\x82\\xdc\"\n  \"\\x82\\xb5\\x82\\xc4\\x82\\xa8\\x82\\xdf\\x82\\xc5\\x82\\xc6\\x82\\xa4\\x82\\xb2\"\n  \"\\x82\\xb4\\x82\\xa2\\x82\\xdc\\x82\\xb7\\x82\\xb1\\x82\\xc6\\x82\\xb5\\x82\\xe0\"\n  \"\\x82\\xe6\\x82\\xeb\\x82\\xb5\\x82\\xad\\x82\\xa8\\x82\\xcb\\x82\\xaa\\x82\\xa2\"\n  \"\\x82\\xa2\\x82\\xbd\\x82\\xb5\\x82\\xa0\\x82\\xaf\\x82\\xdc\\x82\\xb5\\x82\\xc4\"\n  \"\\x82\\xa8\\x82\\xdf\\x82\\xc5\\x82\\xc6\\x82\\xa0\\x82\\xaf\\x82\\xdc\\x82\\xb5\"\n  \"\\x82\\xc4\\x82\\xa8\\x82\\xdf\\x82\\xc5\\x82\\xc6\\x82\\xa4\\x82\\xb2\\x82\\xb4\"\n  \"\\x82\\xa2\\x82\\xdc\\x82\\xb7\\x82\\xb1\\x82\\xc6\\x82\\xb5\\x82\\xe0\\x82\\xe6\"\n  \"\\x82\\xeb\\x82\\xb5\\x82\\xad\\x82\\xa8\\x82\\xcb\\x82\\xaa\\x82\\xa2\\x82\\xa2\"\n  \"\\x82\\xbd\\x82\\xb5\\x82\\xa0\\x82\\xaf\\x82\\xdc\\x82\\xb5\\x82\\xc4\\x82\\xa8\"\n  \"\\x82\\xdf\\x82\\xc5\\x82\\xc6\\x82\\xa0\\x82\\xaf\\x82\\xdc\\x82\\xb5\\x82\\xc4\"\n  \"\\x82\\xa8\\x82\\xdf\\x82\\xc5\\x82\\xc6\\x82\\xa4\\x82\\xb2\\x82\\xb4\\x82\\xa2\"\n  \"\\x82\\xdc\\x82\\xb7\\x82\\xb1\\x82\\xc6\\x82\\xa8\\x82\\xdf\\x82\\xc5\\x82\\xc6\"\n  \"\\x82\\xa4\\x82\\xb2\\x82\\xb4\\x82\\xa2\\x82\\xdc\\x82\\xb7\\x82\\xb1\\x82\\xc6\"\n  \"\\x0a\";\n\nTEST_F(CompactEncDetTest, ShiftJISNoHintTest) {\n  bool is_reliable;\n  EXPECT_EQ(JAPANESE_SHIFT_JIS,\n            TestCompactEncDetWithReliable(kTestShiftJISNoHint,\n                                          strlen(kTestShiftJISNoHint),\n                                          \"JAPANESE_SHIFT_JIS\",\n                                          &is_reliable));\n  EXPECT_EQ(is_reliable, true);\n}\n\n#if 0\nCP1252 => UTF8 => UTF8UTF8\n80 => E282AC => C3A2E2809AC2AC\n81 => C281 => C382C281\n82 => E2809A => C3A2E282ACC5A1\n83 => C692 => C386E28099\n84 => E2809E => C3A2E282ACC5BE\n85 => E280A6 => C3A2E282ACC2A6\n86 => E280A0 => C3A2E282ACC2A0\n87 => E280A1 => C3A2E282ACC2A1\n88 => CB86 => C38BE280A0\n89 => E280B0 => C3A2E282ACC2B0\n8A => C5A0 => C385C2A0\n8B => E280B9 => C3A2E282ACC2B9\n8C => C592 => C385E28099\n8D => C28D => C382C28D\n8E => C5BD => C385C2BD\n8F => C28F => C382C28F\n90 => C290 => C382C290\n91 => E28098 => C3A2E282ACCB9C\n92 => E28099 => C3A2E282ACE284A2\n93 => E2809C => C3A2E282ACC593\n94 => E2809D => C3A2E282ACC29D\n95 => E280A2 => C3A2E282ACC2A2\n96 => E28093 => C3A2E282ACE2809C\n97 => E28094 => C3A2E282ACE2809D\n98 => CB9C => C38BC593\n99 => E284A2 => C3A2E2809EC2A2\n9A => C5A1 => C385C2A1\n9B => E280BA => C3A2E282ACC2BA\n9C => C593 => C385E2809C\n9D => C29D => C382C29D\n9E => C5BE => C385C2BE\n9F => C5B8 => C385C2B8\nA0 => C2A0 => C382C2A0\nA1 => C2A1 => C382C2A1\nA2 => C2A2 => C382C2A2\nA3 => C2A3 => C382C2A3\nA4 => C2A4 => C382C2A4\nA5 => C2A5 => C382C2A5\nA6 => C2A6 => C382C2A6\nA7 => C2A7 => C382C2A7\nA8 => C2A8 => C382C2A8\nA9 => C2A9 => C382C2A9\nAA => C2AA => C382C2AA\nAB => C2AB => C382C2AB\nAC => C2AC => C382C2AC\nAD => C2AD => C382C2AD\nAE => C2AE => C382C2AE\nAF => C2AF => C382C2AF\nB0 => C2B0 => C382C2B0\nB1 => C2B1 => C382C2B1\nB2 => C2B2 => C382C2B2\nB3 => C2B3 => C382C2B3\nB4 => C2B4 => C382C2B4\nB5 => C2B5 => C382C2B5\nB6 => C2B6 => C382C2B6\nB7 => C2B7 => C382C2B7\nB8 => C2B8 => C382C2B8\nB9 => C2B9 => C382C2B9\nBA => C2BA => C382C2BA\nBB => C2BB => C382C2BB\nBC => C2BC => C382C2BC\nBD => C2BD => C382C2BD\nBE => C2BE => C382C2BE\nBF => C2BF => C382C2BF\nC0 => C380 => C383E282AC\nC1 => C381 => C383C281\nC2 => C382 => C383E2809A\nC3 => C383 => C383C692\nC4 => C384 => C383E2809E\nC5 => C385 => C383E280A6\nC6 => C386 => C383E280A0\nC7 => C387 => C383E280A1\nC8 => C388 => C383CB86\nC9 => C389 => C383E280B0\nCA => C38A => C383C5A0\nCB => C38B => C383E280B9\nCC => C38C => C383C592\nCD => C38D => C383C28D\nCE => C38E => C383C5BD\nCF => C38F => C383C28F\nD0 => C390 => C383C290\nD1 => C391 => C383E28098\nD2 => C392 => C383E28099\nD3 => C393 => C383E2809C\nD4 => C394 => C383E2809D\nD5 => C395 => C383E280A2\nD6 => C396 => C383E28093\nD7 => C397 => C383E28094\nD8 => C398 => C383CB9C\nD9 => C399 => C383E284A2\nDA => C39A => C383C5A1\nDB => C39B => C383E280BA\nDC => C39C => C383C593\nDD => C39D => C383C29D\nDE => C39E => C383C5BE\nDF => C39F => C383C5B8\nE0 => C3A0 => C383C2A0\nE1 => C3A1 => C383C2A1\nE2 => C3A2 => C383C2A2\nE3 => C3A3 => C383C2A3\nE4 => C3A4 => C383C2A4\nE5 => C3A5 => C383C2A5\nE6 => C3A6 => C383C2A6\nE7 => C3A7 => C383C2A7\nE8 => C3A8 => C383C2A8\nE9 => C3A9 => C383C2A9\nEA => C3AA => C383C2AA\nEB => C3AB => C383C2AB\nEC => C3AC => C383C2AC\nED => C3AD => C383C2AD\nEE => C3AE => C383C2AE\nEF => C3AF => C383C2AF\nF0 => C3B0 => C383C2B0\nF1 => C3B1 => C383C2B1\nF2 => C3B2 => C383C2B2\nF3 => C3B3 => C383C2B3\nF4 => C3B4 => C383C2B4\nF5 => C3B5 => C383C2B5\nF6 => C3B6 => C383C2B6\nF7 => C3B7 => C383C2B7\nF8 => C3B8 => C383C2B8\nF9 => C3B9 => C383C2B9\nFA => C3BA => C383C2BA\nFB => C3BB => C383C2BB\nFC => C3BC => C383C2BC\nFD => C3BD => C383C2BD\nFE => C3BE => C383C2BE\nFF => C3BF => C383C2BF\n#endif\n}  // namespace\n"
  },
  {
    "path": "third_party/ced/compact_enc_det/detail_head_string.inc",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n// Produced by stringify.cc on 2007-09-28 09:13 from file i18n/encodings/compact_enc_det/tools/detail_head.ps\n  \"%!PS-Adobe-2.0\\n\\n/inch {72 mul} def\\n/cshow {dup stringwidth pop -2 div\"\n  \" 0 rmoveto show} def\\n\\n/lmargin 0.5 inch def\\n/rmargin 8.5 inch def\\n/t\"\n  \"margin 10.5 inch def\\n/bmargin 0.5 inch def\\n\\n\\n% set to N>=0 to track \"\n  \"ranked encoding N\\n/track-me -1 def\\n/track-me2 -1 def\\n\\n/columns 2 def\"\n  \"\\n\\n/lpi 18 def                 % lines per inch\\n/lpc lpi 10 mul def   \"\n  \"      % lines per column\\n/lpp lpc columns mul def    % lines per page\\n\"\n  \"/probw 3.0 inch def         % probability width\\n/probr 50 def          \"\n  \"     % probability range\\n/widowlines lpi 2 idiv def  % 1/2 inch widow a\"\n  \"t bottom\\n/widowlines lpi def         % 1 inch widow at bottom\\n\\n/lpg l\"\n  \"pi 2 idiv def         % 1/2 inch spacing between groups\\n\\n/delc 4 inch \"\n  \"def\\n/dell -1 inch lpi div def\\n\\n/next-line 0 def      % 24 lines per i\"\n  \"nch, 240 per column\\n\\n/Cfont /Courier findfont 6 scalefont def\\n/Hfont \"\n  \"/Helvetica findfont 6 scalefont def\\nHfont setfont\\n\\n\\n% simple string \"\n  \"hash -- sum the characters\\n/strhash {\\n  /hstr exch def\\n  /h 0 def\\n  \"\n  \"0 1 hstr length 1 sub {/i exch def  /h h hstr i get add def} for\\n  h\\n}\"\n  \" def\\n\\n% convert pro at 30 per 2x to 0-2.5 inches spanning -50 to 0\\n/p\"\n  \"rob2x {\\n  30 idiv probr div probw mul neg probw add\\n}def\\n\\n\\n/cliptoc\"\n  \"olumn {\\n  % ====== MUST MATCH ME ======\\n  gsave\\n  lmargin tmargin mov\"\n  \"eto\\n  next-line lpc idiv delc mul 0 rmoveto\\n  -1 18 rmoveto 0 -10.5 in\"\n  \"ch rlineto  delc 2 add 0 rlineto  0 10.5 inch rlineto closepath\\n  clip\\n\"\n  \"  newpath\\n} def\\n\\n/endcliptocolumn {\\n  grestore\\n  % ====== MUST MATC\"\n  \"H ME ======\\n} def\\n\\n\\n\\n/column-box {\\n  lmargin tmargin moveto\\n  nex\"\n  \"t-line 1 sub lpc idiv delc mul  next-line 1 sub lpc mod 1 add dell mul r\"\n  \"moveto\\n  % box\\n  gsave -1.5 0 rmoveto 0 detail-count dell mul neg rmov\"\n  \"eto  probw 3 add 0 rlineto 0.25 setlinewidth stroke grestore\\n  gsave -1\"\n  \".5 0 rmoveto 0 detail-count dell mul neg rlineto 0.25 setlinewidth strok\"\n  \"e grestore\\n  gsave probw .8 mul 0 rmoveto 0 detail-count dell mul neg r\"\n  \"lineto 0.25 setlinewidth 0.8 setgray stroke grestore\\n  gsave probw .6 m\"\n  \"ul 0 rmoveto 0 detail-count dell mul neg rlineto 0.25 setlinewidth 0.8 s\"\n  \"etgray stroke grestore\\n  gsave probw .4 mul 0 rmoveto 0 detail-count de\"\n  \"ll mul neg rlineto 0.25 setlinewidth 0.8 setgray stroke grestore\\n  gsav\"\n  \"e probw .2 mul 0 rmoveto 0 detail-count dell mul neg rlineto 0.25 setlin\"\n  \"ewidth 0.8 setgray stroke grestore\\n  gsave probw 1.5 add 0 rmoveto 0 de\"\n  \"tail-count dell mul neg rlineto 0.25 setlinewidth stroke grestore\\n} def\"\n  \"\\n\\n\\n/IncrementLine {\\n  /incr exch def\\n  /next-line next-line incr ad\"\n  \"d def\\n  next-line lpc ge   next-line incr sub lpc lt   and {\\n    % We \"\n  \"just went to the top of column 2; redo clip\\n    endcliptocolumn     % M\"\n  \"UST match\\n    column-box\\n    /next-line lpc def\\n    cliptocolumn     \"\n  \"   % MUST match\\n  } if\\n  next-line lpp ge {\\n    % We just went to the\"\n  \" top of column 3; start new page column 1\\n    endcliptocolumn     % MUS\"\n  \"T match\\n    column-box\\n    showpage\\n    Hfont setfont\\n    /next-line\"\n  \" 0 def\\n    show-pageno\\n    cliptocolumn        % MUST match\\n  } if\\n}\"\n  \" def\\n\\n/IncrementLineOutside {\\n  /incr exch def\\n  /next-line next-lin\"\n  \"e incr add def\\n  next-line lpc ge   next-line incr sub lpc lt   and {\\n\"\n  \"    % We just went to the top of column 2\\n    /next-line lpc def\\n  } i\"\n  \"f\\n  next-line lpp ge {\\n    % We just went to the top of column 3; star\"\n  \"t new page column 1\\n    showpage\\n    Hfont setfont\\n    /next-line 0 d\"\n  \"ef\\n    show-pageno\\n  } if\\n} def\\n\\n/NextColumn {\\n  lpc 1 sub Increme\"\n  \"ntLine\\n} def\\n\\n/NextPage {\\n    lpp 1 sub IncrementLine\\n} def\\n\\n% Up\"\n  \"on entry, we are OUTSIDE the clip\\n/start-detail {\\n  /d-title exch def\\n\"\n  \"\\n  % align >= 1 inch at bottom of column, and/or start new column\\n  lp\"\n  \"c next-line lpc mod sub widowlines lt {\\n    % Start at top of a column\\n\"\n  \"    next-line lpc ge {\\n      % Start new page\\n      showpage\\n      Hf\"\n  \"ont setfont\\n      /next-line 0 def\\n      show-pageno\\n    } {\\n      %\"\n  \" Start new column\\n      /next-line lpc def\\n    } ifelse\\n  } if\\n\\n  l\"\n  \"margin tmargin moveto\\n  next-line lpc idiv delc mul  next-line lpc mod \"\n  \"dell mul rmoveto\\n  gsave d-title show grestore\\n  0 dell rmoveto\\n  1 1\"\n  \" 4 {/j exch def gsave probw j mul 5 div -2 rmoveto 50 j 10 mul sub 20 st\"\n  \"ring cvs cshow grestore} for\\n  2 IncrementLineOutside\\n  /detail-count \"\n  \"1 def\\n  cliptocolumn            % MUST match\\n  /d-array [] def\\n} def\\n\"\n  \"\\n/size-detail {\\n  /d-names exch def\\n  /d-size exch def\\n  % zero sums\"\n  \"\\n  /sums d-size array def\\n  0 1 d-size 1 sub {/i exch def  sums i 0 pu\"\n  \"t} for\\n  /old-d-max 0 def\\n  /colors d-size array def\\n  0 1 d-size 1 s\"\n  \"ub {/i exch def  colors i i 3 mul 17 mod 17 div put} for\\n  %0 1 d-size \"\n  \"1 sub {/i exch def  colors i d-names i get strhash 3 mul 17 mod 17 div p\"\n  \"ut} for\\n  %0 1 d-size 1 sub {/i exch def  ( ) show colors i get 20 stri\"\n  \"ng cvs show} for\\n} def\\n\\n/count-detail {\\n  /detail-total-count exch d\"\n  \"ef\\n  % if total-count >= one column, start at top of a column\\n  detail\"\n  \"-total-count lpp ge {\\n    % Start new page\\n    NextPage\\n  } {\\n    de\"\n  \"tail-total-count lpc ge {\\n      % Start new column\\n      NextColumn\\n \"\n  \"   } if\\n  } ifelse\\n} def\\n\\n% highlight next entry with underbar\\n/do-\"\n  \"flag {\\ngsave\\n  setrgbcolor\\n  lmargin tmargin moveto\\n  next-line lpc \"\n  \"idiv delc mul  next-line lpc mod dell mul rmoveto\\n  0 -2 rmoveto\\n  pro\"\n  \"bw 0 rlineto\\n  0 dell neg rlineto\\n  probw neg 0 rlineto\\n  closepath\\n\"\n  \"  fill\\ngrestore\\n} def\\n\\n/do-detail-e {\\n  /d-array exch def\\n  /d-enc\"\n  \" exch def\\n  /d-label exch def\\n  /d-max -999999 def\\n\\n  lmargin tmargi\"\n  \"n moveto\\n  next-line lpc idiv delc mul  next-line lpc mod dell mul rmov\"\n  \"eto\\n  0.25 setlinewidth\\n\\n  % show label, using encoding color\\n  gsav\"\n  \"e\\n    probw 2 add -2 rmoveto\\n    detail-count 1 sub 2 mod 0.25 inch mu\"\n  \"l 0 rmoveto\\n    % ([) show detail-count 20 string cvs show (] ) show\\n \"\n  \"   d-enc 0 lt {\\n      0 setgray\\n    }{\\n      colors d-enc get 1 .8 se\"\n  \"thsbcolor\\n    } ifelse\\n    d-label show\\n  grestore\\n  % For -prune- d\"\n  \"raw horizontal line\\n  d-label length 8 gt {d-label 4 get (p) 0 get eq d\"\n  \"-label 5 get (r) 0 get eq and {\\n    /prune-val d-label cvi def\\n    /ne\"\n  \"wx prune-val 30 mul prob2x def\\n    gsave newx 6 rmoveto 0 -12 rlineto 1\"\n  \".5 setlinewidth 0.8 setgray stroke grestore\\n    gsave probw 0 add 0 rli\"\n  \"neto 0.25 setlinewidth 0.8 setgray stroke grestore\\n  } if } if\\n\\n  % t\"\n  \"rack max per new row\\n  0 1 d-array length 1 sub {\\n    /i exch def\\n   \"\n  \" /sum sums i get d-array i get add def\\n    d-max sum lt {/d-max sum def\"\n  \"} if\\n  } for\\n\\n  % draw line increments\\n  0 1 d-array length 1 sub {\\n\"\n  \"    /i exch def\\n    detail-count 1 gt {\\n      /oldx old-d-max sums i g\"\n  \"et sub prob2x def\\n    } {\\n      /oldx 600 prob2x def\\n    } ifelse\\n  \"\n  \"  /oldy dell neg def\\n    /newx d-max  sums i get d-array i get add  sub\"\n  \" prob2x def\\n    /newy 0 def\\n    gsave\\n    oldx oldy rmoveto\\n    newx\"\n  \" oldx sub  newy oldy sub rlineto\\n    % if encoding is being tracked, ma\"\n  \"ke bold line\\n    i track-me eq\\n      {2 setlinewidth}\\n      {i track-\"\n  \"me2 eq {1.25 setlinewidth} {0.25 setlinewidth} ifelse}\\n      ifelse\\n  \"\n  \"  colors i get 1 .8 sethsbcolor stroke\\n    grestore\\n  } for\\n  /detail\"\n  \"-count detail-count 1 add def\\n\\n  % increment running total in sums, tr\"\n  \"ack max per row\\n  0 1 d-array length 1 sub {\\n    /i exch def\\n    sums\"\n  \" i  sums i get d-array i get add  put\\n  } for\\n  /old-d-max d-max def\\n\"\n  \"\\n  1 IncrementLine\\n} def\\n\\n\\n/do-detail {\\n  /d-array exch def\\n  /d-\"\n  \"label exch def\\n  d-label -1 d-array do-detail-e\\n} def\\n\\n% Upon exit, \"\n  \"we are outside the clip\\n/end-detail {\\n  pop\\n  endcliptocolumn        \"\n  \" % MUST match\\n  column-box\\n\\n  % text labels\\n  0 1 d-array length 1 s\"\n  \"ub {\\n    /i exch def\\n    gsave\\n    /newx old-d-max sums i get sub pro\"\n  \"b2x def\\n    newx 0 ge {\\n      newx 0 rmoveto\\n      currentpoint trans\"\n  \"late\\n      colors i get 1 .8 sethsbcolor\\n      gsave 0 dell neg  rline\"\n  \"to 0.25 setlinewidth stroke grestore\\n      -60 rotate\\n      0 -2 movet\"\n  \"o d-names i get show\\n    } if\\n    grestore\\n  } for\\n  d-array length \"\n  \"0 gt {\\n    lpg IncrementLineOutside\\n  } {\\n    lpg 4 idiv IncrementLin\"\n  \"eOutside\\n  } ifelse\\n} def\\n\\n/do-src {\\n/src exch def\\n  lmargin tmarg\"\n  \"in moveto\\n  next-line lpc idiv delc mul  next-line lpc mod dell mul rmo\"\n  \"veto\\n  Cfont setfont\\n  src show\\n  Hfont setfont\\n  1 IncrementLine\\n}\"\n  \" def\\n\\n% Underline trigram in source text\\n/do-highlight1 {\\n  /hl-colo\"\n  \"r exch def\\n  /hl-offset exch def\\n  /hl-line exch 1 sub 2 mul def\\n  gs\"\n  \"ave\\n  lmargin tmargin moveto\\n  next-line hl-line sub lpc idiv delc mul\"\n  \"\\n  next-line hl-line sub lpc mod dell mul rmoveto\\n  % Assume text is 6\"\n  \" chars in and 3.6 pts per char, but 2 chars per offset\\n  hl-offset 2 mu\"\n  \"l 6 add 3.6 mul  4 rmoveto\\n\\n  0 setgray 0.5 setlinewidth\\n  hl-color 1\"\n  \" eq {0 0 1 setrgbcolor} if  % Latin1 blue\\n  hl-color 2 eq {1 0 1 setrgb\"\n  \"color} if  % Latin2 magenta\\n  hl-color 3 eq {1 0.67 0 setrgbcolor} if  \"\n  \"% Latin7 orange\\n  18 -2 rlineto stroke\\n  grestore\\n} def\\n\\n% Box trig\"\n  \"ram in source text\\n/do-highlight2 {\\n  /hl-color exch def\\n  /hl-offset\"\n  \" exch def\\n  /hl-line exch 1 sub 2 mul def\\n  gsave\\n  lmargin tmargin m\"\n  \"oveto\\n  next-line hl-line sub lpc idiv delc mul\\n  next-line hl-line su\"\n  \"b lpc mod dell mul rmoveto\\n  % Assume text is 6 chars in and 3.6 pts pe\"\n  \"r char, but 2 chars per offset\\n  hl-offset 2 mul 6 add 3.6 mul  4 rmove\"\n  \"to\\n\\n  0 setgray 0.25 setlinewidth\\n  hl-color 1 eq {0 0 1 setrgbcolor}\"\n  \" if  % Latin1 blue\\n  hl-color 2 eq {1 0 1 setrgbcolor} if  % Latin2 mag\"\n  \"enta\\n  hl-color 3 eq {1 0.67 0 setrgbcolor} if  % Latin7 orange\\n  -0.5\"\n  \" -0.5 rmoveto\\n  22 0 rlineto\\n  0 4 rlineto\\n  -11 2 rlineto\\n  -11 -2 \"\n  \"rlineto\\n  closepath\\n  stroke\\n  grestore\\n} def\\n\\n/show-pageno {\\ngsa\"\n  \"ve\\nlmargin bmargin moveto 0 -12 rmoveto\\n(Page ) show pageno 20 string \"\n  \"cvs show\\ngrestore\\n/pageno pageno 1 add def\\n} def\\n\\n/pageno 1 def\\nsh\"\n  \"ow-pageno\\n%=============================\\n\\n\\n\"\n"
  },
  {
    "path": "third_party/ced/util/basictypes.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef UTIL_BASICTYPES_H_\n#define UTIL_BASICTYPES_H_\n\n#include <limits.h>         // So we can set the bounds of our types\n#include <stddef.h>         // For size_t\n#include <string.h>         // for memcpy\n\n#include \"util/port.h\"    // Types that only need exist on certain systems\n\n#ifndef COMPILER_MSVC\n// stdint.h is part of C99 but MSVC doesn't have it.\n#include <stdint.h>         // For intptr_t.\n#endif\n\ntypedef signed char         schar;\ntypedef signed char         int8;\ntypedef short               int16;\n// TODO(mbelshe) Remove these type guards.  These are\n//               temporary to avoid conflicts with npapi.h.\n#ifndef _INT32\n#define _INT32\ntypedef int                 int32;\n#endif\n\n// The NSPR system headers define 64-bit as |long| when possible.  In order to\n// not have typedef mismatches, we do the same on LP64.\n#if __LP64__\ntypedef long                int64;\n#else\ntypedef long long           int64;\n#endif\n\n// NOTE: unsigned types are DANGEROUS in loops and other arithmetical\n// places.  Use the signed types unless your variable represents a bit\n// pattern (eg a hash value) or you really need the extra bit.  Do NOT\n// use 'unsigned' to express \"this value should always be positive\";\n// use assertions for this.\n\ntypedef unsigned char      uint8;\ntypedef unsigned short     uint16;\n// TODO(mbelshe) Remove these type guards.  These are\n//               temporary to avoid conflicts with npapi.h.\n#ifndef _UINT32\n#define _UINT32\ntypedef unsigned int       uint32;\n#endif\n\n// See the comment above about NSPR and 64-bit.\n#if __LP64__\ntypedef unsigned long uint64;\n#else\ntypedef unsigned long long uint64;\n#endif\n\n// A type to represent a Unicode code-point value. As of Unicode 4.0,\n// such values require up to 21 bits.\n// (For type-checking on pointers, make this explicitly signed,\n// and it should always be the signed version of whatever int32 is.)\ntypedef signed int         char32;\n\nconst uint8  kuint8max  = (( uint8) 0xFF);\nconst uint16 kuint16max = ((uint16) 0xFFFF);\nconst uint32 kuint32max = ((uint32) 0xFFFFFFFF);\nconst uint64 kuint64max = ((uint64) GG_LONGLONG(0xFFFFFFFFFFFFFFFF));\nconst  int8  kint8min   = ((  int8) 0x80);\nconst  int8  kint8max   = ((  int8) 0x7F);\nconst  int16 kint16min  = (( int16) 0x8000);\nconst  int16 kint16max  = (( int16) 0x7FFF);\nconst  int32 kint32min  = (( int32) 0x80000000);\nconst  int32 kint32max  = (( int32) 0x7FFFFFFF);\nconst  int64 kint64min  = (( int64) GG_LONGLONG(0x8000000000000000));\nconst  int64 kint64max  = (( int64) GG_LONGLONG(0x7FFFFFFFFFFFFFFF));\n\n// A macro to disallow the copy constructor and operator= functions\n// This should be used in the private: declarations for a class\n#define DISALLOW_COPY_AND_ASSIGN(TypeName) \\\n  TypeName(const TypeName&);               \\\n  void operator=(const TypeName&)\n\n// An older, deprecated, politically incorrect name for the above.\n#define DISALLOW_EVIL_CONSTRUCTORS(TypeName) DISALLOW_COPY_AND_ASSIGN(TypeName)\n\n// A macro to disallow all the implicit constructors, namely the\n// default constructor, copy constructor and operator= functions.\n//\n// This should be used in the private: declarations for a class\n// that wants to prevent anyone from instantiating it. This is\n// especially useful for classes containing only static methods.\n#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \\\n  TypeName();                                    \\\n  DISALLOW_COPY_AND_ASSIGN(TypeName)\n\n// The arraysize(arr) macro returns the # of elements in an array arr.\n// The expression is a compile-time constant, and therefore can be\n// used in defining new arrays, for example.  If you use arraysize on\n// a pointer by mistake, you will get a compile-time error.\n\n// This template function declaration is used in defining arraysize.\n// Note that the function doesn't need an implementation, as we only\n// use its type.\ntemplate <typename T, size_t N>\nchar (&ArraySizeHelper(T (&array)[N]))[N];\n\n// That gcc wants both of these prototypes seems mysterious. VC, for\n// its part, can't decide which to use (another mystery). Matching of\n// template overloads: the final frontier.\n#ifndef _MSC_VER\ntemplate <typename T, size_t N>\nchar (&ArraySizeHelper(const T (&array)[N]))[N];\n#endif\n\n#define arraysize(array) (sizeof(ArraySizeHelper(array)))\n\n\n// Use implicit_cast as a safe version of static_cast or const_cast\n// for upcasting in the type hierarchy (i.e. casting a pointer to Foo\n// to a pointer to SuperclassOfFoo or casting a pointer to Foo to\n// a const pointer to Foo).\n// When you use implicit_cast, the compiler checks that the cast is safe.\n// Such explicit implicit_casts are necessary in surprisingly many\n// situations where C++ demands an exact type match instead of an\n// argument type convertable to a target type.\n//\n// The From type can be inferred, so the preferred syntax for using\n// implicit_cast is the same as for static_cast etc.:\n//\n//   implicit_cast<ToType>(expr)\n//\n// implicit_cast would have been part of the C++ standard library,\n// but the proposal was submitted too late.  It will probably make\n// its way into the language in the future.\ntemplate<typename To, typename From>\ninline To implicit_cast(From const &f) {\n  return f;\n}\n\n// The COMPILE_ASSERT macro can be used to verify that a compile time\n// expression is true. For example, you could use it to verify the\n// size of a static array:\n//\n//   COMPILE_ASSERT(arraysize(content_type_names) == CONTENT_NUM_TYPES,\n//                  content_type_names_incorrect_size);\n//\n// or to make sure a struct is smaller than a certain size:\n//\n//   COMPILE_ASSERT(sizeof(foo) < 128, foo_too_large);\n//\n// The second argument to the macro is the name of the variable. If\n// the expression is false, most compilers will issue a warning/error\n// containing the name of the variable.\n\ntemplate <bool>\nstruct CompileAssert {\n};\n\n#undef COMPILE_ASSERT\n#define COMPILE_ASSERT(expr, msg) \\\n  typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]\n\n// Implementation details of COMPILE_ASSERT:\n//\n// - COMPILE_ASSERT works by defining an array type that has -1\n//   elements (and thus is invalid) when the expression is false.\n//\n// - The simpler definition\n//\n//     #define COMPILE_ASSERT(expr, msg) typedef char msg[(expr) ? 1 : -1]\n//\n//   does not work, as gcc supports variable-length arrays whose sizes\n//   are determined at run-time (this is gcc's extension and not part\n//   of the C++ standard).  As a result, gcc fails to reject the\n//   following code with the simple definition:\n//\n//     int foo;\n//     COMPILE_ASSERT(foo, msg); // not supposed to compile as foo is\n//                               // not a compile-time constant.\n//\n// - By using the type CompileAssert<(bool(expr))>, we ensures that\n//   expr is a compile-time constant.  (Template arguments must be\n//   determined at compile-time.)\n//\n// - The outter parentheses in CompileAssert<(bool(expr))> are necessary\n//   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written\n//\n//     CompileAssert<bool(expr)>\n//\n//   instead, these compilers will refuse to compile\n//\n//     COMPILE_ASSERT(5 > 0, some_message);\n//\n//   (They seem to think the \">\" in \"5 > 0\" marks the end of the\n//   template argument list.)\n//\n// - The array size is (bool(expr) ? 1 : -1), instead of simply\n//\n//     ((expr) ? 1 : -1).\n//\n//   This is to avoid running into a bug in MS VC 7.1, which\n//   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.\n\n\n// MetatagId refers to metatag-id that we assign to\n// each metatag <name, value> pair..\ntypedef uint32 MetatagId;\n\n// Argument type used in interfaces that can optionally take ownership\n// of a passed in argument.  If TAKE_OWNERSHIP is passed, the called\n// object takes ownership of the argument.  Otherwise it does not.\nenum Ownership {\n  DO_NOT_TAKE_OWNERSHIP,\n  TAKE_OWNERSHIP\n};\n\n// bit_cast<Dest,Source> is a template function that implements the\n// equivalent of \"*reinterpret_cast<Dest*>(&source)\".  We need this in\n// very low-level functions like the protobuf library and fast math\n// support.\n//\n//   float f = 3.14159265358979;\n//   int i = bit_cast<int32>(f);\n//   // i = 0x40490fdb\n//\n// The classical address-casting method is:\n//\n//   // WRONG\n//   float f = 3.14159265358979;            // WRONG\n//   int i = * reinterpret_cast<int*>(&f);  // WRONG\n//\n// The address-casting method actually produces undefined behavior\n// according to ISO C++ specification section 3.10 -15 -.  Roughly, this\n// section says: if an object in memory has one type, and a program\n// accesses it with a different type, then the result is undefined\n// behavior for most values of \"different type\".\n//\n// This is true for any cast syntax, either *(int*)&f or\n// *reinterpret_cast<int*>(&f).  And it is particularly true for\n// conversions betweeen integral lvalues and floating-point lvalues.\n//\n// The purpose of 3.10 -15- is to allow optimizing compilers to assume\n// that expressions with different types refer to different memory.  gcc\n// 4.0.1 has an optimizer that takes advantage of this.  So a\n// non-conforming program quietly produces wildly incorrect output.\n//\n// The problem is not the use of reinterpret_cast.  The problem is type\n// punning: holding an object in memory of one type and reading its bits\n// back using a different type.\n//\n// The C++ standard is more subtle and complex than this, but that\n// is the basic idea.\n//\n// Anyways ...\n//\n// bit_cast<> calls memcpy() which is blessed by the standard,\n// especially by the example in section 3.9 .  Also, of course,\n// bit_cast<> wraps up the nasty logic in one place.\n//\n// Fortunately memcpy() is very fast.  In optimized mode, with a\n// constant size, gcc 2.95.3, gcc 4.0.1, and msvc 7.1 produce inline\n// code with the minimal amount of data movement.  On a 32-bit system,\n// memcpy(d,s,4) compiles to one load and one store, and memcpy(d,s,8)\n// compiles to two loads and two stores.\n//\n// I tested this code with gcc 2.95.3, gcc 4.0.1, icc 8.1, and msvc 7.1.\n//\n// WARNING: if Dest or Source is a non-POD type, the result of the memcpy\n// is likely to surprise you.\n\ntemplate <class Dest, class Source>\ninline Dest bit_cast(const Source& source) {\n  // Compile time assertion: sizeof(Dest) == sizeof(Source)\n  // A compile error here means your Dest and Source have different sizes.\n  // typedef char VerifySizesAreEqual [sizeof(Dest) == sizeof(Source) ? 1 : -1];\n\n  Dest dest;\n  memcpy(&dest, &source, sizeof(dest));\n  return dest;\n}\n\n// The following enum should be used only as a constructor argument to indicate\n// that the variable has static storage class, and that the constructor should\n// do nothing to its state.  It indicates to the reader that it is legal to\n// declare a static instance of the class, provided the constructor is given\n// the base::LINKER_INITIALIZED argument.  Normally, it is unsafe to declare a\n// static variable that has a constructor or a destructor because invocation\n// order is undefined.  However, IF the type can be initialized by filling with\n// zeroes (which the loader does for static variables), AND the destructor also\n// does nothing to the storage, AND there are no virtual methods, then a\n// constructor declared as\n//       explicit MyClass(base::LinkerInitialized x) {}\n// and invoked as\n//       static MyClass my_variable_name(base::LINKER_INITIALIZED);\nnamespace base {\nenum LinkerInitialized { LINKER_INITIALIZED };\n}  // base\n\n// UnaligndLoad32 is put here instead of util/port.h to\n// avoid the circular dependency between port.h and basictypes.h\n// ARM does not support unaligned memory access.\n#if defined(ARCH_CPU_X86_FAMILY)\n// x86 and x86-64 can perform unaligned loads/stores directly;\ninline uint32 UnalignedLoad32(const void* p) {\n  return *reinterpret_cast<const uint32*>(p);\n}\n#else\n#define NEED_ALIGNED_LOADS\n// If target architecture does not support unaligned loads and stores,\n// use memcpy version of UNALIGNED_LOAD32.\ninline uint32 UnalignedLoad32(const void* p) {\n  uint32 t;\n  memcpy(&t, reinterpret_cast<const uint8*>(p), sizeof(t));\n  return t;\n}\n\n#endif\n#endif  // UTIL_BASICTYPES_H_\n"
  },
  {
    "path": "third_party/ced/util/case_insensitive_hash.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef UTIL_CASE_INSENSITIVE_HASH_H_\n#define UTIL_CASE_INSENSITIVE_HASH_H_\n\n#include <ctype.h>\n#include <stddef.h>\n#ifndef _MSC_VER\n#include <strings.h>\n#endif\n\n#include <string>\n\n#include \"util/basictypes.h\"\n#include \"util/string_util.h\"\n\n// Functors for hashing c-strings with case-insensitive semantics.\nstruct CStringCaseHash {\n  size_t operator()(const char *str) const {\n    unsigned long hash_val = 0;\n    while (*str) {\n      hash_val = 5*hash_val + tolower(*str);\n      str++;\n    }\n    return (size_t)hash_val;\n  }\n};\n\nstruct CStringCaseEqual {\n  bool operator()(const char *str1, const char *str2) const {\n    return !base::strcasecmp(str1, str2);\n  }\n};\n\n// These functors, in addition to being case-insensitive, ignore all\n// non-alphanumeric characters.  This is useful when we want all variants of\n// a string -- where variants can differ in puncutation and whitespace -- to\n// map to the same value.\nstruct CStringAlnumCaseHash {\n  size_t operator()(const char *str) const {\n    unsigned long hash_val = 0;\n    while (*str) {\n      if (isalnum(*str)) {\n        hash_val = 5*hash_val + tolower(*str);\n      }\n      str++;\n    }\n    return (size_t)hash_val;\n  }\n};\n\nstruct CStringAlnumCaseEqual {\n  bool operator()(const char *str1, const char *str2) const {\n    while (true) {\n      // Skip until each pointer is pointing to an alphanumeric char or '\\0'\n      while (!isalnum(*str1) && (*str1 != '\\0')) {\n        str1++;\n      }\n      while (!isalnum(*str2) && (*str2 != '\\0')) {\n        str2++;\n      }\n      if (tolower(*str1) != tolower(*str2)) {\n        return false;       // mismatch on alphanumeric char or '\\0'\n      }\n      if (*str1 == '\\0') {  // in which case *str2 must be '\\0' as well\n        return true;        // reached '\\0' in both strings without mismatch\n      }\n      str1++;\n      str2++;\n    }\n  }\n};\n\n#endif  // UTIL_CASE_INSENSITIVE_HASH_H_\n"
  },
  {
    "path": "third_party/ced/util/commandlineflags.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef UTIL_COMMANDLINEFLAGS_H_\n#define UTIL_COMMANDLINEFLAGS_H_\n\n\n#undef DEFINE_bool\n#define DEFINE_bool(name, default_value, comment) \\\n    bool FLAGS_##name = default_value\n#undef DEFINE_int32\n#define DEFINE_int32(name, default_value, comment) \\\n    int32 FLAGS_##name = default_value\n#undef DEFINE_string\n#define DEFINE_string(name, default_value, comment) \\\n    string FLAGS_##name = default_value\n\n#undef DECLARE_bool\n#define DECLARE_bool(name) extern bool FLAGS_##name\n#undef DECLARE_int32\n#define DECLARE_int32(name) extern int32 FLAGS_##name\n#undef DECLARE_string\n#define DECLARE_string(name) extern string FLAGS_##name\n\n\n#endif  // UTIL_COMMANDLINEFLAGS_H_\n"
  },
  {
    "path": "third_party/ced/util/encodings/encodings.cc",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include \"util/encodings/encodings.h\"\n\n#include <string.h>                     // for strcasecmp\n#include <unordered_map>\n#include <utility>                      // for pair\n\n#include \"util/basictypes.h\"\n#include \"util/string_util.h\"\n#include \"util/case_insensitive_hash.h\"\n\nstruct EncodingInfo {\n  // The standard name for this encoding.\n  //\n  const char* encoding_name_;\n\n  // The \"preferred MIME name\" of an encoding as specified by the IANA at:\n  //     http://www.iana.org/assignments/character-sets\n  //\n  //   Note that the preferred MIME name may differ slightly from the\n  //   official IANA name: i.e. ISO-8859-1 vs. ISO_8859-1:1987\n  //\n  const char* mime_encoding_name_;\n\n  // It is an internal policy that if an encoding has an IANA name,\n  // then encoding_name_ and mime_encoding_name_ must be the same string.\n  //\n  // However, there can be exceptions if there are compelling reasons.\n  // For example, Japanese mobile handsets require the name\n  // \"Shift_JIS\" in charset=... parameter in Content-Type headers to\n  // process emoji (emoticons) in their private encodings.  In that\n  // case, mime_encoding_name_ should be \"Shift_JIS\", despite\n  // encoding_name_ actually is \"X-KDDI-Shift_JIS\".\n\n  // Some multi-byte encodings use byte values that coincide with the\n  // ASCII codes for HTML syntax characters <>\"&' and browsers like MSIE\n  // can misinterpret these, as indicated in an external XSS report from\n  // 2007-02-15. Here, we map these dangerous encodings to safer ones. We\n  // also use UTF8 instead of encodings that we don't support in our\n  // output, and we generally try to be conservative in what we send out.\n  // Where the client asks for single- or double-byte encodings that are\n  // not as common, we substitute a more common single- or double-byte\n  // encoding, if there is one, thereby preserving the client's intent\n  // to use less space than UTF-8. This also means that characters\n  // outside the destination set will be converted to HTML NCRs (&#NNN;)\n  // if requested.\n\n  Encoding preferred_web_output_encoding_;\n};\n\nstatic const EncodingInfo kEncodingInfoTable[] = {\n  { \"ASCII\", \"ISO-8859-1\", ISO_8859_1},\n  { \"Latin2\", \"ISO-8859-2\", ISO_8859_2},\n  { \"Latin3\", \"ISO-8859-3\", UTF8},\n      // MSIE 6 does not support ISO-8859-3 (XSS issue)\n  { \"Latin4\", \"ISO-8859-4\", ISO_8859_4},\n  { \"ISO-8859-5\", \"ISO-8859-5\", ISO_8859_5},\n  { \"Arabic\", \"ISO-8859-6\", ISO_8859_6},\n  { \"Greek\", \"ISO-8859-7\", ISO_8859_7},\n  { \"Hebrew\", \"ISO-8859-8\", MSFT_CP1255},\n      // we do not endorse the visual order\n  { \"Latin5\", \"ISO-8859-9\", ISO_8859_9},\n  { \"Latin6\", \"ISO-8859-10\", UTF8},\n      // MSIE does not support ISO-8859-10 (XSS issue)\n  { \"EUC-JP\",  \"EUC-JP\", JAPANESE_EUC_JP},\n  { \"SJS\", \"Shift_JIS\", JAPANESE_SHIFT_JIS},\n  { \"JIS\", \"ISO-2022-JP\", JAPANESE_SHIFT_JIS},\n      // due to potential confusion with HTML syntax chars\n  { \"BIG5\", \"Big5\", CHINESE_BIG5},\n  { \"GB\",  \"GB2312\", CHINESE_GB},\n  { \"EUC-CN\",\n        \"EUC-CN\",\n        // Misnamed. Should be EUC-TW.\n        CHINESE_BIG5},\n      // MSIE treats \"EUC-CN\" like GB2312, which is not EUC-TW,\n      // and EUC-TW is rare, so we prefer Big5 for output.\n  { \"KSC\", \"EUC-KR\", KOREAN_EUC_KR},\n  { \"Unicode\",\n    \"UTF-16LE\",\n        // Internet Explorer doesn't recognize \"ISO-10646-UCS-2\"\n        UTF8\n        // due to potential confusion with HTML syntax chars\n        },\n  { \"EUC\",\n        \"EUC\",  // Misnamed. Should be EUC-TW.\n        CHINESE_BIG5\n        // MSIE does not recognize \"EUC\" (XSS issue),\n        // and EUC-TW is rare, so we prefer Big5 for output.\n        },\n  { \"CNS\",\n        \"CNS\",  // Misnamed. Should be EUC-TW.\n        CHINESE_BIG5},\n      // MSIE does not recognize \"CNS\" (XSS issue),\n      // and EUC-TW is rare, so we prefer Big5 for output.\n  { \"BIG5-CP950\",\n        \"BIG5-CP950\",  // Not an IANA name\n        CHINESE_BIG5\n        // MSIE does not recognize \"BIG5-CP950\" (XSS issue)\n        },\n  { \"CP932\", \"CP932\",  // Not an IANA name\n        JAPANESE_SHIFT_JIS},  // MSIE does not recognize \"CP932\" (XSS issue)\n  { \"UTF8\", \"UTF-8\", UTF8},\n  { \"Unknown\",\n        \"x-unknown\",  // Not an IANA name\n        UTF8},  // UTF-8 is our default output encoding\n  { \"ASCII-7-bit\", \"US-ASCII\", ASCII_7BIT},\n  { \"KOI8R\", \"KOI8-R\", RUSSIAN_KOI8_R},\n  { \"CP1251\", \"windows-1251\", RUSSIAN_CP1251},\n  { \"CP1252\", \"windows-1252\", MSFT_CP1252},\n  { \"KOI8U\",\n        \"KOI8-U\",\n        ISO_8859_5},  // because koi8-u is not as common\n  { \"CP1250\", \"windows-1250\", MSFT_CP1250},\n  { \"ISO-8859-15\", \"ISO-8859-15\", ISO_8859_15},\n  { \"CP1254\", \"windows-1254\", MSFT_CP1254},\n  { \"CP1257\", \"windows-1257\", MSFT_CP1257},\n  { \"ISO-8859-11\", \"ISO-8859-11\", ISO_8859_11},\n  { \"CP874\", \"windows-874\", MSFT_CP874},\n  { \"CP1256\", \"windows-1256\", MSFT_CP1256},\n  { \"CP1255\", \"windows-1255\", MSFT_CP1255},\n  { \"ISO-8859-8-I\", \"ISO-8859-8-I\", MSFT_CP1255},\n      // Java does not support iso-8859-8-i\n  { \"VISUAL\", \"ISO-8859-8\", MSFT_CP1255},\n      // we do not endorse the visual order\n  { \"CP852\", \"cp852\", MSFT_CP1250},\n      // because cp852 is not as common\n  { \"CSN_369103\", \"csn_369103\", MSFT_CP1250},\n      // MSIE does not recognize \"csn_369103\" (XSS issue)\n  { \"CP1253\", \"windows-1253\", MSFT_CP1253},\n  { \"CP866\", \"IBM866\", RUSSIAN_CP1251},\n      // because cp866 is not as common\n  { \"ISO-8859-13\", \"ISO-8859-13\", UTF8},\n      // because iso-8859-13 is not widely supported\n  { \"ISO-2022-KR\", \"ISO-2022-KR\", KOREAN_EUC_KR},\n      // due to potential confusion with HTML syntax chars\n  { \"GBK\", \"GBK\", GBK},\n  { \"GB18030\", \"GB18030\", GBK},\n      // because gb18030 is not widely supported\n  { \"BIG5_HKSCS\", \"BIG5-HKSCS\", CHINESE_BIG5},\n      // because Big5-HKSCS is not widely supported\n  { \"ISO_2022_CN\", \"ISO-2022-CN\", CHINESE_GB},\n      // due to potential confusion with HTML syntax chars\n  { \"TSCII\", \"tscii\", UTF8},\n      // we do not have an output converter for this font encoding\n  { \"TAM\", \"tam\", UTF8},\n      // we do not have an output converter for this font encoding\n  { \"TAB\", \"tab\", UTF8},\n      // we do not have an output converter for this font encoding\n  { \"JAGRAN\", \"jagran\", UTF8},\n      // we do not have an output converter for this font encoding\n  { \"MACINTOSH\", \"MACINTOSH\", ISO_8859_1},\n      // because macintosh is relatively uncommon\n  { \"UTF7\", \"UTF-7\",\n        UTF8},  // UTF-7 has been the subject of XSS attacks and is deprecated\n  { \"BHASKAR\", \"bhaskar\",\n        UTF8},  // we do not have an output converter for this font encoding\n  { \"HTCHANAKYA\", \"htchanakya\",  // not an IANA charset name.\n        UTF8},  // we do not have an output converter for this font encoding\n  { \"UTF-16BE\", \"UTF-16BE\",\n        UTF8},  // due to potential confusion with HTML syntax chars\n  { \"UTF-16LE\", \"UTF-16LE\",\n        UTF8},  // due to potential confusion with HTML syntax chars\n  { \"UTF-32BE\", \"UTF-32BE\",\n        UTF8},  // unlikely to cause XSS bugs, but very uncommon on Web\n  { \"UTF-32LE\", \"UTF-32LE\",\n        UTF8},  // unlikely to cause XSS bugs, but very uncommon on Web\n  { \"X-BINARYENC\", \"x-binaryenc\",  // Not an IANA name\n        UTF8},  // because this one is not intended for output (just input)\n  { \"HZ-GB-2312\", \"HZ-GB-2312\",\n        CHINESE_GB},  // due to potential confusion with HTML syntax chars\n  { \"X-UTF8UTF8\", \"x-utf8utf8\",  // Not an IANA name\n        UTF8},  // because this one is not intended for output (just input)\n  { \"X-TAM-ELANGO\", \"x-tam-elango\",\n        UTF8},  // we do not have an output converter for this font encoding\n  { \"X-TAM-LTTMBARANI\", \"x-tam-lttmbarani\",\n        UTF8},  // we do not have an output converter for this font encoding\n  { \"X-TAM-SHREE\", \"x-tam-shree\",\n        UTF8},  // we do not have an output converter for this font encoding\n  { \"X-TAM-TBOOMIS\", \"x-tam-tboomis\",\n        UTF8},  // we do not have an output converter for this font encoding\n  { \"X-TAM-TMNEWS\", \"x-tam-tmnews\",\n        UTF8},  // we do not have an output converter for this font encoding\n  { \"X-TAM-WEBTAMIL\", \"x-tam-webtamil\",\n        UTF8},  // we do not have an output converter for this font encoding\n\n  { \"X-KDDI-Shift_JIS\", \"Shift_JIS\", JAPANESE_SHIFT_JIS},\n      // KDDI version of Shift_JIS with Google Emoji PUA mappings.\n      // Note that MimeEncodingName() returns \"Shift_JIS\", since KDDI uses\n      // \"Shift_JIS\" in HTTP headers and email messages.\n\n  { \"X-DoCoMo-Shift_JIS\", \"Shift_JIS\", JAPANESE_SHIFT_JIS},\n      // DoCoMo version of Shift_JIS with Google Emoji PUA mappings.\n      // See the comment at KDDI_SHIFT_JIS for other issues.\n\n  { \"X-SoftBank-Shift_JIS\", \"Shift_JIS\", JAPANESE_SHIFT_JIS},\n      // SoftBank version of Shift_JIS with Google Emoji PUA mappings.\n      // See the comment at KDDI_SHIFT_JIS for other issues.\n\n  { \"X-KDDI-ISO-2022-JP\", \"ISO-2022-JP\", JAPANESE_SHIFT_JIS},\n      // KDDI version of ISO-2022-JP with Google Emoji PUA mappings.\n      // See the comment at KDDI_SHIFT_JIS for other issues.\n      // The preferred Web encoding is due to potential confusion with\n      // HTML syntax chars.\n\n  { \"X-SoftBank-ISO-2022-JP\", \"ISO-2022-JP\", JAPANESE_SHIFT_JIS},\n      // SoftBank version of ISO-2022-JP with Google Emoji PUA mappings.\n      // See the comment at KDDI_SHIFT_JIS for other issues.\n      // The preferred Web encoding is due to potential confusion with\n      // HTML syntax chars.\n\n      // Please refer to NOTE: section in the comments in the definition\n      // of \"struct I18NInfoByEncoding\", before adding new encodings.\n\n};\n\n\n\nCOMPILE_ASSERT(arraysize(kEncodingInfoTable) == NUM_ENCODINGS,\n               kEncodingInfoTable_has_incorrect_size);\n\nEncoding default_encoding() {return LATIN1;}\n\n// *************************************************************\n// Encoding predicates\n//   IsValidEncoding()\n//   IsEncEncCompatible\n//   IsEncodingWithSupportedLanguage\n//   IsSupersetOfAscii7Bit\n//   Is8BitEncoding\n//   IsCJKEncoding\n//   IsHebrewEncoding\n//   IsRightToLeftEncoding\n//   IsLogicalRightToLeftEncoding\n//   IsVisualRightToLeftEncoding\n//   IsIso2022Encoding\n//   IsIso2022JpOrVariant\n//   IsShiftJisOrVariant\n//   IsJapaneseCellPhoneCarrierSpecificEncoding\n// *************************************************************\n\nbool IsValidEncoding(Encoding enc) {\n  return ((enc >= 0) && (enc < kNumEncodings));\n}\n\nbool IsEncEncCompatible(const Encoding from, const Encoding to) {\n  // Tests compatibility between the \"from\" and \"to\" encodings; in\n  // the typical case -- when both are valid known encodings -- this\n  // returns true iff converting from first to second is a no-op.\n  if (!IsValidEncoding(from) || !IsValidEncoding(to)) {\n    return false;  // we only work with valid encodings...\n  } else if (to == from) {\n    return true;   // the trivial common case\n  }\n\n  if (to == UNKNOWN_ENCODING) {\n    return true;   // all valid encodings are compatible with the unknown\n  }\n\n  if (from == UNKNOWN_ENCODING) {\n    return false;  // no unknown encoding is compatible with one that is\n  }\n\n  if (from == ASCII_7BIT) {\n    return IsSupersetOfAscii7Bit(to);\n  }\n\n  return (from == ISO_8859_1 && to == MSFT_CP1252) ||\n         (from == ISO_8859_8 && to == HEBREW_VISUAL) ||\n         (from == HEBREW_VISUAL && to == ISO_8859_8) ||\n         (from == ISO_8859_9 && to == MSFT_CP1254) ||\n         (from == ISO_8859_11 && to == MSFT_CP874) ||\n         (from == JAPANESE_SHIFT_JIS && to == JAPANESE_CP932) ||\n         (from == CHINESE_BIG5 && to == CHINESE_BIG5_CP950) ||\n         (from == CHINESE_GB && to == GBK) ||\n         (from == CHINESE_GB && to == GB18030) ||\n         (from == CHINESE_EUC_CN && to == CHINESE_EUC_DEC) ||\n         (from == CHINESE_EUC_CN && to == CHINESE_CNS) ||\n         (from == CHINESE_EUC_DEC && to == CHINESE_EUC_CN) ||\n         (from == CHINESE_EUC_DEC && to == CHINESE_CNS) ||\n         (from == CHINESE_CNS && to == CHINESE_EUC_CN) ||\n         (from == CHINESE_CNS && to == CHINESE_EUC_DEC);\n}\n\n// To be a superset of 7-bit Ascii means that bytes 0...127 in the given\n// encoding represent the same characters as they do in ISO_8859_1.\n\n// TODO: This list could be expanded.  Many other encodings are supersets\n// of 7-bit Ascii.  In fact, Japanese JIS and Unicode are the only two\n// encodings that I know for a fact should *not* be in this list.\nbool IsSupersetOfAscii7Bit(Encoding e) {\n  switch (e) {\n    case ISO_8859_1:\n    case ISO_8859_2:\n    case ISO_8859_3:\n    case ISO_8859_4:\n    case ISO_8859_5:\n    case ISO_8859_6:\n    case ISO_8859_7:\n    case ISO_8859_8:\n    case ISO_8859_9:\n    case ISO_8859_10:\n    case JAPANESE_EUC_JP:\n    case JAPANESE_SHIFT_JIS:\n    case CHINESE_BIG5:\n    case CHINESE_GB:\n    case CHINESE_EUC_CN:\n    case KOREAN_EUC_KR:\n    case CHINESE_EUC_DEC:\n    case CHINESE_CNS:\n    case CHINESE_BIG5_CP950:\n    case JAPANESE_CP932:\n    case UTF8:\n    case UNKNOWN_ENCODING:\n    case ASCII_7BIT:\n    case RUSSIAN_KOI8_R:\n    case RUSSIAN_CP1251:\n    case MSFT_CP1252:\n    case RUSSIAN_KOI8_RU:\n    case MSFT_CP1250:\n    case ISO_8859_15:\n    case MSFT_CP1254:\n    case MSFT_CP1257:\n    case ISO_8859_11:\n    case MSFT_CP874:\n    case MSFT_CP1256:\n    case MSFT_CP1255:\n    case ISO_8859_8_I:\n    case HEBREW_VISUAL:\n    case CZECH_CP852:\n    case MSFT_CP1253:\n    case RUSSIAN_CP866:\n    case ISO_8859_13:\n    case GBK:\n    case GB18030:\n    case BIG5_HKSCS:\n    case MACINTOSH_ROMAN:\n      return true;\n    default:\n      return false;\n  }\n}\n\n// To be an 8-bit encoding means that there are fewer than 256 symbols.\n// Each byte determines a new character; there are no multi-byte sequences.\n\n// TODO: This list could maybe be expanded.  Other encodings may be 8-bit.\nbool Is8BitEncoding(Encoding e) {\n  switch (e) {\n    case ASCII_7BIT:\n    case ISO_8859_1:\n    case ISO_8859_2:\n    case ISO_8859_3:\n    case ISO_8859_4:\n    case ISO_8859_5:\n    case ISO_8859_6:\n    case ISO_8859_7:\n    case ISO_8859_8:\n    case ISO_8859_8_I:\n    case ISO_8859_9:\n    case ISO_8859_10:\n    case ISO_8859_11:\n    case ISO_8859_13:\n    case ISO_8859_15:\n    case MSFT_CP1252:\n    case MSFT_CP1253:\n    case MSFT_CP1254:\n    case MSFT_CP1255:\n    case MSFT_CP1256:\n    case MSFT_CP1257:\n    case RUSSIAN_KOI8_R:\n    case RUSSIAN_KOI8_RU:\n    case RUSSIAN_CP866:\n      return true;\n    default:\n      return false;\n  }\n}\n\nbool IsCJKEncoding(Encoding e) {\n  switch (e) {\n    case JAPANESE_EUC_JP:\n    case JAPANESE_SHIFT_JIS:\n    case JAPANESE_JIS:\n    case CHINESE_BIG5:\n    case CHINESE_GB:\n    case CHINESE_EUC_CN:\n    case KOREAN_EUC_KR:\n    case CHINESE_EUC_DEC:\n    case CHINESE_CNS:\n    case CHINESE_BIG5_CP950:\n    case JAPANESE_CP932:\n    case ISO_2022_KR:\n    case GBK:\n    case GB18030:\n    case BIG5_HKSCS:\n    case ISO_2022_CN:\n    case HZ_GB_2312:\n      return true;\n    default:\n      return false;\n  }\n}\n\nbool IsHebrewEncoding(Encoding e) {\n  return (e == ISO_8859_8 ||\n          e == ISO_8859_8_I ||\n          e == MSFT_CP1255 ||\n          e == HEBREW_VISUAL);\n}\n\n\n\nbool IsRightToLeftEncoding(Encoding enc) {\n  switch (enc) {\n    case MSFT_CP1255:\n    case MSFT_CP1256:\n    case ARABIC_ENCODING:\n    case HEBREW_ENCODING:\n    case ISO_8859_8_I:\n    case HEBREW_VISUAL:\n      return true;\n    default:\n      return false;\n  }\n}\n\nbool IsLogicalRightToLeftEncoding(Encoding enc) {\n  return IsRightToLeftEncoding(enc) && !IsVisualRightToLeftEncoding(enc);\n}\n\n// Note that despite an RFC to the contrary, ARABIC_ENCODING (ISO-8859-6)\n// is NOT visual.\nbool IsVisualRightToLeftEncoding(Encoding enc) {\n  switch (enc) {\n    case HEBREW_ENCODING:\n    case HEBREW_VISUAL:\n      return true;\n    default:\n      return false;\n  }\n}\n\n\n\n\n\nbool IsIso2022Encoding(Encoding enc) {\n  return (IsIso2022JpOrVariant(enc) ||\n          enc == ISO_2022_KR ||\n          enc == ISO_2022_CN);\n}\n\nbool IsIso2022JpOrVariant(Encoding enc) {\n  return (enc == JAPANESE_JIS ||\n          enc == KDDI_ISO_2022_JP ||\n          enc == SOFTBANK_ISO_2022_JP);\n}\n\nbool IsShiftJisOrVariant(Encoding enc) {\n  return (enc == JAPANESE_SHIFT_JIS ||\n          enc == JAPANESE_CP932 ||\n          enc == KDDI_SHIFT_JIS ||\n          enc == DOCOMO_SHIFT_JIS ||\n          enc == SOFTBANK_SHIFT_JIS);\n}\n\nbool IsJapaneseCellPhoneCarrierSpecificEncoding(Encoding enc) {\n  return (enc == KDDI_ISO_2022_JP ||\n          enc == KDDI_SHIFT_JIS ||\n          enc == DOCOMO_SHIFT_JIS ||\n          enc == SOFTBANK_SHIFT_JIS ||\n          enc == SOFTBANK_ISO_2022_JP);\n}\n\n\n// *************************************************************\n// ENCODING NAMES\n//   EncodingName() [Encoding to name]\n//   MimeEncodingName() [Encoding to name]\n//   EncodingFromName() [name to Encoding]\n//   EncodingNameAliasToEncoding() [name to Encoding]\n//   default_encoding_name()\n//   invalid_encoding_name()\n// *************************************************************\n\nconst char * EncodingName(const Encoding enc) {\n  if ( (enc < 0) || (enc >= kNumEncodings) )\n    return invalid_encoding_name();\n  return kEncodingInfoTable[enc].encoding_name_;\n}\n\n// TODO: Unify MimeEncodingName and EncodingName, or determine why\n// such a unification is not possible.\n\nconst char * MimeEncodingName(Encoding enc) {\n  if ( (enc < 0) || (enc >= kNumEncodings) )\n    return \"\";  // TODO: Should this be invalid_encoding_name()?\n  return kEncodingInfoTable[enc].mime_encoding_name_;\n}\n\nbool EncodingFromName(const char* enc_name, Encoding *encoding) {\n  *encoding = UNKNOWN_ENCODING;\n  if ( enc_name == NULL ) return false;\n\n  for ( int i = 0; i < kNumEncodings; i++ ) {\n    if (!base::strcasecmp(enc_name, kEncodingInfoTable[i].encoding_name_) ) {\n      *encoding = static_cast<Encoding>(i);\n      return true;\n    }\n  }\n  return false;\n}\n\n// The encoding_map maps standard and non-standard encoding-names\n// (strings) to Encoding enums. It is used only by\n// EncodingNameAliasToEncoding. Note that the map uses\n// case-insensitive hash and comparison functions.\n\ntypedef std::unordered_map<const char *, Encoding,\n           CStringAlnumCaseHash,\n           CStringAlnumCaseEqual> EncodingMap;\n\nstatic const EncodingMap& GetEncodingMap() {\n  static EncodingMap encoding_map;\n  if (!encoding_map.empty()) {\n    // Already initialized\n    return encoding_map;\n  }\n\n  // Initialize the map with all the \"standard\" encoding names,\n  // i.e., the ones returned by EncodingName and MimeEncodingName.\n  //\n  // First, add internal encoding names returned by EncodingName().\n  for (int i = 0; i < NUM_ENCODINGS; ++i) {\n    Encoding e = static_cast<Encoding>(i);\n    // Internal encoding names must be unique.\n    // The internal names are guaranteed to be unique by the CHECK_EQ.\n    const char *encoding_name = EncodingName(e);\n    // CHECK_EQ(0, encoding_map.count(encoding_name))\n    //  << \"Duplicate found for \" << encoding_name;\n    encoding_map[encoding_name] = e;\n  }\n  // Then, add mime encoding names returned by MimeEncodingName().\n  // We don't override existing entries, to give precedence to entries\n  // added earlier.\n  for (int i = 0; i < NUM_ENCODINGS; ++i) {\n    Encoding e = static_cast<Encoding>(i);\n    // Note that MimeEncodingName() can return the same mime encoding\n    // name for different encoding enums like JAPANESE_SHIFT_JIS and\n    // KDDI_SHIFT_JIS.  In that case, the encoding enum first seen\n    // will be the value for the encoding name in the map.\n    const char *mime_encoding_name = MimeEncodingName(e);\n    if (encoding_map.count(mime_encoding_name) == 0) {\n      encoding_map[mime_encoding_name] = e;\n    }\n  }\n\n  // Add some non-standard names: alternate spellings, common typos,\n  // etc. (It does no harm to add names already in the map.) Note\n  // that although the map is case-insensitive, by convention the\n  // keys are written here in lower case. For ease of maintenance,\n  // they are listed in alphabetical order.\n  encoding_map[\"5601\"] = KOREAN_EUC_KR;\n  encoding_map[\"646\"] = ASCII_7BIT;\n  encoding_map[\"852\"] = CZECH_CP852;\n  encoding_map[\"866\"] = RUSSIAN_CP866;\n  encoding_map[\"8859-1\"] = ISO_8859_1;\n  encoding_map[\"ansi-1251\"] = RUSSIAN_CP1251;\n  encoding_map[\"ansi_x3.4-1968\"] = ASCII_7BIT;\n  encoding_map[\"arabic\"] = ISO_8859_6;\n  encoding_map[\"ascii\"] = ISO_8859_1;\n  encoding_map[\"ascii-7-bit\"] = ASCII_7BIT;  // not iana standard\n  encoding_map[\"asmo-708\"] = ISO_8859_6;\n  encoding_map[\"bhaskar\"] = BHASKAR;\n  encoding_map[\"big5\"] = CHINESE_BIG5;\n  encoding_map[\"big5-cp950\"] = CHINESE_BIG5_CP950;  // not iana standard\n  encoding_map[\"big5-hkscs\"] = BIG5_HKSCS;\n  encoding_map[\"chinese\"] = CHINESE_GB;\n  encoding_map[\"cns\"] = CHINESE_CNS;  // not iana standard\n  encoding_map[\"cns11643\"] = CHINESE_CNS;\n  encoding_map[\"cp1250\"] = MSFT_CP1250;  // not iana standard\n  encoding_map[\"cp1251\"] = RUSSIAN_CP1251;  // not iana standard\n  encoding_map[\"cp1252\"] = MSFT_CP1252;  // not iana standard\n  encoding_map[\"cp1253\"] = MSFT_CP1253;  // not iana standard\n  encoding_map[\"cp1254\"] = MSFT_CP1254;  // not iana standard\n  encoding_map[\"cp1255\"] = MSFT_CP1255;\n  encoding_map[\"cp1256\"] = MSFT_CP1256;\n  encoding_map[\"cp1257\"] = MSFT_CP1257;  // not iana standard\n  encoding_map[\"cp819\"] = ISO_8859_1;\n  encoding_map[\"cp852\"] = CZECH_CP852;\n  encoding_map[\"cp866\"] = RUSSIAN_CP866;\n  encoding_map[\"cp-866\"] = RUSSIAN_CP866;\n  encoding_map[\"cp874\"] = MSFT_CP874;\n  encoding_map[\"cp932\"] = JAPANESE_CP932;  // not iana standard\n  encoding_map[\"cp950\"] = CHINESE_BIG5_CP950;   // not iana standard\n  encoding_map[\"csbig5\"] = CHINESE_BIG5;\n  encoding_map[\"cseucjpkdfmtjapanese\"] = JAPANESE_EUC_JP;\n  encoding_map[\"cseuckr\"] = KOREAN_EUC_KR;\n  encoding_map[\"csgb2312\"] = CHINESE_GB;\n  encoding_map[\"csibm852\"] = CZECH_CP852;\n  encoding_map[\"csibm866\"] = RUSSIAN_CP866;\n  encoding_map[\"csiso2022jp\"] = JAPANESE_JIS;\n  encoding_map[\"csiso2022kr\"] = ISO_2022_KR;\n  encoding_map[\"csiso58gb231280\"] = CHINESE_GB;\n  encoding_map[\"csiso88598i\"] = ISO_8859_8_I;\n  encoding_map[\"csisolatin1\"] = ISO_8859_1;\n  encoding_map[\"csisolatin2\"] = ISO_8859_2;\n  encoding_map[\"csisolatin3\"] = ISO_8859_3;\n  encoding_map[\"csisolatin4\"] = ISO_8859_4;\n  encoding_map[\"csisolatin5\"] = ISO_8859_9;\n  encoding_map[\"csisolatin6\"] = ISO_8859_10;\n  encoding_map[\"csisolatinarabic\"] = ISO_8859_6;\n  encoding_map[\"csisolatincyrillic\"] = ISO_8859_5;\n  encoding_map[\"csisolatingreek\"] = ISO_8859_7;\n  encoding_map[\"csisolatinhebrew\"] = ISO_8859_8;\n  encoding_map[\"csksc56011987\"] = KOREAN_EUC_KR;\n  encoding_map[\"csmacintosh\"] = MACINTOSH_ROMAN;\n  encoding_map[\"csn-369103\"] = CZECH_CSN_369103;\n  encoding_map[\"csshiftjis\"] = JAPANESE_SHIFT_JIS;\n  encoding_map[\"csunicode\"] = UTF16BE;\n  encoding_map[\"csunicode11\"] = UTF16BE;\n  encoding_map[\"csunicode11utf7\"] = UTF7;\n  encoding_map[\"csunicodeascii\"] = UTF16BE;\n  encoding_map[\"csunicodelatin1\"] = UTF16BE;\n  encoding_map[\"cyrillic\"] = ISO_8859_5;\n  encoding_map[\"ecma-114\"] = ISO_8859_6;\n  encoding_map[\"ecma-118\"] = ISO_8859_7;\n  encoding_map[\"elot_928\"] = ISO_8859_7;\n  encoding_map[\"euc\"] = CHINESE_EUC_DEC;  // not iana standard\n  encoding_map[\"euc-cn\"] = CHINESE_EUC_CN;  // not iana standard\n  encoding_map[\"euc-dec\"] = CHINESE_EUC_DEC;  // not iana standard\n  encoding_map[\"euc-jp\"] = JAPANESE_EUC_JP;\n  encoding_map[\"euc-kr\"] = KOREAN_EUC_KR;\n  encoding_map[\"eucgb2312_cn\"] = CHINESE_GB;\n  encoding_map[\"gb\"] = CHINESE_GB;  // not iana standard\n  encoding_map[\"gb18030\"] = GB18030;\n  encoding_map[\"gb2132\"] = CHINESE_GB;  // common typo\n  encoding_map[\"gb2312\"] = CHINESE_GB;\n  encoding_map[\"gb_2312-80\"] = CHINESE_GB;\n  encoding_map[\"gbk\"] = GBK;\n  encoding_map[\"greek\"] = ISO_8859_7;\n  encoding_map[\"greek8\"] = ISO_8859_7;\n  encoding_map[\"hebrew\"] = ISO_8859_8;\n  encoding_map[\"htchanakya\"] = HTCHANAKYA;\n  encoding_map[\"hz-gb-2312\"] = HZ_GB_2312;\n  encoding_map[\"ibm819\"] = ISO_8859_1;\n  encoding_map[\"ibm852\"] = CZECH_CP852;\n  encoding_map[\"ibm874\"] = MSFT_CP874;\n  encoding_map[\"iso-10646\"] = UTF16BE;\n  encoding_map[\"iso-10646-j-1\"] = UTF16BE;\n  encoding_map[\"iso-10646-ucs-2\"] = UNICODE;\n  encoding_map[\"iso-10646-ucs-4\"] = UTF32BE;\n  encoding_map[\"iso-10646-ucs-basic\"] = UTF16BE;\n  encoding_map[\"iso-10646-unicode-latin1\"] = UTF16BE;\n  encoding_map[\"iso-2022-cn\"] = ISO_2022_CN;\n  encoding_map[\"iso-2022-jp\"] = JAPANESE_JIS;\n  encoding_map[\"iso-2022-kr\"] = ISO_2022_KR;\n  encoding_map[\"iso-8559-1\"] = ISO_8859_1;   // common typo\n  encoding_map[\"iso-874\"] = MSFT_CP874;\n  encoding_map[\"iso-8858-1\"] = ISO_8859_1;   // common typo\n  // iso-8859-0 was a temporary name, eventually renamed iso-8859-15\n  encoding_map[\"iso-8859-0\"] = ISO_8859_15;\n  encoding_map[\"iso-8859-1\"] = ISO_8859_1;\n  encoding_map[\"iso-8859-10\"] = ISO_8859_10;\n  encoding_map[\"iso-8859-11\"] = ISO_8859_11;\n  encoding_map[\"iso-8859-13\"] = ISO_8859_13;\n  encoding_map[\"iso-8859-15\"] = ISO_8859_15;\n  encoding_map[\"iso-8859-2\"] = ISO_8859_2;\n  encoding_map[\"iso-8859-3\"] = ISO_8859_3;\n  encoding_map[\"iso-8859-4\"] = ISO_8859_4;\n  encoding_map[\"iso-8859-5\"] = ISO_8859_5;\n  encoding_map[\"iso-8859-6\"] = ISO_8859_6;\n  encoding_map[\"iso-8859-7\"] = ISO_8859_7;\n  encoding_map[\"iso-8859-8\"] = ISO_8859_8;\n  encoding_map[\"iso-8859-8-i\"] = ISO_8859_8_I;\n  encoding_map[\"iso-8859-9\"] = ISO_8859_9;\n  encoding_map[\"iso-9959-1\"] = ISO_8859_1;   // common typo\n  encoding_map[\"iso-ir-100\"] = ISO_8859_1;\n  encoding_map[\"iso-ir-101\"] = ISO_8859_2;\n  encoding_map[\"iso-ir-109\"] = ISO_8859_3;\n  encoding_map[\"iso-ir-110\"] = ISO_8859_4;\n  encoding_map[\"iso-ir-126\"] = ISO_8859_7;\n  encoding_map[\"iso-ir-127\"] = ISO_8859_6;\n  encoding_map[\"iso-ir-138\"] = ISO_8859_8;\n  encoding_map[\"iso-ir-144\"] = ISO_8859_5;\n  encoding_map[\"iso-ir-148\"] = ISO_8859_9;\n  encoding_map[\"iso-ir-149\"] = KOREAN_EUC_KR;\n  encoding_map[\"iso-ir-157\"] = ISO_8859_10;\n  encoding_map[\"iso-ir-58\"] = CHINESE_GB;\n  encoding_map[\"iso-latin-1\"] = ISO_8859_1;\n  encoding_map[\"iso_2022-cn\"] = ISO_2022_CN;\n  encoding_map[\"iso_2022-kr\"] = ISO_2022_KR;\n  encoding_map[\"iso_8859-1\"] = ISO_8859_1;\n  encoding_map[\"iso_8859-10:1992\"] = ISO_8859_10;\n  encoding_map[\"iso_8859-11\"] = ISO_8859_11;\n  encoding_map[\"iso_8859-13\"] = ISO_8859_13;\n  encoding_map[\"iso_8859-15\"] = ISO_8859_15;\n  encoding_map[\"iso_8859-1:1987\"] = ISO_8859_1;\n  encoding_map[\"iso_8859-2\"] = ISO_8859_2;\n  encoding_map[\"iso_8859-2:1987\"] = ISO_8859_2;\n  encoding_map[\"iso_8859-3\"] = ISO_8859_3;\n  encoding_map[\"iso_8859-3:1988\"] = ISO_8859_3;\n  encoding_map[\"iso_8859-4\"] = ISO_8859_4;\n  encoding_map[\"iso_8859-4:1988\"] = ISO_8859_4;\n  encoding_map[\"iso_8859-5\"] = ISO_8859_5;\n  encoding_map[\"iso_8859-5:1988\"] = ISO_8859_5;\n  encoding_map[\"iso_8859-6\"] = ISO_8859_6;\n  encoding_map[\"iso_8859-6:1987\"] = ISO_8859_6;\n  encoding_map[\"iso_8859-7\"] = ISO_8859_7;\n  encoding_map[\"iso_8859-7:1987\"] = ISO_8859_7;\n  encoding_map[\"iso_8859-8\"] = ISO_8859_8;\n  encoding_map[\"iso_8859-8:1988:\"] = ISO_8859_8;\n  encoding_map[\"iso_8859-9\"] = ISO_8859_9;\n  encoding_map[\"iso_8859-9:1989\"] = ISO_8859_9;\n  encoding_map[\"jagran\"] = JAGRAN;\n  encoding_map[\"jis\"] = JAPANESE_JIS;   // not iana standard\n  encoding_map[\"koi8-cs\"] = CZECH_CSN_369103;\n  encoding_map[\"koi8-r\"] = RUSSIAN_KOI8_R;\n  encoding_map[\"koi8-ru\"] = RUSSIAN_KOI8_RU;  // not iana standard\n  encoding_map[\"koi8-u\"] = RUSSIAN_KOI8_RU;\n  encoding_map[\"koi8r\"] = RUSSIAN_KOI8_R;  // not iana standard\n  encoding_map[\"koi8u\"] = RUSSIAN_KOI8_RU;  // not iana standard\n  encoding_map[\"korean\"] = KOREAN_EUC_KR;  // i assume this is what is meant\n  encoding_map[\"ks-c-5601\"] = KOREAN_EUC_KR;  // not iana standard\n  encoding_map[\"ks-c-5601-1987\"] = KOREAN_EUC_KR;  // not iana standard\n  encoding_map[\"ks_c_5601-1989\"] = KOREAN_EUC_KR;\n  encoding_map[\"ksc\"] = KOREAN_EUC_KR;  // not iana standard\n  encoding_map[\"l1\"] = ISO_8859_1;\n  encoding_map[\"l2\"] = ISO_8859_2;\n  encoding_map[\"l3\"] = ISO_8859_3;\n  encoding_map[\"l4\"] = ISO_8859_4;\n  encoding_map[\"l5\"] = ISO_8859_9;\n  encoding_map[\"l6\"] = ISO_8859_10;\n  encoding_map[\"latin-1\"] = ISO_8859_1;  // not iana standard\n  encoding_map[\"latin1\"] = ISO_8859_1;\n  encoding_map[\"latin2\"] = ISO_8859_2;\n  encoding_map[\"latin3\"] = ISO_8859_3;\n  encoding_map[\"latin4\"] = ISO_8859_4;\n  encoding_map[\"latin5\"] = ISO_8859_9;\n  encoding_map[\"latin6\"] = ISO_8859_10;\n  encoding_map[\"mac\"] = MACINTOSH_ROMAN;\n  encoding_map[\"macintosh\"] = MACINTOSH_ROMAN;\n  encoding_map[\"macintosh-roman\"] = MACINTOSH_ROMAN;\n  encoding_map[\"ms932\"] = JAPANESE_CP932;  // not iana standard\n  encoding_map[\"ms_kanji\"] = JAPANESE_CP932;\n  encoding_map[\"shift-jis\"] = JAPANESE_SHIFT_JIS;\n  encoding_map[\"shift_jis\"] = JAPANESE_SHIFT_JIS;\n  encoding_map[\"sjis\"] = JAPANESE_SHIFT_JIS;  // not iana standard\n  encoding_map[\"sjs\"] = JAPANESE_SHIFT_JIS;  // not iana standard\n  encoding_map[\"sun_eu_greek\"] = ISO_8859_7;\n  encoding_map[\"tab\"] = TAMIL_BI;\n  encoding_map[\"tam\"] = TAMIL_MONO;\n  encoding_map[\"tis-620\"] = ISO_8859_11;\n  encoding_map[\"tscii\"] = TSCII;\n  encoding_map[\"un\"] = UNKNOWN_ENCODING;  // not iana standard\n  encoding_map[\"unicode\"] = UNICODE;  // not iana standard\n  encoding_map[\"unicode-1-1-utf-7\"] = UTF7;\n  encoding_map[\"unicode-1-1-utf-8\"] = UTF8;\n  encoding_map[\"unicode-2-0-utf-7\"] = UTF7;\n  encoding_map[\"unknown\"] = UNKNOWN_ENCODING;   // not iana standard\n  encoding_map[\"us\"] = ISO_8859_1;\n  encoding_map[\"us-ascii\"] = ISO_8859_1;\n  encoding_map[\"utf-16be\"] = UTF16BE;\n  encoding_map[\"utf-16le\"] = UTF16LE;\n  encoding_map[\"utf-32be\"] = UTF32BE;\n  encoding_map[\"utf-32le\"] = UTF32LE;\n  encoding_map[\"utf-7\"] = UTF7;\n  encoding_map[\"utf-8\"] = UTF8;\n  encoding_map[\"utf7\"] = UTF7;\n  encoding_map[\"utf8\"] = UTF8;  // not iana standard\n  encoding_map[\"visual\"] = HEBREW_VISUAL;\n  encoding_map[\"win-1250\"] = MSFT_CP1250;  // not iana standard\n  encoding_map[\"win-1251\"] = RUSSIAN_CP1251;  // not iana standard\n  encoding_map[\"window-874\"] = MSFT_CP874;\n  encoding_map[\"windows-1250\"] = MSFT_CP1250;\n  encoding_map[\"windows-1251\"] = RUSSIAN_CP1251;\n  encoding_map[\"windows-1252\"] = MSFT_CP1252;\n  encoding_map[\"windows-1253\"] = MSFT_CP1253;\n  encoding_map[\"windows-1254\"] = MSFT_CP1254;\n  encoding_map[\"windows-1255\"] = MSFT_CP1255;\n  encoding_map[\"windows-1256\"] = MSFT_CP1256;\n  encoding_map[\"windows-1257\"] = MSFT_CP1257;\n  encoding_map[\"windows-31j\"] = JAPANESE_CP932;\n  encoding_map[\"windows-874\"] = MSFT_CP874;\n  encoding_map[\"windows-936\"] = GBK;\n  encoding_map[\"x-big5\"] = CHINESE_BIG5;\n  encoding_map[\"x-binaryenc\"] = BINARYENC;  // not iana standard\n  encoding_map[\"x-cp1250\"] = MSFT_CP1250;\n  encoding_map[\"x-cp1251\"] = RUSSIAN_CP1251;\n  encoding_map[\"x-cp1252\"] = MSFT_CP1252;\n  encoding_map[\"x-cp1253\"] = MSFT_CP1253;\n  encoding_map[\"x-cp1254\"] = MSFT_CP1254;\n  encoding_map[\"x-cp1255\"] = MSFT_CP1255;\n  encoding_map[\"x-cp1256\"] = MSFT_CP1256;\n  encoding_map[\"x-cp1257\"] = MSFT_CP1257;\n  encoding_map[\"x-euc-jp\"] = JAPANESE_EUC_JP;\n  encoding_map[\"x-euc-tw\"] = CHINESE_CNS;\n  encoding_map[\"x-gbk\"] = GBK;\n  encoding_map[\"x-iso-10646-ucs-2-be\"] = UTF16BE;\n  encoding_map[\"x-iso-10646-ucs-2-le\"] = UTF16LE;\n  encoding_map[\"x-iso-10646-ucs-4-be\"] = UTF32BE;\n  encoding_map[\"x-iso-10646-ucs-4-le\"] = UTF32LE;\n  encoding_map[\"x-jis\"] = JAPANESE_JIS;  // not iana standard\n  encoding_map[\"x-mac-roman\"] = MACINTOSH_ROMAN;\n  encoding_map[\"x-shift_jis\"] = JAPANESE_SHIFT_JIS;  // not iana standard\n  encoding_map[\"x-sjis\"] = JAPANESE_SHIFT_JIS;\n  encoding_map[\"x-unicode-2-0-utf-7\"] = UTF7;\n  encoding_map[\"x-utf8utf8\"] = UTF8UTF8;  // not iana standard\n  encoding_map[\"x-x-big5\"] = CHINESE_BIG5;\n  encoding_map[\"zh_cn.euc\"] = CHINESE_GB;\n  encoding_map[\"zh_tw-big5\"] = CHINESE_BIG5;\n  encoding_map[\"zh_tw-euc\"] = CHINESE_CNS;\n\n  // Remove they entry for the empty string, if any.\n  encoding_map.erase(\"\");\n\n  return encoding_map;\n}\n\n// ----------------------------------------------------------------------\n// EncodingNameAliasToEncoding()\n//\n// This function takes an encoding name/alias and returns the Encoding\n// enum. The input is case insensitive. It is the union of the common\n// IANA standard names, the charset names used in Netscape Navigator,\n// and some common names we have been using.\n// See: http://www.iana.org/assignments/character-sets\n// http://physics.hallym.ac.kr/resource/relnotes/windows-2.0.html\n//\n// UNKNOWN_ENCODING is returned if none matches.\n//\n// TODO: Check if it is possible to remove the non-standard,\n// non-netscape-use names. It is because this routine is used for\n// encoding detections from html meta info. Non-standard names may\n// introduce noise on encoding detection.\n//\n// TODO: Unify EncodingNameAliasToEncoding and EncodingFromName,\n// or determine why such a unification is not possible.\n// ----------------------------------------------------------------------\nEncoding EncodingNameAliasToEncoding(const char *encoding_name) {\n  if (!encoding_name) {\n    return UNKNOWN_ENCODING;\n  }\n\n  const EncodingMap& encoding_map = GetEncodingMap();\n\n  EncodingMap::const_iterator emi = encoding_map.find(encoding_name);\n  if (emi != encoding_map.end()) {\n    return emi->second;\n  } else {\n    return UNKNOWN_ENCODING;\n  }\n}\n\nconst char* default_encoding_name() {\n  return kEncodingInfoTable[LATIN1].encoding_name_;\n}\n\nstatic const char* const kInvalidEncodingName = \"invalid_encoding\";\n\nconst char *invalid_encoding_name() {\n  return kInvalidEncodingName;\n}\n\n\n\n// *************************************************************\n// Miscellany\n// *************************************************************\n\n\nEncoding PreferredWebOutputEncoding(Encoding enc) {\n  return IsValidEncoding(enc)\n      ? kEncodingInfoTable[enc].preferred_web_output_encoding_\n      : UTF8;\n}\n"
  },
  {
    "path": "third_party/ced/util/encodings/encodings.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef UTIL_ENCODINGS_ENCODINGS_H_\n#define UTIL_ENCODINGS_ENCODINGS_H_\n\n// This interface defines the Encoding enum and various functions that\n// depend only on Encoding values.\n\n// A hash-function for Encoding, hash<Encoding>, is defined in\n// i18n/encodings/public/encodings-hash.h\n\n// On some Windows projects, UNICODE may be defined, which would prevent the\n// Encoding enum below from compiling. Note that this is a quick fix that does\n// not break any existing projects. The UNICODE enum may someday be changed\n// to something more specific and non-colliding, but this involves careful\n// testing of changes in many other projects.\n#undef UNICODE\n\n// NOTE: The Encoding enum must always start at 0. This assumption has\n// been made and used.\n\n#ifndef SWIG\n\n#include \"util/encodings/encodings.pb.h\"\n\n#else\n\n// TODO: Include a SWIG workaround header file.\n\n#endif\n\nconst int kNumEncodings = NUM_ENCODINGS;\n\n// some of the popular encoding aliases\n// TODO: Make these static const Encoding values instead of macros.\n#define LATIN1           ISO_8859_1\n#define LATIN2           ISO_8859_2\n#define LATIN3           ISO_8859_3\n#define LATIN4           ISO_8859_4\n#define CYRILLIC         ISO_8859_5\n#define ARABIC_ENCODING  ISO_8859_6     // avoiding the same name as language\n#define GREEK_ENCODING   ISO_8859_7     // avoiding the same name as language\n#define HEBREW_ENCODING  ISO_8859_8     // avoiding the same name as language\n#define LATIN5           ISO_8859_9\n#define LATIN6           ISO_8859_10\n#define KOREAN_HANGUL    KOREAN_EUC_KR\n\n// The default Encoding (LATIN1).\nEncoding default_encoding();\n\n\n\n// *************************************************************\n// Encoding predicates\n//   IsValidEncoding()\n//   IsEncEncCompatible\n//   IsSupersetOfAscii7Bit\n//   Is8BitEncoding\n//   IsCJKEncoding\n//   IsHebrewEncoding\n//   IsRightToLeftEncoding\n//   IsLogicalRightToLeftEncoding\n//   IsVisualRightToLeftEncoding\n//   IsIso2022Encoding\n//   IsIso2022JpOrVariant\n//   IsShiftJisOrVariant\n//   IsJapaneseCellPhoneCarrierSpecificEncoding\n// *************************************************************\n\n// IsValidEncoding\n// ===================================\n//\n// Function to check if the input language enum is within range.\n//\n\nbool IsValidEncoding(Encoding enc);\n\n//\n// IsEncEncCompatible\n// ------------------\n//\n// This function is to determine whether or not converting from the\n// first encoding to the second requires any changes to the underlying\n// text (e.g.  ASCII_7BIT is a subset of UTF8).\n//\n// TODO: the current implementation is likely incomplete.  It would be\n// good to consider the full matrix of all pairs of encodings and to fish out\n// all compatible pairs.\n//\nbool IsEncEncCompatible(const Encoding from, const Encoding to);\n\n// To be a superset of 7-bit Ascii means that bytes 0...127 in the given\n// encoding represent the same characters as they do in ISO_8859_1.\n\n// WARNING: This function does not currently return true for all encodings that\n// are supersets of Ascii 7-bit.\nbool IsSupersetOfAscii7Bit(Encoding e);\n\n// To be an 8-bit encoding means that there are fewer than 256 symbols.\n// Each byte determines a new character; there are no multi-byte sequences.\n\n// WARNING: This function does not currently return true for all encodings that\n// are 8-bit encodings.\nbool Is8BitEncoding(Encoding e);\n\n// IsCJKEncoding\n// -------------\n//\n// This function returns true if the encoding is either Chinese\n// (simplified or traditional), Japanese, or Korean. Note: UTF8 is not\n// considered a CJK encoding.\nbool IsCJKEncoding(Encoding e);\n\n// IsHebrewEncoding\n// -------------\n//\n// This function returns true if the encoding is a Hebrew specific\n// encoding (not UTF8, etc).\nbool IsHebrewEncoding(Encoding e);\n\n// IsRightToLeftEncoding\n// ---------------------\n//\n// Returns true if the encoding is a right-to-left encoding.\n//\n// Note that the name of this function is somewhat misleading. There is nothing\n// \"right to left\" about these encodings. They merely contain code points for\n// characters in RTL languages such as Hebrew and Arabic. But this is also\n// true for UTF-8.\n//\n// TODO: Get rid of this function. The only special-case we\n// should need to worry about are visual encodings. Anything we\n// need to do for all 'RTL' encodings we need to do for UTF-8 as well.\nbool IsRightToLeftEncoding(Encoding enc);\n\n// IsLogicalRightToLeftEncoding\n// ----------------------------\n//\n// Returns true if the encoding is a logical right-to-left encoding.\n// Logical right-to-left encodings are those that the browser renders\n// right-to-left and applies the BiDi algorithm to. Therefore the characters\n// appear in reading order in the file, and indexing, snippet generation etc.\n// should all just work with no special processing.\n//\n// TODO: Get rid of this function. The only special-case we\n// should need to worry about are visual encodings.\nbool IsLogicalRightToLeftEncoding(Encoding enc);\n\n// IsVisualRightToLeftEncoding\n// ---------------------------\n//\n// Returns true if the encoding is a visual right-to-left encoding.\n// Visual right-to-left encodings are those that the browser renders\n// left-to-right and does not apply the BiDi algorithm to. Therefore each\n// line appears in reverse order in the file, lines are manually wrapped\n// by abusing <br> or <p> tags, etc. Visual RTL encoding is a relic of\n// the prehistoric days when browsers couldn't render right-to-left, but\n// unfortunately some visual pages persist to this day. These documents require\n// special processing so that we don't index or snippet them with each line\n// reversed.\nbool IsVisualRightToLeftEncoding(Encoding enc);\n\n// IsIso2022Encoding\n// -----------------\n//\n// Returns true if the encoding is a kind of ISO 2022 such as\n// ISO-2022-JP.\nbool IsIso2022Encoding(Encoding enc);\n\n// IsIso2022JpOrVariant\n// --------------------\n//\n// Returns true if the encoding is ISO-2022-JP or a variant such as\n// KDDI's ISO-2022-JP.\nbool IsIso2022JpOrVariant(Encoding enc);\n\n// IsShiftJisOrVariant\n// --------------------\n//\n// Returns true if the encoding is Shift_JIS or a variant such as\n// KDDI's Shift_JIS.\nbool IsShiftJisOrVariant(Encoding enc);\n\n// IsJapanesCellPhoneCarrierSpecificEncoding\n// -----------------------------------------\n//\n// Returns true if it's Japanese cell phone carrier specific encoding\n// such as KDDI_SHIFT_JIS.\nbool IsJapaneseCellPhoneCarrierSpecificEncoding(Encoding enc);\n\n\n\n// *************************************************************\n// ENCODING NAMES\n//\n// This interface defines a standard name for each valid encoding, and\n// a standard name for invalid encodings. (Some names use all upper\n// case, but others use mixed case.)\n//\n//   EncodingName() [Encoding to name]\n//   MimeEncodingName() [Encoding to name]\n//   EncodingFromName() [name to Encoding]\n//   EncodingNameAliasToEncoding() [name to Encoding]\n//   default_encoding_name()\n//   invalid_encoding_name()\n// *************************************************************\n\n// EncodingName\n// ------------\n//\n// Given the encoding, returns its standard name.\n// Return invalid_encoding_name() if the encoding is invalid.\n//\nconst char* EncodingName(Encoding enc);\n\n//\n// MimeEncodingName\n// ----------------\n//\n// Return the \"preferred MIME name\" of an encoding.\n//\n// This name is suitable for using in HTTP headers, HTML tags,\n// and as the \"charset\" parameter of a MIME Content-Type.\nconst char* MimeEncodingName(Encoding enc);\n\n\n// The maximum length of an encoding name\nconst int kMaxEncodingNameSize = 50;\n\n// The standard name of the default encoding.\nconst char* default_encoding_name();\n\n// The name used for an invalid encoding.\nconst char* invalid_encoding_name();\n\n// EncodingFromName\n// ----------------\n//\n// If enc_name matches the standard name of an Encoding, using a\n// case-insensitive comparison, set *encoding to that Encoding and\n// return true.  Otherwise set *encoding to UNKNOWN_ENCODING and\n// return false.\n//\n// REQUIRES: encoding must not be NULL.\n//\nbool EncodingFromName(const char* enc_name, Encoding *encoding);\n\n//\n// EncodingNameAliasToEncoding\n// ---------------------------\n//\n// If enc_name matches the standard name or an alias of an Encoding,\n// using a case-insensitive comparison, return that\n// Encoding. Otherwise, return UNKNOWN_ENCODING.\n//\n// Aliases include most mime-encoding names (e.g., \"ISO-8859-7\" for\n// GREEK), alternate names (e.g., \"cyrillic\" for ISO_8859_5) and\n// common variations with hyphens and underscores (e.g., \"koi8-u\" and\n// \"koi8u\" for RUSSIAN_KOI8_R).\n\nEncoding EncodingNameAliasToEncoding(const char *enc_name);\n\n// *************************************************************\n// Miscellany\n// *************************************************************\n\n// PreferredWebOutputEncoding\n// --------------------------\n//\n// Some multi-byte encodings use byte values that coincide with the\n// ASCII codes for HTML syntax characters <>\"&' and browsers like MSIE\n// can misinterpret these, as indicated in an external XSS report from\n// 2007-02-15. Here, we map these dangerous encodings to safer ones. We\n// also use UTF8 instead of encodings that we don't support in our\n// output, and we generally try to be conservative in what we send out.\n// Where the client asks for single- or double-byte encodings that are\n// not as common, we substitute a more common single- or double-byte\n// encoding, if there is one, thereby preserving the client's intent\n// to use less space than UTF-8. This also means that characters\n// outside the destination set will be converted to HTML NCRs (&#NNN;)\n// if requested.\nEncoding PreferredWebOutputEncoding(Encoding enc);\n\n\n#endif  // UTIL_ENCODINGS_ENCODINGS_H_\n"
  },
  {
    "path": "third_party/ced/util/encodings/encodings.pb.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef UTIL_ENCODINGS_ENCODINGS_PB_H_\n#define UTIL_ENCODINGS_ENCODINGS_PB_H_\n\nenum Encoding {\n  ISO_8859_1           =  0,  // Teragram ASCII\n  ISO_8859_2           =  1,  // Teragram Latin2\n  ISO_8859_3           =  2,  // in BasisTech but not in Teragram\n  ISO_8859_4           =  3,  // Teragram Latin4\n  ISO_8859_5           =  4,  // Teragram ISO-8859-5\n  ISO_8859_6           =  5,  // Teragram Arabic\n  ISO_8859_7           =  6,  // Teragram Greek\n  ISO_8859_8           =  7,  // Teragram Hebrew\n  ISO_8859_9           =  8,  // in BasisTech but not in Teragram\n  ISO_8859_10          =  9,  // in BasisTech but not in Teragram\n  JAPANESE_EUC_JP      = 10,  // Teragram EUC_JP\n  JAPANESE_SHIFT_JIS   = 11,  // Teragram SJS\n  JAPANESE_JIS         = 12,  // Teragram JIS\n  CHINESE_BIG5         = 13,  // Teragram BIG5\n  CHINESE_GB           = 14,  // Teragram GB\n  CHINESE_EUC_CN       = 15,  // Misnamed. Should be EUC_TW. Was Basis Tech\n                              // CNS11643EUC, before that Teragram EUC-CN(!)\n                              // See //i18n/basistech/basistech_encodings.h\n  KOREAN_EUC_KR        = 16,  // Teragram KSC\n  UNICODE              = 17,  // Teragram Unicode\n  CHINESE_EUC_DEC      = 18,  // Misnamed. Should be EUC_TW. Was Basis Tech\n                              // CNS11643EUC, before that Teragram EUC.\n  CHINESE_CNS          = 19,  // Misnamed. Should be EUC_TW. Was Basis Tech\n                              // CNS11643EUC, before that Teragram CNS.\n  CHINESE_BIG5_CP950   = 20,  // Teragram BIG5_CP950\n  JAPANESE_CP932       = 21,  // Teragram CP932\n  UTF8                 = 22,\n  UNKNOWN_ENCODING     = 23,\n  ASCII_7BIT           = 24,  // ISO_8859_1 with all characters <= 127.\n                              // Should be present only in the crawler\n                              // and in the repository,\n                              // *never* as a result of Document::encoding().\n  RUSSIAN_KOI8_R       = 25,  // Teragram KOI8R\n  RUSSIAN_CP1251       = 26,  // Teragram CP1251\n\n  //----------------------------------------------------------\n  // These are _not_ output from teragram. Instead, they are as\n  // detected in the headers of usenet articles.\n  MSFT_CP1252          = 27,  // 27: CP1252 aka MSFT euro ascii\n  RUSSIAN_KOI8_RU      = 28,  // CP21866 aka KOI8-U, used for Ukrainian.\n                              // Misnamed, this is _not_ KOI8-RU but KOI8-U.\n                              // KOI8-U is used much more often than KOI8-RU.\n  MSFT_CP1250          = 29,  // CP1250 aka MSFT eastern european\n  ISO_8859_15          = 30,  // aka ISO_8859_0 aka ISO_8859_1 euroized\n  //----------------------------------------------------------\n\n  //----------------------------------------------------------\n  // These are in BasisTech but not in Teragram. They are\n  // needed for new interface languages. Now detected by\n  // research langid\n  MSFT_CP1254          = 31,  // used for Turkish\n  MSFT_CP1257          = 32,  // used in Baltic countries\n  //----------------------------------------------------------\n\n  //----------------------------------------------------------\n  //----------------------------------------------------------\n  // New encodings detected by Teragram\n  ISO_8859_11          = 33,  // aka TIS-620, used for Thai\n  MSFT_CP874           = 34,  // used for Thai\n  MSFT_CP1256          = 35,  // used for Arabic\n\n  //----------------------------------------------------------\n  // Detected as ISO_8859_8 by Teragram, but can be found in META tags\n  MSFT_CP1255          = 36,  // Logical Hebrew Microsoft\n  ISO_8859_8_I         = 37,  // Iso Hebrew Logical\n  HEBREW_VISUAL        = 38,  // Iso Hebrew Visual\n  //----------------------------------------------------------\n\n  //----------------------------------------------------------\n  // Detected by research langid\n  CZECH_CP852          = 39,\n  CZECH_CSN_369103     = 40,  // aka ISO_IR_139 aka KOI8_CS\n  MSFT_CP1253          = 41,  // used for Greek\n  RUSSIAN_CP866        = 42,\n  //----------------------------------------------------------\n\n  //----------------------------------------------------------\n  // Handled by iconv in glibc\n  ISO_8859_13          = 43,\n  ISO_2022_KR          = 44,\n  GBK                  = 45,\n  GB18030              = 46,\n  BIG5_HKSCS           = 47,\n  ISO_2022_CN          = 48,\n\n  //-----------------------------------------------------------\n  // Detected by xin liu's detector\n  // Handled by transcoder\n  // (Indic encodings)\n\n  TSCII                = 49,\n  TAMIL_MONO           = 50,\n  TAMIL_BI             = 51,\n  JAGRAN               = 52,\n\n\n  MACINTOSH_ROMAN      = 53,\n  UTF7                 = 54,\n  BHASKAR              = 55,  // Indic encoding - Devanagari\n  HTCHANAKYA           = 56,  // 56 Indic encoding - Devanagari\n\n  //-----------------------------------------------------------\n  // These allow a single place (inputconverter and outputconverter)\n  // to do UTF-16 <==> UTF-8 bulk conversions and UTF-32 <==> UTF-8\n  // bulk conversions, with interchange-valid checking on input and\n  // fallback if needed on ouput.\n  UTF16BE              = 57,  // big-endian UTF-16\n  UTF16LE              = 58,  // little-endian UTF-16\n  UTF32BE              = 59,  // big-endian UTF-32\n  UTF32LE              = 60,  // little-endian UTF-32\n  //-----------------------------------------------------------\n\n  //-----------------------------------------------------------\n  // An encoding that means \"This is not text, but it may have some\n  // simple ASCII text embedded\". Intended input conversion (not yet\n  // implemented) is to keep strings of >=4 seven-bit ASCII characters\n  // (follow each kept string with an ASCII space), delete the rest of\n  // the bytes. This will pick up and allow indexing of e.g. captions\n  // in JPEGs. No output conversion needed.\n  BINARYENC            = 61,\n  //-----------------------------------------------------------\n\n  //-----------------------------------------------------------\n  // Some Web pages allow a mixture of HZ-GB and GB-2312 by using\n  // ~{ ... ~} for 2-byte pairs, and the browsers support this.\n  HZ_GB_2312           = 62,\n  //-----------------------------------------------------------\n\n  //-----------------------------------------------------------\n  // Some external vendors make the common input error of\n  // converting MSFT_CP1252 to UTF8 *twice*. No output conversion needed.\n  UTF8UTF8             = 63,\n  //-----------------------------------------------------------\n\n  //-----------------------------------------------------------\n  // Handled by transcoder for tamil language specific font\n  // encodings without the support for detection at present.\n  TAM_ELANGO           = 64,  // Elango - Tamil\n  TAM_LTTMBARANI       = 65,  // Barani - Tamil\n  TAM_SHREE            = 66,  // Shree - Tamil\n  TAM_TBOOMIS          = 67,  // TBoomis - Tamil\n  TAM_TMNEWS           = 68,  // TMNews - Tamil\n  TAM_WEBTAMIL         = 69,  // Webtamil - Tamil\n  //-----------------------------------------------------------\n\n  //-----------------------------------------------------------\n  // Shift_JIS variants used by Japanese cell phone carriers.\n  KDDI_SHIFT_JIS       = 70,\n  DOCOMO_SHIFT_JIS     = 71,\n  SOFTBANK_SHIFT_JIS   = 72,\n  // ISO-2022-JP variants used by KDDI and SoftBank.\n  KDDI_ISO_2022_JP     = 73,\n  SOFTBANK_ISO_2022_JP = 74,\n  //-----------------------------------------------------------\n\n  NUM_ENCODINGS        = 75,  // Always keep this at the end. It is not a\n                              // valid Encoding enum, it is only used to\n                              // indicate the total number of Encodings.\n};\n\n#endif  // UTIL_ENCODINGS_ENCODINGS_PB_H_\n"
  },
  {
    "path": "third_party/ced/util/encodings/encodings_unittest.cc",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include \"util/encodings/encodings.h\"\n\n#include \"gtest/gtest.h\"\n\nTEST(EncodingsTest, EncodingNameAliasToEncoding) {\n  // Test that cases, non-alpha-numeric chars are ignored.\n  EXPECT_EQ(ISO_8859_1, EncodingNameAliasToEncoding(\"iso_8859_1\"));\n  EXPECT_EQ(ISO_8859_1, EncodingNameAliasToEncoding(\"iso-8859-1\"));\n\n  // Test that spaces are ignored.\n  EXPECT_EQ(UTF8, EncodingNameAliasToEncoding(\"UTF8\"));\n  EXPECT_EQ(UTF8, EncodingNameAliasToEncoding(\"UTF 8\"));\n  EXPECT_EQ(UTF8, EncodingNameAliasToEncoding(\"UTF-8\"));\n\n  // Test alphanumeric differences are counted.\n  EXPECT_NE(UTF8, EncodingNameAliasToEncoding(\"UTF-7\"));\n  EXPECT_NE(KOREAN_EUC_KR, EncodingNameAliasToEncoding(\"euc-jp\"));\n}\n"
  },
  {
    "path": "third_party/ced/util/languages/languages.cc",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#include \"util/languages/languages.h\"\n\n#include \"util/basictypes.h\"\n#include \"util/string_util.h\"\n\n\nLanguage default_language() {return ENGLISH;}\n\n\n// Language names and codes\n\nstruct LanguageInfo {\n  const char * language_name_;\n  const char * language_code_639_1_;   // the ISO-639-1 code for the language\n  const char * language_code_639_2_;   // the ISO-639-2 code for the language\n  const char * language_code_other_;   // some nonstandard code for the language\n};\n\nstatic const LanguageInfo kLanguageInfoTable[] = {\n  { \"ENGLISH\",             \"en\", \"eng\", NULL},\n  { \"DANISH\",              \"da\", \"dan\", NULL},\n  { \"DUTCH\",               \"nl\", \"dut\", NULL},\n  { \"FINNISH\",             \"fi\", \"fin\", NULL},\n  { \"FRENCH\",              \"fr\", \"fre\", NULL},\n  { \"GERMAN\",              \"de\", \"ger\", NULL},\n  { \"HEBREW\",              \"he\", \"heb\", NULL},\n  { \"ITALIAN\",             \"it\", \"ita\", NULL},\n  { \"Japanese\",            \"ja\", \"jpn\", NULL},\n  { \"Korean\",              \"ko\", \"kor\", NULL},\n  { \"NORWEGIAN\",           \"nb\", \"nor\", NULL},\n  { \"POLISH\",              \"pl\", \"pol\", NULL},\n  { \"PORTUGUESE\",          \"pt\", \"por\", NULL},\n  { \"RUSSIAN\",             \"ru\", \"rus\", NULL},\n  { \"SPANISH\",             \"es\", \"spa\", NULL},\n  { \"SWEDISH\",             \"sv\", \"swe\", NULL},\n  { \"Chinese\",             \"zh\", \"chi\", \"zh-CN\"},\n  { \"CZECH\",               \"cs\", \"cze\", NULL},\n  { \"GREEK\",               \"el\", \"gre\", NULL},\n  { \"ICELANDIC\",           \"is\", \"ice\", NULL},\n  { \"LATVIAN\",             \"lv\", \"lav\", NULL},\n  { \"LITHUANIAN\",          \"lt\", \"lit\", NULL},\n  { \"ROMANIAN\",            \"ro\", \"rum\", NULL},\n  { \"HUNGARIAN\",           \"hu\", \"hun\", NULL},\n  { \"ESTONIAN\",            \"et\", \"est\", NULL},\n  // TODO: Although Teragram has two output names \"TG_UNKNOWN_LANGUAGE\"\n  // and \"Unknown\", they are essentially the same. Need to unify them.\n  // \"un\" and \"ut\" are invented by us, not from ISO-639.\n  //\n  { \"TG_UNKNOWN_LANGUAGE\", NULL, NULL, \"ut\"},\n  { \"Unknown\",             NULL, NULL, \"un\"},\n  { \"BULGARIAN\",           \"bg\", \"bul\", NULL},\n  { \"CROATIAN\",            \"hr\", \"scr\", NULL},\n  { \"SERBIAN\",             \"sr\", \"scc\", NULL},\n  { \"IRISH\",               \"ga\", \"gle\", NULL},\n  { \"GALICIAN\",            \"gl\", \"glg\", NULL},\n  // Impossible to tell Tagalog from Filipino at the moment.\n  // Use ISO 639-2 code for Filipino here.\n  { \"TAGALOG\",             NULL, \"fil\", NULL},\n  { \"TURKISH\",             \"tr\", \"tur\", NULL},\n  { \"UKRAINIAN\",           \"uk\", \"ukr\", NULL},\n  { \"HINDI\",               \"hi\", \"hin\", NULL},\n  { \"MACEDONIAN\",          \"mk\", \"mac\", NULL},\n  { \"BENGALI\",             \"bn\", \"ben\", NULL},\n  { \"INDONESIAN\",          \"id\", \"ind\", NULL},\n  { \"LATIN\",               \"la\", \"lat\", NULL},\n  { \"MALAY\",               \"ms\", \"may\", NULL},\n  { \"MALAYALAM\",           \"ml\", \"mal\", NULL},\n  { \"WELSH\",               \"cy\", \"wel\", NULL},\n  { \"NEPALI\",              \"ne\", \"nep\", NULL},\n  { \"TELUGU\",              \"te\", \"tel\", NULL},\n  { \"ALBANIAN\",            \"sq\", \"alb\", NULL},\n  { \"TAMIL\",               \"ta\", \"tam\", NULL},\n  { \"BELARUSIAN\",          \"be\", \"bel\", NULL},\n  { \"JAVANESE\",            \"jw\", \"jav\", NULL},\n  { \"OCCITAN\",             \"oc\", \"oci\", NULL},\n  { \"URDU\",                \"ur\", \"urd\", NULL},\n  { \"BIHARI\",              \"bh\", \"bih\", NULL},\n  { \"GUJARATI\",            \"gu\", \"guj\", NULL},\n  { \"THAI\",                \"th\", \"tha\", NULL},\n  { \"ARABIC\",              \"ar\", \"ara\", NULL},\n  { \"CATALAN\",             \"ca\", \"cat\", NULL},\n  { \"ESPERANTO\",           \"eo\", \"epo\", NULL},\n  { \"BASQUE\",              \"eu\", \"baq\", NULL},\n  { \"INTERLINGUA\",         \"ia\", \"ina\", NULL},\n  { \"KANNADA\",             \"kn\", \"kan\", NULL},\n  { \"PUNJABI\",             \"pa\", \"pan\", NULL},\n  { \"SCOTS_GAELIC\",        \"gd\", \"gla\", NULL},\n  { \"SWAHILI\",             \"sw\", \"swa\", NULL},\n  { \"SLOVENIAN\",           \"sl\", \"slv\", NULL},\n  { \"MARATHI\",             \"mr\", \"mar\", NULL},\n  { \"MALTESE\",             \"mt\", \"mlt\", NULL},\n  { \"VIETNAMESE\",          \"vi\", \"vie\", NULL},\n  { \"FRISIAN\",             \"fy\", \"fry\", NULL},\n  { \"SLOVAK\",              \"sk\", \"slo\", NULL},\n  { \"ChineseT\",\n    NULL,  NULL,  // We intentionally set these 2 fields to NULL to avoid\n                  // confusion between CHINESE_T and CHINESE.\n    \"zh-TW\"},\n  { \"FAROESE\",             \"fo\", \"fao\", NULL},\n  { \"SUNDANESE\",           \"su\", \"sun\", NULL},\n  { \"UZBEK\",               \"uz\", \"uzb\", NULL},\n  { \"AMHARIC\",             \"am\", \"amh\", NULL},\n  { \"AZERBAIJANI\",         \"az\", \"aze\", NULL},\n  { \"GEORGIAN\",            \"ka\", \"geo\", NULL},\n  { \"TIGRINYA\",            \"ti\", \"tir\", NULL},\n  { \"PERSIAN\",             \"fa\", \"per\", NULL},\n  { \"BOSNIAN\",             \"bs\", \"bos\", NULL},\n  { \"SINHALESE\",           \"si\", \"sin\", NULL},\n  { \"NORWEGIAN_N\",         \"nn\", \"nno\", NULL},\n  { \"PORTUGUESE_P\",        NULL, NULL, \"pt-PT\"},\n  { \"PORTUGUESE_B\",        NULL, NULL, \"pt-BR\"},\n  { \"XHOSA\",               \"xh\", \"xho\", NULL},\n  { \"ZULU\",                \"zu\", \"zul\", NULL},\n  { \"GUARANI\",             \"gn\", \"grn\", NULL},\n  { \"SESOTHO\",             \"st\", \"sot\", NULL},\n  { \"TURKMEN\",             \"tk\", \"tuk\", NULL},\n  { \"KYRGYZ\",              \"ky\", \"kir\", NULL},\n  { \"BRETON\",              \"br\", \"bre\", NULL},\n  { \"TWI\",                 \"tw\", \"twi\", NULL},\n  { \"YIDDISH\",             \"yi\", \"yid\", NULL},\n  { \"SERBO_CROATIAN\",      \"sh\", NULL, NULL},\n  { \"SOMALI\",              \"so\", \"som\", NULL},\n  { \"UIGHUR\",              \"ug\", \"uig\", NULL},\n  { \"KURDISH\",             \"ku\", \"kur\", NULL},\n  { \"MONGOLIAN\",           \"mn\", \"mon\", NULL},\n  { \"ARMENIAN\",            \"hy\", \"arm\", NULL},\n  { \"LAOTHIAN\",            \"lo\", \"lao\", NULL},\n  { \"SINDHI\",              \"sd\", \"snd\", NULL},\n  { \"RHAETO_ROMANCE\",      \"rm\", \"roh\", NULL},\n  { \"AFRIKAANS\",           \"af\", \"afr\", NULL},\n  { \"LUXEMBOURGISH\",       \"lb\", \"ltz\", NULL},\n  { \"BURMESE\",             \"my\", \"bur\", NULL},\n  // KHMER is known as Cambodian for Google user interfaces.\n  { \"KHMER\",               \"km\", \"khm\", NULL},\n  { \"TIBETAN\",             \"bo\", \"tib\", NULL},\n  { \"DHIVEHI\",             \"dv\", \"div\", NULL},\n  { \"CHEROKEE\",            NULL, \"chr\", NULL},\n  { \"SYRIAC\",              NULL, \"syr\", NULL},\n  { \"LIMBU\",               NULL, NULL, \"sit-NP\"},\n  { \"ORIYA\",               \"or\", \"ori\", NULL},\n  { \"ASSAMESE\",            \"as\", \"asm\", NULL},\n  { \"CORSICAN\",            \"co\", \"cos\", NULL},\n  { \"INTERLINGUE\",         \"ie\", \"ine\", NULL},\n  { \"KAZAKH\",              \"kk\", \"kaz\", NULL},\n  { \"LINGALA\",             \"ln\", \"lin\", NULL},\n  { \"MOLDAVIAN\",           \"mo\", \"mol\", NULL},\n  { \"PASHTO\",              \"ps\", \"pus\", NULL},\n  { \"QUECHUA\",             \"qu\", \"que\", NULL},\n  { \"SHONA\",               \"sn\", \"sna\", NULL},\n  { \"TAJIK\",               \"tg\", \"tgk\", NULL},\n  { \"TATAR\",               \"tt\", \"tat\", NULL},\n  { \"TONGA\",               \"to\", \"tog\", NULL},\n  { \"YORUBA\",              \"yo\", \"yor\", NULL},\n  { \"CREOLES_AND_PIDGINS_ENGLISH_BASED\", NULL, \"cpe\", NULL},\n  { \"CREOLES_AND_PIDGINS_FRENCH_BASED\",  NULL, \"cpf\", NULL},\n  { \"CREOLES_AND_PIDGINS_PORTUGUESE_BASED\", NULL, \"cpp\", NULL},\n  { \"CREOLES_AND_PIDGINS_OTHER\", NULL, \"crp\", NULL},\n  { \"MAORI\",               \"mi\", \"mao\", NULL},\n  { \"WOLOF\",               \"wo\", \"wol\", NULL},\n  { \"ABKHAZIAN\",           \"ab\", \"abk\", NULL},\n  { \"AFAR\",                \"aa\", \"aar\", NULL},\n  { \"AYMARA\",              \"ay\", \"aym\", NULL},\n  { \"BASHKIR\",             \"ba\", \"bak\", NULL},\n  { \"BISLAMA\",             \"bi\", \"bis\", NULL},\n  { \"DZONGKHA\",            \"dz\", \"dzo\", NULL},\n  { \"FIJIAN\",              \"fj\", \"fij\", NULL},\n  { \"GREENLANDIC\",         \"kl\", \"kal\", NULL},\n  { \"HAUSA\",               \"ha\", \"hau\", NULL},\n  { \"HAITIAN_CREOLE\",       \"ht\", NULL, NULL},\n  { \"INUPIAK\",             \"ik\", \"ipk\", NULL},\n  { \"INUKTITUT\",           \"iu\", \"iku\", NULL},\n  { \"KASHMIRI\",            \"ks\", \"kas\", NULL},\n  { \"KINYARWANDA\",         \"rw\", \"kin\", NULL},\n  { \"MALAGASY\",            \"mg\", \"mlg\", NULL},\n  { \"NAURU\",               \"na\", \"nau\", NULL},\n  { \"OROMO\",               \"om\", \"orm\", NULL},\n  { \"RUNDI\",               \"rn\", \"run\", NULL},\n  { \"SAMOAN\",              \"sm\", \"smo\", NULL},\n  { \"SANGO\",               \"sg\", \"sag\", NULL},\n  { \"SANSKRIT\",            \"sa\", \"san\", NULL},\n  { \"SISWANT\",             \"ss\", \"ssw\", NULL},\n  { \"TSONGA\",              \"ts\", \"tso\", NULL},\n  { \"TSWANA\",              \"tn\", \"tsn\", NULL},\n  { \"VOLAPUK\",             \"vo\", \"vol\", NULL},\n  { \"ZHUANG\",              \"za\", \"zha\", NULL},\n  { \"KHASI\",               NULL, \"kha\", NULL},\n  { \"SCOTS\",               NULL, \"sco\", NULL},\n  { \"GANDA\",               \"lg\", \"lug\", NULL},\n  { \"MANX\",                \"gv\", \"glv\", NULL},\n  { \"MONTENEGRIN\",         NULL, NULL, \"sr-ME\"},\n  { \"XX\",                  NULL, NULL, \"XX\"},\n};\n\nCOMPILE_ASSERT(arraysize(kLanguageInfoTable) == NUM_LANGUAGES + 1,\n               kLanguageInfoTable_has_incorrect_length);\n\n\n// LANGUAGE NAMES\n\nconst char* default_language_name() {\n  return kLanguageInfoTable[ENGLISH].language_name_;\n}\n\nstatic const char* const kInvalidLanguageName = \"invalid_language\";\n\nconst char *invalid_language_name() {\n  return kInvalidLanguageName;\n}\n\nconst char* LanguageName(Language lang) {\n  return IsValidLanguage(lang)\n      ? kLanguageInfoTable[lang].language_name_\n      : kInvalidLanguageName;\n}\n\n\n\n// LANGUAGE CODES\n\n\n// The space before invalid_language_code is intentional. It is used\n// to prevent it matching any two letter language code.\n//\nstatic const char* const kInvalidLanguageCode = \" invalid_language_code\";\n\nconst char *invalid_language_code() {\n  return kInvalidLanguageCode;\n}\n\nconst char * LanguageCode(Language lang) {\n  if (! IsValidLanguage(lang))\n    return kInvalidLanguageCode;\n  const LanguageInfo& info = kLanguageInfoTable[lang];\n  if (info.language_code_639_1_) {\n    return info.language_code_639_1_;\n  } else if (info.language_code_639_2_) {\n    return info.language_code_639_2_;\n  } else if (info.language_code_other_) {\n    return info.language_code_other_;\n  } else {\n    return kInvalidLanguageCode;\n  }\n}\n\nconst char* default_language_code() {\n  return kLanguageInfoTable[ENGLISH].language_code_639_1_;\n}\n\nconst char* LanguageCodeISO639_1(Language lang) {\n  if (! IsValidLanguage(lang))\n    return kInvalidLanguageCode;\n  if (const char* code = kLanguageInfoTable[lang].language_code_639_1_)\n    return code;\n  return kInvalidLanguageCode;\n}\n\nconst char* LanguageCodeISO639_2(Language lang) {\n  if (! IsValidLanguage(lang))\n    return kInvalidLanguageCode;\n  if (const char* code = kLanguageInfoTable[lang].language_code_639_2_)\n    return code;\n  return kInvalidLanguageCode;\n}\n\nconst char* LanguageCodeWithDialects(Language lang) {\n  if (lang == CHINESE)\n    return \"zh-CN\";\n  return LanguageCode(lang);\n}\n\n\n\nbool LanguageFromCode(const char* lang_code, Language *language) {\n  *language = UNKNOWN_LANGUAGE;\n  if ( lang_code == NULL ) return false;\n\n  for ( int i = 0 ; i < kNumLanguages ; i++ ) {\n    const LanguageInfo& info = kLanguageInfoTable[i];\n    if ((info.language_code_639_1_ &&\n         !base::strcasecmp(lang_code, info.language_code_639_1_)) ||\n        (info.language_code_639_2_ &&\n         !base::strcasecmp(lang_code, info.language_code_639_2_)) ||\n        (info.language_code_other_ &&\n         !base::strcasecmp(lang_code, info.language_code_other_))) {\n      *language = static_cast<Language>(i);\n      return true;\n    }\n  }\n\n  // For convenience, this function can also parse the non-standard\n  // five-letter language codes \"zh-cn\" and \"zh-tw\" which are used by\n  // front-ends such as GWS to distinguish Simplified from Traditional\n  // Chinese.\n  if (!base::strcasecmp(lang_code, \"zh-cn\") ||\n      !base::strcasecmp(lang_code, \"zh_cn\")) {\n    *language = CHINESE;\n    return true;\n  }\n  if (!base::strcasecmp(lang_code, \"zh-tw\") ||\n      !base::strcasecmp(lang_code, \"zh_tw\")) {\n    *language = CHINESE_T;\n    return true;\n  }\n  if (!base::strcasecmp(lang_code, \"sr-me\") ||\n      !base::strcasecmp(lang_code, \"sr_me\")) {\n    *language = MONTENEGRIN;\n    return true;\n  }\n\n  // Process language-code synonyms.\n  if (!base::strcasecmp(lang_code, \"he\")) {\n    *language = HEBREW;  // Use \"iw\".\n    return true;\n  }\n  if (!base::strcasecmp(lang_code, \"in\")) {\n    *language = INDONESIAN;  // Use \"id\".\n    return true;\n  }\n  if (!base::strcasecmp(lang_code, \"ji\")) {\n    *language = YIDDISH;  // Use \"yi\".\n    return true;\n  }\n\n  // Process language-detection synonyms.\n  // These distinct languages cannot be differentiated by our current\n  // language-detection algorithms.\n  if (!base::strcasecmp(lang_code, \"fil\")) {\n    *language = TAGALOG;\n    return true;\n  }\n\n  return false;\n}\n"
  },
  {
    "path": "third_party/ced/util/languages/languages.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef UTIL_LANGUAGES_LANGUAGES_H_\n#define UTIL_LANGUAGES_LANGUAGES_H_\n\n// This interface defines the Language enum and functions that depend\n// only on Language values.\n\n// A hash-function for Language, hash<Language>, is defined in\n// i18n/languages/public/languages-hash.h\n\n#ifndef SWIG\n// Language enum defined in languages.proto\n// Also description on how to add languages.\n#include \"util/languages/languages.pb.h\"\n\n#else\n\n// TODO: Include a header containing swig-compatible enum.\n\n#endif\n\nconst int kNumLanguages = NUM_LANGUAGES;\n\n// Return the default language (ENGLISH).\nLanguage default_language();\n\n\n// *******************************************\n// Language predicates\n//   IsValidLanguage()\n//   IS_LANGUAGE_UNKNOWN()\n//   IsCJKLanguage()\n//   IsChineseLanguage()\n//   IsNorwegianLanguage()\n//   IsPortugueseLanguage()\n//   IsRightToLeftLanguage()\n//   IsMaybeRightToLeftLanguage()\n//   IsSameLanguage()\n//   IsScriptRequiringLongerSnippets()\n// *******************************************\n\n// IsValidLanguage\n// ===============\n//\n// Function to check if the input is within range of the Language enum. If\n// IsValidLanguage(lang) returns true, it is safe to call\n// static_cast<Language>(lang).\n//\ninline bool IsValidLanguage(int lang) {\n  return ((lang >= 0) && (lang < kNumLanguages));\n}\n\n// Return true if the language is \"unknown\". (This function was\n// previously a macro, hence the spelling in all caps.)\n//\ninline bool IS_LANGUAGE_UNKNOWN(Language lang) {\n  return lang == TG_UNKNOWN_LANGUAGE || lang == UNKNOWN_LANGUAGE;\n}\n\n// IsCJKLanguage\n// -------------\n//\n// This function returns true if the language is either Chinese\n// (simplified or traditional), Japanese, or Korean.\nbool IsCJKLanguage(Language lang);\n\n// IsChineseLanguage\n// -----------------\n//\n// This function returns true if the language is either Chinese\n// (simplified or traditional)\nbool IsChineseLanguage(Language lang);\n\n// IsNorwegianLanguage\n// --------------------\n//\n// This function returns true if the language is any of the Norwegian\n// (regular or Nynorsk).\nbool IsNorwegianLanguage(Language lang);\n\n// IsPortugueseLanguage\n// --------------------\n//\n// This function returns true if the language is any of the Portuguese\n// languages (regular, Portugal or Brazil)\nbool IsPortugueseLanguage(Language lang);\n\n// IsSameLanguage\n// --------------\n//\n// WARNING: This function provides only a simple test on the values of\n// the two Language arguments. It returns false if either language is\n// invalid. It returns true if the language arguments are equal, or\n// if they are both Chinese languages, both Norwegian languages, or\n// both Portuguese languages, as defined by IsChineseLanguage,\n// IsNorwegianLanguage, and IsPortugueseLanguage. Otherwise it returns\n// false.\nbool IsSameLanguage(Language lang1, Language lang2);\n\n\n// IsRightToLeftLanguage\n// ---------------------\n//\n// This function returns true if the language is only written right-to-left\n// (E.g., Hebrew, Arabic, Persian etc.)\n//\n// IMPORTANT NOTE: Technically we're talking about scripts, not languages.\n// There are languages that can be written in more than one script.\n// Examples:\n//   - Kurdish and Azeri ('AZERBAIJANI') can be written left-to-right in\n//     Latin or Cyrillic script, and right-to-left in Arabic script.\n//   - Sindhi and Punjabi are written in different scripts, depending on\n//     region and dialect.\n//   - Turkmen used an Arabic script historically, but not any more.\n//   - Pashto and Uyghur can use Arabic script, but use a Roman script\n//     on the Internet.\n//   - Kashmiri and Urdu are written either with Arabic or Devanagari script.\n//\n// This function only returns true for languages that are always, unequivocally\n// written in right-to-left script.\n//\n// TODO: If we want to do anything special with multi-script languages\n// we should create new 'languages' for each language+script, as we do for\n// traditional vs. simplified Chinese. However most such languages are rare in\n// use and even rarer on the web, so this is unlikely to be something we'll\n// be concerned with for a while.\nbool IsRightToLeftLanguage(Language lang);\n\n// IsMaybeRightToLeftLanguage\n// --------------------------\n//\n// This function returns true if the language may appear on the web in a\n// right-to-left script (E.g., Hebrew, Arabic, Persian, Urdu, Kurdish, etc.)\n//\n// NOTE: See important notes under IsRightToLeftLanguage(...).\n//\n// This function returns true for languages that *may* appear on the web in a\n// right-to-left script, even if they may also appear in a left-to-right\n// script.\n//\n// This function should typically be used in cases where doing some work on\n// left-to-right text would be OK (usually a no-op), and this function is used\n// just to cut down on unnecessary work on regular, LTR text.\nbool IsMaybeRightToLeftLanguage(Language lang);\n\n// IsScriptRequiringLongerSnippets\n// --------------------\n//\n// This function returns true if the script chracteristics require longer\n// snippet length (Devanagari, Bengali, Gurmukhi,\n// Gujarati, Oriya, Tamil, Telugu, Kannada, Malayalam).\n// COMMENTED OUT TO REDUCE DEPENDENCIES ON GOOGLE3 CODE\n// bool IsScriptRequiringLongerSnippets(UnicodeScript script);\n\n\n// *******************************************\n// LANGUAGE NAMES\n//\n// This interface defines a standard name for each valid Language,\n// and a standard name for invalid languages. Some language names use all\n// uppercase letters, but others use mixed case.\n//   LanguageName() [Language to name]\n//   LanguageEnumName() [language to enum name]\n//   LanguageFromName() [name to Language]\n//   default_language_name()\n//   invalid_language_name()\n// *******************************************\n\n// Given a Language, returns its standard name.\n// Return invalid_language_name() if the language is invalid.\nconst char* LanguageName(Language lang);\n\n// Given a Language, return the name of the enum constant for that\n// language. In all but a few cases, this is the same as its standard\n// name. For example, LanguageName(CHINESE) returns \"Chinese\", but\n// LanguageEnumName(CHINESE) returns \"CHINESE\". This is intended for\n// code that is generating C++ code, where the enum constant is more\n// useful than its integer value.  Return \"NUM_LANGUAGES\" if\n// the language is invalid.\nconst char* LanguageEnumName(Language lang);\n\n// The maximum length of a standard language name.\nconst int kMaxLanguageNameSize = 50;\n\n// The standard name for the default language.\nconst char* default_language_name();\n\n// The standard name for all invalid languages.\nconst char* invalid_language_name();\n\n// If lang_name matches the standard name of a Language, using a\n// case-insensitive comparison, set *language to that Language and\n// return true.\n// Otherwise, set *language to UNKNOWN_LANGUAGE and return false.\n//\n// For backwards compatibility, \"HATIAN_CREOLE\" is allowed as a name\n// for HAITIAN_CREOLE, and \"QUECHAU\" is allowed as a name for QUECHUA.\n// For compatibility with LanguageEnumName, \"UNKNOWN_LANGUAGE\" is allowed\n// as a name for UNKNOWN_LANGUAGE (the return value is true in this case,\n// as it is for \"Unknown\"), and \"CHINESE_T\" is allowed as a name for\n// CHINESE_T (i.e., a synonym for \"ChineseT\").\n//\n// REQUIRES: language must not be NULL.\n//\nbool LanguageFromName(const char* lang_name, Language *language);\n\n\n\n// *******************************************\n// LANGUAGE CODES\n//\n// This interface defines a standard code for each valid language, and\n// a standard code for invalid languages. These are derived from ISO codes,\n// with some Google additions.\n//   LanguageCode()\n//   default_language_code()\n//   invalid_language_code()\n//   LanguageCodeWithDialects()\n//   LanguageCodeISO639_1()\n//   LanguageCodeISO639_2()\n// *******************************************\n\n// Given a Language, return its standard code. There are Google-specific codes:\n//     For CHINESE_T, return \"zh-TW\".\n//     For TG_UNKNOWN_LANGUAGE, return \"ut\".\n//     For UNKNOWN_LANGUAGE, return \"un\".\n//     For PORTUGUESE_P, return \"pt-PT\".\n//     For PORTUGUESE_B, return \"pt-BR\".\n//     For LIMBU, return \"sit-NP\".\n//     For CHEROKEE, return \"chr\".\n//     For SYRIAC, return \"syr\".\n// Otherwise return the ISO 639-1 two-letter language code for lang.\n// If lang is invalid, return invalid_language_code().\n//\n// NOTE: See the note below about the codes for Chinese languages.\n//\nconst char* LanguageCode(Language lang);\n\n// The maximum length of a language code.\nconst int kMaxLanguageCodeSize = 50;\n\n// The standard code for the default language.\nconst char* default_language_code();\n\n// The standard code for all invalid languages.\nconst char* invalid_language_code();\n\n\n// --------------------------------------------\n// NOTE: CHINESE LANGUAGE CODES\n//\n// There are three functions that return codes for Chinese languages.\n// LanguageCode(lang) and LanguageCodeWithDialects(lang) are defined here.\n// LanguageCode(lang, encoding) is defined in i18n/encodings.lang_enc.h.\n// The following list shows the different results.\n//\n// LanguageCode(CHINESE) returns \"zh\"\n// LanguageCode(CHINESE_T) returns \"zh-TW\".\n//\n// LanguageCodeWithDialects(CHINESE) returns \"zh-CN\".\n// LanguageCodeWithDialects(CHINESE_T) returns \"zh-TW\".\n//\n// LanguageCode(CHINESE_T, <any encoding>) returns \"zh-TW\".\n// LanguageCode(CHINESE, CHINESE_BIG5) returns \"zh-TW\".\n// LanguageCode(CHINESE, <any other encoding>) returns \"zh-CN\".\n//\n// --------------------------------------------\n\n// LanguageCodeWithDialects\n// ------------------------\n//\n// If lang is CHINESE, return \"zh-CN\". Otherwise return LanguageCode(lang).\nconst char* LanguageCodeWithDialects(Language lang);\n\n// LanguageCodeISO639_1\n// --------------------\n//\n// Return the ISO 639-1 two-letter language code for lang.\n// Return invalid_language_code() if lang is invalid or does not have\n// an ISO 639-1 two-letter language code.\nconst char* LanguageCodeISO639_1(Language lang);\n\n// LanguageCodeISO639_2\n// --------------------\n//\n// Return the ISO 639-2 three-letter language for lang.\n// Return invalid_language_code() if lang is invalid or does not have\n// an ISO 639-2 three-letter language code.\nconst char* LanguageCodeISO639_2(Language lang);\n\n// LanguageFromCode\n// ----------------\n//\n// If lang_code matches the code for a Language, using a case-insensitive\n// comparison, set *lang to that Language and return true.\n// Otherwise, set *lang to UNKNOWN_LANGUAGE and return false.\n//\n// lang_code can be an ISO 639-1 (two-letter) code, an ISO 639-2\n// (three-letter) code, or a Google-specific code (see LanguageCode).\n//\n// Certain language-code aliases are also allowed:\n//   For \"zh-cn\" and \"zh_cn\", set *lang to CHINESE.\n//   For \"zh-tw\" and \"zh_tw\", set *lang to CHINESE_T.\n//   For \"he\", set *lang to HEBREW.\n//   For \"in\", set *lang to INDONESIAN.\n//   For \"ji\", set *lang to YIDDISH.\n//   For \"fil\", set *lang to TAGALOG.\n//\n// REQUIRES: 'lang' must not be NULL.\nbool LanguageFromCode(const char* lang_code, Language *language);\n\n\n// LanguageFromCodeOrName\n// ----------------------\n//\n// If lang_code_or_name is a language code or a language name.\n// set *language to the corresponding Language and return true.\n// Otherwise set *language to UNKNOWN_LANGUAGE and return false.\n//\nbool LanguageFromCodeOrName(const char* lang_code_or_name,\n                            Language* language);\n\n// LanguageNameFromCode\n// --------------------\n//\n// If language_code is the code for a Language (see LanguageFromCode),\n// return the standard name of that language (see LanguageName).\n// Otherwise return invalid_language_name().\n//\nconst char* LanguageNameFromCode(const char* language_code);\n\n\n// Miscellany\n\n// LanguageCodeToUnderscoreForm\n// ----------------------------\n//\n// Given a language code, convert the dash \"-\" to underscore \"_\".\n//\n// Specifically, if result_length <= strlen(lang_code), set result[0]\n// to '\\0' and return false. Otherwise, copy lang_code to result,\n// converting every dash to an underscore, converting every character\n// before the first dash or underscore to lower case, and converting\n// every character after the first dash or underscore to upper\n// case. If there is no dash or underscore, convert the entire string\n// to lower case.\n//\n// REQUIRES: 'lang_code' must not be NULL. 'result' must not be NULL.\n\nbool LanguageCodeToUnderscoreForm(const char* lang_code,\n                                  char* result,\n                                  int result_length);\n\n//\n// AlwaysPutInExpectedRestrict\n// ---------------------------\n//\n// For Web pages in certain top-level domains, Web Search always\n// applies a \"country restrict\". If 'tld' matches one of those, using\n// a case-SENSITIVE comparison, set *expected_language to the Language\n// most commonly found in that top-level domain and return true.\n// Otherwise, set *expected_language to UNKNOWN_LANGUAGE and return false.\nbool AlwaysPutInExpectedRestrict(const char *tld, Language *expected_language);\n\n\n#endif  // UTIL_LANGUAGES_LANGUAGES_H_\n"
  },
  {
    "path": "third_party/ced/util/languages/languages.pb.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef UTIL_LANGUAGES_LANGUAGES_PB_H_\n#define UTIL_LANGUAGES_LANGUAGES_PB_H_\n\nenum Language {\n  ENGLISH       = 0,\n  DANISH        = 1,\n  DUTCH         = 2,\n  FINNISH       = 3,\n  FRENCH        = 4,\n  GERMAN        = 5,\n  HEBREW        = 6,\n  ITALIAN       = 7,\n  JAPANESE      = 8,\n  KOREAN        = 9,\n  NORWEGIAN     = 10,\n  POLISH        = 11,\n  PORTUGUESE    = 12,\n  RUSSIAN       = 13,\n  SPANISH       = 14,\n  SWEDISH       = 15,\n  CHINESE       = 16,\n  CZECH         = 17,\n  GREEK         = 18,\n  ICELANDIC     = 19,\n  LATVIAN       = 20,\n  LITHUANIAN    = 21,\n  ROMANIAN      = 22,\n  HUNGARIAN     = 23,\n  ESTONIAN      = 24,\n  TG_UNKNOWN_LANGUAGE   = 25,\n  UNKNOWN_LANGUAGE      = 26,\n  BULGARIAN     = 27,\n  CROATIAN      = 28,\n  SERBIAN       = 29,\n  IRISH         = 30,      // UI only.\n  GALICIAN      = 31,\n  TAGALOG       = 32,      // Tagalog (tl) + Filipino (fil),\n  TURKISH       = 33,\n  UKRAINIAN     = 34,\n  HINDI         = 35,\n  MACEDONIAN    = 36,\n  BENGALI       = 37,\n  INDONESIAN    = 38,\n  LATIN         = 39,      // UI only.\n  MALAY         = 40,\n  MALAYALAM     = 41,\n  WELSH         = 42,      // UI only.\n  NEPALI        = 43,\n  TELUGU        = 44,\n  ALBANIAN      = 45,\n  TAMIL         = 46,\n  BELARUSIAN    = 47,\n  JAVANESE      = 48,      // UI only.\n  OCCITAN       = 49,      // UI only.\n  URDU          = 50,\n  BIHARI        = 51,\n  GUJARATI      = 52,\n  THAI          = 53,\n  ARABIC        = 54,\n  CATALAN       = 55,\n  ESPERANTO     = 56,\n  BASQUE        = 57,\n  INTERLINGUA   = 58,      // UI only.\n  KANNADA       = 59,\n  PUNJABI       = 60,\n  SCOTS_GAELIC  = 61,      // UI only.\n  SWAHILI       = 62,\n  SLOVENIAN     = 63,\n  MARATHI       = 64,\n  MALTESE       = 65,\n  VIETNAMESE    = 66,\n  FRISIAN       = 67,      // UI only.\n  SLOVAK        = 68,\n  CHINESE_T     = 69,      // This is added to solve the problem of\n                           // distinguishing Traditional and Simplified\n                           // Chinese when the encoding is UTF8.\n  FAROESE       = 70,      // UI only.\n  SUNDANESE     = 71,      // UI only.\n  UZBEK         = 72,\n  AMHARIC       = 73,\n  AZERBAIJANI   = 74,\n  GEORGIAN      = 75,\n  TIGRINYA      = 76,      // UI only.\n  PERSIAN       = 77,\n  BOSNIAN       = 78,      // UI only. LangId language: CROATIAN (28)\n  SINHALESE     = 79,\n  NORWEGIAN_N   = 80,      // UI only. LangId language: NORWEGIAN (10)\n  PORTUGUESE_P  = 81,      // UI only. LangId language: PORTUGUESE (12)\n  PORTUGUESE_B  = 82,      // UI only. LangId language: PORTUGUESE (12)\n  XHOSA         = 83,      // UI only.\n  ZULU          = 84,      // UI only.\n  GUARANI       = 85,\n  SESOTHO       = 86,      // UI only.\n  TURKMEN       = 87,      // UI only.\n  KYRGYZ        = 88,\n  BRETON        = 89,      // UI only.\n  TWI           = 90,      // UI only.\n  YIDDISH       = 91,      // UI only.\n  SERBO_CROATIAN= 92,      // UI only. LangId language: SERBIAN (29)\n  SOMALI        = 93,      // UI only.\n  UIGHUR        = 94,\n  KURDISH       = 95,\n  MONGOLIAN     = 96,\n  ARMENIAN      = 97,\n  LAOTHIAN      = 98,\n  SINDHI        = 99,\n  RHAETO_ROMANCE= 100,     // UI only.\n  AFRIKAANS     = 101,\n  LUXEMBOURGISH = 102,     // UI only.\n  BURMESE       = 103,\n  KHMER         = 104,\n  TIBETAN       = 105,\n  DHIVEHI       = 106,     // sometimes spelled Divehi, lang of Maldives\n  CHEROKEE      = 107,\n  SYRIAC        = 108,     // UI only.\n  LIMBU         = 109,     // UI only.\n  ORIYA         = 110,\n  ASSAMESE      = 111,     // UI only.\n  CORSICAN      = 112,     // UI only.\n  INTERLINGUE   = 113,     // UI only.\n  KAZAKH        = 114,\n  LINGALA       = 115,     // UI only.\n  MOLDAVIAN     = 116,     // UI only. LangId language: ROMANIAN (22)\n  PASHTO        = 117,\n  QUECHUA       = 118,     // UI only.\n  SHONA         = 119,     // UI only.\n  TAJIK         = 120,\n  TATAR         = 121,     // UI only.\n  TONGA         = 122,     // UI only.\n  YORUBA        = 123,     // UI only.\n  CREOLES_AND_PIDGINS_ENGLISH_BASED       = 124,   // UI only.\n  CREOLES_AND_PIDGINS_FRENCH_BASED        = 125,   // UI only.\n  CREOLES_AND_PIDGINS_PORTUGUESE_BASED    = 126,   // UI only.\n  CREOLES_AND_PIDGINS_OTHER               = 127,   // UI only.\n  MAORI         = 128,     // UI only.\n  WOLOF         = 129,     // UI only.\n  ABKHAZIAN     = 130,     // UI only.\n  AFAR          = 131,     // UI only.\n  AYMARA        = 132,     // UI only.\n  BASHKIR       = 133,     // UI only.\n  BISLAMA       = 134,     // UI only.\n  DZONGKHA      = 135,     // UI only.\n  FIJIAN        = 136,     // UI only.\n  GREENLANDIC   = 137,     // UI only.\n  HAUSA         = 138,     // UI only.\n  HAITIAN_CREOLE= 139,     // UI only.\n  INUPIAK       = 140,     // UI only.\n  INUKTITUT     = 141,\n  KASHMIRI      = 142,     // UI only.\n  KINYARWANDA   = 143,     // UI only.\n  MALAGASY      = 144,     // UI only.\n  NAURU         = 145,     // UI only.\n  OROMO         = 146,     // UI only.\n  RUNDI         = 147,     // UI only.\n  SAMOAN        = 148,     // UI only.\n  SANGO         = 149,     // UI only.\n  SANSKRIT      = 150,\n  SISWANT       = 151,     // UI only.\n  TSONGA        = 152,     // UI only.\n  TSWANA        = 153,     // UI only.\n  VOLAPUK       = 154,     // UI only.\n  ZHUANG        = 155,     // UI only.\n  KHASI         = 156,     // UI only.\n  SCOTS         = 157,     // UI only.\n  GANDA         = 158,     // UI only.\n  MANX          = 159,     // UI only.\n  MONTENEGRIN   = 160,     // UI only. LangId language: SERBIAN (29)\n  NUM_LANGUAGES = 161,        // Always keep this at the end. It is not a\n                              // valid Language enum. It is only used to\n                              // indicate the total number of Languages.\n  // NOTE: If you add a language, you will break a unittest. See the note\n  // at the top of this enum.\n};\n\n#endif  // UTIL_LANGUAGES_LANGUAGES_PB_H_\n"
  },
  {
    "path": "third_party/ced/util/logging.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef UTIL_LOGGING_H_\n#define UTIL_LOGGING_H_\n\n#undef CHECK\n#define CHECK(expr)\n#undef DCHECK\n#define DCHECK(expr)\n\n#endif  // UTIL_LOGGING_H_\n"
  },
  {
    "path": "third_party/ced/util/port.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef UTIL_PORT_H_\n#define UTIL_PORT_H_\n\n#include <stdarg.h>\n\n#if defined(_MSC_VER)\n#define GG_LONGLONG(x) x##I64\n#define GG_ULONGLONG(x) x##UI64\n#else\n#define GG_LONGLONG(x) x##LL\n#define GG_ULONGLONG(x) x##ULL\n#endif\n\n// Per C99 7.8.14, define __STDC_CONSTANT_MACROS before including <stdint.h>\n// to get the INTn_C and UINTn_C macros for integer constants.  It's difficult\n// to guarantee any specific ordering of header includes, so it's difficult to\n// guarantee that the INTn_C macros can be defined by including <stdint.h> at\n// any specific point.  Provide GG_INTn_C macros instead.\n\n#define GG_INT8_C(x)    (x)\n#define GG_INT16_C(x)   (x)\n#define GG_INT32_C(x)   (x)\n#define GG_INT64_C(x)   GG_LONGLONG(x)\n\n#define GG_UINT8_C(x)   (x ## U)\n#define GG_UINT16_C(x)  (x ## U)\n#define GG_UINT32_C(x)  (x ## U)\n#define GG_UINT64_C(x)  GG_ULONGLONG(x)\n\n// Define an OS-neutral wrapper for shared library entry points\n#if defined(_WIN32)\n#define API_CALL __stdcall\n#else\n#define API_CALL\n#endif\n\n#endif  // UTIL_PORT_H_\n"
  },
  {
    "path": "third_party/ced/util/string_util.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef UTIL_STRING_UTIL_H_\n#define UTIL_STRING_UTIL_H_\n\n#include <string.h>\n\nnamespace base {\n\n#if defined(_WIN32)\n// Compare the two strings s1 and s2 without regard to case using\n// the current locale; returns 0 if they are equal, 1 if s1 > s2, and -1 if\n// s2 > s1 according to a lexicographic comparison.\ninline int strcasecmp(const char* s1, const char* s2) {\n  return _stricmp(s1, s2);\n}\ninline int strncasecmp(const char* s1, const char* s2, size_t n) {\n  return _strnicmp(s1, s2, n);\n}\n#else\ninline int strcasecmp(const char* s1, const char* s2) {\n  return ::strcasecmp(s1, s2);\n}\ninline int strncasecmp(const char* s1, const char* s2, size_t n) {\n  return ::strncasecmp(s1, s2, n);\n}\n#endif\n}\n\n#ifndef HAVE_MEMRCHR\n#if defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2)))\n#define HAVE_MEMRCHR\n#endif\n#endif\n\n#ifndef HAVE_MEMRCHR\ninline void* memrchr(const void* s, int c, size_t n) {\n  const unsigned char* p = (const unsigned char*) s;\n  for (p += n; n > 0; n--) {\n    if (*--p == c)\n      return (void*) p;\n  }\n  return NULL;\n}\n#endif\n\n#endif  // UTIL_STRING_UTIL_H_\n"
  },
  {
    "path": "third_party/ced/util/varsetter.h",
    "content": "// Copyright 2016 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n#ifndef UTIL_VARSETTER_H_\n#define UTIL_VARSETTER_H_\n\n//\n// Use a VarSetter object to temporarily set an object of some sort to\n// a particular value.  When the VarSetter object is destructed, the\n// underlying object will revert to its former value.\n//\n// Sample code:\n//\n#if 0\n{\n  bool b = true;\n  {\n    VarSetter<bool> bool_setter(&b, false);\n    // Now b == false.\n  }\n  // Now b == true again.\n}\n#endif\n\ntemplate <class C>\nclass VarSetter {\npublic:\n\n  // Constructor that just sets the object to a fixed value\n  VarSetter(C* object, const C& value) : object_(object), old_value_(*object) {\n    *object = value;\n  }\n\n  ~VarSetter() { *object_ = old_value_; }\n\nprivate:\n\n  C*const object_;\n  C old_value_;\n\n  // Disallow\n  VarSetter(const VarSetter&);\n  VarSetter& operator=(const VarSetter&);\n\n  // VarSetters always live on the stack\n  static void* operator new (size_t);\n  static void* operator new[](size_t);  // Redundant, no default ctor\n\n  static void operator delete (void*);\n  static void operator delete[](void*);\n};\n\n#endif  // UTIL_VARSETTER_H_\n"
  },
  {
    "path": "third_party/guicon/CMakeLists.txt",
    "content": "# ========================\nfile(GLOB SRC_CODE\n\t*.h\n\t*.cpp\n\t)\n\nadd_library(guicon STATIC ${SRC_CODE})\n\n# 添加include目录\ntarget_include_directories(guicon PUBLIC\n\t..\n)\n"
  },
  {
    "path": "third_party/guicon/guicon.cpp",
    "content": "#include \"guicon.h\"\n\n#include <tlhelp32.h>\n\n#include <memory>\n#include <stdexcept>\n#include <cassert>\n#include <iostream>\n\nDWORD GetParentPID() {\n    int pid = GetCurrentProcessId();\n    HANDLE h = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);\n    std::shared_ptr<void> defer(nullptr, [h](auto) {\n        CloseHandle(h);\n    });\n\n    PROCESSENTRY32 pe = {0};\n    pe.dwSize = sizeof(PROCESSENTRY32);\n\n    if (!Process32First(h, &pe)) {\n        throw std::runtime_error(\"failed at Process32First\");\n    }\n\n    DWORD parentPid = 0;\n\n    do {\n        if (pe.th32ProcessID != pid) {\n            continue;\n        }\n\n        assert(parentPid == 0);\n\n        parentPid = pe.th32ParentProcessID;\n    } while (Process32Next(h, &pe));\n\n    return parentPid;\n}\n\nbool ReleaseConsole() {\n    bool result = true;\n    FILE *fp;\n\n    // Just to be safe, redirect standard IO to NUL before releasing.\n\n    // Redirect STDIN to NUL\n    if (freopen_s(&fp, \"NUL:\", \"r\", stdin) != 0)\n        result = false;\n    else\n        setvbuf(stdin, NULL, _IONBF, 0);\n\n    // Redirect STDOUT to NUL\n    if (freopen_s(&fp, \"NUL:\", \"w\", stdout) != 0)\n        result = false;\n    else\n        setvbuf(stdout, NULL, _IONBF, 0);\n\n    // Redirect STDERR to NUL\n    if (freopen_s(&fp, \"NUL:\", \"w\", stderr) != 0)\n        result = false;\n    else\n        setvbuf(stderr, NULL, _IONBF, 0);\n\n    // Detach from console\n    if (!FreeConsole())\n        result = false;\n\n    return result;\n}\n\nbool RedirectConsoleIO() {\n    bool result = true;\n    FILE *fp;\n\n    // Redirect STDIN if the console has an input handle\n    if (GetStdHandle(STD_INPUT_HANDLE) != INVALID_HANDLE_VALUE)\n        if (freopen_s(&fp, \"CONIN$\", \"r\", stdin) != 0)\n            result = false;\n        else\n            setvbuf(stdin, NULL, _IONBF, 0);\n\n    // Redirect STDOUT if the console has an output handle\n    if (GetStdHandle(STD_OUTPUT_HANDLE) != INVALID_HANDLE_VALUE)\n        if (freopen_s(&fp, \"CONOUT$\", \"w\", stdout) != 0)\n            result = false;\n        else\n            setvbuf(stdout, NULL, _IONBF, 0);\n\n    // Redirect STDERR if the console has an error handle\n    if (GetStdHandle(STD_ERROR_HANDLE) != INVALID_HANDLE_VALUE)\n        if (freopen_s(&fp, \"CONOUT$\", \"w\", stderr) != 0)\n            result = false;\n        else\n            setvbuf(stderr, NULL, _IONBF, 0);\n\n    // Make C++ standard streams point to console as well.\n    std::ios::sync_with_stdio(true);\n\n    // Clear the error state for each of the C++ standard streams.\n    std::wcout.clear();\n    std::cout.clear();\n    std::wcerr.clear();\n    std::cerr.clear();\n    std::wcin.clear();\n    std::cin.clear();\n\n    return result;\n}\n\nvoid AdjustConsoleBuffer(short minLength) {\n    // Set the screen buffer to be big enough to scroll some text\n    CONSOLE_SCREEN_BUFFER_INFO conInfo;\n    GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &conInfo);\n    if (conInfo.dwSize.Y < minLength)\n        conInfo.dwSize.Y = minLength;\n    SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), conInfo.dwSize);\n}\n\nbool AttachParentConsole(short minLength) {\n    bool result = false;\n\n    // Release any current console and redirect IO to NUL\n    ReleaseConsole();\n\n    // Attempt to attach to parent process's console\n    if (AttachConsole(ATTACH_PARENT_PROCESS)) {\n        AdjustConsoleBuffer(minLength);\n        result = RedirectConsoleIO();\n    }\n\n    return result;\n}"
  },
  {
    "path": "third_party/guicon/guicon.h",
    "content": "#pragma once\n\n#include <Windows.h>\n\nDWORD GetParentPID();\n\nbool ReleaseConsole();\n\nbool RedirectConsoleIO();\n\nbool AttachParentConsole(short minLength);\n"
  },
  {
    "path": "third_party/uchardet/WinCodePage_Identifiers.txt",
    "content": "Identifier          .NET Name                      Additional information\n-------------------------------------------------------------------------------\n  037                IBM037                        IBM EBCDIC US-Canada\n  437                IBM437                        OEM United States\n  500                IBM500                        IBM EBCDIC International\n  708                ASMO-708                      Arabic (ASMO 708)\n  709                                              Arabic (ASMO-449+, BCON V4)\n  710                                              Arabic - Transparent Arabic\n  720                DOS-720                       Arabic (Transparent ASMO); Arabic (DOS)\n  737                ibm737                        OEM Greek (formerly 437G); Greek (DOS)\n  775                ibm775                        OEM Baltic; Baltic (DOS)\n  850                ibm850                        OEM Multilingual Latin 1; Western European (DOS)\n  852                ibm852                        OEM Latin 2; Central European (DOS)\n  855                IBM855                        OEM Cyrillic (primarily Russian)\n  857                ibm857                        OEM Turkish; Turkish (DOS)\n  858                IBM00858                      OEM Multilingual Latin 1 + Euro symbol\n  860                IBM860                        OEM Portuguese; Portuguese (DOS)\n  861                ibm861                        OEM Icelandic; Icelandic (DOS)\n  862                DOS-862                       OEM Hebrew; Hebrew (DOS)\n  863                IBM863                        OEM French Canadian; French Canadian (DOS)\n  864                IBM864                        OEM Arabic; Arabic (864)\n  865                IBM865                        OEM Nordic; Nordic (DOS)\n  866                cp866                         OEM Russian; Cyrillic (DOS)\n  869                ibm869                        OEM Modern Greek; Greek, Modern (DOS)\n  870                IBM870                        IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2\n  874                windows-874                   ANSI/OEM Thai (ISO 8859-11); Thai (Windows)\n  875                cp875                         IBM EBCDIC Greek Modern\n  932                shift_jis                     ANSI/OEM Japanese; Japanese (Shift-JIS)\n  936                gb2312                        ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312)\n  949                ks_c_5601-1987                ANSI/OEM Korean (Unified Hangul Code)\n  950                big5                          ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5)\n 1026                IBM1026                       IBM EBCDIC Turkish (Latin 5)\n 1047                IBM01047                      IBM EBCDIC Latin 1/Open System\n 1140                IBM01140                      IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro)\n 1141                IBM01141                      IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro)\n 1142                IBM01142                      IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro)\n 1143                IBM01143                      IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro)\n 1144                IBM01144                      IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro)\n 1145                IBM01145                      IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro)\n 1146                IBM01146                      IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro)\n 1147                IBM01147                      IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro)\n 1148                IBM01148                      IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro)\n 1149                IBM01149                      IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro)\n 1200                utf-16                        Unicode UTF-16, little endian byte order (BMP of ISO 10646); available only to managed applications\n 1201                unicodeFFFE                   Unicode UTF-16, big endian byte order; available only to managed applications\n 1250                windows-1250                  ANSI Central European; Central European (Windows)\n 1251                windows-1251                  ANSI Cyrillic; Cyrillic (Windows)\n 1252                windows-1252                  ANSI Latin 1; Western European (Windows)\n 1253                windows-1253                  ANSI Greek; Greek (Windows)\n 1254                windows-1254                  ANSI Turkish; Turkish (Windows)\n 1255                windows-1255                  ANSI Hebrew; Hebrew (Windows)\n 1256                windows-1256                  ANSI Arabic; Arabic (Windows)\n 1257                windows-1257                  ANSI Baltic; Baltic (Windows)\n 1258                windows-1258                  ANSI/OEM Vietnamese; Vietnamese (Windows)\n 1361                Johab                         Korean (Johab)\n10000                macintosh                     MAC Roman; Western European (Mac)\n10001                x-mac-japanese                Japanese (Mac)\n10002                x-mac-chinesetrad             MAC Traditional Chinese (Big5); Chinese Traditional (Mac)\n10003                x-mac-korean                  Korean (Mac)\n10004                x-mac-arabic                  Arabic (Mac)\n10005                x-mac-hebrew                  Hebrew (Mac)\n10006                x-mac-greek                   Greek (Mac)\n10007                x-mac-cyrillic                Cyrillic (Mac)\n10008                x-mac-chinesesimp             MAC Simplified Chinese (GB 2312); Chinese Simplified (Mac)\n10010                x-mac-romanian                Romanian (Mac)\n10017                x-mac-ukrainian               Ukrainian (Mac)\n10021                x-mac-thai                    Thai (Mac)\n10029                x-mac-ce                      MAC Latin 2; Central European (Mac)\n10079                x-mac-icelandic               Icelandic (Mac)\n10081                x-mac-turkish                 Turkish (Mac)\n10082                x-mac-croatian                Croatian (Mac)\n12000                utf-32                        Unicode UTF-32, little endian byte order; available only to managed applications\n12001                utf-32BE                      Unicode UTF-32, big endian byte order; available only to managed applications\n20000                x-Chinese_CNS                 CNS Taiwan; Chinese Traditional (CNS)\n20001                x-cp20001                     TCA Taiwan\n20002                x_Chinese-Eten                Eten Taiwan; Chinese Traditional (Eten)\n20003                x-cp20003                     IBM5550 Taiwan\n20004                x-cp20004                     TeleText Taiwan\n20005                x-cp20005                     Wang Taiwan\n20105                x-IA5                         IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5)\n20106                x-IA5-German                  IA5 German (7-bit)\n20107                x-IA5-Swedish                 IA5 Swedish (7-bit)\n20108                x-IA5-Norwegian               IA5 Norwegian (7-bit)\n20127                us-ascii                      US-ASCII (7-bit)\n20261                x-cp20261                     T.61\n20269                x-cp20269                     ISO 6937 Non-Spacing Accent\n20273                IBM273                        IBM EBCDIC Germany\n20277                IBM277                        IBM EBCDIC Denmark-Norway\n20278                IBM278                        IBM EBCDIC Finland-Sweden\n20280                IBM280                        IBM EBCDIC Italy\n20284                IBM284                        IBM EBCDIC Latin America-Spain\n20285                IBM285                        IBM EBCDIC United Kingdom\n20290                IBM290                        IBM EBCDIC Japanese Katakana Extended\n20297                IBM297                        IBM EBCDIC France\n20420                IBM420                        IBM EBCDIC Arabic\n20423                IBM423                        IBM EBCDIC Greek\n20424                IBM424                        IBM EBCDIC Hebrew\n20833                x-EBCDIC-KoreanExtended       IBM EBCDIC Korean Extended\n20838                IBM-Thai                      IBM EBCDIC Thai\n20866                koi8-r                        Russian (KOI8-R); Cyrillic (KOI8-R)\n20871                IBM871                        IBM EBCDIC Icelandic\n20880                IBM880                        IBM EBCDIC Cyrillic Russian\n20905                IBM905                        IBM EBCDIC Turkish\n20924                IBM00924                      IBM EBCDIC Latin 1/Open System (1047 + Euro symbol)\n20932                EUC-JP                        Japanese (JIS 0208-1990 and 0212-1990)\n20936                x-cp20936                     Simplified Chinese (GB2312); Chinese Simplified (GB2312-80)\n20949                x-cp20949                     Korean Wansung\n21025                cp1025                        IBM EBCDIC Cyrillic Serbian-Bulgarian\n21027                                              (deprecated)\n21866                koi8-u                        Ukrainian (KOI8-U); Cyrillic (KOI8-U)\n28591                iso-8859-1                    ISO 8859-1 Latin 1; Western European (ISO)\n28592                iso-8859-2                    ISO 8859-2 Central European; Central European (ISO)\n28593                iso-8859-3                    ISO 8859-3 Latin 3\n28594                iso-8859-4                    ISO 8859-4 Baltic\n28595                iso-8859-5                    ISO 8859-5 Cyrillic\n28596                iso-8859-6                    ISO 8859-6 Arabic\n28597                iso-8859-7                    ISO 8859-7 Greek\n28598                iso-8859-8                    ISO 8859-8 Hebrew; Hebrew (ISO-Visual)\n28599                iso-8859-9                    ISO 8859-9 Turkish\n28603                iso-8859-13                   ISO 8859-13 Estonian\n28605                iso-8859-15                   ISO 8859-15 Latin 9\n29001                x-Europa                      Europa 3\n38598                iso-8859-8-i                  ISO 8859-8 Hebrew; Hebrew (ISO-Logical)\n50220                iso-2022-jp                   ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS)\n50221                csISO2022JP                   ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana)\n50222                iso-2022-jp                   ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI)\n50225                iso-2022-kr                   ISO 2022 Korean\n50227                x-cp50227                     ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022)\n50229                                              ISO 2022 Traditional Chinese\n50930                                              EBCDIC Japanese (Katakana) Extended\n50931                                              EBCDIC US-Canada and Japanese\n50933                                              EBCDIC Korean Extended and Korean\n50935                                              EBCDIC Simplified Chinese Extended and Simplified Chinese\n50936                                              EBCDIC Simplified Chinese\n50937                                              EBCDIC US-Canada and Traditional Chinese\n50939                                              EBCDIC Japanese (Latin) Extended and Japanese\n51932                euc-jp                        EUC Japanese\n51936                EUC-CN                        EUC Simplified Chinese; Chinese Simplified (EUC)\n51949                euc-kr                        EUC Korean\n51950                                              EUC Traditional Chinese\n52936                hz-gb-2312                    HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ)\n54936                GB18030                       Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030)\n57002                x-iscii-de                    ISCII Devanagari\n57003                x-iscii-be                    ISCII Bangla\n57004                x-iscii-ta                    ISCII Tamil\n57005                x-iscii-te                    ISCII Telugu\n57006                x-iscii-as                    ISCII Assamese\n57007                x-iscii-or                    ISCII Odia\n57008                x-iscii-ka                    ISCII Kannada\n57009                x-iscii-ma                    ISCII Malayalam\n57010                x-iscii-gu                    ISCII Gujarati\n57011                x-iscii-pa                    ISCII Punjabi\n65000                utf-7                         Unicode (UTF-7)\n65001                utf-8                         Unicode (UTF-8)\n"
  },
  {
    "path": "third_party/uchardet/uchardet/AUTHORS",
    "content": "== Original Authors ==\n\nThe original code is Mozilla Universal charset detector code.\nThe initial developer of the Original Code is Netscape Communications Corporation.\nThe initial developer of the C wrapper is BYVoid.\n\n== Maintainers ==\n\nBYVoid <byvoid.kcp@gmail.com>\nJehan <jehan@girinstud.io>\n\n== Contributors ==\n\nYou can obtain the full list of contributors to uchardet with the\nfollowing git command in the source repository:\n$ git shortlog -s\n"
  },
  {
    "path": "third_party/uchardet/uchardet/CMakeLists.txt",
    "content": "######## Project settings\ncmake_minimum_required(VERSION 2.8.5)\ninclude(CheckCCompilerFlag)\nset (PACKAGE_NAME uchardet)\nproject (${PACKAGE_NAME} CXX C)\nenable_testing()\n\n######## Package information\nset (PACKAGE_URL https://www.freedesktop.org/wiki/Software/uchardet)\nset (PACKAGE_BUGREPORT https://bugs.freedesktop.org/enter_bug.cgi?product=uchardet)\nset (UCHARDET_VERSION_MAJOR 0)\nset (UCHARDET_VERSION_MINOR 0)\nset (UCHARDET_VERSION_REVISION 6)\n\nif (CMAKE_BUILD_TYPE MATCHES Debug)\n\tset (version_suffix .debug)\nendif (CMAKE_BUILD_TYPE MATCHES Debug)\n\nset (\n\tUCHARDET_VERSION\n\t${UCHARDET_VERSION_MAJOR}.${UCHARDET_VERSION_MINOR}.${UCHARDET_VERSION_REVISION}${version_suffix}\n)\nset(CMAKE_CXX_STANDARD 11)\nset(CMAKE_CXX_STANDARD_REQUIRED ON)\n\n######## Directory\n\ninclude(GNUInstallDirs)\n\n######## Configuration\n\noption(BUILD_BINARY \"Build the CLI tool.\" ON)\noption(BUILD_SHARED_LIBS \"Build shared library and link executable to it.\" ON)\noption(CHECK_SSE2 \"Check and enable SSE2 extensions if supported. Disabling SSE on platforms which support it may decrease performances.\" ON)\nset(TARGET_ARCHITECTURE \"\" CACHE STRING \"Target CPU architecture. It is autodetected if not specified.\")\n\nif (BUILD_SHARED_LIBS)\n\toption(BUILD_STATIC \"Build static library\" ON)\nendif (BUILD_SHARED_LIBS)\n\nif (TARGET_ARCHITECTURE STREQUAL \"\")\n    string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} TARGET_ARCHITECTURE)\nendif (TARGET_ARCHITECTURE STREQUAL \"\")\n\nif (TARGET_ARCHITECTURE MATCHES \".*(x86)|(amd).*\")\n    CHECK_C_COMPILER_FLAG(-msse2 SUPPORTS_CFLAG_SSE2)\n    CHECK_C_COMPILER_FLAG(-mfpmath=sse SUPPORTS_CFLAG_SSE_MATH)\n    if (CHECK_SSE2 AND SUPPORTS_CFLAG_SSE2 AND SUPPORTS_CFLAG_SSE_MATH)\n        set(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} -msse2 -mfpmath=sse\")\n        set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -msse2 -mfpmath=sse\")\n    else (CHECK_SSE2 AND SUPPORTS_CFLAG_SSE2 AND SUPPORTS_CFLAG_SSE_MATH)\n        set(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} -ffloat-store\")\n        set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -ffloat-store\")\n    endif (CHECK_SSE2 AND SUPPORTS_CFLAG_SSE2 AND SUPPORTS_CFLAG_SSE_MATH)\nendif (TARGET_ARCHITECTURE MATCHES \".*(x86)|(amd).*\")\n\nconfigure_file(\n\tuchardet.pc.in\n\tuchardet.pc\n\t@ONLY\n)\n\ninstall(\n\tFILES\n\t\t${CMAKE_BINARY_DIR}/uchardet.pc\n\tDESTINATION\n\t\t${CMAKE_INSTALL_LIBDIR}/pkgconfig\n)\n\n######## Subdirectories\n\nadd_subdirectory(src)\nadd_subdirectory(doc)\n"
  },
  {
    "path": "third_party/uchardet/uchardet/COPYING",
    "content": "                          MOZILLA PUBLIC LICENSE\n                                Version 1.1\n\n                              ---------------\n\n1. Definitions.\n\n     1.0.1. \"Commercial Use\" means distribution or otherwise making the\n     Covered Code available to a third party.\n\n     1.1. \"Contributor\" means each entity that creates or contributes to\n     the creation of Modifications.\n\n     1.2. \"Contributor Version\" means the combination of the Original\n     Code, prior Modifications used by a Contributor, and the Modifications\n     made by that particular Contributor.\n\n     1.3. \"Covered Code\" means the Original Code or Modifications or the\n     combination of the Original Code and Modifications, in each case\n     including portions thereof.\n\n     1.4. \"Electronic Distribution Mechanism\" means a mechanism generally\n     accepted in the software development community for the electronic\n     transfer of data.\n\n     1.5. \"Executable\" means Covered Code in any form other than Source\n     Code.\n\n     1.6. \"Initial Developer\" means the individual or entity identified\n     as the Initial Developer in the Source Code notice required by Exhibit\n     A.\n\n     1.7. \"Larger Work\" means a work which combines Covered Code or\n     portions thereof with code not governed by the terms of this License.\n\n     1.8. \"License\" means this document.\n\n     1.8.1. \"Licensable\" means having the right to grant, to the maximum\n     extent possible, whether at the time of the initial grant or\n     subsequently acquired, any and all of the rights conveyed herein.\n\n     1.9. \"Modifications\" means any addition to or deletion from the\n     substance or structure of either the Original Code or any previous\n     Modifications. When Covered Code is released as a series of files, a\n     Modification is:\n          A. Any addition to or deletion from the contents of a file\n          containing Original Code or previous Modifications.\n\n          B. Any new file that contains any part of the Original Code or\n          previous Modifications.\n\n     1.10. \"Original Code\" means Source Code of computer software code\n     which is described in the Source Code notice required by Exhibit A as\n     Original Code, and which, at the time of its release under this\n     License is not already Covered Code governed by this License.\n\n     1.10.1. \"Patent Claims\" means any patent claim(s), now owned or\n     hereafter acquired, including without limitation,  method, process,\n     and apparatus claims, in any patent Licensable by grantor.\n\n     1.11. \"Source Code\" means the preferred form of the Covered Code for\n     making modifications to it, including all modules it contains, plus\n     any associated interface definition files, scripts used to control\n     compilation and installation of an Executable, or source code\n     differential comparisons against either the Original Code or another\n     well known, available Covered Code of the Contributor's choice. The\n     Source Code can be in a compressed or archival form, provided the\n     appropriate decompression or de-archiving software is widely available\n     for no charge.\n\n     1.12. \"You\" (or \"Your\")  means an individual or a legal entity\n     exercising rights under, and complying with all of the terms of, this\n     License or a future version of this License issued under Section 6.1.\n     For legal entities, \"You\" includes any entity which controls, is\n     controlled by, or is under common control with You. For purposes of\n     this definition, \"control\" means (a) the power, direct or indirect,\n     to cause the direction or management of such entity, whether by\n     contract or otherwise, or (b) ownership of more than fifty percent\n     (50%) of the outstanding shares or beneficial ownership of such\n     entity.\n\n2. Source Code License.\n\n     2.1. The Initial Developer Grant.\n     The Initial Developer hereby grants You a world-wide, royalty-free,\n     non-exclusive license, subject to third party intellectual property\n     claims:\n          (a)  under intellectual property rights (other than patent or\n          trademark) Licensable by Initial Developer to use, reproduce,\n          modify, display, perform, sublicense and distribute the Original\n          Code (or portions thereof) with or without Modifications, and/or\n          as part of a Larger Work; and\n\n          (b) under Patents Claims infringed by the making, using or\n          selling of Original Code, to make, have made, use, practice,\n          sell, and offer for sale, and/or otherwise dispose of the\n          Original Code (or portions thereof).\n\n          (c) the licenses granted in this Section 2.1(a) and (b) are\n          effective on the date Initial Developer first distributes\n          Original Code under the terms of this License.\n\n          (d) Notwithstanding Section 2.1(b) above, no patent license is\n          granted: 1) for code that You delete from the Original Code; 2)\n          separate from the Original Code;  or 3) for infringements caused\n          by: i) the modification of the Original Code or ii) the\n          combination of the Original Code with other software or devices.\n\n     2.2. Contributor Grant.\n     Subject to third party intellectual property claims, each Contributor\n     hereby grants You a world-wide, royalty-free, non-exclusive license\n\n          (a)  under intellectual property rights (other than patent or\n          trademark) Licensable by Contributor, to use, reproduce, modify,\n          display, perform, sublicense and distribute the Modifications\n          created by such Contributor (or portions thereof) either on an\n          unmodified basis, with other Modifications, as Covered Code\n          and/or as part of a Larger Work; and\n\n          (b) under Patent Claims infringed by the making, using, or\n          selling of  Modifications made by that Contributor either alone\n          and/or in combination with its Contributor Version (or portions\n          of such combination), to make, use, sell, offer for sale, have\n          made, and/or otherwise dispose of: 1) Modifications made by that\n          Contributor (or portions thereof); and 2) the combination of\n          Modifications made by that Contributor with its Contributor\n          Version (or portions of such combination).\n\n          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are\n          effective on the date Contributor first makes Commercial Use of\n          the Covered Code.\n\n          (d)    Notwithstanding Section 2.2(b) above, no patent license is\n          granted: 1) for any code that Contributor has deleted from the\n          Contributor Version; 2)  separate from the Contributor Version;\n          3)  for infringements caused by: i) third party modifications of\n          Contributor Version or ii)  the combination of Modifications made\n          by that Contributor with other software  (except as part of the\n          Contributor Version) or other devices; or 4) under Patent Claims\n          infringed by Covered Code in the absence of Modifications made by\n          that Contributor.\n\n3. Distribution Obligations.\n\n     3.1. Application of License.\n     The Modifications which You create or to which You contribute are\n     governed by the terms of this License, including without limitation\n     Section 2.2. The Source Code version of Covered Code may be\n     distributed only under the terms of this License or a future version\n     of this License released under Section 6.1, and You must include a\n     copy of this License with every copy of the Source Code You\n     distribute. You may not offer or impose any terms on any Source Code\n     version that alters or restricts the applicable version of this\n     License or the recipients' rights hereunder. However, You may include\n     an additional document offering the additional rights described in\n     Section 3.5.\n\n     3.2. Availability of Source Code.\n     Any Modification which You create or to which You contribute must be\n     made available in Source Code form under the terms of this License\n     either on the same media as an Executable version or via an accepted\n     Electronic Distribution Mechanism to anyone to whom you made an\n     Executable version available; and if made available via Electronic\n     Distribution Mechanism, must remain available for at least twelve (12)\n     months after the date it initially became available, or at least six\n     (6) months after a subsequent version of that particular Modification\n     has been made available to such recipients. You are responsible for\n     ensuring that the Source Code version remains available even if the\n     Electronic Distribution Mechanism is maintained by a third party.\n\n     3.3. Description of Modifications.\n     You must cause all Covered Code to which You contribute to contain a\n     file documenting the changes You made to create that Covered Code and\n     the date of any change. You must include a prominent statement that\n     the Modification is derived, directly or indirectly, from Original\n     Code provided by the Initial Developer and including the name of the\n     Initial Developer in (a) the Source Code, and (b) in any notice in an\n     Executable version or related documentation in which You describe the\n     origin or ownership of the Covered Code.\n\n     3.4. Intellectual Property Matters\n          (a) Third Party Claims.\n          If Contributor has knowledge that a license under a third party's\n          intellectual property rights is required to exercise the rights\n          granted by such Contributor under Sections 2.1 or 2.2,\n          Contributor must include a text file with the Source Code\n          distribution titled \"LEGAL\" which describes the claim and the\n          party making the claim in sufficient detail that a recipient will\n          know whom to contact. If Contributor obtains such knowledge after\n          the Modification is made available as described in Section 3.2,\n          Contributor shall promptly modify the LEGAL file in all copies\n          Contributor makes available thereafter and shall take other steps\n          (such as notifying appropriate mailing lists or newsgroups)\n          reasonably calculated to inform those who received the Covered\n          Code that new knowledge has been obtained.\n\n          (b) Contributor APIs.\n          If Contributor's Modifications include an application programming\n          interface and Contributor has knowledge of patent licenses which\n          are reasonably necessary to implement that API, Contributor must\n          also include this information in the LEGAL file.\n\n               (c)    Representations.\n          Contributor represents that, except as disclosed pursuant to\n          Section 3.4(a) above, Contributor believes that Contributor's\n          Modifications are Contributor's original creation(s) and/or\n          Contributor has sufficient rights to grant the rights conveyed by\n          this License.\n\n     3.5. Required Notices.\n     You must duplicate the notice in Exhibit A in each file of the Source\n     Code.  If it is not possible to put such notice in a particular Source\n     Code file due to its structure, then You must include such notice in a\n     location (such as a relevant directory) where a user would be likely\n     to look for such a notice.  If You created one or more Modification(s)\n     You may add your name as a Contributor to the notice described in\n     Exhibit A.  You must also duplicate this License in any documentation\n     for the Source Code where You describe recipients' rights or ownership\n     rights relating to Covered Code.  You may choose to offer, and to\n     charge a fee for, warranty, support, indemnity or liability\n     obligations to one or more recipients of Covered Code. However, You\n     may do so only on Your own behalf, and not on behalf of the Initial\n     Developer or any Contributor. You must make it absolutely clear than\n     any such warranty, support, indemnity or liability obligation is\n     offered by You alone, and You hereby agree to indemnify the Initial\n     Developer and every Contributor for any liability incurred by the\n     Initial Developer or such Contributor as a result of warranty,\n     support, indemnity or liability terms You offer.\n\n     3.6. Distribution of Executable Versions.\n     You may distribute Covered Code in Executable form only if the\n     requirements of Section 3.1-3.5 have been met for that Covered Code,\n     and if You include a notice stating that the Source Code version of\n     the Covered Code is available under the terms of this License,\n     including a description of how and where You have fulfilled the\n     obligations of Section 3.2. The notice must be conspicuously included\n     in any notice in an Executable version, related documentation or\n     collateral in which You describe recipients' rights relating to the\n     Covered Code. You may distribute the Executable version of Covered\n     Code or ownership rights under a license of Your choice, which may\n     contain terms different from this License, provided that You are in\n     compliance with the terms of this License and that the license for the\n     Executable version does not attempt to limit or alter the recipient's\n     rights in the Source Code version from the rights set forth in this\n     License. If You distribute the Executable version under a different\n     license You must make it absolutely clear that any terms which differ\n     from this License are offered by You alone, not by the Initial\n     Developer or any Contributor. You hereby agree to indemnify the\n     Initial Developer and every Contributor for any liability incurred by\n     the Initial Developer or such Contributor as a result of any such\n     terms You offer.\n\n     3.7. Larger Works.\n     You may create a Larger Work by combining Covered Code with other code\n     not governed by the terms of this License and distribute the Larger\n     Work as a single product. In such a case, You must make sure the\n     requirements of this License are fulfilled for the Covered Code.\n\n4. Inability to Comply Due to Statute or Regulation.\n\n     If it is impossible for You to comply with any of the terms of this\n     License with respect to some or all of the Covered Code due to\n     statute, judicial order, or regulation then You must: (a) comply with\n     the terms of this License to the maximum extent possible; and (b)\n     describe the limitations and the code they affect. Such description\n     must be included in the LEGAL file described in Section 3.4 and must\n     be included with all distributions of the Source Code. Except to the\n     extent prohibited by statute or regulation, such description must be\n     sufficiently detailed for a recipient of ordinary skill to be able to\n     understand it.\n\n5. Application of this License.\n\n     This License applies to code to which the Initial Developer has\n     attached the notice in Exhibit A and to related Covered Code.\n\n6. Versions of the License.\n\n     6.1. New Versions.\n     Netscape Communications Corporation (\"Netscape\") may publish revised\n     and/or new versions of the License from time to time. Each version\n     will be given a distinguishing version number.\n\n     6.2. Effect of New Versions.\n     Once Covered Code has been published under a particular version of the\n     License, You may always continue to use it under the terms of that\n     version. You may also choose to use such Covered Code under the terms\n     of any subsequent version of the License published by Netscape. No one\n     other than Netscape has the right to modify the terms applicable to\n     Covered Code created under this License.\n\n     6.3. Derivative Works.\n     If You create or use a modified version of this License (which you may\n     only do in order to apply it to code which is not already Covered Code\n     governed by this License), You must (a) rename Your license so that\n     the phrases \"Mozilla\", \"MOZILLAPL\", \"MOZPL\", \"Netscape\",\n     \"MPL\", \"NPL\" or any confusingly similar phrase do not appear in your\n     license (except to note that your license differs from this License)\n     and (b) otherwise make it clear that Your version of the license\n     contains terms which differ from the Mozilla Public License and\n     Netscape Public License. (Filling in the name of the Initial\n     Developer, Original Code or Contributor in the notice described in\n     Exhibit A shall not of themselves be deemed to be modifications of\n     this License.)\n\n7. DISCLAIMER OF WARRANTY.\n\n     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN \"AS IS\" BASIS,\n     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,\n     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF\n     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.\n     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE\n     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,\n     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE\n     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER\n     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF\n     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.\n\n8. TERMINATION.\n\n     8.1.  This License and the rights granted hereunder will terminate\n     automatically if You fail to comply with terms herein and fail to cure\n     such breach within 30 days of becoming aware of the breach. All\n     sublicenses to the Covered Code which are properly granted shall\n     survive any termination of this License. Provisions which, by their\n     nature, must remain in effect beyond the termination of this License\n     shall survive.\n\n     8.2.  If You initiate litigation by asserting a patent infringement\n     claim (excluding declatory judgment actions) against Initial Developer\n     or a Contributor (the Initial Developer or Contributor against whom\n     You file such action is referred to as \"Participant\")  alleging that:\n\n     (a)  such Participant's Contributor Version directly or indirectly\n     infringes any patent, then any and all rights granted by such\n     Participant to You under Sections 2.1 and/or 2.2 of this License\n     shall, upon 60 days notice from Participant terminate prospectively,\n     unless if within 60 days after receipt of notice You either: (i)\n     agree in writing to pay Participant a mutually agreeable reasonable\n     royalty for Your past and future use of Modifications made by such\n     Participant, or (ii) withdraw Your litigation claim with respect to\n     the Contributor Version against such Participant.  If within 60 days\n     of notice, a reasonable royalty and payment arrangement are not\n     mutually agreed upon in writing by the parties or the litigation claim\n     is not withdrawn, the rights granted by Participant to You under\n     Sections 2.1 and/or 2.2 automatically terminate at the expiration of\n     the 60 day notice period specified above.\n\n     (b)  any software, hardware, or device, other than such Participant's\n     Contributor Version, directly or indirectly infringes any patent, then\n     any rights granted to You by such Participant under Sections 2.1(b)\n     and 2.2(b) are revoked effective as of the date You first made, used,\n     sold, distributed, or had made, Modifications made by that\n     Participant.\n\n     8.3.  If You assert a patent infringement claim against Participant\n     alleging that such Participant's Contributor Version directly or\n     indirectly infringes any patent where such claim is resolved (such as\n     by license or settlement) prior to the initiation of patent\n     infringement litigation, then the reasonable value of the licenses\n     granted by such Participant under Sections 2.1 or 2.2 shall be taken\n     into account in determining the amount or value of any payment or\n     license.\n\n     8.4.  In the event of termination under Sections 8.1 or 8.2 above,\n     all end user license agreements (excluding distributors and resellers)\n     which have been validly granted by You or any distributor hereunder\n     prior to termination shall survive termination.\n\n9. LIMITATION OF LIABILITY.\n\n     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT\n     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL\n     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,\n     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR\n     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY\n     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,\n     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER\n     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN\n     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF\n     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY\n     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW\n     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE\n     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO\n     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.\n\n10. U.S. GOVERNMENT END USERS.\n\n     The Covered Code is a \"commercial item,\" as that term is defined in\n     48 C.F.R. 2.101 (Oct. 1995), consisting of \"commercial computer\n     software\" and \"commercial computer software documentation,\" as such\n     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48\n     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),\n     all U.S. Government End Users acquire Covered Code with only those\n     rights set forth herein.\n\n11. MISCELLANEOUS.\n\n     This License represents the complete agreement concerning subject\n     matter hereof. If any provision of this License is held to be\n     unenforceable, such provision shall be reformed only to the extent\n     necessary to make it enforceable. This License shall be governed by\n     California law provisions (except to the extent applicable law, if\n     any, provides otherwise), excluding its conflict-of-law provisions.\n     With respect to disputes in which at least one party is a citizen of,\n     or an entity chartered or registered to do business in the United\n     States of America, any litigation relating to this License shall be\n     subject to the jurisdiction of the Federal Courts of the Northern\n     District of California, with venue lying in Santa Clara County,\n     California, with the losing party responsible for costs, including\n     without limitation, court costs and reasonable attorneys' fees and\n     expenses. The application of the United Nations Convention on\n     Contracts for the International Sale of Goods is expressly excluded.\n     Any law or regulation which provides that the language of a contract\n     shall be construed against the drafter shall not apply to this\n     License.\n\n12. RESPONSIBILITY FOR CLAIMS.\n\n     As between Initial Developer and the Contributors, each party is\n     responsible for claims and damages arising, directly or indirectly,\n     out of its utilization of rights under this License and You agree to\n     work with Initial Developer and Contributors to distribute such\n     responsibility on an equitable basis. Nothing herein is intended or\n     shall be deemed to constitute any admission of liability.\n\n13. MULTIPLE-LICENSED CODE.\n\n     Initial Developer may designate portions of the Covered Code as\n     \"Multiple-Licensed\".  \"Multiple-Licensed\" means that the Initial\n     Developer permits you to utilize portions of the Covered Code under\n     Your choice of the NPL or the alternative licenses, if any, specified\n     by the Initial Developer in the file described in Exhibit A.\n\nEXHIBIT A -Mozilla Public License.\n\n     ``The contents of this file are subject to the Mozilla Public License\n     Version 1.1 (the \"License\"); you may not use this file except in\n     compliance with the License. You may obtain a copy of the License at\n     http://www.mozilla.org/MPL/\n\n     Software distributed under the License is distributed on an \"AS IS\"\n     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the\n     License for the specific language governing rights and limitations\n     under the License.\n\n     The Original Code is ______________________________________.\n\n     The Initial Developer of the Original Code is ________________________.\n     Portions created by ______________________ are Copyright (C) ______\n     _______________________. All Rights Reserved.\n\n     Contributor(s): ______________________________________.\n\n     Alternatively, the contents of this file may be used under the terms\n     of the _____ license (the  \"[___] License\"), in which case the\n     provisions of [______] License are applicable instead of those\n     above.  If you wish to allow use of your version of this file only\n     under the terms of the [____] License and not to allow others to use\n     your version of this file under the MPL, indicate your decision by\n     deleting  the provisions above and replace  them with the notice and\n     other provisions required by the [___] License.  If you do not delete\n     the provisions above, a recipient may use your version of this file\n     under either the MPL or the [___] License.\"\n\n     [NOTE: The text of this Exhibit A may differ slightly from the text of\n     the notices in the Source Code files of the Original Code. You should\n     use the text of this Exhibit A rather than the text found in the\n     Original Code Source Code for Your Modifications.]\n\n------------------------------------------------------------------------\n\n                    GNU GENERAL PUBLIC LICENSE\n                       Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicense is intended to guarantee your freedom to share and change free\nsoftware--to make sure the software is free for all its users.  This\nGeneral Public License applies to most of the Free Software\nFoundation's software and to any other program whose authors commit to\nusing it.  (Some other Free Software Foundation software is covered by\nthe GNU Lesser General Public License instead.)  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthis service if you wish), that you receive source code or can get it\nif you want it, that you can change the software or use pieces of it\nin new free programs; and that you know you can do these things.\n\n  To protect your rights, we need to make restrictions that forbid\nanyone to deny you these rights or to ask you to surrender the rights.\nThese restrictions translate to certain responsibilities for you if you\ndistribute copies of the software, or if you modify it.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must give the recipients all the rights that\nyou have.  You must make sure that they, too, receive or can get the\nsource code.  And you must show them these terms so they know their\nrights.\n\n  We protect your rights with two steps: (1) copyright the software, and\n(2) offer you this license which gives you legal permission to copy,\ndistribute and/or modify the software.\n\n  Also, for each author's protection and ours, we want to make certain\nthat everyone understands that there is no warranty for this free\nsoftware.  If the software is modified by someone else and passed on, we\nwant its recipients to know that what they have is not the original, so\nthat any problems introduced by others will not reflect on the original\nauthors' reputations.\n\n  Finally, any free program is threatened constantly by software\npatents.  We wish to avoid the danger that redistributors of a free\nprogram will individually obtain patent licenses, in effect making the\nprogram proprietary.  To prevent this, we have made it clear that any\npatent must be licensed for everyone's free use or not licensed at all.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                    GNU GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License applies to any program or other work which contains\na notice placed by the copyright holder saying it may be distributed\nunder the terms of this General Public License.  The \"Program\", below,\nrefers to any such program or work, and a \"work based on the Program\"\nmeans either the Program or any derivative work under copyright law:\nthat is to say, a work containing the Program or a portion of it,\neither verbatim or with modifications and/or translated into another\nlanguage.  (Hereinafter, translation is included without limitation in\nthe term \"modification\".)  Each licensee is addressed as \"you\".\n\nActivities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning the Program is not restricted, and the output from the Program\nis covered only if its contents constitute a work based on the\nProgram (independent of having been made by running the Program).\nWhether that is true depends on what the Program does.\n\n  1. You may copy and distribute verbatim copies of the Program's\nsource code as you receive it, in any medium, provided that you\nconspicuously and appropriately publish on each copy an appropriate\ncopyright notice and disclaimer of warranty; keep intact all the\nnotices that refer to this License and to the absence of any warranty;\nand give any other recipients of the Program a copy of this License\nalong with the Program.\n\nYou may charge a fee for the physical act of transferring a copy, and\nyou may at your option offer warranty protection in exchange for a fee.\n\n  2. You may modify your copy or copies of the Program or any portion\nof it, thus forming a work based on the Program, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) You must cause the modified files to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    b) You must cause any work that you distribute or publish, that in\n    whole or in part contains or is derived from the Program or any\n    part thereof, to be licensed as a whole at no charge to all third\n    parties under the terms of this License.\n\n    c) If the modified program normally reads commands interactively\n    when run, you must cause it, when started running for such\n    interactive use in the most ordinary way, to print or display an\n    announcement including an appropriate copyright notice and a\n    notice that there is no warranty (or else, saying that you provide\n    a warranty) and that users may redistribute the program under\n    these conditions, and telling the user how to view a copy of this\n    License.  (Exception: if the Program itself is interactive but\n    does not normally print such an announcement, your work based on\n    the Program is not required to print an announcement.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Program,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Program, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote it.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Program.\n\nIn addition, mere aggregation of another work not based on the Program\nwith the Program (or with a work based on the Program) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may copy and distribute the Program (or a work based on it,\nunder Section 2) in object code or executable form under the terms of\nSections 1 and 2 above provided that you also do one of the following:\n\n    a) Accompany it with the complete corresponding machine-readable\n    source code, which must be distributed under the terms of Sections\n    1 and 2 above on a medium customarily used for software interchange; or,\n\n    b) Accompany it with a written offer, valid for at least three\n    years, to give any third party, for a charge no more than your\n    cost of physically performing source distribution, a complete\n    machine-readable copy of the corresponding source code, to be\n    distributed under the terms of Sections 1 and 2 above on a medium\n    customarily used for software interchange; or,\n\n    c) Accompany it with the information you received as to the offer\n    to distribute corresponding source code.  (This alternative is\n    allowed only for noncommercial distribution and only if you\n    received the program in object code or executable form with such\n    an offer, in accord with Subsection b above.)\n\nThe source code for a work means the preferred form of the work for\nmaking modifications to it.  For an executable work, complete source\ncode means all the source code for all modules it contains, plus any\nassociated interface definition files, plus the scripts used to\ncontrol compilation and installation of the executable.  However, as a\nspecial exception, the source code distributed need not include\nanything that is normally distributed (in either source or binary\nform) with the major components (compiler, kernel, and so on) of the\noperating system on which the executable runs, unless that component\nitself accompanies the executable.\n\nIf distribution of executable or object code is made by offering\naccess to copy from a designated place, then offering equivalent\naccess to copy the source code from the same place counts as\ndistribution of the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  4. You may not copy, modify, sublicense, or distribute the Program\nexcept as expressly provided under this License.  Any attempt\notherwise to copy, modify, sublicense or distribute the Program is\nvoid, and will automatically terminate your rights under this License.\nHowever, parties who have received copies, or rights, from you under\nthis License will not have their licenses terminated so long as such\nparties remain in full compliance.\n\n  5. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Program or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Program (or any work based on the\nProgram), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Program or works based on it.\n\n  6. Each time you redistribute the Program (or any work based on the\nProgram), the recipient automatically receives a license from the\noriginal licensor to copy, distribute or modify the Program subject to\nthese terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties to\nthis License.\n\n  7. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Program at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Program by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Program.\n\nIf any portion of this section is held invalid or unenforceable under\nany particular circumstance, the balance of the section is intended to\napply and the section as a whole is intended to apply in other\ncircumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system, which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  8. If the distribution and/or use of the Program is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Program under this License\nmay add an explicit geographical distribution limitation excluding\nthose countries, so that distribution is permitted only in or among\ncountries not thus excluded.  In such case, this License incorporates\nthe limitation as if written in the body of this License.\n\n  9. The Free Software Foundation may publish revised and/or new versions\nof the General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Program\nspecifies a version number of this License which applies to it and \"any\nlater version\", you have the option of following the terms and conditions\neither of that version or of any later version published by the Free\nSoftware Foundation.  If the Program does not specify a version number of\nthis License, you may choose any version ever published by the Free Software\nFoundation.\n\n  10. If you wish to incorporate parts of the Program into other free\nprograms whose distribution conditions are different, write to the author\nto ask for permission.  For software which is copyrighted by the Free\nSoftware Foundation, write to the Free Software Foundation; we sometimes\nmake exceptions for this.  Our decision will be guided by the two goals\nof preserving the free status of all derivatives of our free software and\nof promoting the sharing and reuse of software generally.\n\n                            NO WARRANTY\n\n  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\nFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\nOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\nPROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\nOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\nTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\nPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\nREPAIR OR CORRECTION.\n\n  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\nREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\nINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\nOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\nTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\nYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\nPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGES.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License along\n    with this program; if not, write to the Free Software Foundation, Inc.,\n    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\nAlso add information on how to contact you by electronic and paper mail.\n\nIf the program is interactive, make it output a short notice like this\nwhen it starts in an interactive mode:\n\n    Gnomovision version 69, Copyright (C) year name of author\n    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, the commands you use may\nbe called something other than `show w' and `show c'; they could even be\nmouse-clicks or menu items--whatever suits your program.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the program, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n  `Gnomovision' (which makes passes at compilers) written by James Hacker.\n\n  <signature of Ty Coon>, 1 April 1989\n  Ty Coon, President of Vice\n\nThis General Public License does not permit incorporating your program into\nproprietary programs.  If your program is a subroutine library, you may\nconsider it more useful to permit linking proprietary applications with the\nlibrary.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.\n\n------------------------------------------------------------------------\n\n                  GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 2.1, February 1999\n\n Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n[This is the first released version of the Lesser GPL.  It also counts\n as the successor of the GNU Library Public License, version 2, hence\n the version number 2.1.]\n\n                            Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicenses are intended to guarantee your freedom to share and change\nfree software--to make sure the software is free for all its users.\n\n  This license, the Lesser General Public License, applies to some\nspecially designated software packages--typically libraries--of the\nFree Software Foundation and other authors who decide to use it.  You\ncan use it too, but we suggest you first think carefully about whether\nthis license or the ordinary General Public License is the better\nstrategy to use in any particular case, based on the explanations below.\n\n  When we speak of free software, we are referring to freedom of use,\nnot price.  Our General Public Licenses are designed to make sure that\nyou have the freedom to distribute copies of free software (and charge\nfor this service if you wish); that you receive source code or can get\nit if you want it; that you can change the software and use pieces of\nit in new free programs; and that you are informed that you can do\nthese things.\n\n  To protect your rights, we need to make restrictions that forbid\ndistributors to deny you these rights or to ask you to surrender these\nrights.  These restrictions translate to certain responsibilities for\nyou if you distribute copies of the library or if you modify it.\n\n  For example, if you distribute copies of the library, whether gratis\nor for a fee, you must give the recipients all the rights that we gave\nyou.  You must make sure that they, too, receive or can get the source\ncode.  If you link other code with the library, you must provide\ncomplete object files to the recipients, so that they can relink them\nwith the library after making changes to the library and recompiling\nit.  And you must show them these terms so they know their rights.\n\n  We protect your rights with a two-step method: (1) we copyright the\nlibrary, and (2) we offer you this license, which gives you legal\npermission to copy, distribute and/or modify the library.\n\n  To protect each distributor, we want to make it very clear that\nthere is no warranty for the free library.  Also, if the library is\nmodified by someone else and passed on, the recipients should know\nthat what they have is not the original version, so that the original\nauthor's reputation will not be affected by problems that might be\nintroduced by others.\n\n  Finally, software patents pose a constant threat to the existence of\nany free program.  We wish to make sure that a company cannot\neffectively restrict the users of a free program by obtaining a\nrestrictive license from a patent holder.  Therefore, we insist that\nany patent license obtained for a version of the library must be\nconsistent with the full freedom of use specified in this license.\n\n  Most GNU software, including some libraries, is covered by the\nordinary GNU General Public License.  This license, the GNU Lesser\nGeneral Public License, applies to certain designated libraries, and\nis quite different from the ordinary General Public License.  We use\nthis license for certain libraries in order to permit linking those\nlibraries into non-free programs.\n\n  When a program is linked with a library, whether statically or using\na shared library, the combination of the two is legally speaking a\ncombined work, a derivative of the original library.  The ordinary\nGeneral Public License therefore permits such linking only if the\nentire combination fits its criteria of freedom.  The Lesser General\nPublic License permits more lax criteria for linking other code with\nthe library.\n\n  We call this license the \"Lesser\" General Public License because it\ndoes Less to protect the user's freedom than the ordinary General\nPublic License.  It also provides other free software developers Less\nof an advantage over competing non-free programs.  These disadvantages\nare the reason we use the ordinary General Public License for many\nlibraries.  However, the Lesser license provides advantages in certain\nspecial circumstances.\n\n  For example, on rare occasions, there may be a special need to\nencourage the widest possible use of a certain library, so that it becomes\na de-facto standard.  To achieve this, non-free programs must be\nallowed to use the library.  A more frequent case is that a free\nlibrary does the same job as widely used non-free libraries.  In this\ncase, there is little to gain by limiting the free library to free\nsoftware only, so we use the Lesser General Public License.\n\n  In other cases, permission to use a particular library in non-free\nprograms enables a greater number of people to use a large body of\nfree software.  For example, permission to use the GNU C Library in\nnon-free programs enables many more people to use the whole GNU\noperating system, as well as its variant, the GNU/Linux operating\nsystem.\n\n  Although the Lesser General Public License is Less protective of the\nusers' freedom, it does ensure that the user of a program that is\nlinked with the Library has the freedom and the wherewithal to run\nthat program using a modified version of the Library.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.  Pay close attention to the difference between a\n\"work based on the library\" and a \"work that uses the library\".  The\nformer contains code derived from the library, whereas the latter must\nbe combined with the library in order to run.\n\n                  GNU LESSER GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License Agreement applies to any software library or other\nprogram which contains a notice placed by the copyright holder or\nother authorized party saying it may be distributed under the terms of\nthis Lesser General Public License (also called \"this License\").\nEach licensee is addressed as \"you\".\n\n  A \"library\" means a collection of software functions and/or data\nprepared so as to be conveniently linked with application programs\n(which use some of those functions and data) to form executables.\n\n  The \"Library\", below, refers to any such software library or work\nwhich has been distributed under these terms.  A \"work based on the\nLibrary\" means either the Library or any derivative work under\ncopyright law: that is to say, a work containing the Library or a\nportion of it, either verbatim or with modifications and/or translated\nstraightforwardly into another language.  (Hereinafter, translation is\nincluded without limitation in the term \"modification\".)\n\n  \"Source code\" for a work means the preferred form of the work for\nmaking modifications to it.  For a library, complete source code means\nall the source code for all modules it contains, plus any associated\ninterface definition files, plus the scripts used to control compilation\nand installation of the library.\n\n  Activities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning a program using the Library is not restricted, and output from\nsuch a program is covered only if its contents constitute a work based\non the Library (independent of the use of the Library in a tool for\nwriting it).  Whether that is true depends on what the Library does\nand what the program that uses the Library does.\n\n  1. You may copy and distribute verbatim copies of the Library's\ncomplete source code as you receive it, in any medium, provided that\nyou conspicuously and appropriately publish on each copy an\nappropriate copyright notice and disclaimer of warranty; keep intact\nall the notices that refer to this License and to the absence of any\nwarranty; and distribute a copy of this License along with the\nLibrary.\n\n  You may charge a fee for the physical act of transferring a copy,\nand you may at your option offer warranty protection in exchange for a\nfee.\n\n  2. You may modify your copy or copies of the Library or any portion\nof it, thus forming a work based on the Library, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) The modified work must itself be a software library.\n\n    b) You must cause the files modified to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    c) You must cause the whole of the work to be licensed at no\n    charge to all third parties under the terms of this License.\n\n    d) If a facility in the modified Library refers to a function or a\n    table of data to be supplied by an application program that uses\n    the facility, other than as an argument passed when the facility\n    is invoked, then you must make a good faith effort to ensure that,\n    in the event an application does not supply such function or\n    table, the facility still operates, and performs whatever part of\n    its purpose remains meaningful.\n\n    (For example, a function in a library to compute square roots has\n    a purpose that is entirely well-defined independent of the\n    application.  Therefore, Subsection 2d requires that any\n    application-supplied function or table used by this function must\n    be optional: if the application does not supply it, the square\n    root function must still compute square roots.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Library,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Library, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote\nit.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Library.\n\nIn addition, mere aggregation of another work not based on the Library\nwith the Library (or with a work based on the Library) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may opt to apply the terms of the ordinary GNU General Public\nLicense instead of this License to a given copy of the Library.  To do\nthis, you must alter all the notices that refer to this License, so\nthat they refer to the ordinary GNU General Public License, version 2,\ninstead of to this License.  (If a newer version than version 2 of the\nordinary GNU General Public License has appeared, then you can specify\nthat version instead if you wish.)  Do not make any other change in\nthese notices.\n\n  Once this change is made in a given copy, it is irreversible for\nthat copy, so the ordinary GNU General Public License applies to all\nsubsequent copies and derivative works made from that copy.\n\n  This option is useful when you wish to copy part of the code of\nthe Library into a program that is not a library.\n\n  4. You may copy and distribute the Library (or a portion or\nderivative of it, under Section 2) in object code or executable form\nunder the terms of Sections 1 and 2 above provided that you accompany\nit with the complete corresponding machine-readable source code, which\nmust be distributed under the terms of Sections 1 and 2 above on a\nmedium customarily used for software interchange.\n\n  If distribution of object code is made by offering access to copy\nfrom a designated place, then offering equivalent access to copy the\nsource code from the same place satisfies the requirement to\ndistribute the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  5. A program that contains no derivative of any portion of the\nLibrary, but is designed to work with the Library by being compiled or\nlinked with it, is called a \"work that uses the Library\".  Such a\nwork, in isolation, is not a derivative work of the Library, and\ntherefore falls outside the scope of this License.\n\n  However, linking a \"work that uses the Library\" with the Library\ncreates an executable that is a derivative of the Library (because it\ncontains portions of the Library), rather than a \"work that uses the\nlibrary\".  The executable is therefore covered by this License.\nSection 6 states terms for distribution of such executables.\n\n  When a \"work that uses the Library\" uses material from a header file\nthat is part of the Library, the object code for the work may be a\nderivative work of the Library even though the source code is not.\nWhether this is true is especially significant if the work can be\nlinked without the Library, or if the work is itself a library.  The\nthreshold for this to be true is not precisely defined by law.\n\n  If such an object file uses only numerical parameters, data\nstructure layouts and accessors, and small macros and small inline\nfunctions (ten lines or less in length), then the use of the object\nfile is unrestricted, regardless of whether it is legally a derivative\nwork.  (Executables containing this object code plus portions of the\nLibrary will still fall under Section 6.)\n\n  Otherwise, if the work is a derivative of the Library, you may\ndistribute the object code for the work under the terms of Section 6.\nAny executables containing that work also fall under Section 6,\nwhether or not they are linked directly with the Library itself.\n\n  6. As an exception to the Sections above, you may also combine or\nlink a \"work that uses the Library\" with the Library to produce a\nwork containing portions of the Library, and distribute that work\nunder terms of your choice, provided that the terms permit\nmodification of the work for the customer's own use and reverse\nengineering for debugging such modifications.\n\n  You must give prominent notice with each copy of the work that the\nLibrary is used in it and that the Library and its use are covered by\nthis License.  You must supply a copy of this License.  If the work\nduring execution displays copyright notices, you must include the\ncopyright notice for the Library among them, as well as a reference\ndirecting the user to the copy of this License.  Also, you must do one\nof these things:\n\n    a) Accompany the work with the complete corresponding\n    machine-readable source code for the Library including whatever\n    changes were used in the work (which must be distributed under\n    Sections 1 and 2 above); and, if the work is an executable linked\n    with the Library, with the complete machine-readable \"work that\n    uses the Library\", as object code and/or source code, so that the\n    user can modify the Library and then relink to produce a modified\n    executable containing the modified Library.  (It is understood\n    that the user who changes the contents of definitions files in the\n    Library will not necessarily be able to recompile the application\n    to use the modified definitions.)\n\n    b) Use a suitable shared library mechanism for linking with the\n    Library.  A suitable mechanism is one that (1) uses at run time a\n    copy of the library already present on the user's computer system,\n    rather than copying library functions into the executable, and (2)\n    will operate properly with a modified version of the library, if\n    the user installs one, as long as the modified version is\n    interface-compatible with the version that the work was made with.\n\n    c) Accompany the work with a written offer, valid for at\n    least three years, to give the same user the materials\n    specified in Subsection 6a, above, for a charge no more\n    than the cost of performing this distribution.\n\n    d) If distribution of the work is made by offering access to copy\n    from a designated place, offer equivalent access to copy the above\n    specified materials from the same place.\n\n    e) Verify that the user has already received a copy of these\n    materials or that you have already sent this user a copy.\n\n  For an executable, the required form of the \"work that uses the\nLibrary\" must include any data and utility programs needed for\nreproducing the executable from it.  However, as a special exception,\nthe materials to be distributed need not include anything that is\nnormally distributed (in either source or binary form) with the major\ncomponents (compiler, kernel, and so on) of the operating system on\nwhich the executable runs, unless that component itself accompanies\nthe executable.\n\n  It may happen that this requirement contradicts the license\nrestrictions of other proprietary libraries that do not normally\naccompany the operating system.  Such a contradiction means you cannot\nuse both them and the Library together in an executable that you\ndistribute.\n\n  7. You may place library facilities that are a work based on the\nLibrary side-by-side in a single library together with other library\nfacilities not covered by this License, and distribute such a combined\nlibrary, provided that the separate distribution of the work based on\nthe Library and of the other library facilities is otherwise\npermitted, and provided that you do these two things:\n\n    a) Accompany the combined library with a copy of the same work\n    based on the Library, uncombined with any other library\n    facilities.  This must be distributed under the terms of the\n    Sections above.\n\n    b) Give prominent notice with the combined library of the fact\n    that part of it is a work based on the Library, and explaining\n    where to find the accompanying uncombined form of the same work.\n\n  8. You may not copy, modify, sublicense, link with, or distribute\nthe Library except as expressly provided under this License.  Any\nattempt otherwise to copy, modify, sublicense, link with, or\ndistribute the Library is void, and will automatically terminate your\nrights under this License.  However, parties who have received copies,\nor rights, from you under this License will not have their licenses\nterminated so long as such parties remain in full compliance.\n\n  9. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Library or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Library (or any work based on the\nLibrary), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Library or works based on it.\n\n  10. Each time you redistribute the Library (or any work based on the\nLibrary), the recipient automatically receives a license from the\noriginal licensor to copy, distribute, link with or modify the Library\nsubject to these terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties with\nthis License.\n\n  11. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Library at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Library by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Library.\n\nIf any portion of this section is held invalid or unenforceable under any\nparticular circumstance, the balance of the section is intended to apply,\nand the section as a whole is intended to apply in other circumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  12. If the distribution and/or use of the Library is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Library under this License may add\nan explicit geographical distribution limitation excluding those countries,\nso that distribution is permitted only in or among countries not thus\nexcluded.  In such case, this License incorporates the limitation as if\nwritten in the body of this License.\n\n  13. The Free Software Foundation may publish revised and/or new\nversions of the Lesser General Public License from time to time.\nSuch new versions will be similar in spirit to the present version,\nbut may differ in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Library\nspecifies a version number of this License which applies to it and\n\"any later version\", you have the option of following the terms and\nconditions either of that version or of any later version published by\nthe Free Software Foundation.  If the Library does not specify a\nlicense version number, you may choose any version ever published by\nthe Free Software Foundation.\n\n  14. If you wish to incorporate parts of the Library into other free\nprograms whose distribution conditions are incompatible with these,\nwrite to the author to ask for permission.  For software which is\ncopyrighted by the Free Software Foundation, write to the Free\nSoftware Foundation; we sometimes make exceptions for this.  Our\ndecision will be guided by the two goals of preserving the free status\nof all derivatives of our free software and of promoting the sharing\nand reuse of software generally.\n\n                            NO WARRANTY\n\n  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\nWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\nOTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\nKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\nLIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\nTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\nAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\nFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\nLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\nRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\nFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\nSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGES.\n\n                     END OF TERMS AND CONDITIONS\n\n           How to Apply These Terms to Your New Libraries\n\n  If you develop a new library, and you want it to be of the greatest\npossible use to the public, we recommend making it free software that\neveryone can redistribute and change.  You can do so by permitting\nredistribution under these terms (or, alternatively, under the terms of the\nordinary General Public License).\n\n  To apply these terms, attach the following notices to the library.  It is\nsafest to attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least the\n\"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the library's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\nAlso add information on how to contact you by electronic and paper mail.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the library, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the\n  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\n\n  <signature of Ty Coon>, 1 April 1990\n  Ty Coon, President of Vice\n\nThat's all there is to it!\n"
  },
  {
    "path": "third_party/uchardet/uchardet/INSTALL",
    "content": "# Building uchardet (generic)\n\n`uchardet` uses a typical cmake installation.\n\n* Configure with `cmake`. There are various options. For instance to configure\n  with a prefix as a release-ready build:\n\n> cmake -DCMAKE_INSTALL_PREFIX=/home/jehan/.local -DCMAKE_BUILD_TYPE=Release\n\nAlternatively, use `ccmake`, curses interface to `cmake`.\n\n* Build with `make`.\n\n* Install with `make install`.\n\nRead `README` for more details on uchardet.\n\n# Building uchardet on Windows\n\nThe above procedure is generic, which means it should work on any platform.\nIn particular, it works well on Linux.\n\nThe procedure is the same on Windows, but if you want more details (for\ninstance which tools to use in order to run CMake on Windows, compiler\ninformation, etc.), the following link may be useful:\nhttps://github.com/BYVoid/uchardet/issues/39#issuecomment-353873891\n"
  },
  {
    "path": "third_party/uchardet/uchardet/Origin_GitHub.url",
    "content": "[InternetShortcut]\nURL=https://github.com/freedesktop/uchardet"
  },
  {
    "path": "third_party/uchardet/uchardet/README.md",
    "content": "# uchardet\n\nForked from [freedesktop/uchardet](https://github.com/freedesktop/uchardet)\n\n[uchardet](https://www.freedesktop.org/wiki/Software/uchardet/) is an encoding detector library, which takes a sequence of bytes in an unknown character encoding without any additional information, and attempts to determine the encoding of the text. Returned encoding names are [iconv](https://www.gnu.org/software/libiconv/)-compatible.\n\nuchardet started as a C language binding of the original C++ implementation of the universal charset detection library by Mozilla. It can now detect more charsets, and more reliably than the original implementation.\n\nThe original code of universalchardet is available at http://lxr.mozilla.org/seamonkey/source/extensions/universalchardet/\n\nTechniques used by universalchardet are described at http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html\n\n## Supported Languages/Encodings\n\n  * International (Unicode)\n    * UTF-8\n    * UTF-16BE / UTF-16LE\n    * UTF-32BE / UTF-32LE / X-ISO-10646-UCS-4-34121 / X-ISO-10646-UCS-4-21431\n  * Arabic\n    * ISO-8859-6\n    * WINDOWS-1256\n  * Bulgarian\n    * ISO-8859-5\n    * WINDOWS-1251\n  * Chinese\n    * ISO-2022-CN\n    * BIG5\n    * EUC-TW\n    * GB18030\n    * HZ-GB-2312\n  * Croatian:\n    * ISO-8859-2\n    * ISO-8859-13\n    * ISO-8859-16\n    * Windows-1250\n    * IBM852\n    * MacCentralEurope\n  * Czech\n    * Windows-1250\n    * ISO-8859-2\n    * IBM852\n    * MacCentralEurope\n  * Danish\n    * ISO-8859-1\n    * ISO-8859-15\n    * WINDOWS-1252\n  * English\n    * ASCII\n  * Esperanto\n    * ISO-8859-3\n  * Estonian\n    * ISO-8859-4\n    * ISO-8859-13\n    * ISO-8859-13\n    * Windows-1252\n    * Windows-1257\n  * Finnish\n    * ISO-8859-1\n    * ISO-8859-4\n    * ISO-8859-9\n    * ISO-8859-13\n    * ISO-8859-15\n    * WINDOWS-1252\n  * French\n    * ISO-8859-1\n    * ISO-8859-15\n    * WINDOWS-1252\n  * German\n    * ISO-8859-1\n    * WINDOWS-1252\n  * Greek\n    * ISO-8859-7\n    * WINDOWS-1253\n  * Hebrew\n    * ISO-8859-8\n    * WINDOWS-1255\n  * Hungarian:\n    * ISO-8859-2\n    * WINDOWS-1250\n  * Irish Gaelic\n    * ISO-8859-1\n    * ISO-8859-9\n    * ISO-8859-15\n    * WINDOWS-1252\n  * Italian\n    * ISO-8859-1\n    * ISO-8859-3\n    * ISO-8859-9\n    * ISO-8859-15\n    * WINDOWS-1252\n  * Japanese\n    * ISO-2022-JP\n    * SHIFT_JIS\n    * EUC-JP\n  * Korean\n    * ISO-2022-KR\n    * EUC-KR / UHC\n  * Lithuanian\n    * ISO-8859-4\n    * ISO-8859-10\n    * ISO-8859-13\n  * Latvian\n    * ISO-8859-4\n    * ISO-8859-10\n    * ISO-8859-13\n  * Maltese\n    * ISO-8859-3\n  * Polish:\n    * ISO-8859-2\n    * ISO-8859-13\n    * ISO-8859-16\n    * Windows-1250\n    * IBM852\n    * MacCentralEurope\n  * Portuguese\n    * ISO-8859-1\n    * ISO-8859-9\n    * ISO-8859-15\n    * WINDOWS-1252\n  * Romanian:\n    * ISO-8859-2\n    * ISO-8859-16\n    * Windows-1250\n    * IBM852\n  * Russian\n    * ISO-8859-5\n    * KOI8-R\n    * WINDOWS-1251\n    * MAC-CYRILLIC\n    * IBM866\n    * IBM855\n  * Slovak\n    * Windows-1250\n    * ISO-8859-2\n    * IBM852\n    * MacCentralEurope\n  * Slovene\n    * ISO-8859-2\n    * ISO-8859-16\n    * Windows-1250\n    * IBM852\n    * MacCentralEurope\n  * Spanish\n    * ISO-8859-1\n    * ISO-8859-15\n    * WINDOWS-1252\n  * Swedish\n    * ISO-8859-1\n    * ISO-8859-4\n    * ISO-8859-9\n    * ISO-8859-15\n    * WINDOWS-1252\n  * Thai\n    * TIS-620\n    * ISO-8859-11\n  * Turkish:\n    * ISO-8859-3\n    * ISO-8859-9\n  * Vietnamese:\n    * VISCII\n    * Windows-1258\n  * Others\n    * WINDOWS-1252\n\n## Installation\n\n### Build from source\n\nIf you prefer a development version, clone the git repository:\n\n    git clone https://github.com/PyYoshi/uchardet.git\n\nThe source can be browsed at: https://github.com/PyYoshi/uchardet\n\n    mkdir build/ && cd build/\n    cmake ..\n    make\n    make install\n\n## Usage\n\n### Command Line\n\n```\nuchardet Command Line Tool\nVersion 0.0.6\n\nAuthors: BYVoid, Jehan\nBug Report: https://bugs.freedesktop.org/enter_bug.cgi?product=uchardet\n\nUsage:\n uchardet [Options] [File]...\n\nOptions:\n -v, --version         Print version and build information.\n -h, --help            Print this help.\n ```\n### Library\n\nSee [uchardet.h](https://github.com/PyYoshi/uchardet/blob/cchardet/src/uchardet.h)\n\n## Licenses\n\n* [Mozilla Public License Version 1.1](http://www.mozilla.org/MPL/1.1/)\n* [GNU General Public License, version 2.0](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) or later.\n* [GNU Lesser General Public License, version 2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) or later.\n\nSee the file `COPYING` for the complete text of these 3 licenses.\n"
  },
  {
    "path": "third_party/uchardet/uchardet/_GitHub.url",
    "content": "[InternetShortcut]\nURL=https://github.com/PyYoshi/uchardet"
  },
  {
    "path": "third_party/uchardet/uchardet/_GitHub_libchardet.url",
    "content": "[InternetShortcut]\nURL=https://github.com/Joungkyun/libchardet\n"
  },
  {
    "path": "third_party/uchardet/uchardet/doc/CMakeLists.txt",
    "content": "install(\n\tFILES\n\t\tuchardet.1\n\tDESTINATION\n\t\t${CMAKE_INSTALL_MANDIR}/man1\n)\n"
  },
  {
    "path": "third_party/uchardet/uchardet/doc/README.maintainer",
    "content": "# How to do a uchardet release #\n\n* Update UCHARDET_VERSION_MAJOR, UCHARDET_VERSION_MINOR and\n  UCHARDET_VERSION_REVISION as needed in CMakeLists.txt.\n\n* Update README.md.\n\n* Commit the version change with the message \"Release: version X.Y.Z.\"\n\n* Tag your release commit with:\n\n    git tag -a vx.y.z\n\n  The tag message should be have the header \"Version x.y.z released.\" followed\n  by a list of new features or important fixes. This tag message will be\n  considered as the release note, hence have to be carefully crafted.\n\n  Considering that the previous release was va.b.c, you can read the full list\n  of commits between a.b.c and x.y.z with:\n\n    git log va.b.c..\n\n  This should help you to build a proper release note.\n\n* Push the release and the tag:\n\n    git push\n    git push origin vx.y.z\n\n* Create a release tarball:\n\n    git archive --format=tar.xz --prefix=uchardet-x.y.z/ vx.y.z >uchardet-x.y.z.tar.xz\n\nNote: if you have not already set this up, you have to run first:\n\n    git config tar.tar.xz.command \"xz -c\"\n\nCf. EXAMPLES section in `git help archive`.\n\n* Compute a SHA1 checksum:\n\n    sha1sum uchardet-x.y.x.tar.xz > uchardet-x.y.z.tar.xz.sha1\n\n* Upload to annarchy download server:\n\n    scp uchardet-x.y.x.tar.xz uchardet-x.y.z.tar.xz.sha1 annarchy.freedesktop.org:/srv/www.freedesktop.org/www/software/uchardet/releases/\n\n  The archive and its checksum file should now be available from:\n  https://www.freedesktop.org/software/uchardet/releases/\n\n* Make the git tag into a Gitlab release (not automatic).\n  It will be found at: https://gitlab.freedesktop.org/uchardet/uchardet/-/tags/vx.y.z\n  Just click the \"Edit release notes\" button, and copy paste the tag comment as \"release notes\".\n\n* Update the wiki page: https://www.freedesktop.org/wiki/Software/uchardet/\n  The release note link will be:\n  https://gitlab.freedesktop.org/uchardet/uchardet/-/releases/vx.y.z\n\n* Spread the good news!\n"
  },
  {
    "path": "third_party/uchardet/uchardet/doc/uchardet.1",
    "content": ".TH UCHARDET \"1\" \"July 2011\" \"uchardet \" \"User Commands\"\n.SH NAME\nuchardet \\- Universal Charset Detector\n.SH DESCRIPTION\nuchardet CLI is an encoding detector utility, which takes one or several files in unknown character encoding without any additional information, and attempts to determine the encoding of the texts. Returned encoding names are iconv-compatible.\n.SS \"Usage:\"\n.HP\nuchardet [\\fBOptions\\fR] [\\fBFile\\fR]...\n.HP\n\\fB\\-v\\fR\nPrint version and build information.\n.HP\n\\fB\\-h\\fR\nPrint help text.\n.HP\n.IP\n.PP\nuchardet Command Line Interface\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModel.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\n# Third party modules.\nimport unicodedata\nimport subprocess\nimport wikipedia\nimport importlib\nimport optparse\nimport datetime\nimport operator\nimport requests\nimport sys\nimport re\nimport os\n\n# Custom modules.\nimport charsets.db\nfrom charsets.codepoints import *\n\n# Command line processing.\nusage = 'Usage: {} <LANG-CODE>\\n' \\\n        '\\nEx: `{} fr`'.format(__file__, __file__)\n\ndescription = \"Internal tool for uchardet to generate language data.\"\ncmdline = optparse.OptionParser(usage, description = description)\ncmdline.add_option('--max-page',\n                   help = 'Maximum number of Wikipedia pages to parse (useful for debugging).',\n                   action = 'store', type = 'int', dest = 'max_page', default = None)\ncmdline.add_option('--max-depth',\n                   help = 'Maximum depth when following links from start page (default: 2).',\n                   action = 'store', type = 'int',\n                   dest = 'max_depth', default = 2)\n(options, langs) = cmdline.parse_args()\nif len(langs) < 1:\n    print(\"Please select at least one language code.\\n\")\n    exit(1)\nif len(langs) > 1:\n    print(\"This script is meant to generate data for one language at a time.\\n\")\n    exit(1)\nlang = langs[0]\n\n# Load the language data.\nsys_path_backup = sys.path\ncurrent_dir = os.path.dirname(os.path.realpath(__file__))\nsys.path = [current_dir + '/langs']\n\ntry:\n    lang = importlib.import_module(lang.lower())\nexcept ImportError:\n    print('Unknown language code \"{}\": '\n          'file \"langs/{}.py\" does not exist.'.format(lang, lang.lower()))\n    exit(1)\nsys.path = sys_path_backup\n\ncharsets = charsets.db.load(lang.charsets)\n\nif not hasattr(lang, 'start_pages') or lang.start_pages is None or \\\n   lang.start_pages == []:\n    # Let's start with the main page, assuming it should have links\n    # to relevant pages. In locale wikipedia, this page is usually redirected\n    # to a relevant page.\n    print(\"Warning: no `start_pages` set for '{}'. Using ['Main_Page'].\\n\"\n          \"         If you don't get good data, it is advised to set a \"\n          \"start_pages` variable yourself.\".format(lang.code))\n    lang.start_pages = ['Main_Page']\nif not hasattr(lang, 'wikipedia_code') or lang.wikipedia_code is None:\n    lang.wikipedia_code = lang.code\nif not hasattr(lang, 'clean_wikipedia_content') or lang.clean_wikipedia_content is None:\n    lang.clean_wikipedia_content = None\nif hasattr(lang, 'case_mapping'):\n    lang.case_mapping = bool(lang.case_mapping)\nelse:\n    lang.case_mapping = False\nif not hasattr(lang, 'custom_case_mapping'):\n    lang.custom_case_mapping = None\nif not hasattr(lang, 'alphabet') or lang.alphabet is None:\n    lang.alphabet = None\n\ndef local_lowercase(text, lang):\n    lowercased = ''\n    for l in text:\n        if lang.custom_case_mapping is not None and \\\n           l in lang.custom_case_mapping:\n            lowercased += lang.custom_case_mapping[l]\n        elif l.isupper() and \\\n             lang.case_mapping and \\\n             len(unicodedata.normalize('NFC', l.lower())) == 1:\n            lowercased += l.lower()\n        else:\n            lowercased += l\n    return lowercased\n\nif lang.alphabet is not None:\n    # Allowing to provide an alphabet in string format rather than list.\n    lang.alphabet = list(lang.alphabet)\n    if lang.use_ascii:\n        lang.alphabet += [chr(l) for l in range(65, 91)] + [chr(l) for l in range(97, 123)]\n    if lang.case_mapping or lang.custom_case_mapping is not None:\n        lang.alphabet = [local_lowercase(l, lang) for l in lang.alphabet]\n        #alphabet = []\n        #for l in lang.alphabet:\n            #if l.isupper() and \\\n               #lang.custom_case_mapping is not None and \\\n               #l in lang.custom_case_mapping:\n                #alphabet.append(lang.custom_case_mapping[l])\n            #elif l.isupper() and \\\n                 #lang.case_mapping and \\\n                 #len(unicodedata.normalize('NFC', l.lower())) == 1:\n                #alphabet.append(l.lower())\n            #else:\n                #alphabet.append(l)\n    lang.alphabet = list(set(lang.alphabet))\n\n# Starting processing.\nwikipedia.set_lang(lang.wikipedia_code)\n\nvisited_pages = []\n\n# The full list of letter characters.\n# The key is the unicode codepoint,\n# and the value is the occurrence count.\ncharacters = {}\n# Sequence of letters.\n# The key is the couple (char1, char2) in unicode codepoint,\n# the value is the occurrence count.\nsequences = {}\nprev_char = None\n\ndef process_text(content, lang):\n    global charsets\n    global characters\n    global sequences\n    global prev_char\n\n    if lang.clean_wikipedia_content is not None:\n        content = lang.clean_wikipedia_content(content)\n    # Clean out the Wikipedia syntax for titles.\n    content = re.sub(r'(=+) *([^=]+) *\\1',\n                     r'\\2', content)\n    # Clean multiple spaces. Newlines and such are normalized to spaces,\n    # since they have basically a similar role in the purpose of uchardet.\n    content = re.sub(r'\\s+', ' ', content)\n\n    if lang.case_mapping or lang.custom_case_mapping is not None:\n        content = local_lowercase(content, lang)\n\n    # In python 3, strings are UTF-8.\n    # Looping through them return expected characters.\n    for char in content:\n        is_letter = False\n        if ord(char) in characters:\n            characters[ord(char)] += 1\n            is_letter = True\n        else:\n            # We save the character if it is at least in one of the\n            # language encodings and its not a special character.\n            for charset in charsets:\n                # Does the character exist in the charset?\n                try:\n                    codepoint = char.encode(charset, 'ignore')\n                except LookupError:\n                    # unknown encoding. Use iconv from command line instead.\n                    try:\n                        call = subprocess.Popen(['iconv', '-f', 'UTF-8', '-t', charset],\n                                                stdin=subprocess.PIPE, stdout=subprocess.PIPE,\n                                                stderr=subprocess.DEVNULL)\n                        if call.poll() is not None:\n                            (_, error) = call.communicate(input='')\n                            print('Error: `iconv` ended with error \"{}\".\\n'.format(error))\n                            exit(1)\n                        (codepoint, _) = call.communicate(input=char.encode('UTF-8'))\n                    except FileNotFoundError:\n                        print('Error: \"{}\" is not a supported charset by python and `iconv` is not installed.\\n')\n                        exit(1)\n\n                if codepoint == b'':\n                    continue\n                # ord() is said to return the unicode codepoint.\n                # But it turns out it also gives the codepoint for other\n                # charsets if I turn the string to encoded bytes first.\n                # Not sure if that is a bug or expected.\n                codepoint = ord(codepoint)\n                if charsets[charset].charmap[codepoint] == LET:\n                    characters[ord(char)] = 1\n                    is_letter = True\n                    break\n        if is_letter:\n            if prev_char is not None:\n                if (prev_char, ord(char)) in sequences:\n                    sequences[(prev_char, ord(char))] += 1\n                else:\n                    sequences[(prev_char, ord(char))] = 1\n            prev_char = ord(char)\n        else:\n            prev_char = None\n\ndef visit_pages(titles, depth, lang, logfd):\n    global visited_pages\n    global options\n\n    if len(titles) == 0:\n        return\n\n    next_titles = []\n    for title in titles:\n        if options.max_page is not None and \\\n           len(visited_pages) > options.max_page:\n            return\n        if title in visited_pages:\n            continue\n        visited_pages += [title]\n        try:\n            page = wikipedia.page(title)\n        except (wikipedia.exceptions.PageError,\n                wikipedia.exceptions.DisambiguationError):\n            # Let's just discard a page when I get an exception.\n            print(\"Discarding page {}.\\n\".format(title))\n            continue\n        logfd.write(\"\\n{} (revision {})\".format(title, page.revision_id))\n\n        process_text(page.content, lang)\n        try:\n            next_titles += page.links\n        except KeyError:\n            pass\n\n    if depth >= options.max_depth:\n        return\n\n    visit_pages (next_titles, depth + 1, lang, logfd)\n\nlanguage_c = lang.name.replace('-', '_').title()\nbuild_log = current_dir + '/BuildLangModelLogs/Lang{}Model.log'.format(language_c)\nlogfd = open(build_log, 'w')\nlogfd.write('= Logs of language model for {} ({}) =\\n'.format(lang.name, lang.code))\nlogfd.write('\\n- Generated by {}'.format(os.path.basename(__file__)))\nlogfd.write('\\n- Started: {}'.format(str(datetime.datetime.now())))\nlogfd.write('\\n- Maximum depth: {}'.format(options.max_depth))\nif options.max_page is not None:\n    logfd.write('\\n- Max number of pages: {}'.format(options.max_page))\nlogfd.write('\\n\\n== Parsed pages ==\\n')\ntry:\n    visit_pages(lang.start_pages, 0, lang, logfd)\nexcept requests.exceptions.ConnectionError:\n    print('Error: connection to Wikipedia failed. Aborting\\n')\n    exit(1)\nlogfd.write('\\n\\n== End of Parsed pages ==')\nlogfd.write('\\n\\n- Wikipedia parsing ended at: {}\\n'.format(str(datetime.datetime.now())))\n\n########### CHARACTERS ###########\n\n# Character ratios.\nratios = {}\nn_char = len(characters)\noccurrences = sum(characters.values())\n\nlogfd.write(\"\\n{} characters appeared {} times.\\n\".format(n_char, occurrences))\nfor char in characters:\n    ratios[char] = characters[char] / occurrences\n    #logfd.write(\"Character '{}' usage: {} ({} %)\\n\".format(chr(char),\n    #                                                       characters[char],\n    #                                                       ratios[char] * 100))\n\nsorted_ratios = sorted(ratios.items(), key=operator.itemgetter(1),\n                       reverse=True)\n# Accumulated ratios of the frequent chars.\naccumulated_ratios = 0\n\n# If there is no alphabet defined, we just use the first 64 letters, which was\n# the original default.\n# If there is an alphabet, we make sure all the alphabet characters are in the\n# frequent list, and we stop then. There may therefore be more or less than\n# 64 frequent characters depending on the language.\nif lang.alphabet is None:\n    freq_count = 64\nelse:\n    freq_count = 0\n    for order, (char, ratio) in enumerate(sorted_ratios):\n        if len(lang.alphabet) == 0:\n            break\n        if chr(char) in lang.alphabet:\n            lang.alphabet.remove(chr(char))\n        freq_count += 1\n    else:\n        if len(lang.alphabet) > 0:\n            print(\"Error: alphabet characters are absent from data collection\"\n                  \"\\n       Please check the configuration or the data.\"\n                  \"\\n       Missing characters: {}\".format(\", \".join(lang.alphabet)))\n            exit(1)\n\nlogfd.write('\\nFirst {} characters:'.format(freq_count))\nfor order, (char, ratio) in enumerate(sorted_ratios):\n    if order >= freq_count:\n        break\n    logfd.write(\"\\n[{:2}] Char {}: {} %\".format(order, chr(char), ratio * 100))\n    accumulated_ratios += ratio\n\nlogfd.write(\"\\n\\nThe first {} characters have an accumulated ratio of {}.\\n\".format(freq_count, accumulated_ratios))\n\nwith open(current_dir + '/header-template.cpp', 'r') as header_fd:\n    c_code = header_fd.read()\n\nc_code += '\\n/********* Language model for: {} *********/\\n\\n'.format(lang.name)\nc_code += '/**\\n * Generated by {}\\n'.format(os.path.basename(__file__))\nc_code += ' * On: {}\\n'.format(str(datetime.datetime.now()))\nc_code += ' **/\\n'\n\nc_code += \\\n\"\"\"\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\n\"\"\"\n\nfor charset in charsets:\n    charset_c = charset.replace('-', '_').title()\n    CTOM_str = 'static const unsigned char {}_CharToOrderMap[]'.format(charset_c)\n    CTOM_str += ' =\\n{'\n    for line in range(0, 16):\n        CTOM_str += '\\n  '\n        for column in range(0, 16):\n            cp = line * 16 + column\n            cp_type = charsets[charset].charmap[cp]\n            if cp_type == ILL:\n                CTOM_str += 'ILL,'\n            elif cp_type == RET:\n                CTOM_str += 'RET,'\n            elif cp_type == CTR:\n                CTOM_str += 'CTR,'\n            elif cp_type == SYM:\n                CTOM_str += 'SYM,'\n            elif cp_type == NUM:\n                CTOM_str += 'NUM,'\n            else: # LET\n                try:\n                    uchar = bytes([cp]).decode(charset)\n                except UnicodeDecodeError:\n                    print('Unknown character 0X{:X} in {}.'.format(cp, charset))\n                    print('Please verify your charset specification.\\n')\n                    exit(1)\n                except LookupError:\n                    # Unknown encoding. Use iconv instead.\n                    try:\n                        call = subprocess.Popen(['iconv', '-t', 'UTF-8', '-f', charset],\n                                                stdin=subprocess.PIPE,\n                                                stdout=subprocess.PIPE,\n                                                stderr=subprocess.PIPE)\n                        if call.poll() is not None:\n                            (_, error) = call.communicate(input='')\n                            print('Error: `iconv` ended with error \"{}\".\\n'.format(error))\n                            exit(1)\n                        (uchar, _) = call.communicate(input=bytes([cp]))\n                        uchar = uchar.decode('UTF-8')\n                    except FileNotFoundError:\n                        print('Error: \"{}\" is not a supported charset by python and `iconv` is not installed.\\n')\n                        exit(1)\n                #if lang.case_mapping and uchar.isupper() and \\\n                   #len(unicodedata.normalize('NFC', uchar.lower())) == 1:\n                   # Unless we encounter special cases of characters with no\n                   # composed lowercase, we lowercase it.\n                if lang.case_mapping or lang.custom_case_mapping is not None:\n                    uchar = local_lowercase(uchar, lang)\n                for order, (char, ratio) in enumerate(sorted_ratios):\n                    if char == ord(uchar):\n                        CTOM_str += '{:3},'.format(min(249, order))\n                        break\n                else:\n                    # XXX: we must make sure the character order does not go\n                    # over the special characters (250 currently). This may\n                    # actually happen when building a model for a language\n                    # writable with many different encoding. So let's just\n                    # ceil the order value at 249 max.\n                    # It may be an interesting alternative to add another\n                    # constant for any character with an order > freqCharCount.\n                    # Maybe IRR (irrelevant character) or simply CHR.\n                    CTOM_str += '{:3},'.format(min(249, n_char))\n                    n_char += 1\n        CTOM_str += ' /* {:X}X */'.format(line)\n    CTOM_str += '\\n};\\n/*'\n    CTOM_str += 'X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF'\n    CTOM_str += ' */\\n\\n'\n    c_code += CTOM_str\n\n########### SEQUENCES ###########\n\nratios = {}\noccurrences = sum(sequences.values())\nratio_512 = 0\nratio_1024 = 0\n\nsorted_seqs = sorted(sequences.items(), key=operator.itemgetter(1),\n                     reverse=True)\nfor order, ((c1, c2), count) in enumerate(sorted_seqs):\n    if order < 512:\n        ratio_512 += count\n    elif order < 1024:\n        ratio_1024 += count\n    else:\n        break\nratio_512 /= occurrences\nratio_1024 /= occurrences\n\nlogfd.write(\"\\n{} sequences found.\\n\".format(len(sorted_seqs)))\n\nc_code += \"\"\"\n/* Model Table:\n * Total sequences: {}\n * First 512 sequences: {}\n * Next 512 sequences (512-1024): {}\n * Rest: {}\n * Negative sequences: TODO\"\"\".format(len(sorted_seqs),\n                                      ratio_512,\n                                      ratio_1024,\n                                      1 - ratio_512 - ratio_1024)\n\nlogfd.write(\"\\nFirst 512 (typical positive ratio): {}\".format(ratio_512))\nlogfd.write(\"\\nNext 512 (512-1024): {}\".format(ratio))\nlogfd.write(\"\\nRest: {}\".format(1 - ratio_512 - ratio_1024))\n\nc_code += \"\\n */\\n\"\n\nLM_str = 'static const PRUint8 {}LangModel[]'.format(language_c)\nLM_str += ' =\\n{'\nfor line in range(0, freq_count):\n    LM_str += '\\n  '\n    for column in range(0, freq_count):\n        # Let's not make too long lines.\n        if freq_count > 40 and column == int(freq_count / 2):\n            LM_str += '\\n   '\n        first_order = int(line)\n        second_order = column\n        if first_order < len(sorted_ratios) and second_order < len(sorted_ratios):\n            (first_char, _) = sorted_ratios[first_order]\n            (second_char, _) = sorted_ratios[second_order]\n            if (first_char, second_char) in sequences:\n                for order, (seq, _) in enumerate(sorted_seqs):\n                    if seq == (first_char, second_char):\n                        if order < 512:\n                            LM_str += '3,'\n                        elif order < 1024:\n                            LM_str += '2,'\n                        else:\n                            LM_str += '1,'\n                        break\n                else:\n                    pass # impossible!\n                    LM_str += '0,'\n            else:\n                LM_str += '0,'\n        else:\n            # It may indeed happen that we find less than 64 letters used for a\n            # given language.\n            LM_str += '0,'\nLM_str += '\\n};\\n'\nc_code += LM_str\n\nfor charset in charsets:\n    charset_c = charset.replace('-', '_').title()\n    SM_str = '\\n\\nconst SequenceModel {}{}Model ='.format(charset_c, language_c)\n    SM_str += '\\n{\\n  '\n    SM_str += '{}_CharToOrderMap,\\n  {}LangModel,'.format(charset_c, language_c)\n    SM_str += '\\n  {},'.format(freq_count)\n    SM_str += '\\n  (float){},'.format(ratio_512)\n    SM_str += '\\n  {},'.format('PR_TRUE' if lang.use_ascii else 'PR_FALSE')\n    SM_str += '\\n  \"{}\"'.format(charset)\n    SM_str += '\\n};'\n    c_code += SM_str\n\nc_code += '\\n'\n\nlang_model_file = current_dir + '/../src/LangModels/Lang{}Model.cpp'.format(language_c)\nwith open(lang_model_file, 'w') as cpp_fd:\n    cpp_fd.write(c_code)\n\nlogfd.write('\\n\\n- Processing end: {}\\n'.format(str(datetime.datetime.now())))\nlogfd.close()\n\nprint(\"The following language model file has been generated: {}\"\n      \"\\nThe build log is available in: {}\"\n      \"\\nTest them and commit them.\".format(lang_model_file, build_log))\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangAfricaansModel.log",
    "content": "= Logs of language model for Africaans (af) =\n\n- Generated by BuildLangModel.py\n- Started: 2019-03-05 22:03:10.909663\n- Maximum depth: 4\n- Max number of pages: 100\n\n== Parsed pages ==\n\nTuisblad (revision 1684582)\n1461 (revision 1430176)\n1790 (revision 1675248)\n1791 (revision 1675249)\n1902 (revision 1754087)\n1975 (revision 1880191)\n1980 (revision 1758590)\n4 Maart (revision 1661671)\n91ste Oscar-toekenningsaand (revision 1946970)\nAfrikaans (revision 1948308)\nArbeidersparty (Verenigde Koninkryk) (revision 1889370)\nBohemian Rhapsody (rolprent) (revision 1866749)\nBrexit (revision 1929336)\nBritse Ryk (revision 1818751)\nBritse Statebond (revision 1948285)\nCalvados (département) (revision 1868774)\nChagos-argipel (revision 1615824)\nCharlie Chaplin (revision 1781860)\nCôtes-d'Armor (revision 1782169)\nDeelstate van die Verenigde State van Amerika (revision 1649766)\nDemokratiese Alliansie (revision 1812222)\nDépartement (revision 1854517)\nEduard IV van Engeland (revision 1782743)\nElizabeth II van die Verenigde Koninkryk (revision 1901993)\nEngeland (revision 1888071)\nFrankryk (revision 1879703)\nFranse Rewolusie (revision 1756798)\nHendrik VI van Engeland (revision 1800756)\nHuis van Lancaster (revision 1785007)\nHuis van York (revision 1785020)\nInternasionale Geregshof (revision 1882325)\nInternasionale reg (revision 1882335)\nKanada (revision 1877750)\nKarl Lagerfeld (revision 1949039)\nLitaue (revision 1931631)\nMaori (revision 1890097)\nMauritius (revision 1888421)\nNieu-Seeland (revision 1671277)\nOttawa (revision 1789990)\nPole (revision 1936495)\nPretoria (revision 1918057)\nPretoriabrug (revision 1887276)\nPyrénées-Atlantiques (revision 1792575)\nRami Malek (revision 1949040)\nRidder (revision 1884319)\nRobert Mugabe (revision 1906590)\nRose-oorlog (revision 1913440)\nSrc: (revision 1901833)\nStevens Mokgalapa (revision 1930702)\nSuid-Afrika (revision 1948307)\nSuider-Afrika (revision 1948287)\nSuiderkruis (revision 1888298)\nSuur (revision 1798004)\nSuurstof (revision 1798017)\nTweede Vryheidsoorlog (revision 1948023)\nVerenigde Koninkryk (revision 1929407)\nVerenigde State van Amerika (revision 1912053)\nVermont (revision 1801379)\nVlag van Nieu-Seeland (revision 1843138)\nWapen (heraldiek) (revision 1927920)\nWikipedia (revision 1857198)\nZimbabwe (revision 1811872)\nZimbabwe African National Union (revision 1281251)\n1361 (revision 1232246)\n13de eeu (revision 1778015)\n1403 (revision 1298375)\n1451 (revision 1436197)\n1456 (revision 1290621)\n1457 (revision 1245081)\n1458 (revision 1287891)\n1459 (revision 1499559)\n1460 (revision 1340662)\n1462 (revision 1226747)\n1463 (revision 1222574)\n1464 (revision 1825686)\n1465 (revision 1606552)\n1466 (revision 1435721)\n1471 (revision 1614854)\n14de eeu (revision 1424027)\n1561 (revision 1443451)\n15de eeu (revision 1929254)\n16de eeu (revision 1778021)\n17de eeu (revision 1778022)\n18 Desember (revision 1868555)\n22 Julie (revision 1574046)\n29 Maart (revision 1557782)\nAb Urbe Condita (jaartelling) (revision 1610886)\nArmeense kalender (revision 1614076)\nDinsdag (revision 1881264)\nDrie Konings (revision 1882373)\nEeue (revision 1824796)\nEthiopiese kalender (revision 1617197)\nGeskiedenis (revision 1881847)\nGewone jaar (revision 1618048)\nGregoriaanse kalender (revision 1784182)\nHierdie dag in die geskiedenis (revision 1805537)\nHindoekalender (revision 1882190)\nIndiese kalender (revision 1619125)\nIrannese kalender (revision 1120053)\nIslamitiese kalender (revision 1866795)\nJoodse kalender (revision 1950690)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2019-03-05 22:07:18.720938\n\n53 characters appeared 821166 times.\n\nFirst 50 characters:\n[ 0] Char e: 17.6384555619692 %\n[ 1] Char i: 8.750605845833851 %\n[ 2] Char n: 8.378330325415325 %\n[ 3] Char a: 8.181536985213707 %\n[ 4] Char s: 6.845875255429474 %\n[ 5] Char r: 6.67185441189723 %\n[ 6] Char o: 5.801384860064834 %\n[ 7] Char t: 5.707372200018023 %\n[ 8] Char d: 5.647335617889683 %\n[ 9] Char l: 4.071284003477981 %\n[10] Char g: 3.3341614241213104 %\n[11] Char k: 3.1217804926165966 %\n[12] Char v: 2.253990058039422 %\n[13] Char u: 2.214168633382288 %\n[14] Char m: 2.17848766266504 %\n[15] Char w: 1.7287612979592433 %\n[16] Char b: 1.5950489913123533 %\n[17] Char p: 1.5948054351982426 %\n[18] Char h: 1.476193607626229 %\n[19] Char y: 0.8480623893341908 %\n[20] Char f: 0.8352756933433678 %\n[21] Char c: 0.3411003378123303 %\n[22] Char j: 0.29957402035642 %\n[23] Char ë: 0.16768838456536192 %\n[24] Char ê: 0.0817130762842105 %\n[25] Char z: 0.07367572451855045 %\n[26] Char é: 0.05212100841973487 %\n[27] Char x: 0.026060504209867434 %\n[28] Char á: 0.02581694809575652 %\n[29] Char q: 0.018510264672429205 %\n[30] Char ï: 0.009864022621491879 %\n[31] Char ó: 0.00596712479571731 %\n[32] Char š: 0.0038968978257745692 %\n[33] Char ô: 0.003409785597552748 %\n[34] Char ü: 0.0026791172552200165 %\n[35] Char è: 0.00207022696994274 %\n[36] Char ø: 0.0018266708558318295 %\n[37] Char ž: 0.0014613366846654636 %\n[38] Char í: 0.001217780570554553 %\n[39] Char ç: 0.001217780570554553 %\n[40] Char ö: 0.0010960025134990976 %\n[41] Char ò: 0.0007306683423327318 %\n[42] Char æ: 0.0006088902852772765 %\n[43] Char ä: 0.0006088902852772765 %\n[44] Char ã: 0.00048711222822182116 %\n[45] Char â: 0.0003653341711663659 %\n[46] Char ß: 0.0003653341711663659 %\n[47] Char û: 0.00024355611411091058 %\n[48] Char à: 0.00024355611411091058 %\n[49] Char î: 0.00024355611411091058 %\n\nThe first 50 characters have an accumulated ratio of 0.9999963466582882.\n\n825 sequences found.\n\nFirst 512 (typical positive ratio): 0.9986034713711631\nNext 512 (512-1024): 1.217780570554553e-06\nRest: -1.1709383462843448e-17\n\n- Processing end: 2019-03-05 22:07:18.831493\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangArabicModel.log",
    "content": "= Logs of language model for Arabic (ar) =\n\n- Generated by BuildLangModel.py\n- Started: 2015-12-13 18:31:12.817808\n- Maximum depth: 2\n- Max number of pages: 50\n\n== Parsed pages ==\n\nالصفحة_الرئيسية (revision 17217037)\n11 ديسمبر (revision 17699159)\n12 ديسمبر (revision 17710194)\n13 ديسمبر (revision 17722318)\n1437 هـ (revision 17278274)\n14 ديسمبر (revision 17432010)\n15 ديسمبر (revision 17206233)\n1645 (revision 17168144)\n1954 (revision 17409780)\n1955 (revision 16826533)\n1972 (revision 17004868)\n1988 (revision 17671285)\n2003 (revision 17656994)\n2011 (revision 17589601)\n2015 (revision 17678287)\n216 ق.م (revision 17586752)\n25 يناير (revision 17325864)\n2 ربيع الأول (revision 17722146)\n6 (عدد) (revision 16972178)\nآريز (revision 17466671)\nآلهة اليونان (revision 17722617)\nأثينا (revision 17642941)\nأثينا (ميثولوجيا) (revision 17662932)\nأزمة المهاجرين إلى أوروبا (revision 17718437)\nأوروبا (revision 17713457)\nإس سي إي سانتا مونيكا ستوديو (revision 17035439)\nإسبارطة (revision 16733170)\nإسماعيل الصفوي (revision 17194218)\nإله الحرب (لعبة فيديو) (revision 17630201)\nإمارة دبي (revision 17602037)\nإيطاليا (revision 17586853)\nاتفاق باريس (revision 17718086)\nالأزمة الليبية (revision 17630232)\nالإمارات العربية المتحدة (revision 17722077)\nالإنتخابات البلدية السعودية 2015 (revision 17722004)\nالاتحاد الأوروبي لكرة القدم (revision 17596822)\nالاحتجاجات اللبنانية 2015 (revision 17315127)\nالانتفاضة الفلسطينية (2015) (revision 17710414)\nالتمرد العراقي (revision 17708640)\nالجمعية العامة للأمم المتحدة (revision 17304227)\nالجمهورية الرومانية (revision 16472557)\nالجيش اللبناني (revision 17516533)\nالحرب الأهلية السورية (revision 17675300)\nالحرب الأهلية اليمنية (2015) (revision 17686236)\nالحرب في شمال غرب باكستان (revision 17490838)\nالدولة الصفوية (revision 17031046)\nالرياض (revision 17580586)\nالسعودية (revision 17711339)\nالسلطة الوطنية الفلسطينية (revision 17438123)\nالعراق (revision 17704602)\nالعلاقات الخارجية في تركيا (revision 17647409)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2015-12-13 18:33:58.846891\n\n95 characters appeared 727795 times.\n\nFirst 64 characters:\n[ 0] Char ا: 14.933875610577156 %\n[ 1] Char ل: 11.460782225764122 %\n[ 2] Char ي: 8.30302489025069 %\n[ 3] Char م: 6.3702003998378665 %\n[ 4] Char و: 5.952637762007158 %\n[ 5] Char ر: 4.9419135883043985 %\n[ 6] Char ن: 4.900967992360486 %\n[ 7] Char ت: 4.229625100474721 %\n[ 8] Char ة: 3.6022506337636284 %\n[ 9] Char ب: 3.5434428650925054 %\n[10] Char ع: 3.3116468236247845 %\n[11] Char د: 3.1756195082406444 %\n[12] Char س: 2.5401383631379715 %\n[13] Char ف: 2.3899587109007343 %\n[14] Char ق: 2.010868445097864 %\n[15] Char أ: 1.8763525443291036 %\n[16] Char ه: 1.8663222473361318 %\n[17] Char ك: 1.8573911609725264 %\n[18] Char ح: 1.8431014227907585 %\n[19] Char ج: 1.3270220323030524 %\n[20] Char ط: 1.0305099650313618 %\n[21] Char ش: 0.9638703206260004 %\n[22] Char إ: 0.8946200509758929 %\n[23] Char ص: 0.8509264284585631 %\n[24] Char ى: 0.7726076711161797 %\n[25] Char خ: 0.717097534333157 %\n[26] Char ز: 0.6687322666410184 %\n[27] Char ث: 0.6549921337739336 %\n[28] Char ض: 0.5409490309771295 %\n[29] Char غ: 0.4574090231452538 %\n[30] Char ذ: 0.44765352880962356 %\n[31] Char ئ: 0.39269299734128427 %\n[32] Char ء: 0.295138053984982 %\n[33] Char ظ: 0.2397653185306302 %\n[34] Char آ: 0.12324899181775088 %\n[35] Char ؤ: 0.08491402111858422 %\n[36] Char ـ: 0.047678261048784344 %\n[37] Char a: 0.03311372020967443 %\n[38] Char e: 0.029403884335561525 %\n[39] Char i: 0.027205463076827956 %\n[40] Char o: 0.02432003517474014 %\n[41] Char t: 0.02349562720271505 %\n[42] Char r: 0.02294602188803166 %\n[43] Char n: 0.020472797971956388 %\n[44] Char s: 0.01799957405588112 %\n[45] Char l: 0.012915724895059736 %\n[46] Char h: 0.011816514265692949 %\n[47] Char d: 0.011129507622338709 %\n[48] Char پ: 0.010717303636326163 %\n[49] Char c: 0.009480691678288529 %\n[50] Char u: 0.007969277062909199 %\n[51] Char m: 0.007694474405567502 %\n[52] Char A: 0.006870066433542411 %\n[53] Char گ: 0.006595263776200715 %\n[54] Char f: 0.006183059790188171 %\n[55] Char S: 0.005770855804175626 %\n[56] Char y: 0.0054960531468339294 %\n[57] Char T: 0.0049464478321505365 %\n[58] Char b: 0.0048090465034796885 %\n[59] Char G: 0.0046716451748088405 %\n[60] Char I: 0.004396842517467144 %\n[61] Char C: 0.0042594411887962955 %\n[62] Char p: 0.0039846385314545995 %\n[63] Char k: 0.003709835874112903 %\n\nThe first 64 characters have an accumulated ratio of 0.999523217389512.\n\n1479 sequences found.\n\nFirst 512 (typical positive ratio): 0.9696025116913417\nNext 512 (512-1024): 1.3740132867084825e-06\nRest: 0.0012305764497782395\n\n- Processing end: 2015-12-13 18:33:59.193909\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangBelarusianModel.log",
    "content": "= Logs of language model for Belarusian (be) =\n\n- Generated by BuildLangModel.py\n- Started: 2019-03-05 18:30:17.964464\n- Maximum depth: 4\n- Max number of pages: 100\n\n== Parsed pages ==\n\nГалоўная_старонка (revision 3314810)\n1386 (revision 3318522)\n1812 (revision 3317760)\n1837 (revision 3317732)\n1925 (revision 3316369)\n1956 (revision 3316332)\n1959 (revision 3316329)\n2019 (revision 3333637)\n4 сакавіка (revision 1761191)\nHelaeomyia petrolei (revision 3312800)\nTUT.BY (revision 3189969)\nXX стагоддзе (revision 3006438)\nІван Пятровіч Паўлаў (revision 3330827)\nІнструкцыя па транслітарацыі (revision 3285076)\nАнтрапалогія (revision 3095342)\nАсфальт (revision 2594585)\nАэрапорт Віцебск (revision 3106296)\nАўстрыя (revision 3306502)\nБаравуха (revision 3332684)\nБеларуская Вікіпедыя (revision 3330925)\nБеларуская мова (revision 3321859)\nБеларусь (revision 3320908)\nБеласток (revision 3082237)\nВялікае княства Літоўскае (revision 3259013)\nВікіпедыя (revision 3333246)\nВіцебск (revision 3328544)\nВіцебская вобласць (revision 3328232)\nВіцебскі раён (revision 3238295)\nВіцьба (revision 3194807)\nГорад (revision 2627422)\nГравітацыя (альбом) (revision 3333104)\nДавыд Львовіч Глінскі (revision 3326607)\nЕўрапейскі маршрут E95 (revision 2686641)\nЖарэс Іванавіч Алфёраў (revision 3332006)\nЗаходняя Дзвіна (revision 3169818)\nЗнакі паштовай аплаты Украіны (1999) (revision 3225969)\nЗігмунд Фрэйд (revision 3200632)\nКА Піянер-4 (revision 2394843)\nЛучоса (revision 3251826)\nЛявон Вольскі (revision 3333010)\nЛітаратура (revision 1786497)\nМагістраль М3 (revision 3116154)\nМагістраль М8 (revision 3107563)\nМанстэра прывабная (revision 3332338)\nМасква (revision 3227608)\nМастацтва (revision 3294147)\nМедыцына (revision 1782135)\nМесяц, спадарожнік Зямлі (revision 3186245)\nМінск (revision 3229030)\nНаваполацк (revision 3260791)\nНафта (revision 3327706)\nНеўралогія (revision 3193067)\nНобелеўская прэмія па фізіцы (revision 3052696)\nНіва (1956) (revision 3315439)\nОрша (revision 3248596)\nПагранічны канфлікт паміж Індыяй і Пакістанам (2019) (revision 3333643)\nПанядзелак (revision 1526755)\nПолацк (revision 3329956)\nПоль Марыа (revision 3281894)\nПорт (revision 2674776)\nПсіхааналіз (revision 3260302)\nПсіхааналітык (revision 3260302)\nПсіхалогія (revision 2232890)\nПсіхіятрыя (revision 1919915)\nРасія (revision 3239593)\nРэч Паспалітая (revision 3266116)\nСанкт-Пецярбург (revision 2857455)\nСацыялогія (revision 3130424)\nСлавенская Вікіпедыя (revision 2760315)\nСправа БелТА (revision 3333271)\nСуперкубак Беларусі па футболе 2019 (revision 3333334)\nСыраежка шэрая (revision 3332345)\nУніверсальны каардынаваны час (revision 2713688)\nФК БАТЭ (revision 3333087)\nФК Дынама Брэст (revision 3332229)\nФутбол (revision 3161765)\nЧыкага (revision 3312149)\nЭнцыклапедыя (revision 3048519)\nЯгайла (revision 3248985)\nЯўхім Храптовіч (revision 3008180)\n12 сакавіка (revision 3110377)\n1345 (revision 3318571)\n1360-я (revision 2963824)\n1370-я (revision 3318540)\n1380-я (revision 3066609)\n1383 (revision 3318525)\n1384 (revision 3318524)\n1385 (revision 3318523)\n1387 (revision 3318521)\n1388 (revision 3318520)\n1389 (revision 3318519)\n1390-я (revision 3318516)\n1400-я (revision 3005229)\n1428 (revision 3318470)\n1456 (revision 3318437)\n23.10 (revision 2463644)\n24 лютага (revision 3100846)\n24 чэрвеня (revision 2866534)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2019-03-05 18:36:38.571630\n\n64 characters appeared 650592 times.\n\nFirst 61 characters:\n[ 0] Char а: 15.592106881117504 %\n[ 1] Char н: 6.625350450051645 %\n[ 2] Char і: 5.712796960306921 %\n[ 3] Char р: 5.026345236338596 %\n[ 4] Char с: 4.852196153656977 %\n[ 5] Char ы: 4.281024051940387 %\n[ 6] Char к: 4.109795386355811 %\n[ 7] Char л: 4.034633072647681 %\n[ 8] Char е: 3.7853216762579316 %\n[ 9] Char т: 3.5224841375239784 %\n[10] Char я: 3.404437804338203 %\n[11] Char д: 3.239664797599725 %\n[12] Char о: 3.2385888544587087 %\n[13] Char в: 3.172802616693719 %\n[14] Char м: 2.900435295853623 %\n[15] Char у: 2.899205646549604 %\n[16] Char п: 2.7653275785745906 %\n[17] Char з: 2.334028085190104 %\n[18] Char ц: 2.276849392553244 %\n[19] Char г: 2.130521125375043 %\n[20] Char ў: 2.0449067925827555 %\n[21] Char б: 1.5492044169003 %\n[22] Char ч: 1.3281749545029757 %\n[23] Char э: 1.3109598642467168 %\n[24] Char й: 1.2388716737986325 %\n[25] Char х: 1.0653374157690227 %\n[26] Char ь: 1.0553465151738723 %\n[27] Char ш: 0.8255558014854164 %\n[28] Char ж: 0.5312084993359893 %\n[29] Char ю: 0.4706482711130786 %\n[30] Char ф: 0.4598888397029167 %\n[31] Char i: 0.2782081550341842 %\n[32] Char ё: 0.27574885642614727 %\n[33] Char и: 0.14233190694014067 %\n[34] Char e: 0.13833554670208056 %\n[35] Char a: 0.13664477890905513 %\n[36] Char s: 0.111436968176676 %\n[37] Char o: 0.10344424770055581 %\n[38] Char n: 0.10298312921154887 %\n[39] Char t: 0.09744970734346564 %\n[40] Char r: 0.09714229501746102 %\n[41] Char x: 0.07516231370813044 %\n[42] Char l: 0.07485490138212582 %\n[43] Char u: 0.0667084747430033 %\n[44] Char c: 0.06363435148295707 %\n[45] Char v: 0.053336038561802177 %\n[46] Char m: 0.04857114750873051 %\n[47] Char d: 0.04764891053071664 %\n[48] Char b: 0.04518961192267965 %\n[49] Char p: 0.041808076336628794 %\n[50] Char k: 0.033815355860508586 %\n[51] Char g: 0.03243200039348778 %\n[52] Char w: 0.031202351089469286 %\n[53] Char y: 0.0301264079484531 %\n[54] Char h: 0.029511583296443857 %\n[55] Char z: 0.020750332005312084 %\n[56] Char f: 0.018905858049284345 %\n[57] Char j: 0.010605725247159511 %\n[58] Char ъ: 0.002305592445034676 %\n[59] Char щ: 0.0019981801190300527 %\n[60] Char q: 0.001844473956027741 %\n\nThe first 61 characters have an accumulated ratio of 0.9999815552604403.\n\n1419 sequences found.\n\nFirst 512 (typical positive ratio): 0.9748335015136226\nNext 512 (512-1024): 0.03404437804338203\nRest: 0.0015613246491147821\n\n- Processing end: 2019-03-05 18:36:38.805955\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangCroatianModel.log",
    "content": "= Logs of language model for Croatian (hr) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-25 23:41:35.999066\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nFizika čvrstog stanja (revision 4776646)\nAgregatno stanje (revision 4663090)\nAlnico (revision 3915185)\nAluminij (revision 4772363)\nAmorfna tvar (revision 4659679)\nAntimon (revision 4420072)\nAntoine Henri Becquerel (revision 4634966)\nApsolutna nula (revision 4706683)\nArsen (revision 4540773)\nArthur Holly Compton (revision 4736068)\nAtom (revision 4778162)\nAtomska jezgra (revision 4540956)\nBell Labs (revision 4769518)\nBor (element) (revision 4602837)\nBrian Josephson (revision 4403761)\nCink (revision 4537854)\nCoulombov zakon (revision 4710338)\nDijamant (revision 4625335)\nDimenzija (revision 4669110)\nDinastija Han (revision 4541686)\nDislokacija (revision 4668021)\nEV (revision 4538157)\nEksponencijalna funkcija (revision 4160157)\nElektrična struja (revision 4280621)\nElektrična vodljivost (revision 4460160)\nElektrični izolator (revision 4649046)\nElektrični luk (revision 4646980)\nElektrični naboj (revision 4727496)\nElektrični otpor (revision 4593314)\nElektrični vodič (revision 4333008)\nElektrično polje (revision 4705679)\nElektrolit (revision 4486319)\nElektromagnetsko zračenje (revision 4537368)\nElektron (revision 4630705)\nElektronika (revision 4090016)\nElektronska konfiguracija (revision 4420620)\nElektronski mikroskop (revision 4413214)\nElektrotehnika (revision 4596912)\nEnergetika (revision 4586277)\nEnergija (revision 4719089)\nFermi-Diracova statistika (revision 3934172)\nFeromagnetizam (revision 4760511)\nFizika (revision 4769955)\nFizika kondenzirane tvari (revision 4769955)\nFizikalna veličina (revision 4621676)\nFosfor (revision 4602427)\nFotodioda (revision 3939069)\nFotoelektrični učinak (revision 4704417)\nFoton (revision 4537522)\nFotonaponski sustavi (revision 4418887)\nFrancuski jezik (revision 4771366)\nGalij (revision 4537855)\nGenitiv (revision 4625199)\nGermanij (revision 4537856)\nHelij (revision 4747001)\nHenri (revision 3922500)\nIndij (revision 4537867)\nIntegrirani krug (revision 4447159)\nIon (revision 4549144)\nIoniziranje (revision 4566703)\nIzolator (revision 4649046)\nJohn Bardeen (revision 4403736)\nKadmij (revision 3921860)\nKelvin (revision 4624351)\nKeramika (revision 4599177)\nKinetička energija (revision 4719090)\nKlasična mehanika (revision 4637127)\nKompas (revision 4702880)\nKondenzacija (revision 4477825)\nKondenzirana tvar (revision 4776646)\nKonstrukcija (revision 4680450)\nKovalentna veza (revision 4641419)\nKristal (revision 4720329)\nKristalna rešetka (revision 4479184)\nKristalografija (revision 4105956)\nKrutine (revision 4625162)\nKubični kristalni sustav (revision 4344344)\nKubični metar (revision 4616551)\nKvantna mehanika (revision 4541215)\nLatinski jezik (revision 4760544)\nLuminiscencija (revision 4708222)\nMagnet (revision 4603344)\nMagnetizam (revision 4760040)\nMagnetska permeabilnost (revision 4675996)\nMagnetska vodljivost (revision 4736934)\nMagnetski moment (revision 4410235)\nMagnetsko polje (revision 4678057)\nMaterijal (revision 4669230)\nMehanika (revision 4698699)\nMetal (revision 4671710)\nMetan (revision 4422418)\nMetar (revision 4655527)\nMjerna veličina (revision 4621676)\nMolekula (revision 4539232)\nMolekule (revision 4539232)\nNapon (revision 4585417)\nNiskotemperaturna fizika (revision 4657522)\nNjemački jezik (revision 4731246)\nOptika (revision 4768098)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-25 23:50:27.589690\n\n49 characters appeared 500582 times.\n\nFirst 31 characters:\n[ 0] Char a: 10.808019465342342 %\n[ 1] Char i: 10.18554402675286 %\n[ 2] Char e: 9.571259054460608 %\n[ 3] Char o: 8.468143081453189 %\n[ 4] Char n: 6.952906816465634 %\n[ 5] Char t: 5.369549843981606 %\n[ 6] Char r: 5.331993559496746 %\n[ 7] Char j: 5.102860270644969 %\n[ 8] Char s: 4.717109284792501 %\n[ 9] Char k: 4.013927788054705 %\n[10] Char l: 3.854713113935379 %\n[11] Char u: 3.786792173909569 %\n[12] Char m: 3.730058212240951 %\n[13] Char v: 3.0989927724129114 %\n[14] Char p: 2.67308852495695 %\n[15] Char d: 2.6135578186990345 %\n[16] Char z: 1.8931963194841206 %\n[17] Char g: 1.5665765049482403 %\n[18] Char č: 1.161048539500022 %\n[19] Char b: 1.1440683044935693 %\n[20] Char c: 1.007627122029957 %\n[21] Char h: 0.8006680224219008 %\n[22] Char f: 0.5159993767254915 %\n[23] Char š: 0.422907735395999 %\n[24] Char ž: 0.3611795869607777 %\n[25] Char ć: 0.34959307366225717 %\n[26] Char đ: 0.2195444502598975 %\n[27] Char y: 0.11306838839590717 %\n[28] Char w: 0.07291512679241363 %\n[29] Char x: 0.04534721584076135 %\n[30] Char q: 0.02477116636235422 %\n\nThe first 31 characters have an accumulated ratio of 0.9997702674087363.\n\n712 sequences found.\n\nFirst 512 (typical positive ratio): 0.9989731099787131\nNext 512 (512-1024): 1.9976747066414694e-06\nRest: 3.7513395167998453e-17\n\n- Processing end: 2016-09-25 23:50:27.987029\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangCzechModel.log",
    "content": "= Logs of language model for Czech (cs) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-21 03:20:56.824516\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nSociální fobie (revision 13567590)\nAdaptace (revision 13991192)\nAgorafobie (revision 13013445)\nAlkoholismus (revision 13822064)\nAlprazolam (revision 14082425)\nAntidepresivum (revision 14113423)\nAsertivita (revision 14111958)\nAtenolol (revision 12051880)\nAutomatické negativní myšlenky (revision 13567590)\nBenzodiazepin (revision 13947546)\nBeta-blokátory (revision 13428762)\nBlud (revision 13888988)\nBohatství (revision 13556478)\nBupropion (revision 13686045)\nCitaloparam (revision 13567590)\nClonazepan (revision 13567590)\nCrohnova nemoc (revision 13745254)\nDeprese (psychologie) (revision 13695735)\nDiagnostický a statický manuál mentálních poruch (revision 13567590)\nDiagnostický a statistický manuál mentálních poruch (revision 13714660)\nDiagnóza (medicína) (revision 13052239)\nDichotomické myšlení (revision 13567590)\nDigital object identifier (revision 14138049)\nDopamin (revision 13714274)\nDystymie (revision 13567267)\nDůkaz kruhem (revision 13190761)\nElektivní mutismus (revision 9940891)\nEmoce (revision 14110033)\nEscitalopram (revision 12954987)\nEvoluce (revision 13951488)\nExpozice (psychologie) (revision 14119474)\nExtraverze a introverze (revision 13872996)\nFluoxetin (revision 12955006)\nFluvoxamin (revision 12955006)\nGen (revision 13907182)\nGeneralizovaná úzkostná porucha (revision 14006709)\nHalucinaci (revision 12188143)\nHněv (revision 14057864)\nInteligence (revision 14009781)\nInternational Standard Serial Number (revision 12869806)\nInterpersonální psychoterapie (revision 13567590)\nIracionalita (revision 4765977)\nJán Praško Pavlov (revision 14086840)\nKlinické testování (revision 13530979)\nKognitivní omyl (revision 13107294)\nKognitivní psychologie (revision 11629465)\nKognitivní restrukturalizace (revision 13567360)\nKognitivně behaviorální terapie (revision 13980494)\nKomorbidita (revision 11351714)\nLymská borelióza (revision 14068446)\nMalé sebevědomí (revision 13567590)\nMedical Subject Headings (revision 12239331)\nMeditace (revision 13180783)\nMentální černý filtr (revision 13567590)\nMezinárodní klasifikace nemocí (revision 12531067)\nMichael Liebowitz (revision 13567590)\nMoclobemid (revision 13567590)\nMoritova terapie (revision 11960292)\nMusturbace (revision 13567590)\nNervozita (revision 13847097)\nNoradrenalin (revision 14054165)\nObsedantně kompulzivní porucha (revision 13950365)\nPanická ataka (revision 13253537)\nPanická porucha (revision 13253537)\nParanoia (revision 14027052)\nParoxetin (revision 12955006)\nPohlavnost (revision 13564689)\nPorucha (revision 11039108)\nPravděpodobnost (revision 13596041)\nPredestinace (revision 12467403)\nProfese (revision 13975485)\nPropanolol (revision 12972658)\nPsychiatr (revision 12767960)\nPsychické trauma (revision 11227535)\nPsychoaktivní droga (revision 13939232)\nPsychodynamická léčba (revision 13567590)\nPsychofarmaka (revision 9928215)\nPsycholog (revision 12358728)\nPsychoterapie (revision 13874178)\nPuberta (revision 12540014)\nRIMA (revision 10234728)\nRemise (revision 9896748)\nRichard Heimberg (revision 13567590)\nRámování myšlenek (revision 13567590)\nSchizofrenie (revision 13977456)\nSebevražda (revision 14053884)\nSelektivní abstrakce (revision 13567590)\nSelektivní inhibitor zpětného vychytávání serotoninu (revision 12955027)\nSerotonin (revision 13975104)\nSertralin (revision 12955006)\nSkupinová terapie (revision 11964235)\nSociální chování (revision 13507313)\nSociální dovednost (revision 12226347)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-21 03:28:11.731386\n\n47 characters appeared 594800 times.\n\nFirst 41 characters:\n[ 0] Char o: 8.323806321452588 %\n[ 1] Char e: 8.040013449899126 %\n[ 2] Char n: 6.895595158036315 %\n[ 3] Char a: 6.263113651647613 %\n[ 4] Char i: 5.650470746469401 %\n[ 5] Char t: 5.40383322125084 %\n[ 6] Char s: 4.588937457969065 %\n[ 7] Char v: 3.8685272360457295 %\n[ 8] Char p: 3.6914929388029587 %\n[ 9] Char r: 3.6302958977807664 %\n[10] Char l: 3.6017148621385338 %\n[11] Char í: 3.5733019502353733 %\n[12] Char k: 3.301950235373235 %\n[13] Char u: 3.1782111634162744 %\n[14] Char c: 3.1383658372562206 %\n[15] Char d: 3.120208473436449 %\n[16] Char m: 2.758406186953598 %\n[17] Char h: 2.2747141896435776 %\n[18] Char á: 2.156186953597848 %\n[19] Char z: 2.0260591795561536 %\n[20] Char y: 1.9894082044384667 %\n[21] Char j: 1.8979488903833224 %\n[22] Char b: 1.8189307330195021 %\n[23] Char ě: 1.277236045729657 %\n[24] Char é: 1.2291526563550772 %\n[25] Char č: 0.9502353732347008 %\n[26] Char ž: 0.9214862138533961 %\n[27] Char ř: 0.8955951580363146 %\n[28] Char ý: 0.7646267652992602 %\n[29] Char š: 0.6605581708137189 %\n[30] Char f: 0.6260928043039677 %\n[31] Char ů: 0.5016812373907196 %\n[32] Char g: 0.47041022192333554 %\n[33] Char ú: 0.19502353732347008 %\n[34] Char x: 0.13685272360457296 %\n[35] Char ň: 0.05447209145931405 %\n[36] Char w: 0.04488903833221251 %\n[37] Char ó: 0.03429724277067922 %\n[38] Char ť: 0.02269670477471419 %\n[39] Char ď: 0.012104909213180902 %\n[40] Char q: 0.007229320780094149 %\n\nThe first 41 characters have an accumulated ratio of 0.9999613315400132.\n\n1025 sequences found.\n\nFirst 512 (typical positive ratio): 0.9786035192432675\nNext 512 (512-1024): 1.6812373907195695e-06\nRest: 2.0246480655940202e-06\n\n- Processing end: 2016-09-21 03:28:12.235582\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangDanishModel.log",
    "content": "= Logs of language model for Danish (da) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-02-19 17:53:58.564190\n- Maximum depth: 4\n- Max number of pages: 100\n\n== Parsed pages ==\n\nForside (revision 2692411)\n16. februar (revision 6877446)\n17. februar (revision 8454583)\n1878 (revision 8280505)\n19. februar (revision 8206479)\n1922 (revision 8455105)\n1926 (revision 8425271)\n1942 (revision 8443554)\n1945 (revision 8448461)\n1948 (revision 8454392)\n1985 (revision 8409096)\n2. verdenskrig (revision 8433181)\n23. oktober (revision 6877825)\n26. oktober (revision 7849938)\n3C 273 (revision 8443798)\nA-bus (revision 8427319)\nAktuelle begivenheder (revision 8440596)\nB-52 Stratofortress (revision 8422571)\nBorgerkrigen i Syrien (revision 8447763)\nBoutros Boutros-Ghali (revision 8453935)\nBrasilien (revision 8452750)\nCusco (region) (revision 7693764)\nDanmark (revision 8451178)\nDanmark i Eurovision Song Contest (revision 8453514)\nDansk (sprog) (revision 8455750)\nDansk Melodi Grand Prix 2016 (revision 8452164)\nDobbeltmordet på Peter Bangs Vej (revision 8334648)\nEncyklopædi (revision 8446641)\nEritrea-sagen (revision 8452285)\nEurovision Song Contest 2014 (revision 8445804)\nEurovision Song Contest 2016 (revision 8453588)\nFlygtningekrisen i Europa 2015 (revision 8452286)\nFonograf (revision 8177165)\nFormel 1 (revision 8450846)\nFormel 1 2016 (revision 8456463)\nFrederik 6. (revision 8438503)\nFørste observation af gravitationsbølger (revision 8451269)\nGrammofon (revision 8375093)\nGuadalcanal (revision 7796248)\nHarper Lee (revision 8456583)\nHartkorn (revision 8437552)\nIC4 (revision 8446402)\nIC4-sagen (revision 8434463)\nIslamisk Stat (revision 8439228)\nJonathan Leunbach (revision 8452603)\nJuliane Marie af Braunschweig-Wolfenbüttel (revision 8437957)\nKaliumklorid (revision 8452216)\nKejserriget Japan (revision 8044942)\nKevin Magnussen (revision 8455302)\nKøbenhavn (revision 8427847)\nLIGO (revision 8451266)\nLatinamerika (revision 7692181)\nLeonid Hurwicz (revision 8445727)\nLighthouse X (revision 8452940)\nLinkoban (revision 8455879)\nMachu Picchu (revision 8406907)\nMatador (tv-serie) (revision 8454648)\nMiddelaldercentret (revision 8449194)\nNobelprisen (revision 8409809)\nNykøbing Falster (revision 8452825)\nNyligt afdøde (revision 8456580)\nOvervågning (revision 8455039)\nPanorama (foto) (revision 8448393)\nPeru (revision 8437485)\nPeter Lauritsen (revision 8456097)\nProfessor (revision 8415451)\nRenault F1 (revision 8450843)\nS-bus (revision 8455589)\nSalomonøerne (revision 8238961)\nSlaget om Belgien (1940) (revision 8430013)\nSlaget om Guadalcanal (revision 7762887)\nSlaget om Henderson Field (revision 8445480)\nSlaget om Iwo Jima (revision 8145239)\nSoldiers of Love (Lighthouse X-sang) (revision 8452929)\nSolen (revision 8276478)\nStillehavskrigen (revision 8430649)\nStockholm (revision 8358042)\nSøslaget ved Guadalcanal (revision 7772812)\nThomas Edison (revision 8282441)\nTogulykken ved Bad Aibling (revision 8455364)\nTopografi (revision 6886168)\nUSA (revision 8448088)\nUnited States Army (revision 8401635)\nUnited States Marine Corps (revision 8401667)\nVestallierede (revision 6961443)\nWikimedia (revision 8263252)\nWikipedia (revision 8267051)\nZikavirus (revision 8454832)\n1. februar (revision 8404985)\n10. februar (revision 6877431)\n11. februar (revision 6877433)\n12. februar (revision 6877437)\n13. februar (revision 6877438)\n14. februar (revision 6877441)\n1497 (revision 7369489)\n15. februar (revision 7329463)\n1560 (revision 7874693)\n1568 (revision 7369703)\n1620 (revision 7423903)\n1688 (revision 7367090)\n18. februar (revision 6877450)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-02-19 17:56:42.162636\n\n53 characters appeared 1301488 times.\n\nFirst 30 characters:\n[ 0] Char e: 15.272749345364689 %\n[ 1] Char r: 8.48482659847805 %\n[ 2] Char n: 7.695652975670924 %\n[ 3] Char t: 6.977014002434137 %\n[ 4] Char a: 6.780469739252302 %\n[ 5] Char i: 6.164636170291236 %\n[ 6] Char s: 6.0942551909814 %\n[ 7] Char d: 5.953493232361728 %\n[ 8] Char l: 5.076650725938311 %\n[ 9] Char o: 4.883026197706011 %\n[10] Char g: 4.012253666572415 %\n[11] Char k: 3.232607599916403 %\n[12] Char m: 3.0863135119186653 %\n[13] Char f: 2.701600014752345 %\n[14] Char v: 2.13970470722742 %\n[15] Char b: 1.982423195603801 %\n[16] Char u: 1.8339777239590376 %\n[17] Char p: 1.5789619266562582 %\n[18] Char h: 1.3433085821767086 %\n[19] Char ø: 0.8730775850411222 %\n[20] Char y: 0.859938777768216 %\n[21] Char å: 0.7699648402443973 %\n[22] Char æ: 0.7208671920140639 %\n[23] Char j: 0.644108896893402 %\n[24] Char c: 0.5698093259407694 %\n[25] Char w: 0.11087309295206717 %\n[26] Char z: 0.05309307500338075 %\n[27] Char x: 0.032424424965885205 %\n[28] Char é: 0.032193919575132464 %\n[29] Char q: 0.012139950579644223 %\n\nThe first 30 characters have an accumulated ratio of 0.9997241618823994.\n\n964 sequences found.\n\nFirst 512 (typical positive ratio): 0.9968082796759031\nNext 512 (512-1024): 7.68351302509128e-07\nRest: 3.903127820947816e-17\n\n- Processing end: 2016-02-19 17:56:42.304278\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangEsperantoModel.log",
    "content": "= Logs of language model for Esperanto (eo) =\n\n- Generated by BuildLangModel.py\n- Started: 2015-12-04 01:22:51.466573\n- Maximum depth: 3\n- Max number of pages: 50\n\n== Parsed pages ==\n\nVikipedio:Ĉefpaĝo (revision 5524911)\n10-a de novembro (revision 5792999)\n12-a de novembro (revision 5793854)\n13-a de novembro (revision 5795088)\n18-a de novembro (revision 5796972)\n2-a de novembro (revision 5772615)\n20-a de novembro (revision 5799664)\n2015 (revision 5791963)\n22-a de novembro (revision 5799355)\n24-a de novembro (revision 5800563)\n4-a de decembro (revision 5806422)\n4-a de novembro (revision 5789811)\n5-a de novembro (revision 5789774)\n6-a de novembro (revision 5790336)\n7-a de novembro (revision 5791066)\n8-a de novembro (revision 5791337)\n9-a de novembro (revision 5791916)\nA Night at the Opera (Queen) (revision 5184272)\nAbdelhamid Abaaoud (revision 5800134)\nAndré Glucksmann (revision 5792591)\nAnglio (revision 5693468)\nArgentino (revision 5804665)\nAtencoj de novembro 2015 en Parizo (revision 5800135)\nAung San Suu Kyi (revision 5791362)\nAustin FX4 (revision 5583207)\nAzilo (revision 5751210)\nAŭstrio (revision 5804014)\nBahio (revision 5773065)\nBamako (revision 5798202)\nBataclan (revision 5795605)\nBejruto (revision 5774306)\nBirmo (revision 5790386)\nBlonda (revision 5441229)\nBohemian rhapsody (revision 5654078)\nCayetano Redondo (revision 5591025)\nCiro la 2-a (revision 5774667)\nDJ Abdel (revision 5628860)\nDaniela Mercury (revision 5764721)\nDecembro de 2015 (revision 5626904)\nDilatkoeficiento (revision 5806460)\nEksproprietigo (revision 5586845)\nElektroniko (revision 5788966)\nElle s'appelait Sarah (filmo) (revision 5475154)\nEsperanto (revision 5804190)\nFederaciero (revision 5696168)\nFondaĵo Vikimedio (revision 5772681)\nFrancio (revision 5759775)\nFrançois Hollande (revision 5627721)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2015-12-04 01:27:38.176708\n\n56 characters appeared 342524 times.\n\nFirst 35 characters:\n[ 0] Char a: 12.557952143499435 %\n[ 1] Char o: 9.84719318938235 %\n[ 2] Char e: 9.10242785906973 %\n[ 3] Char i: 8.362333734278474 %\n[ 4] Char n: 7.6359612757062285 %\n[ 5] Char r: 6.630192336887342 %\n[ 6] Char t: 5.70821314710794 %\n[ 7] Char l: 5.610409781504361 %\n[ 8] Char s: 5.004320865107262 %\n[ 9] Char k: 3.8855671427403626 %\n[10] Char d: 3.7194473963868226 %\n[11] Char j: 3.28531723324497 %\n[12] Char u: 2.8465158645817517 %\n[13] Char m: 2.787833845219605 %\n[14] Char p: 2.6582078920017285 %\n[15] Char g: 1.6825098387266293 %\n[16] Char v: 1.4048650605505015 %\n[17] Char c: 1.3823848839789328 %\n[18] Char b: 1.1406499982482978 %\n[19] Char f: 1.077296773364786 %\n[20] Char z: 0.7342551178895493 %\n[21] Char h: 0.6735294461118053 %\n[22] Char ĝ: 0.53572888323154 %\n[23] Char ŭ: 0.4268314045147202 %\n[24] Char ĉ: 0.33545094650301877 %\n[25] Char y: 0.17079095187490512 %\n[26] Char ŝ: 0.15327393116978666 %\n[27] Char w: 0.1442234704721421 %\n[28] Char ĵ: 0.1039343228503696 %\n[29] Char á: 0.0814541462788009 %\n[30] Char ó: 0.05430276418586727 %\n[31] Char é: 0.053718863495696656 %\n[32] Char q: 0.04350060141771087 %\n[33] Char x: 0.040873048311943105 %\n[34] Char ĥ: 0.03824549520617533 %\n\nThe first 35 characters have an accumulated ratio of 0.9991971365510156.\n\n989 sequences found.\n\nFirst 512 (typical positive ratio): 0.9942980632768038\nNext 512 (512-1024): 0.0015327393116978665\nRest: -5.0306980803327406e-17\n\n- Processing end: 2015-12-04 01:27:38.307198\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangEstonianModel.log",
    "content": "= Logs of language model for Estonian (et) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-26 23:45:22.351942\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nHarilik pohl (revision 4248853)\nA-vitamiin (revision 4330862)\nAasta keskmine sademete hulk (revision 4266801)\nAasta keskmine õhutemperatuur (revision 3902142)\nAhm (revision 4343671)\nAin Raal (revision 4464651)\nAlalehed (revision 2892741)\nAlamliik (revision 3522810)\nAlaska (revision 4216575)\nAleksander Heintalu (revision 4445156)\nAleuudid (revision 4335893)\nAmeerika jänes (revision 4325220)\nAmeerika valgejänes (revision 4355263)\nAnneli Sihvart (revision 4211078)\nArbutiin (revision 4451788)\nBaribal (revision 4268462)\nBensoehape (revision 3810308)\nBinaarne nomenklatuur (revision 3970950)\nC-vitamiin (revision 4444353)\nDroog (revision 4352968)\nE-vitamiin (revision 4336726)\nEesti (revision 4474984)\nEesti Entsüklopeediakirjastus (revision 4012421)\nEesti köök (revision 4314947)\nEllips (revision 4272113)\nEmakakael (botaanika) (revision 3521516)\nEuraasia (revision 3710768)\nFenoloogia (revision 3512905)\nFolaadid (revision 4266628)\nFosfor (revision 4270122)\nFotosüntees (revision 4380600)\nFruktoos (revision 4285660)\nGlükoos (revision 4047315)\nGneiss (revision 4333338)\nGraniit (revision 4435351)\nGröönimaa (revision 4331557)\nHalljänes (revision 4051603)\nHaned (revision 4127680)\nHappeline keskkond (revision 2966453)\nHeilongjiang (revision 4342364)\nHendrik Relve (revision 4342591)\nHiina (revision 4448121)\nHolland (revision 4307885)\nHunt (revision 4427752)\nHõimkond (revision 3489569)\nHüdrofiilsus (revision 4309797)\nIda-Euroopa (revision 4337624)\nIda-sinilind (revision 4248853)\nIda-vöötorav (revision 3520679)\nIgihaljus (revision 3536500)\nIlves (revision 4404632)\nImetaja (revision 4289188)\nIndiaanlased (revision 4479868)\nIndrek Rohtmets (revision 4218674)\nItaalia (revision 4404119)\nJaapan (revision 4465542)\nJilin (revision 3894473)\nJood (revision 4025060)\nJuurestik (revision 3341159)\nJääkaru (revision 4372399)\nJõhvikas (revision 4391549)\nKaalium (revision 4486067)\nKaheidulehelised (revision 4031352)\nKaheli õiekate (revision 3063362)\nKahesuguline õis (revision 3383221)\nKaitsestaatus (revision 3527096)\nKajakas (revision 4456839)\nKalorsus (revision 3843290)\nKaltsium (revision 4339861)\nKanada (revision 4434682)\nKanalised (revision 3616579)\nKanarbikulaadsed (revision 4318215)\nKanarbikulised (revision 3534760)\nKarboksüülhapped (revision 3659011)\nKaroteen (revision 4347634)\nKasvuperiood (revision 4231717)\nKatteseemnetaimed (revision 4176294)\nKaukasus (revision 4476003)\nKesk-Euroopa (revision 3580746)\nKimalane (revision 4261145)\nKiudained (toit) (revision 3538655)\nKlass (bioloogia) (revision 3489567)\nKliima (revision 4160781)\nKorea (revision 4329396)\nKroom (revision 4030460)\nKroonlehed (revision 3543291)\nKuusepüü (revision 4028988)\nKvertsetiin (revision 4448461)\nLaanemets (revision 4001157)\nLaanepüü (revision 4475093)\nLaiuskraad (revision 3990366)\nLeesikas (revision 4420533)\nLehed (revision 4471821)\nLeheroots (revision 3595351)\nLiik (bioloogia) (revision 4320981)\nLiiv (revision 4399494)\nLiivakivi (revision 4330598)\nLinnaeus (revision 4276836)\nLinnud (revision 4479668)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-26 23:47:54.476445\n\n55 characters appeared 433559 times.\n\nFirst 33 characters:\n[ 0] Char a: 12.486881831538499 %\n[ 1] Char i: 10.26503889897338 %\n[ 2] Char e: 10.177622884082673 %\n[ 3] Char s: 8.710233209320991 %\n[ 4] Char t: 6.56634967789851 %\n[ 5] Char l: 6.051540851418146 %\n[ 6] Char u: 5.423944607308348 %\n[ 7] Char n: 5.131020230233947 %\n[ 8] Char k: 4.663033174262327 %\n[ 9] Char o: 4.526950195936424 %\n[10] Char d: 4.167368224393911 %\n[11] Char r: 3.6740097656835635 %\n[12] Char m: 3.552688330769284 %\n[13] Char v: 2.4700213811730354 %\n[14] Char p: 1.9229216784797456 %\n[15] Char g: 1.865259399528092 %\n[16] Char h: 1.8043680329551455 %\n[17] Char j: 1.6860450365463524 %\n[18] Char ä: 1.0247740215287884 %\n[19] Char b: 0.9255949017319443 %\n[20] Char õ: 0.9246723052687178 %\n[21] Char ü: 0.6536595941959457 %\n[22] Char f: 0.37342091849090897 %\n[23] Char c: 0.34851081398379463 %\n[24] Char ö: 0.24333481717597835 %\n[25] Char y: 0.1287022066200909 %\n[26] Char x: 0.06781084004714467 %\n[27] Char w: 0.04082489349777078 %\n[28] Char q: 0.020989069538401926 %\n[29] Char š: 0.018913227496142396 %\n[30] Char z: 0.017529332801302706 %\n[31] Char ō: 0.010379210211297655 %\n[32] Char ž: 0.009687262863877812 %\n\nThe first 33 characters have an accumulated ratio of 0.9995410082595447.\n\n853 sequences found.\n\nFirst 512 (typical positive ratio): 0.9972721312183132\nNext 512 (512-1024): 9.687262863877811e-05\nRest: -5.204170427930421e-18\n\n- Processing end: 2016-09-26 23:47:54.561846"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangFinnishModel.log",
    "content": "= Logs of language model for Finnish (fi) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-21 18:12:24.181917\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nYhdistynyt kuningaskunta (revision 15843357)\n1. toukokuuta (revision 15910178)\n1700-luku (revision 15493702)\n1707 (revision 15106709)\n1800-luku (revision 15708929)\n2014 (revision 15891601)\n409 (revision 12809782)\n5. marraskuuta (revision 15421719)\n927 (revision 12785964)\nAasia (revision 15948161)\nAbhasia (revision 15730328)\nAdolf Hitler (revision 15951829)\nAfrikka (revision 15934209)\nAgatha Christie (revision 15760740)\nAikavyöhyke (revision 15800313)\nAjoneuvon kansallisuustunnus (revision 15897445)\nAkrotiri ja Dhekelia (revision 14625383)\nAlamaat (revision 15913741)\nAlan Turing (revision 15904871)\nAlankomaat (revision 15936643)\nAlbania (revision 15767604)\nAlec Guinness (revision 15363805)\nAlexander Fleming (revision 15023225)\nAlfred Hitchcock (revision 15892843)\nAlfred Tennyson (revision 15856114)\nAllen Jones (revision 12871703)\nAndorra (revision 15913862)\nAndrew Lloyd Webber (revision 14978349)\nAnglit (revision 15902350)\nAnguilla (revision 15854041)\nAnne Brontë (revision 14287992)\nAnthony Eden (revision 14391831)\nAntigua ja Barbuda (revision 15196967)\nArabian Lawrence (revision 15736417)\nArgentiina (revision 15676474)\nArmenia (revision 15634470)\nArthur Conan Doyle (revision 15402837)\nArts and Crafts (revision 15806930)\nAurinko (revision 15934252)\nAustralia (revision 15934255)\nAvara luonto (revision 15815943)\nAzerbaidžan (revision 15946891)\nBBC (revision 15866026)\nBKT (revision 15656549)\nBahama (revision 15516869)\nBangladesh (revision 15883994)\nBank of England (revision 14481173)\nBarbados (revision 15839821)\nBarbara Hepworth (revision 15106880)\nBath (revision 15869900)\nBeatrix Potter (revision 15057380)\nBelfast (revision 15715934)\nBelgia (revision 15932391)\nBelize (revision 15665086)\nBen Nevis (revision 15610196)\nBengalin kieli (revision 15551820)\nBenjamin Britten (revision 15081615)\nBermuda (revision 15632621)\nBertrand Russell (revision 14631969)\nBhutan (revision 15377394)\nBig Ben (revision 14897401)\nBig Brother (revision 14641391)\nBirmingham (revision 15855259)\nBlack Sabbath (revision 15839917)\nBosnia ja Hertsegovina (revision 15934266)\nBotswana (revision 15524955)\nBristol (revision 15891889)\nBristolin kanaali (revision 15849713)\nBristolin kansainvälinen lentoasema (revision 14452870)\nBritannia (provinssi) (revision 14557442)\nBritannian avoin golfturnaus (revision 14293265)\nBritannian kuninkaallinen perhe (revision 15522149)\nBritannian talous (revision 15470242)\nBritannian väestö (revision 15661241)\nBrittein saaret (revision 15805422)\nBrittiläinen Antarktiksen alue (revision 15836227)\nBrittiläinen Intia (revision 15593126)\nBrittiläinen Intian valtameren alue (revision 14272903)\nBrittiläinen imperiumi (revision 15906600)\nBrittiläinen kansainyhteisö (revision 15894379)\nBrittiläinen keittiö (revision 13393533)\nBrittiläinen kulttuuri (revision 15951407)\nBrittiläiset Neitsytsaaret (revision 15910520)\nBrittiläiset merentakaiset alueet (revision 15836213)\nBrunei (revision 15580824)\nBruttokansantuote (revision 15656549)\nBulgaria (revision 15944101)\nBurma (revision 15627218)\nCambridge (revision 14641664)\nCambridgen yliopisto (revision 15493340)\nCanterburyn tarinoita (revision 15232140)\nCardiff (revision 15840398)\nCaymansaaret (revision 15914575)\nChannel 4 (revision 15882475)\nCharles Babbage (revision 15203616)\nCharles Chaplin (revision 15674652)\nCharles Darwin (revision 15894085)\nCharles Dickens (revision 15699592)\nCharles Dickensin joulutarina (revision 15116247)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-21 18:15:05.189221\n\n61 characters appeared 940364 times.\n\nFirst 30 characters:\n[ 0] Char a: 12.508773198463574 %\n[ 1] Char i: 10.969475649854738 %\n[ 2] Char n: 8.815841525196626 %\n[ 3] Char t: 8.80169806585535 %\n[ 4] Char e: 7.8206949649284745 %\n[ 5] Char s: 7.595782058862313 %\n[ 6] Char l: 5.963541777439374 %\n[ 7] Char o: 5.439808414613916 %\n[ 8] Char u: 5.0102938861972595 %\n[ 9] Char k: 4.589712068943515 %\n[10] Char r: 3.1231523112326713 %\n[11] Char ä: 3.041800834570443 %\n[12] Char m: 3.0392486313810396 %\n[13] Char v: 2.156292669647073 %\n[14] Char h: 1.996141919512019 %\n[15] Char j: 1.9248929138078446 %\n[16] Char p: 1.6324529650220552 %\n[17] Char y: 1.6323466232224966 %\n[18] Char d: 1.1981530556252684 %\n[19] Char b: 0.6835650875618378 %\n[20] Char g: 0.5793501239945382 %\n[21] Char c: 0.5056552569005194 %\n[22] Char ö: 0.38931732818355447 %\n[23] Char f: 0.215023118707224 %\n[24] Char w: 0.2106631049253268 %\n[25] Char z: 0.06593191572625068 %\n[26] Char x: 0.024458613898447838 %\n[27] Char š: 0.010421496356729947 %\n[28] Char ž: 0.007869293167326695 %\n[29] Char q: 0.007762951367768225 %\n\nThe first 30 characters have an accumulated ratio of 0.9996012182516557.\n\n919 sequences found.\n\nFirst 512 (typical positive ratio): 0.9985378147555799\nNext 512 (512-1024): 1.0634179955846884e-06\nRest: 3.881443777498106e-17\n\n- Processing end: 2016-09-21 18:15:05.307164\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangFrenchModel.log",
    "content": "= Logs of language model for French (fr) =\n\n- Generated by BuildLangModel.py\n- Started: 2015-12-03 21:07:37.508739\n- Maximum depth: 2\n- Max number of pages: 50\n\n== Parsed pages ==\n\nWikipédia:Accueil_principal (revision 115957655)\nBœuf (animal) (revision 115500130)\n1500 av. J.-C. (revision 110583603)\n1898 dans les chemins de fer (revision 106801806)\n1913 dans les chemins de fer (revision 112852042)\n1974 dans les chemins de fer (revision 90170756)\n1er décembre (revision 121012781)\n2009 dans les chemins de fer (revision 107042206)\n2011 dans les chemins de fer (revision 109560866)\n24 novembre (revision 120782024)\n26 novembre (revision 120833172)\n29 novembre (revision 120918160)\n2 décembre (revision 121025437)\n30 novembre (revision 120947714)\n3 décembre (revision 121030621)\nAmphibien (revision 120332329)\nAngleterre (revision 120784240)\nAnne-Josèphe Théroigne de Méricourt (revision 121009789)\nAnnées 1930 (revision 120558236)\nAntonio Troyo Calderón (revision 121028881)\nAntónio Costa (revision 120993829)\nAttentat du 24 novembre 2015 à Tunis (revision 121015161)\nBalard (métro de Paris) (revision 118979088)\nBois de Vincennes (revision 120822909)\nBuse à tête blanche (revision 121009499)\nCalifornie (revision 120922479)\nCharenton-le-Pont (revision 120210025)\nCharenton - Écoles (métro de Paris) (revision 108644873)\nChronique médiévale (revision 100253272)\nConcorde (métro de Paris) (revision 120856751)\nConférence de Paris de 2015 sur le climat (revision 121029398)\nCrise de la dette publique grecque (revision 120905208)\nCrise entre la Colombie et le Venezuela de 2015 (revision 120857143)\nCrise migratoire en Europe (revision 121002308)\nCrise russo-turque de 2015 (revision 121030214)\nCréteil (revision 120684618)\nCréteil - Préfecture (métro de Paris) (revision 113486387)\nDeuxième guerre civile libyenne (revision 121027704)\nDevise (monnaie) (revision 121015771)\nDroits de tirage spéciaux (revision 121009135)\nDécembre 2015 (revision 121010045)\nDépartement français (revision 120993190)\nEldar Riazanov (revision 120996396)\nEnfants verts de Woolpit (revision 121002303)\nErnst Larsen (revision 121026772)\nFatima Mernissi (revision 120992271)\nFejervarya cancrivora (revision 120353807)\nFonds monétaire international (revision 120754406)\nFrançais (revision 120883858)\nFreyja (revision 121028677)\nFusillade du 2 décembre 2015 en Californie (revision 121030353)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2015-12-03 21:10:27.682316\n\n56 characters appeared 728239 times.\n\nFirst 38 characters:\n[ 0] Char e: 14.339660468609894 %\n[ 1] Char s: 7.954806045817375 %\n[ 2] Char a: 7.864176458552756 %\n[ 3] Char n: 7.572102015959047 %\n[ 4] Char i: 7.34154583866011 %\n[ 5] Char r: 7.020222756540091 %\n[ 6] Char t: 6.833608197308851 %\n[ 7] Char l: 5.9446143367768 %\n[ 8] Char o: 5.386418469760614 %\n[ 9] Char u: 5.024861343597363 %\n[10] Char d: 4.169235649285468 %\n[11] Char c: 3.4240132703686568 %\n[12] Char p: 2.8882001650557028 %\n[13] Char m: 2.803063280049544 %\n[14] Char é: 2.498355622261373 %\n[15] Char g: 1.277739862874688 %\n[16] Char v: 1.1729665672945284 %\n[17] Char f: 1.1614318925517584 %\n[18] Char b: 0.9925312981040565 %\n[19] Char h: 0.8580974103282026 %\n[20] Char q: 0.7740590657737364 %\n[21] Char x: 0.43570860665248634 %\n[22] Char y: 0.41044217626356183 %\n[23] Char è: 0.4100302235941771 %\n[24] Char à: 0.363479571953713 %\n[25] Char j: 0.29591933417463223 %\n[26] Char k: 0.1359443808969308 %\n[27] Char ç: 0.11685724054877589 %\n[28] Char ê: 0.11218844362908331 %\n[29] Char z: 0.10738232915292918 %\n[30] Char w: 0.08239053387692777 %\n[31] Char ô: 0.04792382720507965 %\n[32] Char â: 0.03364280133307884 %\n[33] Char î: 0.029385957082770905 %\n[34] Char û: 0.024854477719539875 %\n[35] Char œ: 0.021146903695078125 %\n[36] Char ï: 0.017851282340001016 %\n[37] Char ù: 0.015242248767231636 %\n\nThe first 38 characters have an accumulated ratio of 0.999621003544166.\n\n914 sequences found.\n\nFirst 512 (typical positive ratio): 0.997057879992383\nNext 512 (512-1024): 1.3731755646154627e-06\nRest: 3.8163916471489756e-17\n\n- Processing end: 2015-12-03 21:10:27.987730\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangGermanModel.log",
    "content": "= Logs of language model for German (de) =\n\n- Generated by BuildLangModel.py\n- Started: 2015-12-03 22:42:29.154759\n- Maximum depth: 3\n- Max number of pages: 100\n\n== Parsed pages ==\n\nWikipedia:Hauptseite (revision 140459035)\n1740 (revision 145584733)\n1890 (revision 148575121)\n1925 (revision 148682812)\n1965 (revision 148411693)\n3. Dezember (revision 148684818)\nBundeswehreinsatz in Syrien (revision 148714599)\nClara Klabunde (revision 148697193)\nDay Tripper (revision 145956669)\nDezember 2015 (revision 148713161)\nEdwar al-Charrat (revision 148656295)\nEnzyklika (revision 148704406)\nEnzyklopädie (revision 148364925)\nFacebook Inc. (revision 148280344)\nFranz Neubauer (CSU) (revision 148710968)\nFreie Inhalte (revision 148123311)\nGabriele Ferzetti (revision 148715582)\nGeorg von Waldburg zu Zeil und Trauchburg (revision 148710609)\nJim Loscutoff (revision 148690370)\nKatarina Witt (revision 148713884)\nKlavierkonzert (Gershwin) (revision 143900338)\nLudolf Camphausen (revision 145088962)\nMark Zuckerberg (revision 148714452)\nMontenegro (revision 148692773)\nNATO (revision 148697872)\nNATO-Osterweiterung (revision 148697354)\nNekrolog 2015 (revision 148711617)\nPeter-Ulrich-Haus (revision 148654149)\nPhilanthropie (revision 145561255)\nPräsidentschaftswahl in Burkina Faso 2015 (revision 148677453)\nQuébec (Stadt) (revision 148716893)\nRivka Zohar (revision 148708850)\nRoch Marc Kaboré (revision 148673951)\nRubber Soul (revision 148665720)\nSalve Regina (Latry) (revision 148713279)\nSchießerei in San Bernardino (revision 148711974)\nSingle (Musik) (revision 146450210)\nThe Giving Pledge (revision 148711856)\nUbi primum (Benedikt XIV.) (revision 136691297)\nVTech (revision 148704025)\nWalter Damrosch (revision 148716127)\nWe Can Work It Out (revision 148706519)\n1. August (revision 148089156)\n1. Januar (revision 148659041)\n1. Juni (revision 148375663)\n1. November (revision 147888516)\n10. August (revision 148079904)\n10. November (revision 148658709)\n10. September (revision 148201788)\n11. August (revision 148315737)\n11. Oktober (revision 148087353)\n12. Januar (revision 147377586)\n12. September (revision 148359994)\n13. Dezember (revision 148614781)\n13. September (revision 148320520)\n14. August (revision 148513270)\n14. Dezember (revision 147968142)\n15. April (revision 146544147)\n15. August (revision 147827975)\n16. April (revision 148712866)\n16. Dezember (revision 148392316)\n16. Februar (revision 148221712)\n16. Jahrhundert (revision 147390194)\n16. Juli (revision 147928181)\n1652 (revision 142931287)\n1654 (revision 145531451)\n1656 (revision 144194148)\n1657 (revision 147492859)\n1662 (revision 147548355)\n1665 (revision 147757128)\n1666 (revision 147843417)\n1667 (revision 148566099)\n1668 (revision 145304760)\n1670 (revision 147643990)\n1672 (revision 145296252)\n1673 (revision 147879655)\n1674 (revision 146784434)\n1679 (revision 146069377)\n1685 (revision 148596629)\n1688 (revision 140370621)\n1692 (revision 146892539)\n1693 (revision 147464373)\n17. August (revision 148288443)\n17. Februar (revision 145814425)\n17. Jahrhundert (revision 147869798)\n17. Oktober (revision 148327370)\n1700er (revision 127393249)\n1707 (revision 148288721)\n1710er (revision 134739897)\n1720er (revision 127302296)\n1730 (revision 148694277)\n1730er (revision 127393280)\n1731 (revision 147730204)\n1735 (revision 145436596)\n1736 (revision 145680122)\n1737 (revision 146645905)\n1738 (revision 145094942)\n1739 (revision 147843445)\n1740er (revision 127393296)\n1741 (revision 146530178)\n1742 (revision 147010984)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2015-12-03 22:50:46.517106\n\n59 characters appeared 1746165 times.\n\nFirst 31 characters:\n[ 0] Char e: 14.27997926885489 %\n[ 1] Char r: 8.696257226550754 %\n[ 2] Char n: 8.464091308667852 %\n[ 3] Char i: 8.258784250056554 %\n[ 4] Char s: 6.690833913175444 %\n[ 5] Char a: 6.370703799469123 %\n[ 6] Char t: 5.925728668253001 %\n[ 7] Char h: 4.540979804314025 %\n[ 8] Char d: 4.367284878576767 %\n[ 9] Char l: 4.083634708060234 %\n[10] Char u: 3.899917819908199 %\n[11] Char o: 3.6450163644329145 %\n[12] Char c: 3.392405643223865 %\n[13] Char m: 2.578565026787274 %\n[14] Char g: 2.543631329227192 %\n[15] Char b: 1.9455206123132693 %\n[16] Char k: 1.7604292836014925 %\n[17] Char f: 1.6422273954637734 %\n[18] Char p: 1.519329502080273 %\n[19] Char w: 1.0273370500496803 %\n[20] Char z: 1.0037997554641171 %\n[21] Char v: 0.9010603236234834 %\n[22] Char ä: 0.4926224039538073 %\n[23] Char j: 0.4661644231787947 %\n[24] Char ü: 0.4094687500894818 %\n[25] Char y: 0.34229296773214446 %\n[26] Char ö: 0.3044958523392692 %\n[27] Char ß: 0.14477440562604335 %\n[28] Char x: 0.09918879372796958 %\n[29] Char é: 0.07633871942227682 %\n[30] Char q: 0.06099079983850323 %\n\nThe first 31 characters have an accumulated ratio of 0.9993385504806246.\n\n1188 sequences found.\n\nFirst 512 (typical positive ratio): 0.9934041448127945\nNext 512 (512-1024): 1.1453671331174316e-06\nRest: 0.0001130256702826099\n\n- Processing end: 2015-12-03 22:50:46.681265\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangGreekModel.log",
    "content": "= Logs of language model for Greek (el) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-05-25 15:16:42.898905\n- Maximum depth: 5\n- Max number of pages: 200\n\n== Parsed pages ==\n\nΠύλη:Κύρια (revision 5511929)\n14 Σεπτεμβρίου (revision 5808678)\n16 Σεπτεμβρίου (revision 5810117)\n1771 (revision 4940722)\n1829 (revision 5863423)\n1921 (revision 5819621)\n1948 (revision 5785943)\n1965 (revision 5846907)\n1970 (revision 5816968)\n1973 (revision 5423504)\n25 Μαΐου (revision 5865973)\nEurovision (revision 5865484)\nScorpions (revision 5586116)\nWiki (revision 5859059)\nWikimedia (revision 5771416)\nΑγία Πετρούπολη (revision 5782933)\nΑγγλική γλώσσα (revision 5851128)\nΑλεξάντρ Πούσκιν (revision 5790131)\nΒέλος ΙΙ (Αντιτορπιλικό) (revision 5178914)\nΒραζιλία (revision 5857981)\nΓαλλική γλώσσα (revision 5851119)\nΓαλλική εισβολή στην Ρωσία (revision 5858523)\nΓενικές εκλογές στη Δομινικανή Δημοκρατία 2016 (revision 5848770)\nΓηραιότερο πρόσωπο στον κόσμο (revision 5852034)\nΔιαγωνισμός Τραγουδιού Eurovision 2016 (revision 5863783)\nΔικτατορία των Συνταγματαρχών (revision 5864405)\nΔομινικανή Δημοκρατία (revision 5848627)\nΕγκυκλοπαίδεια (revision 5566281)\nΕλεύθερο περιεχόμενο (revision 5824058)\nΕλλάδα (revision 5863759)\nΕλληνική γλώσσα (revision 5790854)\nΙππικό (revision 5376587)\nΙταλία (revision 5781867)\nΚίεβο (revision 5794613)\nΚατάληψη του Παρισιού (1814) (revision 5729368)\nΚλάους Μάιν (revision 5668218)\nΜάχη της Λειψίας (revision 5729316)\nΜάχη της Σαλτάνοφκα (revision 5865460)\nΜάχη του Μποροντίνο (revision 5670322)\nΜαξ Βερστάπεν (revision 5864745)\nΜπλουζ (revision 5846428)\nΝίκος Καχτίτσης (revision 5723615)\nΝικολάι Νικολάεβιτς Ραέφσκι (revision 5865460)\nΝτίλμα Ρούσεφ (revision 5843412)\nΟμοσπονδιακό Σοβιέτ της Ρωσικής Αυτοκρατορίας (revision 5865460)\nΟυκρανία (revision 5847651)\nΠάτρα (revision 5800331)\nΠοδόσφαιρο (revision 5864952)\nΠριμέρα Ντιβιζιόν (revision 5846965)\nΡωσική Αυτοκρατορία (revision 5858419)\nΡωσική γλώσσα (revision 5818960)\nΡώσοι (revision 5376764)\nΣουζάνα Μούσατ Τζόουνς (revision 5848866)\nΣτοκχόλμη (revision 5670508)\nΣτρατηγός (revision 5464718)\nΤζακ Στάινμπεργκερ (revision 5820361)\nΤζαμάλα (revision 5863755)\nΦΚ Μπαρτσελόνα (revision 5862032)\nΦόρμουλα Ένα (revision 5809160)\n10 Σεπτεμβρίου (revision 5841838)\n11 Σεπτεμβρίου (revision 5796866)\n12 Σεπτεμβρίου (revision 5795991)\n1321 (revision 5811404)\n13 Σεπτεμβρίου (revision 5830505)\n1435 (revision 5600729)\n1498 (revision 5831868)\n1523 (revision 5863396)\n1527 (revision 5579042)\n1580 (revision 5742938)\n15 Σεπτεμβρίου (revision 5817369)\n1712 (revision 5699806)\n1741 (revision 5817896)\n1752 (revision 5666171)\n1760 (revision 5490201)\n1769 (revision 5336004)\n17 Σεπτεμβρίου (revision 5843911)\n1812 (revision 5703237)\n1814 (revision 5751122)\n1851 (revision 5854460)\n1878 (revision 5863501)\n1889 (revision 5795061)\n1890 (revision 5705460)\n1898 (revision 5863504)\n18 Σεπτεμβρίου (revision 5661544)\n1901 (revision 5865687)\n1902 (revision 5779111)\n1905 (revision 5862599)\n1910 (revision 5794858)\n1916 (revision 5800363)\n1917 (revision 5865701)\n1925 (revision 5854774)\n1927 (revision 5839595)\n1928 (revision 5814308)\n1933 (revision 5854834)\n1936 (revision 5854290)\n1937 (revision 5794891)\n1943 (revision 5807315)\n1944 (revision 5865804)\n1950 (revision 5807377)\n1956 (revision 5795994)\n1960 (revision 5795065)\n1963 (revision 5863751)\n1966 (revision 5707508)\n1969 (revision 5668647)\n1980 (revision 5832053)\n1981 (revision 5817635)\n1982 (revision 5788879)\n1983 (revision 5812702)\n1984 (revision 5749754)\n1989 (revision 5846909)\n1994 (revision 5863999)\n1999 (revision 5795003)\n19 Σεπτεμβρίου (revision 5850863)\n1 Σεπτεμβρίου (revision 5630491)\n2000 (revision 5779037)\n2001 (revision 5779042)\n2005 (revision 5779066)\n2006 (revision 5808681)\n2009 (revision 5827105)\n2011 (revision 5808660)\n2016 (revision 5801621)\n20 Σεπτεμβρίου (revision 5808561)\n21 Σεπτεμβρίου (revision 5751207)\n22 Σεπτεμβρίου (revision 5807133)\n23 Σεπτεμβρίου (revision 5800012)\n24 Σεπτεμβρίου (revision 5662618)\n258 (revision 4952368)\n25 Σεπτεμβρίου (revision 5817621)\n26 Σεπτεμβρίου (revision 5817637)\n27 Σεπτεμβρίου (revision 5817648)\n28 Σεπτεμβρίου (revision 5817677)\n29 Σεπτεμβρίου (revision 5703562)\n2 Σεπτεμβρίου (revision 5701639)\n30 Σεπτεμβρίου (revision 5838312)\n326 (revision 5818811)\n3 Σεπτεμβρίου (revision 5816313)\n407 (revision 4952524)\n4 Σεπτεμβρίου (revision 5816970)\n5 Σεπτεμβρίου (revision 5817185)\n628 (revision 5398024)\n680 (revision 5365010)\n685 (revision 5819296)\n6 Σεπτεμβρίου (revision 5765157)\n775 (revision 5373211)\n786 (revision 5398031)\n7 Σεπτεμβρίου (revision 5749649)\n81 (revision 5397958)\n891 (revision 4952139)\n8 Σεπτεμβρίου (revision 5788878)\n9 Σεπτεμβρίου (revision 5817240)\nCIA (revision 5857678)\nMiyavi (revision 4944860)\nΆρμεν Κούπτσιος (revision 5766774)\nΈιμι Γουάινχαουζ (revision 5809279)\nΈρβιν Θάλμπεργκ (revision 5716376)\nΊων Δραγούμης (revision 5818568)\nΑγία Ελένη (revision 5821916)\nΑλεξάντερ φον Χούμπολτ (revision 5773636)\nΑλμπέρτο Κόρντα (revision 5800055)\nΑπρίλιος (revision 5766829)\nΑυτοκρατορία των Σασσανιδών (revision 5859880)\nΑύγουστος (revision 5461793)\nΒ΄ Παγκόσμιος Πόλεμος (revision 5848530)\nΒέρμαχτ (revision 5212228)\nΒασίλης Λάσκος (revision 5695445)\nΒενεζουέλα (revision 5847962)\nΒρετανική Αυτοκρατορία (revision 5606306)\nΒόρεια Ελλάδα (revision 5670938)\nΓαλλία (revision 5776756)\nΓεώργιος Καρατζαφέρης (revision 5803114)\nΓιάννης Λάτσης (revision 5692530)\nΓιάννος Κρανιδιώτης (revision 5574536)\nΓιώργος Παπασιδέρης (μουσικός) (revision 5722203)\nΓκέοργκ Φρήντριχ Χαίντελ (revision 5807098)\nΓκρέις Κέλι (revision 5807168)\nΓρηγοριανό Hμερολόγιο (revision 5793842)\nΓρηγοριανό ημερολόγιο (revision 5793842)\nΓρηγόρης Λαμπράκης (revision 5752808)\nΔάντης Αλιγκέρι (revision 5648882)\nΔήμος Βιάννου (revision 4816422)\nΔεκέμβριος (revision 5461807)\nΔομιτιανός (revision 5735554)\nΔράμα (πόλη) (revision 5857326)\nΕνιαία Δημοκρατική Αριστερά (revision 5742309)\nΕτόρε Σότσας (revision 5785872)\nΖιλ Αντριαμαχαζό (revision 5819706)\nΗ.Π.Α. (revision 5845171)\nΗράκλειος (revision 5778827)\nΘεσσαλονίκη (revision 5844955)\nΘεόδωρος Ρούζβελτ (revision 5815087)\nΙανουάριος (revision 5615044)\nΙερουσαλήμ (revision 5824734)\nΙησούς Χριστός (revision 5859687)\nΙούλιος (revision 5712711)\nΙούνιος (revision 5461799)\nΙράκ (revision 5820378)\nΙράν (revision 5861249)\nΙσιδώρα Ντάνκαν (revision 5044778)\nΙωάννης ο Χρυσόστομος (revision 5824898)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-05-25 15:21:50.071087\n\n63 characters appeared 1875535 times.\n\nFirst 46 characters:\n[ 0] Char α: 9.004097497514042 %\n[ 1] Char ο: 8.311015256980008 %\n[ 2] Char τ: 7.94493304577094 %\n[ 3] Char ι: 6.338831320129989 %\n[ 4] Char ν: 5.836627948825269 %\n[ 5] Char ε: 5.635565318695733 %\n[ 6] Char ρ: 4.717907157157825 %\n[ 7] Char σ: 4.307197679595422 %\n[ 8] Char κ: 4.061294510632965 %\n[ 9] Char ς: 3.766551943845356 %\n[10] Char η: 3.7565281373048225 %\n[11] Char π: 3.4156653968067783 %\n[12] Char υ: 3.30956233821283 %\n[13] Char μ: 3.1442761665338157 %\n[14] Char λ: 3.0899983204792236 %\n[15] Char ί: 2.429973314280992 %\n[16] Char ό: 2.076100952528212 %\n[17] Char ά: 1.922651403466211 %\n[18] Char γ: 1.8994047031913561 %\n[19] Char έ: 1.6641651582081913 %\n[20] Char δ: 1.508582884350332 %\n[21] Char ω: 1.2410325587099147 %\n[22] Char ή: 1.2077087337746297 %\n[23] Char χ: 1.0482342371643292 %\n[24] Char ύ: 0.9225101104484854 %\n[25] Char β: 0.8928652357860558 %\n[26] Char θ: 0.8681256281541001 %\n[27] Char φ: 0.806756472153279 %\n[28] Char ώ: 0.6969211451665791 %\n[29] Char ζ: 0.35515199663029484 %\n[30] Char e: 0.35488540603081253 %\n[31] Char ξ: 0.314736861748781 %\n[32] Char a: 0.2909036621550651 %\n[33] Char i: 0.2884510286398281 %\n[34] Char o: 0.24137112877125727 %\n[35] Char r: 0.23262695710823847 %\n[36] Char n: 0.2206303801315358 %\n[37] Char t: 0.21668483925919804 %\n[38] Char s: 0.2013825388489151 %\n[39] Char l: 0.14865091827131993 %\n[40] Char d: 0.1359078876160669 %\n[41] Char c: 0.12124540464454144 %\n[42] Char h: 0.1166600463334462 %\n[43] Char u: 0.10381037943840024 %\n[44] Char m: 0.09074744006376848 %\n[45] Char ψ: 0.08669526295163779 %\n\nThe first 46 characters have an accumulated ratio of 0.993456267145108.\n\n1579 sequences found.\n\nFirst 512 (typical positive ratio): 0.958419074626211\nNext 512 (512-1024): 0.006969211451665791\nRest: 0.0018920066107342773\n\n- Processing end: 2016-05-25 15:21:50.812982\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangHungarianModel.log",
    "content": "= Logs of language model for Hungarian (hu) =\n\n- Generated by BuildLangModel.py\n- Started: 2015-12-12 18:01:21.560682\n- Maximum depth: 2\n- Max number of pages: 50\n\n== Parsed pages ==\n\nKezdőlap (revision 12748721)\n1722 (revision 16471860)\n1780 (revision 16407861)\n1800 (revision 15028835)\n1831 (revision 16469576)\n1848–49-es forradalom és szabadságharc (revision 16955214)\n1875 (revision 16798555)\n1895 (revision 16649417)\n1900 (revision 16961019)\n1905 (revision 16601113)\n1915 (revision 16792868)\n1940 (revision 16936087)\n1950 (revision 16820817)\n1970 (revision 16093156)\n1985 (revision 16463340)\n1995 (revision 16945805)\n1998 (revision 16542908)\n2003 (revision 16943939)\n2015 (revision 16960983)\n73. Golden Globe-gála (revision 16937296)\nAkacuki (revision 16960353)\nAkasztottak erdeje (regény) (revision 16918702)\nAlan Hodgkinson (revision 16953214)\nAlfred Bernhard Nobel (revision 16654409)\nAlkotmány (revision 16784843)\nAndré-Marie Ampère (revision 16865419)\nAngela Merkel (revision 16960753)\nAnne Baxter (revision 15572176)\nAz irgalmasság rendkívüli szentéve (revision 16951018)\nAz év embereinek listája (revision 16961722)\nBencések (revision 16853524)\nBoeing 747–400 (revision 16947261)\nChantal Szent Johanna Franciska (revision 16371923)\nDecember 12. (revision 15637986)\nDecember 13. (revision 16546152)\nDinamó (revision 15949492)\nDionne Warwick (revision 16522754)\nElektrodinamika (revision 14888277)\nElektromosság (revision 16051899)\nEnciklopédia (revision 16556513)\nEric Maskin (revision 16907781)\nEurópai migrációs válság (revision 16922218)\nEötvös Loránd (revision 16960057)\nEötvös Loránd Tudományegyetem (revision 16684410)\nFellner Jakab (revision 16960223)\nFeltaláló (revision 13609621)\nFerenc pápa (revision 16928970)\nFrank Sinatra (revision 16927399)\nFrançois Jean Dominique Arago (revision 16197941)\nGabriella (revision 16906500)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2015-12-12 18:02:46.729734\n\n55 characters appeared 375370 times.\n\nFirst 32 characters:\n[ 0] Char e: 9.710685457015744 %\n[ 1] Char a: 8.803314063457389 %\n[ 2] Char t: 7.322375256413672 %\n[ 3] Char s: 6.666222660308496 %\n[ 4] Char l: 5.73967019207715 %\n[ 5] Char r: 5.4341050163838345 %\n[ 6] Char n: 5.39920611663159 %\n[ 7] Char i: 4.773689959240216 %\n[ 8] Char o: 4.347976663025815 %\n[ 9] Char k: 4.289634227562138 %\n[10] Char z: 4.244611982843594 %\n[11] Char á: 3.7855982097663636 %\n[12] Char m: 3.2144284306151265 %\n[13] Char g: 3.0727016010869277 %\n[14] Char é: 3.0295441830727015 %\n[15] Char b: 2.287609558568879 %\n[16] Char d: 1.9966965926952074 %\n[17] Char v: 1.8832085675466872 %\n[18] Char y: 1.8453792258305137 %\n[19] Char u: 1.5155713029810587 %\n[20] Char h: 1.2960545595012922 %\n[21] Char p: 1.288861656498921 %\n[22] Char j: 1.2363801049631031 %\n[23] Char c: 1.0951860830647095 %\n[24] Char f: 1.0256546873751233 %\n[25] Char ö: 1.020859418706876 %\n[26] Char ó: 0.9955510562911262 %\n[27] Char ő: 0.8399712283879905 %\n[28] Char í: 0.6340410794682579 %\n[29] Char ü: 0.4211844313610571 %\n[30] Char ú: 0.3295415190345526 %\n[31] Char ű: 0.2056637451048299 %\n\nThe first 32 characters have an accumulated ratio of 0.9975117883688093.\n\n1084 sequences found.\n\nFirst 512 (typical positive ratio): 0.9748272224933486\nNext 512 (512-1024): 5.328076298052588e-06\nRest: 0.0001889139024889644\n\n- Processing end: 2015-12-12 18:02:46.902033\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangIrishModel.log",
    "content": "= Logs of language model for Irish (ga) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-27 00:31:16.489602\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nTracy Caldwell Dyson (revision 812158)\n14 Lúnasa (revision 716575)\n1969 (revision 810361)\nCalifornia (revision 790976)\nCeimic (revision 759983)\nCeimic fhisiciúil (revision 656896)\nNASA (revision 806394)\nRúisis (revision 771746)\nSAM (revision 807668)\nSpáinnis (revision 812323)\nStáisiún Idirnáisiúnta Spáis (revision 806394)\nTointeálaí spáis (revision 761309)\n10 Lúnasa (revision 649045)\n11 Lúnasa (revision 776455)\n12 Lúnasa (revision 716531)\n13 Lúnasa (revision 716546)\n1598 (revision 703178)\n15 Lúnasa (revision 776986)\n16 Lúnasa (revision 648836)\n1740 (revision 791225)\n1771 (revision 776762)\n17 Lúnasa (revision 777131)\n1823 (revision 791774)\n1832 (revision 794492)\n1898 (revision 805176)\n18 Lúnasa (revision 777242)\n1911 (revision 801932)\n1956 (revision 797081)\n1962 (revision 801511)\n1966 (revision 807415)\n19 Lúnasa (revision 648524)\n1 Lúnasa (revision 647726)\n2001 (revision 801012)\n2004 (revision 795759)\n2016 (revision 812091)\n20 Lúnasa (revision 777924)\n21 Lúnasa (revision 647805)\n22 Lúnasa (revision 778960)\n23 Lúnasa (revision 778453)\n24 Lúnasa (revision 778495)\n25 Lúnasa (revision 778551)\n26 Lúnasa (revision 649051)\n27 Lúnasa (revision 778763)\n28 Lúnasa (revision 778813)\n29 Lúnasa (revision 778959)\n2 Lúnasa (revision 774393)\n30 Lúnasa (revision 648308)\n31 Lúnasa (revision 649053)\n3 Lúnasa (revision 647811)\n4 Lúnasa (revision 786284)\n5 Lúnasa (revision 776845)\n6 Lúnasa (revision 647834)\n7 Lúnasa (revision 775859)\n8 Lúnasa (revision 648745)\n9 Lúnasa (revision 648522)\nAK Parti (revision 792248)\nAn Phacastáin (revision 759339)\nAn Tuirc (revision 811970)\nAoine (revision 717430)\nBertolt Brecht (revision 800584)\nCzesław Miłosz (revision 780306)\nCéadaoin (revision 717606)\nDan Boyle (revision 797926)\nDomhnach (revision 717663)\nDéardaoin (revision 647860)\nFéilire (revision 648837)\nHalle Berry (revision 759955)\nHenry Bagenal (revision 716575)\nIúil (revision 647071)\nLuan (revision 717791)\nLúnasa (revision 810265)\nMeán Fómhair (revision 779166)\nPápa Pius VII (revision 758126)\nSatharn (revision 784525)\nWalter Scott (revision 759029)\nÁth Buí (revision 716575)\n11 Márta (revision 716519)\n17 Márta (revision 798614)\n1882 (revision 801198)\n1886 (revision 776624)\n1890 (revision 801200)\n1891 (revision 796677)\n1903 (revision 812849)\n1922 (revision 801227)\n1930í (revision 740221)\n1940í (revision 740219)\n1950í (revision 740217)\n1960í (revision 772724)\n1967 (revision 796983)\n1968 (revision 810926)\n1970 (revision 812852)\n1970í (revision 740213)\n1971 (revision 809746)\n1972 (revision 789490)\n1980í (revision 740211)\n1990í (revision 740208)\n19ú haois (revision 739964)\n1 Bealtaine (revision 647679)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-27 00:33:40.157338\n\n44 characters appeared 183561 times.\n\nFirst 31 characters:\n[ 0] Char a: 15.192769705983297 %\n[ 1] Char i: 10.534372769814938 %\n[ 2] Char n: 8.106297089250985 %\n[ 3] Char h: 7.243368689427493 %\n[ 4] Char r: 6.442544985045844 %\n[ 5] Char e: 6.198484427520007 %\n[ 6] Char s: 5.622654049607488 %\n[ 7] Char t: 4.776068990689743 %\n[ 8] Char c: 4.543448771797931 %\n[ 9] Char l: 4.1953356105054995 %\n[10] Char o: 3.9469168287381304 %\n[11] Char d: 3.2169142682813887 %\n[12] Char g: 2.811054635788648 %\n[13] Char m: 2.6269196615838877 %\n[14] Char á: 2.2749930540801153 %\n[15] Char u: 2.1932763495513754 %\n[16] Char b: 2.0478206154902185 %\n[17] Char í: 1.6599386579938005 %\n[18] Char é: 1.2829522611012143 %\n[19] Char f: 1.1494816437042727 %\n[20] Char ú: 1.0525111543301682 %\n[21] Char p: 0.9059658642086281 %\n[22] Char ó: 0.8890777452726886 %\n[23] Char v: 0.2522322279787101 %\n[24] Char y: 0.23479933101257894 %\n[25] Char k: 0.18195586208399386 %\n[26] Char w: 0.1688811893593955 %\n[27] Char j: 0.09697048937410452 %\n[28] Char z: 0.07735848028720697 %\n[29] Char x: 0.0343210159020707 %\n[30] Char q: 0.010895560603831969 %\n\nThe first 31 characters have an accumulated ratio of 0.9997058198636966.\n\n701 sequences found.\n\nFirst 512 (typical positive ratio): 0.9974076651249096\nNext 512 (512-1024): 5.447780301915984e-06\nRest: -2.7755575615628914e-17\n\n- Processing end: 2016-09-27 00:33:40.258886\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangItalianModel.log",
    "content": "= Logs of language model for Italian (it) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-21 18:43:12.831409\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nPieve Ligure (revision 83186252)\n010 (prefisso) (revision 76157203)\n1000 (revision 83185341)\n1143 (revision 70627567)\n1162 (revision 70627612)\n118 - Emergenza sanitaria (revision 83267411)\n1201 (revision 77523243)\n1202 (revision 76764411)\n1374 (revision 78259457)\n1404 (revision 70628069)\n1520 (revision 76854924)\n1537 (revision 70628296)\n1582 (revision 80626188)\n1584 (revision 76837051)\n1600 (revision 76869356)\n1619 (revision 70628455)\n1742 (revision 70628675)\n1748 (revision 70628682)\n1749 (revision 70628684)\n1750 (revision 70628690)\n1754 (revision 70628697)\n1775 (revision 70628734)\n1797 (revision 78338823)\n1798 (revision 82047236)\n1803 (revision 77502534)\n1805 (revision 79369853)\n1809 (revision 70628789)\n1810 (revision 82930218)\n1814 (revision 78338825)\n1815 (revision 82669615)\n1816 (revision 83185384)\n1818 (revision 72407239)\n1823 (revision 74880156)\n1859 (revision 83185401)\n1860 (revision 83185403)\n1861 (revision 83185412)\n1868 (revision 83185430)\n1874 (revision 83185441)\n1897 (revision 83185267)\n1908 (revision 83185631)\n1909 (revision 83185630)\n1913 (revision 83185626)\n1915 (revision 83185625)\n1917 (revision 83185270)\n1920 (revision 83185621)\n1921 (revision 83185619)\n1923 (revision 83185616)\n1925 (revision 83185614)\n1926 (revision 83185612)\n1928 (revision 83185610)\n1929 (revision 83185609)\n1939 (revision 83185598)\n1946 (revision 83185590)\n1947 (revision 83185589)\n1948 (revision 83185587)\n1951 (revision 83185584)\n1956 (revision 83185478)\n1960 (revision 83185487)\n1964 (revision 83185493)\n1965 (revision 83185494)\n1969 (revision 83185500)\n1970 (revision 83185503)\n1971 (revision 83185505)\n1975 (revision 83185510)\n1976 (revision 83185513)\n1977 (revision 83185514)\n1980 (revision 83185518)\n1981 (revision 83308867)\n1983 (revision 83185524)\n1985 (revision 83185526)\n1988 (revision 83185280)\n1990 (revision 83185531)\n1995 (revision 83185538)\n1999 (revision 83326325)\n2000 (revision 83185544)\n2001 (revision 83309058)\n2002 (revision 83185545)\n2003 (revision 83185546)\n2004 (revision 83185283)\n2005 (revision 83185285)\n2006 (revision 83185547)\n2007 (revision 83185549)\n2008 (revision 83185551)\n2009 (revision 83185552)\n2010 (revision 83185287)\n2012 (revision 83185289)\n712 (revision 70630167)\n749 (revision 78272323)\nATP (Provincia di Genova) (revision 82754117)\nAbbazia di San Colombano (revision 83062997)\nAbbazia di San Fruttuoso (revision 83288120)\nAcacia dealbata (revision 83036867)\nAcquedotto (revision 82973825)\nAffresco (revision 82000422)\nAgricoltura (revision 82578266)\nAllevamento (revision 82971452)\nAltitudine (revision 82971213)\nAngelo (revision 82333116)\nAnni 1960 (revision 83161222)\nAnni 1970 (revision 81663175)\nAntica Roma (revision 83125874)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-21 18:46:08.840718\n\n59 characters appeared 823241 times.\n\nFirst 34 characters:\n[ 0] Char i: 11.823147778111148 %\n[ 1] Char a: 11.252112078965942 %\n[ 2] Char e: 10.910170897707962 %\n[ 3] Char o: 8.936386793174782 %\n[ 4] Char n: 7.317055394471364 %\n[ 5] Char l: 6.931263141655967 %\n[ 6] Char r: 6.521784021932824 %\n[ 7] Char t: 6.386708145002497 %\n[ 8] Char s: 4.572415610981475 %\n[ 9] Char c: 4.116291584116923 %\n[10] Char d: 3.9770856893667834 %\n[11] Char u: 2.8944136650142545 %\n[12] Char m: 2.762860450342002 %\n[13] Char p: 2.6809889206198427 %\n[14] Char g: 2.1493098618751985 %\n[15] Char v: 1.5369739845318686 %\n[16] Char b: 1.2855287819727153 %\n[17] Char f: 0.9932692856648295 %\n[18] Char z: 0.9664241698360504 %\n[19] Char h: 0.7159507361756764 %\n[20] Char q: 0.2416060424590126 %\n[21] Char k: 0.18876610858788617 %\n[22] Char à: 0.15596890825408355 %\n[23] Char y: 0.12462936126844994 %\n[24] Char è: 0.11600491229178332 %\n[25] Char w: 0.10628722330398996 %\n[26] Char x: 0.10312897438295712 %\n[27] Char j: 0.07555503188009344 %\n[28] Char ù: 0.05575524056746445 %\n[29] Char ò: 0.03304014255849745 %\n[30] Char é: 0.021014502436103158 %\n[31] Char ì: 0.0191924357508919 %\n[32] Char á: 0.004737373381549267 %\n[33] Char ó: 0.003644133370422513 %\n\nThe first 34 characters have an accumulated ratio of 0.9997947138201325.\n\n872 sequences found.\n\nFirst 512 (typical positive ratio): 0.9989484485502651\nNext 512 (512-1024): 1.214711123474171e-06\nRest: -4.336808689942018e-17\n\n- Processing end: 2016-09-21 18:46:08.920456\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangLatvianModel.log",
    "content": "= Logs of language model for Latvian (lv) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-21 00:16:33.485953\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nZigfrīds Anna Meierovics (revision 2546984)\n1. Saeima (revision 2511127)\n1. Saeimas deputāti (revision 2303859)\n1. Saeimas frakcijas (revision 2429725)\n1. Saeimas vēlēšanas (revision 2464758)\n1887. gads (revision 2583253)\n1919. gada Parīzes miera konference (revision 2482078)\n1920 (revision 2401222)\n1921 (revision 2473337)\n1922 (revision 2486819)\n1923 (revision 2544643)\n1924 (revision 2539361)\n1925 (revision 2486795)\n22. augusts (revision 2583254)\n31. jūlijs (revision 2559648)\n5. februāris (revision 2581966)\nASV (revision 2549746)\nAgrārā reforma Latvijā (revision 2473423)\nAgudas Izrael (Latvija) (revision 2311143)\nAigars Kalvītis (revision 2545858)\nAlberts Kviesis (revision 2546934)\nAleksandrs Bočagovs (revision 2329526)\nAleksandrs Dauge (revision 2546805)\nAleksandrs Jaunbērzs (revision 2462254)\nAleksandrs Kerenskis (revision 2461214)\nAleksandrs Millerāns (revision 2309419)\nAleksandrs Neibergs (revision 2491897)\nAlfrēds Birznieks (revision 2567317)\nAlfrēds Jēkabs Bērziņš (revision 2564068)\nAlfrēds Riekstiņš (politiķis) (revision 2586148)\nAndrejs Bērziņš (revision 2564283)\nAndrejs Kurcijs (revision 2564338)\nAndrejs Petrevics (revision 2460269)\nAndrejs Sīmanis (revision 2547079)\nAndrejs Veckalns (revision 2564224)\nAndrievs Niedra (revision 2546988)\nAndris Bērziņš (politiķis, 1951) (revision 2218488)\nAndris Šķēle (revision 2457423)\nAngļu valoda (revision 2447598)\nAnsis Buševics (revision 2578312)\nAnsis Rudevics (revision 2414854)\nAntante (revision 2581862)\nAntons Dzenis (revision 2564295)\nAntons Laizāns (revision 2467408)\nAntons Rubins (1885) (revision 2465396)\nAntons Velkme (revision 2564425)\nAnts Pīps (revision 2564383)\nApollo (portāls) (revision 2371202)\nApolonija Laurinoviča (revision 2466232)\nAprīļa pučs (revision 2150686)\nApvienotā Karaliste (revision 2566258)\nAristīds Briāns (revision 2536819)\nArons Nuroks (revision 2337085)\nArturs Alberings (revision 2442531)\nArturs Ozols (inženieris) (revision 2491399)\nArtūrs Balfūrs (revision 2309461)\nArtūrs Vīgants (revision 2461471)\nArtūrs Žers (revision 2564230)\nArveds Bergs (revision 2564118)\nArveds Švābe (revision 2586288)\nArvīds Kalniņš (revision 2545254)\nAspazija (revision 2574081)\nAugusts Briedis (revision 2546879)\nAugusts Kalniņš (revision 2436647)\nAugusts Kirhenšteins (revision 2547109)\nAustroungārija (revision 2524307)\nAutoritatīvā vadība (revision 2385793)\nBalfūra nota (revision 2538973)\nBaltijas Antante (revision 2541901)\nBaltijas pārkrievošana (revision 2570657)\nBermontiāde (revision 2499160)\nBernards Kublinskis (revision 2441386)\nBezpartijiskais nacionālais centrs (revision 2438819)\nBeļģija (revision 2579008)\nBrestļitovskas miera līgums (revision 2569020)\nBrizules muiža (revision 2584564)\nBruno Kalniņš (revision 2566572)\nBrīvības piemineklis (revision 2578595)\nBulduru konference (revision 2193449)\nCeire-Cion (revision 2311779)\nCelmiņa 1. Ministru kabinets (revision 2112830)\nDelfi (portāls) (revision 2544918)\nDemokrātiskais Centrs (revision 2113060)\nDemokrātu savienība (revision 2179593)\nDiena (laikraksts) (revision 2548854)\nDonats Bicāns (revision 2479349)\nDubulti (Jūrmala) (revision 2456811)\nDurbe (revision 2381790)\nDāvids Komisārs (revision 2574685)\nDžovanni Džoliti (revision 2538055)\nEbreju bloks (revision 2311643)\nEbreju nacionāldemokrātu partija (revision 2312288)\nEduards Grantskalns (revision 2565167)\nEduards Jaunzems (revision 2452579)\nEduards Laimiņš (revision 2449521)\nEduards Radziņš (revision 2564393)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-21 00:19:18.361533\n\n55 characters appeared 354745 times.\n\nFirst 39 characters:\n[ 0] Char a: 11.905171320244119 %\n[ 1] Char i: 9.3977364022044 %\n[ 2] Char s: 8.224217395594017 %\n[ 3] Char e: 6.367108768270166 %\n[ 4] Char r: 5.854064186951191 %\n[ 5] Char t: 5.831230884156225 %\n[ 6] Char u: 4.939604504644181 %\n[ 7] Char n: 4.463769750102186 %\n[ 8] Char ā: 3.9498794909019157 %\n[ 9] Char l: 3.8030134321836813 %\n[10] Char o: 3.6296494665182033 %\n[11] Char k: 3.524785409237621 %\n[12] Char m: 3.2739009711201 %\n[13] Char d: 3.177775585279567 %\n[14] Char v: 3.0046935122411873 %\n[15] Char p: 2.827101157169234 %\n[16] Char j: 2.8166711299665956 %\n[17] Char b: 2.0279355593454453 %\n[18] Char ī: 1.8855797826607845 %\n[19] Char g: 1.6146809680192813 %\n[20] Char z: 1.5343415692962552 %\n[21] Char ē: 1.4593581304880971 %\n[22] Char c: 1.2231321089796898 %\n[23] Char š: 0.8876798827326671 %\n[24] Char ņ: 0.46596851259355315 %\n[25] Char f: 0.4203019070036223 %\n[26] Char ļ: 0.34700982395805435 %\n[27] Char ū: 0.30162511099522193 %\n[28] Char h: 0.20070755049401684 %\n[29] Char ž: 0.18774048964749326 %\n[30] Char ķ: 0.14207388405756247 %\n[31] Char ģ: 0.1268516821942522 %\n[32] Char č: 0.08287643236691145 %\n[33] Char w: 0.0324176521163089 %\n[34] Char y: 0.02734358482853881 %\n[35] Char x: 0.015785987117506943 %\n[36] Char ö: 0.005074067287770088 %\n[37] Char é: 0.003946496779376736 %\n[38] Char q: 0.0031008188980817205 %\n\nThe first 39 characters have an accumulated ratio of 0.9998590536864506.\n\n970 sequences found.\n\nFirst 512 (typical positive ratio): 0.9904102202220861\nNext 512 (512-1024): 0.0018774048964749328\nRest: -1.734723475976807e-17\n\n- Processing end: 2016-09-21 00:19:18.484318\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangLithuanianModel.log",
    "content": "= Logs of language model for Lithuanian (lt) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-21 00:23:03.857157\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nKarūna (laivas) (revision 5080379)\n1650 (revision 4990868)\n1654 (revision 4991037)\n1664 (revision 4991048)\n1665 (revision 4991050)\n1668 (revision 4991052)\n1669 (revision 4991053)\n1672 (revision 4991056)\n1676 (revision 4991060)\n1718 (revision 4990914)\n1909 (revision 4990667)\n1928 (revision 4990262)\n1932 (revision 4990613)\n1956 (revision 4990635)\n1980 (revision 4990655)\nBaltijos jūra (revision 5052833)\nBurinis laivas (revision 4657401)\nFlagmanas (laivas) (revision 5005271)\nGrimzlė (revision 4487052)\nKalmaras (Švedija) (revision 4978519)\nKaro laivas (revision 4726931)\nKarolis XI (revision 4944621)\nKarolis XII (revision 4915230)\nKilis (revision 4325533)\nKoordinačių sistema (revision 5033980)\nLaivo vėliava (revision 4986001)\nLiepos 1 d. (revision 4910200)\nNyderlandai (revision 5080140)\nRugpjūčio 10 (revision 4910281)\nVarytuvas (revision 4620792)\nVaza (laivas) (revision 5079282)\nXVIII a. (revision 4896219)\nXVII a. (revision 4768242)\nŠvedija (revision 5057665)\nŠvedų kalba (revision 4687559)\n1590 (revision 4990983)\n1596 (revision 4990989)\n1608 (revision 4991000)\n1610 (revision 4991002)\n1623 m. (revision 4991015)\n1634 m. (revision 4991026)\n1643 m. (revision 4990870)\n1644 m. (revision 4990872)\n1645 m. (revision 4990873)\n1646 m. (revision 4990874)\n1647 m. (revision 4913295)\n1648 m. (revision 4990875)\n1649 m. (revision 4990876)\n1651 m. (revision 4991035)\n1652 m. (revision 4991072)\n1653 m. (revision 4991036)\n1654 m. (revision 4991037)\n1655 m. (revision 4991038)\n1662 m. (revision 4991046)\n1668 m. (revision 4991052)\n1677 m. (revision 4991061)\n1702 (revision 4990595)\n1704 (revision 4990863)\n1722 (revision 4990918)\n1723 (revision 4990919)\n1737 (revision 4990931)\n2 tūkstantmetis (revision 4296407)\nATR (revision 5078529)\nAbiejų Tautų Respublika (revision 5078529)\nAdomas Freitagas (revision 4362991)\nAnglų kalba (revision 4911240)\nArmėnų kalendorius (revision 4817534)\nBahajų kalendorius (revision 4706296)\nBajorai (revision 5006456)\nBerberų kalendorius (revision 4926904)\nBirželio 21 (revision 4910142)\nBizantijos kalendorius (revision 4927623)\nBudistų kalendorius (revision 4705734)\nDešimtmetis (revision 4296419)\nDominikonai (revision 4921895)\nDominikonų ordinas (revision 4921895)\nDžohoro sultonatas (revision 4934526)\nDžu Ihai (revision 4991072)\nDžu Joulang (revision 4991072)\nEmanuelis Vladislovas Tiškevičius Logoiskis (revision 4939239)\nFilosofas (revision 5078172)\nGegužės 26 (revision 4910130)\nGrafas (titulas) (revision 5008057)\nGrigaliaus kalendorius (revision 5000317)\nHebrajų kalendorius (revision 4728592)\nImperatorius Go-Komijas (revision 4907057)\nInocentas X (revision 4905150)\nIraniečių kalendorius (revision 4964854)\nIsaac Titsingh (revision 4990745)\nJaponija (revision 5035249)\nJaponijos imperatorius (revision 4720428)\nJaponų kalendorius (revision 4956765)\nJohn Churchill (revision 4903704)\nJonas Kazimieras Vaza (revision 5037754)\nJurgis Kasakauskis (revision 5047829)\nJurgis Kazimieras Ancuta (revision 5059404)\nJurgis Mikalojus Tiškevičius (revision 4939554)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-21 00:25:34.773941\n\n60 characters appeared 353051 times.\n\nFirst 38 characters:\n[ 0] Char i: 13.032394753165974 %\n[ 1] Char a: 11.167225131779828 %\n[ 2] Char s: 8.586578143101137 %\n[ 3] Char o: 7.018815978428046 %\n[ 4] Char e: 5.525830545728521 %\n[ 5] Char r: 5.469181506354606 %\n[ 6] Char n: 5.142599794363987 %\n[ 7] Char t: 5.105777918770942 %\n[ 8] Char u: 4.270487833202568 %\n[ 9] Char k: 3.9617505686147325 %\n[10] Char l: 3.9051015292408184 %\n[11] Char m: 3.359854525266888 %\n[12] Char d: 3.0372382460324427 %\n[13] Char v: 2.7270847554602593 %\n[14] Char j: 2.4472385009531203 %\n[15] Char p: 2.329125253858508 %\n[16] Char g: 1.9427788053284087 %\n[17] Char ė: 1.5657794482950054 %\n[18] Char b: 1.5074309377398734 %\n[19] Char y: 1.2236192504765602 %\n[20] Char ų: 1.181698961339863 %\n[21] Char š: 0.9630336693565519 %\n[22] Char ž: 0.8171623929687212 %\n[23] Char c: 0.5959478942135839 %\n[24] Char č: 0.48010060869392807 %\n[25] Char f: 0.428266737666796 %\n[26] Char h: 0.42515104050123065 %\n[27] Char z: 0.4010751987673169 %\n[28] Char ū: 0.3685020011273159 %\n[29] Char ą: 0.3526402701026197 %\n[30] Char į: 0.29004308159444386 %\n[31] Char ę: 0.14813723796278724 %\n[32] Char x: 0.08752276583269838 %\n[33] Char w: 0.059198246145740985 %\n[34] Char ō: 0.01812769259965274 %\n[35] Char ö: 0.008780601102956797 %\n[36] Char é: 0.0076476203154785 %\n[37] Char q: 0.007364375118608926 %\n\nThe first 38 characters have an accumulated ratio of 0.9996629382157253.\n\n1016 sequences found.\n\nFirst 512 (typical positive ratio): 0.9928710196247589\nNext 512 (512-1024): 0.008171623929687212\nRest: -4.85722573273506e-17\n\n- Processing end: 2016-09-21 00:25:34.935858\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangMalteseModel.log",
    "content": "= Logs of language model for Maltese (mt) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-21 02:05:23.411546\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nUnjoni Ewropea (revision 246298)\n1951 (revision 229183)\n1952 (revision 229184)\n1957 (revision 229188)\n1958 (revision 229189)\n1973 (revision 223536)\n1979 (revision 243876)\n1981 (revision 205545)\n1985 (revision 216368)\n1986 (revision 231433)\n1990 (revision 237666)\n1992 (revision 244087)\n1995 (revision 214650)\n1 ta' Mejju (revision 245374)\n2007 (revision 214851)\n2013 (revision 245606)\nAlbanija (revision 243079)\nAwstrija (revision 243627)\nAwtonomija (revision 245824)\nAżores (revision 246298)\nBank Ċentrali Ewropew (revision 246298)\nBelt kapitali (revision 237400)\nBelġju (revision 244363)\nBrussell (revision 243311)\nBulgarija (revision 243622)\nDanimarka (revision 244419)\nDe facto (revision 215102)\nEstonja (revision 243826)\nEuropean Free Trade Association (revision 246298)\nEwropa (revision 244177)\nEx Repubblika Jugoslava tal-Maċedonja (revision 246298)\nFederazzjoni (revision 246226)\nFinlandja (revision 245824)\nFrankfurt (revision 243576)\nFranza (revision 244461)\nGreċja (revision 244423)\nGroenlandja (revision 243829)\nIndja (revision 244873)\nIslanda (revision 243771)\nIsle of Man (revision 246298)\nIstitut tal-Unjoni Ewropea għall-Istudji dwar is-Sigurtà (revision 244412)\nItalja (revision 246323)\nKilometru kwadru (revision 244871)\nKomunitajiet Ewropej (revision 246298)\nKomunità Ekonomika Ewropea (revision 246298)\nKroazja (revision 245711)\nKummissjoni Ewropea (revision 243311)\nKunsill Ewropew (revision 246298)\nKunsill tal-Ewropa (revision 243334)\nKunsill tal-Unjoni Ewropea (revision 243311)\nLatvja (revision 245746)\nLista ta' pajjiżi skont id-daqs (revision 244419)\nLista ta' pajjiżi skont il-popolazzjoni (revision 246128)\nLitwanja (revision 243114)\nLiġijiet tal-Unjoni Ewropea (revision 246298)\nLussemburgu (revision 244239)\nLussemburgu (belt) (revision 243587)\nMadejra (revision 243625)\nMalta (revision 247210)\nMontenegro (revision 243930)\nNorveġja (revision 243829)\nOlanda (revision 243989)\nOrganizzazzjoni Internazzjonali (revision 246724)\nPajjiżi l-Baxxi (revision 243989)\nPajjiżi membri tal-Unjoni Ewropea (revision 243625)\nPajjiżi ġirien li jdawru l-Unjoni Ewropea (revision 246298)\nParlament Ewropew (revision 243907)\nPatt ta' Stabilità u Tkabbir (revision 246298)\nPolitika agrikola komuni (revision 244363)\nPolitika reġjonali tal-Unjoni Ewropea (revision 246298)\nPolonja (revision 244530)\nPortugall (revision 243625)\nRelazzjonijiet ta' terzi pajjiżi ma l-UE (revision 246298)\nRenju Unit (revision 247318)\nRepubblika Federali tal-Ġermanja (revision 244859)\nRepubblika tal-Irlanda (revision 243686)\nRepubblika Ċeka (revision 246832)\nRumanija (revision 243623)\nSegretarjat tal-Parlament Ewropew (revision 246298)\nSerbja (revision 243728)\nSlovakkja (revision 243831)\nSlovenja (revision 244588)\nSpanja (revision 246856)\nStati Uniti tal-Amerika (revision 243926)\nStati membri tal-Unjoni Ewropea (revision 243114)\nStrasburgu (revision 243503)\nSui generis (revision 247150)\nSuq komuni (revision 246298)\nSvezja (revision 244871)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-21 02:07:45.508113\n\n48 characters appeared 474337 times.\n\nFirst 31 characters:\n[ 0] Char a: 12.326257492036252 %\n[ 1] Char i: 12.069899670487438 %\n[ 2] Char t: 8.064941170518008 %\n[ 3] Char l: 7.795301652622502 %\n[ 4] Char e: 6.615971345267184 %\n[ 5] Char n: 6.128132530247482 %\n[ 6] Char r: 5.579577389071483 %\n[ 7] Char u: 4.376424356522894 %\n[ 8] Char o: 3.8337721915009797 %\n[ 9] Char j: 3.7378488289971057 %\n[10] Char m: 3.6084049947611088 %\n[11] Char s: 3.3533120966738834 %\n[12] Char k: 2.588033402412209 %\n[13] Char d: 2.3173397816320462 %\n[14] Char p: 2.0555006250830106 %\n[15] Char b: 2.017131280081461 %\n[16] Char f: 2.004692866042497 %\n[17] Char ħ: 1.6372326004507345 %\n[18] Char w: 1.4801712706366992 %\n[19] Char g: 1.4763765002519307 %\n[20] Char z: 1.3150987588992635 %\n[21] Char ż: 0.9910675321554084 %\n[22] Char h: 0.9750451683086075 %\n[23] Char ġ: 0.7640137708000851 %\n[24] Char ċ: 0.6723068198348432 %\n[25] Char x: 0.5892435125237964 %\n[26] Char v: 0.5668965313690478 %\n[27] Char q: 0.5647883255997318 %\n[28] Char c: 0.2759641352034524 %\n[29] Char à: 0.10730767365817974 %\n[30] Char y: 0.059029761540845424 %\n\nThe first 31 characters have an accumulated ratio of 0.9994708403519017.\n\n870 sequences found.\n\nFirst 512 (typical positive ratio): 0.9959115850692665\nNext 512 (512-1024): 2.108205769315908e-06\nRest: -4.423544863740858e-17\n\n- Processing end: 2016-09-21 02:07:45.646198\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangNederlandsModel.log",
    "content": "= Logs of language model for Nederlands (nl) =\n\n- Generated by BuildLangModel.py\n- Started: 2019-03-05 22:44:20.050852\n- Maximum depth: 4\n- Max number of pages: 100\n\n== Parsed pages ==\n\nHoofdpagina (revision 42806222)\n1193 (revision 49105208)\n1678 (revision 51370454)\n1877 (revision 52221957)\n1 maart (revision 53328825)\n28 februari (revision 53333556)\n2 maart (revision 53304319)\n4 maart (revision 53328727)\nAardolie (revision 53232183)\nAdder (revision 53255935)\nAjjoebiden (revision 52061408)\nAnorganische verbinding (revision 50266701)\nAnton Webern (revision 51435017)\nAntonio Vivaldi (revision 53013950)\nAtoombommen op Hiroshima en Nagasaki (revision 53186027)\nBaan (hemellichaam) (revision 52421076)\nBacteriën (revision 53284887)\nBallet (revision 53166893)\nBelgië (revision 53089250)\nBiomolecuul (revision 52342598)\nBolsjojtheater (revision 46840685)\nCitadel van Damascus (revision 52714519)\nDe vier jaargetijden (revision 51236952)\nDesoxyribonucleïnezuur (revision 52928136)\nDierenrijk (revision 53171437)\nDonald Trump (revision 53316008)\nDragon 2 (revision 53325378)\nEindhoven (revision 53148954)\nEmma Hamilton (revision 53200721)\nFosfolipide (revision 45426802)\nFrankrijk (revision 53201265)\nGangbare jaartelling (revision 53305089)\nGeologie (revision 52133989)\nGeorge Romney (revision 48220482)\nGesteente (revision 52807934)\nHeiligdomsvaart van Maastricht (revision 53142350)\nHet zwanenmeer (revision 53219336)\nHoning (revision 53181307)\nHoratio Nelson (revision 53314699)\nHout (hoofdbetekenis) (revision 53044527)\nHoward Hughes (revision 53293454)\nIndia (revision 53279672)\nInternetencyclopedie (revision 52816473)\nIslamitische kalender (revision 53328122)\nJames Lick (revision 53252724)\nJammu en Kasjmir (gebied) (revision 53313902)\nKasjmirconflict (revision 49694027)\nKeith Flint (revision 53324751)\nKennedy Space Center (revision 53281818)\nKernwapenprogramma van Noord-Korea (revision 52456973)\nKim Jong-un (revision 52426396)\nKredietcrisis (revision 53280092)\nLemma (naslagwerk) (revision 53063550)\nLijst van personen overleden in 2019 (revision 52904365)\nLucifer (toneelstuk) (revision 51853284)\nLudo Loos (revision 53312584)\nLuke Perry (revision 53334097)\nMacromolecuul (revision 53233815)\nMedina (Arabië) (revision 53164210)\nMineraal (revision 53228621)\nMohammed (revision 53205987)\nMoskou (hoofdbetekenis) (revision 53161394)\nNatuur (werkelijkheid) (revision 52651323)\nNatuurproduct (materiaal) (revision 44076415)\nNatuurproduct (scheikunde) (revision 52509420)\nNederlandstalige Wikipedia (revision 52234843)\nNon-profit (revision 52177686)\nOrganisme (revision 52466273)\nOxytocine (revision 51856966)\nPakistan (revision 53255621)\nPaul Williams (blueszanger) (revision 53316424)\nPeter van Gestel (revision 53319161)\nPlanten (revision 52775791)\nProtestbeweging van de gele hesjes (revision 53334148)\nProteïne (revision 52684512)\nRepubliek Venetië (revision 53244002)\nSaladin (revision 51827810)\nScheikunde (revision 53170134)\nSedimentair gesteente (revision 52717620)\nSeksualiteit (revision 52702386)\nSpX-DM1 (revision 53331792)\nSpaceX (revision 53312861)\nStof (scheikunde) (revision 53162151)\nSubductie (revision 53057979)\nSupramoleculaire chemie (revision 45112850)\nSyrië (revision 53321993)\nTNT-equivalent (revision 52284099)\nTabak (hoofdbetekenis) (revision 53251285)\nTektonische plaat (revision 52847756)\nTopconferentie (revision 52015958)\nVerliefdheid (revision 52492009)\nVest (kleding) (revision 52737592)\nVioolconcert (revision 52347055)\nVriendschap (revision 53223707)\nVroeg-islamitisch Egypte (revision 52269237)\nWallonië (revision 53178812)\nWikimedia Foundation (revision 52930105)\nWikipedia (revision 52234843)\nZuivere stof (revision 52503197)\n1180-1189 (revision 46239029)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2019-03-05 22:48:03.613070\n\n59 characters appeared 1279049 times.\n\nFirst 33 characters:\n[ 0] Char e: 17.793376172453126 %\n[ 1] Char n: 9.722301491186029 %\n[ 2] Char a: 7.944887177895452 %\n[ 3] Char i: 6.839221953185532 %\n[ 4] Char r: 6.648533402551426 %\n[ 5] Char t: 6.374267131282695 %\n[ 6] Char o: 5.982257130102131 %\n[ 7] Char d: 5.676483074534283 %\n[ 8] Char s: 4.556432161707644 %\n[ 9] Char l: 4.042534726972931 %\n[10] Char g: 2.9120854634967075 %\n[11] Char v: 2.647670261264424 %\n[12] Char m: 2.385287819309503 %\n[13] Char h: 2.3648820334482887 %\n[14] Char k: 2.06176620285853 %\n[15] Char u: 1.9499643876036021 %\n[16] Char c: 1.7972728175386556 %\n[17] Char b: 1.6535723025466575 %\n[18] Char p: 1.6050987882403254 %\n[19] Char w: 1.3385726426430888 %\n[20] Char j: 1.2271617428261155 %\n[21] Char z: 0.9909706352141316 %\n[22] Char f: 0.9094256748568664 %\n[23] Char y: 0.2506549788162924 %\n[24] Char ë: 0.12001103945196784 %\n[25] Char x: 0.09718157787543714 %\n[26] Char é: 0.034713290890341184 %\n[27] Char q: 0.02322037701448498 %\n[28] Char ï: 0.02009305351085064 %\n[29] Char ü: 0.0053164499561783795 %\n[30] Char è: 0.0050037176058149455 %\n[31] Char ó: 0.0043000698174972185 %\n[32] Char ö: 0.003909154379542926 %\n\nThe first 33 characters have an accumulated ratio of 0.9998842890303653.\n\n924 sequences found.\n\nFirst 512 (typical positive ratio): 0.9980487395086337\nNext 512 (512-1024): 7.818308759085852e-07\nRest: -4.9439619065339e-17\n\n- Processing end: 2019-03-05 22:48:03.706807\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangPolishModel.log",
    "content": "= Logs of language model for Polish (pl) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-21 17:06:43.735784\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nKrasnyj Krym (revision 46884814)\n1913 (revision 46708474)\n1915 (revision 46743905)\n1917 (revision 46559521)\n1925 (revision 46809935)\n1928 (revision 46875978)\n1929 (revision 46760445)\n1935 (revision 46487358)\n1936 (revision 46874348)\n1939 (revision 46789269)\n1941 (revision 46856112)\n1942 (revision 46851808)\n1943 (revision 46768330)\n1944 (revision 46866229)\n1949 (revision 46882598)\n1953 (revision 46437607)\n1957 (revision 46591716)\n1959 (revision 46255886)\nAdmirał Butakow (revision 45993412)\nAdmirał Spiridow (revision 45993412)\nAparat torpedowy (revision 46633263)\nAskold (revision 45787848)\nAvro 504 (revision 44668646)\nAłmaz (1903) (revision 46472283)\nBatumi (revision 46594611)\nBomba głębinowa (revision 46011227)\nBrest (revision 45771242)\nBurta (revision 45569092)\nCagliari (revision 46235605)\nCesariewicz (revision 40031486)\nCzerwona Ukraina (revision 45993524)\nDaty nowego i starego porządku (revision 45622575)\nDrednot (revision 45789788)\nDziało przeciwlotnicze (revision 45160162)\nFlota Bałtycka Marynarki Wojennej Rosji (revision 45700667)\nGromoboj (revision 44328986)\nHulk (okręt) (revision 46020688)\nII wojna światowa (revision 46871591)\nI wojna światowa (revision 46869119)\nImperator Nikołaj I (okręt lotniczy) (revision 45520638)\nImperium Rosyjskie (revision 46604959)\nImpierator Nikołaj I (1916) (revision 46534166)\nJęzyk rosyjski (revision 46433952)\nKanonierka (revision 41091952)\nKanonierki typu Ardagan (revision 46534166)\nKanonierki typu Bobr (revision 45788694)\nKanonierki typu Chiwiniec (revision 46534166)\nKanonierki typu Groziaszczij (revision 46534166)\nKanonierki typu Mandżur (revision 46534166)\nKarabin maszynowy DSzK (revision 45587452)\nKarabin maszynowy Vickers 12,7 mm (revision 44572918)\nKocioł parowy (revision 46716473)\nKonstrukcyjna linia wodna (revision 37082620)\nKontrtorpedowce typu Biesstrasznyj (revision 46534166)\nKontrtorpedowce typu Brawyj (revision 46534166)\nKontrtorpedowce typu Grozowoj (revision 46534166)\nKontrtorpedowce typu Prytkij (revision 46534166)\nKoń mechaniczny (revision 44722357)\nKrab (1915) (revision 42791389)\nKronsztad (revision 46425497)\nKrążownik lekki (revision 40661490)\nKrążownik liniowy (revision 40601776)\nKrążownik pancernopokładowy (revision 40055901)\nKrążownik pancerny (revision 40324458)\nKrążowniki lekkie typu Swietłana (revision 45993412)\nKrążowniki liniowe typu Borodino (revision 45990866)\nKrążowniki typu Admirał Nachimow (revision 45993521)\nKrążowniki typu Bajan (revision 45991279)\nKrążowniki typu Diana (revision 45991349)\nKrążowniki typu Izumrud (revision 45991349)\nLend-Lease Act (revision 46877263)\nMarynarka Wojenna Związku Socjalistycznych Republik Radzieckich (revision 45795993)\nMaszyna sterowa (revision 28497888)\nMecidiye (1903) (revision 43956539)\nMila morska (revision 45754209)\nMina morska (revision 45781427)\nMorze Czarne (revision 46729213)\nNadbudówka (revision 45292731)\nNeapol (revision 46823083)\nNiszczyciel (revision 45799132)\nNiszczyciele rakietowe projektu 61 (revision 46498775)\nNiszczyciele typu Finn (revision 46620140)\nNiszczyciele typu Lejtienant Szestakow (revision 46620140)\nNiszczyciele typu Ochotnik (revision 46620140)\nNiszczyciele typu Ukraina (revision 46620140)\nNoworosyjsk (revision 44721836)\nOdessa (revision 45629804)\nOerlikon 20 mm (revision 45493862)\nOkres międzywojenny (revision 46668249)\nOkręt-baza wodnosamolotów (revision 45115462)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-21 17:21:04.404471\n\n78 characters appeared 1159291 times.\n\nFirst 37 characters:\n[ 0] Char a: 9.685575062689178 %\n[ 1] Char i: 8.815819324052374 %\n[ 2] Char o: 7.920185699707839 %\n[ 3] Char e: 6.871613770830621 %\n[ 4] Char r: 5.8672067668945935 %\n[ 5] Char n: 5.763608964444647 %\n[ 6] Char s: 4.736688199942896 %\n[ 7] Char k: 4.722196583946568 %\n[ 8] Char z: 4.519227700378939 %\n[ 9] Char w: 4.279512219106333 %\n[10] Char t: 4.0191806888865695 %\n[11] Char c: 3.6891513864939864 %\n[12] Char y: 3.565282573572986 %\n[13] Char p: 3.0190004062828053 %\n[14] Char d: 2.851052928039638 %\n[15] Char l: 2.7930002044352973 %\n[16] Char m: 2.7530620008263673 %\n[17] Char u: 2.348504387595522 %\n[18] Char j: 1.881236031332944 %\n[19] Char ł: 1.6885320424293815 %\n[20] Char b: 1.394559260789569 %\n[21] Char g: 1.3928340684090534 %\n[22] Char h: 1.163901039514669 %\n[23] Char ę: 0.8066136975099435 %\n[24] Char ó: 0.5971753425153823 %\n[25] Char ą: 0.563275312238256 %\n[26] Char f: 0.5245447432956868 %\n[27] Char ż: 0.4545019326467643 %\n[28] Char ś: 0.39567287247119143 %\n[29] Char ń: 0.3857530162832283 %\n[30] Char ć: 0.1397405828217419 %\n[31] Char v: 0.12455888987320698 %\n[32] Char ź: 0.10204512930748191 %\n[33] Char x: 0.05468859846233603 %\n[34] Char é: 0.020961087423261287 %\n[35] Char á: 0.01707940456710179 %\n[36] Char q: 0.011386269711401192 %\n\nThe first 37 characters have an accumulated ratio of 0.9993892818972973.\n\n1321 sequences found.\n\nFirst 512 (typical positive ratio): 0.9894531815946438\nNext 512 (512-1024): 1.7251923805153322e-06\nRest: 0.0003530230403650733\n\n- Processing end: 2016-09-21 17:21:04.878014\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangPortugueseModel.log",
    "content": "= Logs of language model for Portuguese (pt) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-20 23:44:39.722451\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nPapagaio-das-mascarenhas (revision 46763149)\nAlbinismo (revision 46498446)\nAlfred Newton (revision 43617011)\nAlphonse Milne-Edwards (revision 39740747)\nAnimalia (revision 46727732)\nAsa (revision 46338820)\nAugust von Pelzeln (revision 34726241)\nAves (revision 46728980)\nBico (revision 45311553)\nCarl Wilhelm Hahn (revision 45025566)\nCarlos Lineu (revision 46625396)\nCarolus Linnaeus (revision 46625396)\nCauda (revision 43275401)\nCharles Lucien Bonaparte (revision 45529712)\nChordata (revision 46640101)\nCladograma (revision 46700307)\nClasse (biologia) (revision 46701409)\nClassificação científica (revision 46306288)\nColeção Leverian (revision 45026647)\nComores (revision 46181501)\nCoracopsinae (revision 36946101)\nCoracopsis nigra (revision 44338845)\nCoracopsis vasa (revision 42905822)\nCylindraspis indica (revision 42905410)\nCúlmen (revision 45311553)\nDigital object identifier (revision 42172651)\nEclectus roratus (revision 44380798)\nEdward Newton (revision 39261469)\nEndemismo (revision 45260961)\nEpíteto específico (revision 35101647)\nEspécie (revision 45685675)\nEsquilo-vermelho (revision 43489595)\nEstado de conservação (revision 46662839)\nExtinção (revision 46526607)\nFamília (biologia) (revision 46636004)\nFilo (revision 46704246)\nFrança (revision 46740839)\nFrançois-Nicolas Martinet (revision 43679514)\nFrançois Levaillant (revision 40142351)\nFredrik Hasselqvist (revision 44381122)\nFregilupus varius (revision 46555765)\nFumigação (revision 42458244)\nGeorge Robert Gray (revision 39047844)\nGeorges-Louis Leclerc, conde de Buffon (revision 45622418)\nGénero (biologia) (revision 45296588)\nHermann Schlegel (revision 43137605)\nHerpetologista (revision 46207704)\nHistoire Naturelle (revision 44293456)\nHolótipo (revision 44029660)\nIlha da Reunião (revision 45458206)\nIlha vulcânica (revision 37924535)\nIlhas Mascarenhas (revision 45858660)\nIlhas Molucas (revision 45476933)\nInternational Standard Book Number (revision 46326494)\nJacques Barraband (revision 45007769)\nJean Feuilley (revision 43140791)\nJohann Georg Wagler (revision 34585234)\nJohn Gerrard Keulemans (revision 39664498)\nJulian Hume (revision 41876605)\nLeiolopisma (revision 43997173)\nLionel Walter Rothschild (revision 46022922)\nLista Vermelha da IUCN (revision 46569884)\nLista Vermelha da União Internacional para a Conservação da Natureza e dos Recursos Naturais (revision 46569884)\nLista Vermelha de Espécies Ameaçadas da IUCN (revision 46569884)\nLista de aves extintas (revision 45507420)\nLondres (revision 46310311)\nLíngua inglesa (revision 46609785)\nMadagascar (revision 46617630)\nMascarenotus grucheti (revision 43145662)\nMathurin Jacques Brisson (revision 36018826)\nMaurício (revision 46723599)\nMaximiliano I José da Baviera (revision 46372080)\nMelanina (revision 46762903)\nMuseu Nacional de História Natural (França) (revision 43731807)\nNaturhistorisches Museum (revision 46694247)\nNesoenas duboisi (revision 43995805)\nNome científico (revision 46671641)\nNomenclatura binomial (revision 46671641)\nNycticorax duboisi (revision 43816214)\nNível do mar (revision 46414695)\nOrdem (biologia) (revision 46360024)\nOtto Finsch (revision 42362273)\nPapagaio (revision 46738207)\nPapagaio-cinzento (revision 46673943)\nPapagaio-cinzento-de-maurício (revision 46664408)\nPedro Mascarenhas (c. 1484-1555) (revision 45541977)\nPeriquito-de-maurício (revision 43010883)\nPeriquito-de-reunião (revision 43048764)\nPeter Mundy (revision 43563846)\nPiton des Neiges (revision 45632497)\nPleistoceno (revision 45916874)\nPlumagem (revision 34951058)\nPonto quente (revision 45375495)\nPorphyrio coerulescens (revision 43672493)\nPraslin (revision 40728143)\nPsitacídeos (revision 46598835)\nPsittaciformes (revision 46598835)\nPsittacula (revision 42856453)\nPsittaculinae (revision 46760737)\nPsittaculini (revision 43015966)\nPsittrichasiidae (revision 44385977)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-20 23:47:27.346826\n\n51 characters appeared 558324 times.\n\nFirst 38 characters:\n[ 0] Char a: 11.864795351802895 %\n[ 1] Char e: 11.44604208309154 %\n[ 2] Char o: 9.868284365350585 %\n[ 3] Char s: 8.346587286235232 %\n[ 4] Char i: 7.118089138206489 %\n[ 5] Char r: 6.394136737808154 %\n[ 6] Char n: 5.568272186042513 %\n[ 7] Char d: 5.243192125002687 %\n[ 8] Char t: 4.80061756256224 %\n[ 9] Char m: 4.498105042949971 %\n[10] Char c: 3.9747530107965985 %\n[11] Char u: 3.7229279056605127 %\n[12] Char l: 3.207814817202914 %\n[13] Char p: 2.77562848811801 %\n[14] Char g: 1.3850380782484721 %\n[15] Char v: 1.3210967108703908 %\n[16] Char f: 1.122466524813549 %\n[17] Char b: 0.9702251739133549 %\n[18] Char h: 0.9130898904578704 %\n[19] Char é: 0.7026386112723079 %\n[20] Char ã: 0.7022803963290133 %\n[21] Char q: 0.5903382265494588 %\n[22] Char ç: 0.5856814322866293 %\n[23] Char í: 0.41391736697688086 %\n[24] Char x: 0.3913498255493226 %\n[25] Char á: 0.34567742027926435 %\n[26] Char z: 0.3170202248156984 %\n[27] Char ó: 0.22925756370852768 %\n[28] Char j: 0.20454073262120204 %\n[29] Char ê: 0.20239144296143458 %\n[30] Char õ: 0.16155493942585308 %\n[31] Char y: 0.15080849112701586 %\n[32] Char w: 0.09241945537000021 %\n[33] Char ú: 0.08794176857881804 %\n[34] Char k: 0.08364318925928313 %\n[35] Char â: 0.07898639499645367 %\n[36] Char à: 0.06859816164091102 %\n[37] Char ô: 0.031164700066627977 %\n\nThe first 38 characters have an accumulated ratio of 0.9998137282294869.\n\n891 sequences found.\n\nFirst 512 (typical positive ratio): 0.9953179582313172\nNext 512 (512-1024): 1.7910747164728723e-06\nRest: 2.42861286636753e-17\n\n- Processing end: 2016-09-20 23:47:27.489355\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangRomanianModel.log",
    "content": "= Logs of language model for Romanian (ro) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-28 18:53:56.086095\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nThe Loving Kind (revision 10166481)\n12 ianuarie (revision 10711676)\n13 decembrie (revision 9938353)\n2007 (revision 10716321)\n2008 (revision 10752084)\n2009 (revision 10654003)\n21 noiembrie (revision 10447643)\n25 ianuarie (revision 10228199)\n31 ianuarie (revision 10718063)\n4 Music (revision 9701591)\nBillboard (revision 10505294)\nBiology (revision 10112430)\nBulgaria (revision 10481051)\nCD (revision 10477531)\nCall The Shots (revision 10101027)\nCall the Shots (revision 10101027)\nCan't Speak French (revision 9721506)\nCasă de discuri (revision 10611348)\nChannel 4 (revision 7953101)\nChemistry (revision 10112479)\nCheryl Cole (revision 10475016)\nChitară (revision 10468266)\nCroația (revision 10737746)\nDance (revision 10231736)\nDescărcare digitală (revision 10100743)\nDigital Spy (revision 9044016)\nDiscografia Girls Aloud (revision 10172788)\nEstonia (revision 10749810)\nEuropa (revision 10752724)\nFascination Records (revision 9655292)\nFiona Phillips (revision 5384082)\nGen muzical (revision 10534645)\nGirls A Live (revision 10112444)\nGirls Aloud (revision 10112446)\nGood Morning Television (revision 10166481)\nHeat World (revision 10166481)\nI'll Stand By You (cântec de Girls Aloud) (revision 10112432)\nITunes (revision 10744174)\nI Think We're Alone Now (revision 10112427)\nIrlanda (revision 10573806)\nJump (cântec de Girls Aloud) (revision 10112438)\nLady GaGa (revision 10753010)\nLife Got Cold (revision 10112437)\nLimba engleză (revision 10756676)\nLong Hot Summer (revision 10112429)\nLove Machine (revision 10112433)\nMSN Search (revision 10653298)\nMTV (revision 10170766)\nMixed Up (revision 10112443)\nMuzică electronică (revision 10608432)\nMuzică pop (revision 10740529)\nNadine Coyle (revision 10316187)\nNeil Tennant (revision 10499980)\nNo Good Advice (revision 10112436)\nOut Of Control (revision 10112484)\nOut of Control (revision 10112484)\nPet Shop Boys (revision 10612741)\nPoker Face (revision 10496402)\nPopJustice (revision 10625677)\nRegatul Unit (revision 10752338)\nRegatul Unit al Marii Britanii și Irlandei de Nord (revision 10752338)\nRegatul Unit al Marii Britanii și al Irlandei de Nord (revision 10752338)\nRepublica Irlanda (revision 10573806)\nRomanian Top 100 (revision 10736281)\nRomânia (revision 10732435)\nSarah Harding (revision 10633651)\nSarah Hearding (revision 10112425)\nSee the Day (revision 10112431)\nSexy! No No No... (revision 10112425)\nSlant Magazine (revision 7697473)\nSlovenia (revision 10521499)\nSomething Kinda Ooooh (revision 10112426)\nSound of the Underground (album) (revision 10112476)\nSound of the Underground (cântec) (revision 10112434)\nTangled Up (revision 10112482)\nThe Guardian (revision 9752334)\nThe Paul O'Grady Show (revision 10101027)\nThe Promise (revision 10166482)\nThe Show (revision 10112441)\nThe Sound of Girls Aloud (revision 10112480)\nTonalitate (revision 9966362)\nTurneul Out of Control (revision 10112446)\nUK Mix (revision 9721468)\nUK Singles Chart (revision 10226705)\nUngaria (revision 10737745)\nUniunea Europeană (revision 10751590)\nUntouchable (revision 10112410)\nWake Me Up (revision 10112439)\nWhat Will The Neighbours Say? (revision 10112478)\nWhole Lotta History (revision 10475020)\nWideboys (revision 10166481)\nWikimedia Commons (revision 9703907)\nXenomania (revision 10112484)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-28 18:58:13.756622\n\n60 characters appeared 883554 times.\n\nFirst 33 characters:\n[ 0] Char e: 11.67014127036944 %\n[ 1] Char i: 10.97567324690964 %\n[ 2] Char a: 10.080198833348046 %\n[ 3] Char r: 7.490657050955572 %\n[ 4] Char n: 7.18246988865423 %\n[ 5] Char t: 6.516296683620921 %\n[ 6] Char l: 5.595130574928075 %\n[ 7] Char u: 5.551217016730161 %\n[ 8] Char o: 4.922732509840938 %\n[ 9] Char c: 4.495707110148333 %\n[10] Char s: 3.8308920563994957 %\n[11] Char d: 3.590499279048027 %\n[12] Char m: 2.971408651876399 %\n[13] Char p: 2.902369294915761 %\n[14] Char ă: 2.1349006399156134 %\n[15] Char g: 1.2248261000459508 %\n[16] Char f: 1.1199089133205216 %\n[17] Char b: 1.0781457613230203 %\n[18] Char ț: 1.0323081554721047 %\n[19] Char ș: 0.9732285745975912 %\n[20] Char î: 0.97017273420753 %\n[21] Char v: 0.9693804792915882 %\n[22] Char z: 0.7369102510995367 %\n[23] Char h: 0.533413916976212 %\n[24] Char â: 0.4986678799484808 %\n[25] Char x: 0.22081276300033725 %\n[26] Char j: 0.20055367300696958 %\n[27] Char k: 0.1901411798260208 %\n[28] Char y: 0.15471606715605385 %\n[29] Char w: 0.11827234102273318 %\n[30] Char á: 0.016297815413658927 %\n[31] Char é: 0.013355154297303842 %\n[32] Char q: 0.00520624659047438 %\n\nThe first 33 characters have an accumulated ratio of 0.9996661211425673.\n\n981 sequences found.\n\nFirst 512 (typical positive ratio): 0.997762564143313\nNext 512 (512-1024): 1.1317927370596478e-06\nRest: 3.0357660829594124e-18\n\n- Processing end: 2016-09-28 18:58:13.862425\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangSlovakModel.log",
    "content": "= Logs of language model for Slovak (sk) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-21 13:26:28.712674\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nDôkaz (matematika) (revision 6358810)\n1825 (revision 6122752)\n1839 (revision 6165808)\n1847 (revision 5941780)\n1852 (revision 5941777)\n1878 (revision 6221358)\n1955 (revision 6226609)\n1976 (revision 6310709)\n1983 (revision 6356952)\n1993 (revision 6348358)\n1995 (revision 6277350)\n2012 (revision 6291145)\nAdrien-Marie Legendre (revision 6060342)\nAlgebra (revision 6319238)\nAlgebraická geometria (revision 5964212)\nAlgebraická rovnica (revision 5288111)\nAlgebrické číslo (revision 6106622)\nAlgoritmus (revision 6286937)\nAndrew Wiles (revision 5791970)\nArabi (revision 6044956)\nArabčina (revision 6322514)\nAristoteles (revision 6359959)\nArthur Cayley (revision 6332355)\nAxióma (revision 6338092)\nBabylonia (revision 6168813)\nBernard Bolzano (revision 6261374)\nBoh (revision 6282272)\nBolzanova veta (revision 6345299)\nBytie (revision 5274918)\nByzantská ríša (revision 6359782)\nCaroline Blundenová (revision 6358810)\nCauchyho postupnosť (revision 6215169)\nCelé číslo (revision 6302805)\nCharles Hermite (revision 5751036)\nDaniel Marcus (revision 5657431)\nDavid Hilbert (revision 5968866)\nDedukcia (revision 6338099)\nDefinícia (revision 6106684)\nDerivácia (funkcia) (revision 5970574)\nDesiatková číselná sústava (revision 5924486)\nDiofantická rovnica (revision 6327292)\nDynastia Chan (revision 6342042)\nDôkaz (logika) (revision 5495754)\nDôkaz sporom (revision 5940134)\nDôkaz výpočtom (revision 6358810)\nEnergia (revision 6277761)\nEric Weisstein (revision 6054413)\nErnst Kummer (revision 6001344)\nEurópa (revision 6295124)\nExperiment (revision 6354302)\nFenomén (filozofia) (revision 5420897)\nFilozofia (revision 6296369)\nFormula (logika) (revision 3916562)\nFormálny dôkaz (revision 6358810)\nFormálny jazyk (revision 5623029)\nGabriel Cramer (revision 5923903)\nGaloisova teória (revision 6353573)\nGentzenovský kalkul (revision 6358810)\nGeometria (revision 5970028)\nGeometrický dôkaz (revision 6358810)\nGeorg Ferdinand Cantor (revision 6186696)\nGiordano Bruno (revision 6312876)\nGottlob Frege (revision 5968855)\nGödelova veta o neúplnosti (revision 5323549)\nHardvér (revision 6214401)\nHenri Poincaré (revision 6315506)\nHilbertovský kalkul (revision 6358810)\nHmotnosť (revision 5979540)\nHypotéza (revision 5983410)\nIdea (revision 5960449)\nIndia (revision 6362189)\nIntuícia (revision 5837951)\nJazyk (lingvistika) (revision 6073293)\nJohn Taylor (revision 6355518)\nKardinálne číslo (revision 6090126)\nKenneth Appel (revision 5968422)\nKlasická mechanika (revision 6295646)\nKonečná množina (revision 5276494)\nKonfucianizmus (revision 5968816)\nKresťanstvo (revision 6289571)\nLanglandsov program (revision 6088475)\nLatinčina (revision 6121105)\nLeonhard Euler (revision 6339382)\nLineárna algebra (revision 5473535)\nLogická axióma (revision 5495754)\nLogický kalkul (revision 1608550)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-21 13:33:10.330458\n\n62 characters appeared 550293 times.\n\nFirst 45 characters:\n[ 0] Char o: 8.867094438780795 %\n[ 1] Char a: 8.59705647718579 %\n[ 2] Char e: 8.562347694773512 %\n[ 3] Char n: 6.0867574183207855 %\n[ 4] Char i: 5.828531346028389 %\n[ 5] Char t: 5.366595613609477 %\n[ 6] Char r: 4.977711873492848 %\n[ 7] Char k: 4.264273759615332 %\n[ 8] Char s: 4.257731790155426 %\n[ 9] Char v: 4.117079446767449 %\n[10] Char l: 3.5979014815743615 %\n[11] Char d: 3.416361829061972 %\n[12] Char m: 3.2513588215732345 %\n[13] Char p: 2.878466562358598 %\n[14] Char u: 2.5987973679476206 %\n[15] Char c: 2.419438371921867 %\n[16] Char z: 2.127412124086623 %\n[17] Char h: 2.0687161203213558 %\n[18] Char j: 2.0312815173007834 %\n[19] Char y: 1.6700194260148686 %\n[20] Char b: 1.6574806512167153 %\n[21] Char á: 1.6422160558102683 %\n[22] Char ý: 1.2564215790497062 %\n[23] Char í: 1.1326693234331529 %\n[24] Char č: 0.9473135220691523 %\n[25] Char é: 0.8913433389121795 %\n[26] Char ž: 0.7668641978000811 %\n[27] Char ú: 0.6949025337411161 %\n[28] Char š: 0.6785476100913513 %\n[29] Char f: 0.6514711253822963 %\n[30] Char g: 0.6096752093884531 %\n[31] Char ť: 0.46375294615777407 %\n[32] Char ô: 0.4172322744428877 %\n[33] Char ľ: 0.36053520579036985 %\n[34] Char x: 0.23114958758334195 %\n[35] Char ó: 0.2251527822450949 %\n[36] Char ň: 0.09304134342977287 %\n[37] Char w: 0.09013380144759246 %\n[38] Char ä: 0.0694175648245571 %\n[39] Char ď: 0.06560141597294532 %\n[40] Char q: 0.01726353051919614 %\n[41] Char ě: 0.009994675563745132 %\n[42] Char ĺ: 0.009267790068200032 %\n[43] Char ö: 0.008904347320427481 %\n[44] Char ŕ: 0.00599680533824708 %\n\nThe first 45 characters have an accumulated ratio of 0.9998128269848972.\n\n1181 sequences found.\n\nFirst 512 (typical positive ratio): 0.9733303573968434\nNext 512 (512-1024): 1.8172137388627513e-06\nRest: 0.0003522983638913346\n\n- Processing end: 2016-09-21 13:33:10.831531\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangSloveneModel.log",
    "content": "= Logs of language model for Slovene (sl) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-28 22:00:35.243966\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nXCOM: Enemy Unknown (revision 4704271)\n1UP.com (revision 4547348)\n2K Games (revision 4110089)\nAndroid (operacijski sistem) (revision 4619359)\nAnimator videoigre (revision 4702643)\nApp Store (revision 3903089)\nArtefakt (revision 4484504)\nAthlon (revision 4524746)\nAvstralazija (revision 4623530)\nAvtopsija (revision 4541344)\nBralno-pisalni pomnilnik (revision 4256388)\nCivilization (serija) (revision 4645770)\nDeus Ex: Human Revolution (revision 4694860)\nDigitalna distribucija (revision 4696215)\nDirectX (revision 4477913)\nDishonored (revision 4619444)\nEdge (magazine) (revision 4690049)\nElectronic Entertainment Expo (revision 4538691)\nEnoigralska videoigra (revision 4610359)\nEurogamer (revision 4694860)\nEvropa (revision 4687833)\nFantasy Flight Games (revision 4649361)\nFiraxis Games (revision 4110089)\nGameRankings (revision 3934020)\nGameSpot (revision 4238015)\nGameSpy (revision 4538691)\nGameTrailers (revision 4704271)\nGame Informer (revision 4704271)\nGamesTM (revision 4704271)\nGrafična kartica (revision 4257980)\nGranata (revision 3859332)\nHolograf (revision 4477482)\nIGN (revision 4576233)\nIOS (revision 4597264)\nIgra igranja vlog (revision 4642276)\nIgra na deski (revision 4649363)\nIgralna konzola (revision 4649866)\nIgralni pogon (revision 4622773)\nIntel (revision 4626025)\nInternational Standard Book Number (revision 4015087)\nIzdelovalec videoigre (revision 3851747)\nJoker (revija) (revision 3867772)\nKotaku (revision 4613535)\nKristal (revision 4156234)\nLinux (revision 4524740)\nLovec prestreznik (revision 4102792)\nMTV (revision 4621758)\nMac OS X (revision 4601645)\nMachinima (revision 4601716)\nMajor (revision 4245802)\nMednarodna različica (revision 4116054)\nMetacritic (revision 3934020)\nMichael McCann (skladatelj) (revision 4694860)\nMicroProse (revision 4382810)\nMicrosoft Windows (revision 4691357)\nNezemeljsko življenje (revision 4620576)\nNowGamer (revision 4704271)\nOS X (revision 4601645)\nOgnjena ekipa (revision 4694450)\nOperacijski sistem (revision 4698515)\nOstrostrelec (revision 4529694)\nPilot (revision 4069093)\nPlayStation 3 (revision 4382944)\nPlayStation Network (revision 4382944)\nPlayStation Vita (revision 3944025)\nPogon igre (revision 4622773)\nProcesor (revision 4702518)\nProducent videoiger (revision 4599904)\nRazvijalec videoiger (revision 4093281)\nRačunalniška miška (revision 4385579)\nRačunalniška platforma (revision 4673669)\nSeverna Amerika (revision 4643798)\nSid Meier (revision 4061487)\nStealth (revision 4618630)\nSteam (revision 4696215)\nStrateška videoigra (revision 4236795)\nTablični računalnik (revision 4409985)\nTake-Two Interactive (revision 4110089)\nTelepatija (revision 4481192)\nThe Bureau: XCOM Declassified (revision 4704271)\nThe Guardian (revision 3929479)\nTrdi disk (revision 4644623)\nUFO: Enemy Unknown (revision 4704271)\nUnreal Engine (revision 4622773)\nUnreal Engine 3 (revision 4622773)\nUporabniški vmesnik (revision 4552473)\nValve Corporation (revision 4110105)\nVečigralska videoigra (revision 4618639)\nVideoGamer.com (revision 4704271)\nVohunski satelit (revision 4215166)\nVojaška taktika (revision 3970259)\nVojaški čini (revision 4363026)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-28 22:06:46.133919\n\n41 characters appeared 411226 times.\n\nFirst 29 characters:\n[ 0] Char a: 10.090315301075321 %\n[ 1] Char e: 9.90477255815537 %\n[ 2] Char i: 9.666703953543793 %\n[ 3] Char o: 9.177921629468953 %\n[ 4] Char n: 7.28309980400072 %\n[ 5] Char r: 5.808241696779873 %\n[ 6] Char s: 4.575586174025961 %\n[ 7] Char t: 4.4963110309173056 %\n[ 8] Char j: 4.343840126840229 %\n[ 9] Char l: 4.2672399118732764 %\n[10] Char v: 3.802775116359374 %\n[11] Char p: 3.5216644861949393 %\n[12] Char k: 3.5136397017698293 %\n[13] Char d: 3.0387183689747244 %\n[14] Char m: 2.9487435132992563 %\n[15] Char z: 2.350775485985808 %\n[16] Char u: 1.9719083910064055 %\n[17] Char g: 1.9342162217369525 %\n[18] Char b: 1.5392995579073308 %\n[19] Char c: 1.2924766430138173 %\n[20] Char h: 1.1864522184881305 %\n[21] Char č: 1.137087635509428 %\n[22] Char š: 0.6932927392723223 %\n[23] Char ž: 0.45303555709026183 %\n[24] Char f: 0.40707542811009034 %\n[25] Char x: 0.19381070263067024 %\n[26] Char y: 0.19040624863213904 %\n[27] Char w: 0.18919037220409216 %\n[28] Char q: 0.011186063138031156 %\n\nThe first 29 characters have an accumulated ratio of 0.9998978663800442.\n\n727 sequences found.\n\nFirst 512 (typical positive ratio): 0.9983524317161332\nNext 512 (512-1024): 2.4317528560937295e-06\nRest: -3.859759734048396e-17\n\n- Processing end: 2016-09-28 22:06:46.601266\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangSpanishModel.log",
    "content": "= Logs of language model for Spanish (es) =\n\n- Generated by BuildLangModel.py\n- Started: 2015-12-12 18:37:37.085123\n- Maximum depth: 2\n- Max number of pages: 50\n\n== Parsed pages ==\n\nWikipedia:Portada (revision 84894710)\n11 de diciembre (revision 87735970)\n12 de diciembre (revision 87742023)\n13 de diciembre (revision 87697780)\n1474 (revision 66715698)\n1915 (revision 86935345)\n2000 (revision 87686385)\n2015 (revision 87743360)\nActuación (revision 87459085)\nAkiyuki Nosaka (revision 87726149)\nAlberto Podestá (revision 87729965)\nAlejandro Magno (revision 87717064)\nArgentina (revision 87742018)\nArnold Peralta (revision 87733100)\nAtentados del 11 de diciembre de 2007 (revision 87720544)\nCantante (revision 86761085)\nCanto (revision 87664585)\nCarlo Furno (revision 87726011)\nCiencia ficción (revision 87662615)\nCopa Mundial de Clubes de la FIFA 2015 (revision 87734956)\nCorona de Castilla (revision 87209578)\nCrisis migratoria en Europa (revision 87609406)\nDictadura de Primo de Rivera (revision 87371131)\nDionisio Miguel Recio (revision 87724426)\nDisneyland (revision 87665192)\nDolph Schayes (revision 87730770)\nDía Internacional de las Montañas (revision 87739490)\nEl discurso del rey (revision 87570241)\nElecciones regionales de Francia de 2015 (revision 87744011)\nEstados Unidos (revision 87510736)\nFiction House (revision 87732511)\nFiloxeno de Eretria (revision 83958621)\nFrank Sinatra (revision 87742871)\nFundación Wikimedia (revision 87703852)\nGeoffrey Marcy (revision 87706505)\nGheorghe Gruia (revision 87737327)\nGrupo de Acción Republicana (revision 87739104)\nGuerra contra el Estado Islámico (revision 87648946)\nHere We Go Again (canción) (revision 87680365)\nIsaac Asimov (revision 87591711)\nIsabel I de Castilla (revision 87743713)\nJohn \"Hot Rod\" Williams (revision 87730438)\nJosé Subirà-Puig (revision 87740413)\nJulio Terrazas Sandoval (revision 87736542)\nLibertad Lamarque (revision 87508996)\nMosaico de Issos (revision 87731652)\nMuseo Arqueológico Nacional de Nápoles (revision 87302262)\nPhilip K. Dick (revision 87725371)\nPlanet Comics (revision 86698920)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2015-12-12 18:39:02.288858\n\n52 characters appeared 991829 times.\n\nFirst 33 characters:\n[ 0] Char e: 12.571925200815867 %\n[ 1] Char a: 11.81988024145291 %\n[ 2] Char o: 8.07941691561751 %\n[ 3] Char n: 7.234513207417812 %\n[ 4] Char s: 7.042242160695039 %\n[ 5] Char i: 7.040528155559072 %\n[ 6] Char r: 6.8208330266608455 %\n[ 7] Char l: 5.722559029832763 %\n[ 8] Char d: 5.275707808503281 %\n[ 9] Char t: 4.668647518876742 %\n[10] Char c: 4.466999855821921 %\n[11] Char u: 3.673717949364255 %\n[12] Char m: 2.710547886782903 %\n[13] Char p: 2.4541528832086983 %\n[14] Char b: 1.3867309788280036 %\n[15] Char g: 1.2748165258325779 %\n[16] Char f: 0.925058654263991 %\n[17] Char y: 0.9045914164639268 %\n[18] Char v: 0.8877538365988492 %\n[19] Char ó: 0.8641610600214351 %\n[20] Char h: 0.7369213846338432 %\n[21] Char q: 0.5913317719082624 %\n[22] Char í: 0.5612862701130941 %\n[23] Char j: 0.43283670874717317 %\n[24] Char z: 0.38071078784750195 %\n[25] Char á: 0.37587124393418625 %\n[26] Char é: 0.29632124085905936 %\n[27] Char k: 0.2001353055819098 %\n[28] Char x: 0.18743150280945606 %\n[29] Char ñ: 0.17462687620547493 %\n[30] Char ú: 0.12865120902897575 %\n[31] Char w: 0.0972949974239511 %\n[32] Char ü: 0.004436248587206061 %\n\nThe first 33 characters have an accumulated ratio of 0.9999263986029848.\n\n897 sequences found.\n\nFirst 512 (typical positive ratio): 0.9970385677528184\nNext 512 (512-1024): 1.0082383152741046e-06\nRest: 4.597017211338539e-17\n\n- Processing end: 2015-12-12 18:39:02.460105\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangSwedishModel.log",
    "content": "= Logs of language model for Swedish (sv) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-09-28 22:26:37.221506\n- Maximum depth: 5\n- Max number of pages: 100\n\n== Parsed pages ==\n\nKakapo (revision 36509929)\nAkut hotad (revision 32517788)\nAotearoa (revision 36575359)\nArt (revision 36771341)\nArtepitet (revision 36771341)\nAuckland (revision 35752058)\nAuktorsnamn (revision 35976965)\nBBC (revision 36508743)\nBasalomsättning (revision 30567523)\nBeilschmiedia tawa (revision 29101923)\nBerguv (revision 36295501)\nBetesmark (revision 34292168)\nBiotop (revision 35528052)\nBirdLife International (revision 36124283)\nBonaparte (revision 37325183)\nBritish Museum (revision 36420244)\nBröstben (revision 30602527)\nDacrydium cupressinum (revision 32986501)\nDigital object identifier (revision 27637223)\nDjur (revision 37300775)\nDjurpark (revision 37147093)\nDomän (biologi) (revision 33377709)\nDon Merton (revision 36509929)\nDouglas Adams (revision 36556245)\nDäggdjur (revision 37328286)\nEkologisk nisch (revision 33898643)\nEkosystem (revision 36598266)\nEndemisk (revision 30647109)\nEukaryoter (revision 37095313)\nEvolution (revision 37093592)\nFamilj (biologi) (revision 30280200)\nFemininum (revision 30597527)\nFjäder (biologi) (revision 36364943)\nFjäderdräkt (revision 36364943)\nFladdermöss (revision 37307257)\nFlygg (revision 36479633)\nFrukter (revision 34088588)\nFrö (revision 37333131)\nFågelläte (revision 34034723)\nFåglar (revision 37387306)\nFåglarnas liv (revision 36509929)\nGenitiv (revision 37388438)\nGeorge Edward Grey (revision 36509929)\nGeorge Robert Gray (revision 20426710)\nHaasts örn (revision 29175076)\nHauturu/Little Barrier Island (revision 36509929)\nHermelin (revision 36578682)\nHertz (revision 37104488)\nHjortdjur (revision 36493550)\nHund (revision 37351832)\nHusdjur (revision 37384850)\nHuskatt (revision 32922967)\nHāngi (revision 29609696)\nIUCN (revision 30570280)\nIller (revision 30663158)\nInfraröd (revision 36770733)\nInternationella naturvårdsunionen (revision 30570280)\nJordbruk (revision 37352625)\nKahurangi National Park (revision 35956142)\nKamouflage (revision 36579595)\nKaniner (revision 36877621)\nKapiti Island (revision 37395588)\nKatt (revision 36734686)\nKelp (revision 30312471)\nKivier (revision 36373234)\nKlass (biologi) (revision 30280201)\nKroppsfett (revision 35066611)\nKönsdimorfism (revision 30816932)\nKönsfördelning (revision 24769321)\nLamm- och fårkött (revision 36187205)\nLek (fortplantningsbeteende) (revision 30508235)\nMandel (revision 36577529)\nMaori (revision 32560474)\nMaorier (revision 35862066)\nMaoripapegojor (revision 36545138)\nMark Carwardine (revision 20375916)\nMarkpapegoja (revision 36295722)\nMaskulinum (revision 32704551)\nMasterton (revision 29859631)\nMetrosideros umbellata (revision 29071212)\nMilford Sound (revision 20284758)\nMorrhår (revision 36533839)\nMuskelmage (revision 31196380)\nMustela (revision 20934105)\nMårddjur (revision 37306347)\nMāori (revision 32560474)\nNHNZ (revision 36509929)\nNattpapegoja (revision 33486517)\nNordön (revision 24810231)\nNya Zeeland (revision 36575359)\nNäbb (revision 23648463)\nOllonår (revision 36509929)\nOrdning (biologi) (revision 30280196)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-09-28 22:29:21.480287\n\n48 characters appeared 594415 times.\n\nFirst 31 characters:\n[ 0] Char a: 10.070741821791172 %\n[ 1] Char e: 9.737136512369304 %\n[ 2] Char r: 9.110638190489809 %\n[ 3] Char n: 8.378826240925951 %\n[ 4] Char t: 7.481305148759705 %\n[ 5] Char s: 5.828587771169974 %\n[ 6] Char i: 5.359891658184939 %\n[ 7] Char l: 5.173489901836259 %\n[ 8] Char o: 4.694195133029954 %\n[ 9] Char d: 4.597293136949774 %\n[10] Char k: 3.297359588839447 %\n[11] Char m: 3.1898589369379975 %\n[12] Char g: 3.004466576381821 %\n[13] Char v: 2.2324470277499726 %\n[14] Char f: 2.1988005013332437 %\n[15] Char p: 2.06017681249632 %\n[16] Char u: 2.0499146219392173 %\n[17] Char ä: 2.0475593650900468 %\n[18] Char h: 2.028380845032511 %\n[19] Char å: 1.5443755625278637 %\n[20] Char c: 1.442594820117258 %\n[21] Char ö: 1.3515809661600062 %\n[22] Char b: 1.268642278542769 %\n[23] Char j: 0.7302978558751041 %\n[24] Char y: 0.6699023409570755 %\n[25] Char x: 0.2111319532649748 %\n[26] Char w: 0.10262190557102362 %\n[27] Char z: 0.09151855185350302 %\n[28] Char é: 0.021197311642539303 %\n[29] Char ā: 0.011103353717520588 %\n[30] Char q: 0.007570468443764037 %\n\nThe first 31 characters have an accumulated ratio of 0.999936071599808.\n\n748 sequences found.\n\nFirst 512 (typical positive ratio): 0.997323508584682\nNext 512 (512-1024): 1.6823263208364526e-06\nRest: 1.7780915628762273e-17\n\n- Processing end: 2016-09-28 22:29:21.590354\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangThaiModel.log",
    "content": "= Logs of language model for Thai (th) =\n\n- Generated by BuildLangModel.py\n- Started: 2015-12-04 03:01:52.148282\n- Maximum depth: 3\n- Max number of pages: 50\n\n== Parsed pages ==\n\nหน้าหลัก (revision 5512633)\n26 พฤศจิกายน (revision 5570053)\n27 พฤศจิกายน (revision 5888433)\n28 พฤศจิกายน (revision 6110206)\nกล้องโทรทรรศน์อวกาศฮับเบิล (revision 5830742)\nการประชุมสภาสงฆ์แห่งแคลมงต์ (revision 5463877)\nความเอนเอียงเพื่อยืนยัน (revision 6231756)\nคัมภีร์พระเวท (revision 6109417)\nคาบสมุทรไซนาย (revision 5661104)\nจักรวรรดิโรมันตะวันออก (revision 6150148)\nชาวมุสลิม (revision 6242838)\nซุคฮอย ซู-24 (revision 6015891)\nดาวอังคาร (revision 6235017)\nดาวเคราะห์นอกระบบ (revision 5823077)\nดินแดนศักดิ์สิทธิ์ (revision 6179072)\nทฤษฎี (revision 5606447)\nทะกะอะกิ คะจิตะ (revision 6177601)\nท่าอากาศยานนานาชาติตริภูวัน (revision 6010470)\nนกกาเหว่า (revision 6142782)\nประเทศอัฟกานิสถาน (revision 6216996)\nประเทศเนปาล (revision 6206980)\nปรากฏการณ์การวางกรอบ (revision 6046655)\nปารีส (revision 6222115)\nพ.ศ. 1638 (revision 4723508)\nพ.ศ. 2438 (revision 5737055)\nพ.ศ. 2515 (revision 6197082)\nพ.ศ. 2544 (revision 6189598)\nพินัยกรรม (revision 5607889)\nมูลนิธิวิกิมีเดีย (revision 5816103)\nระบบสุริยะ (revision 6201228)\nรางวัลโนเบล (revision 5828030)\nรางวัลโนเบลสาขาฟิสิกส์ (revision 6177103)\nรายชื่อบทความวันนี้ในอดีต (revision 5410610)\nลักกีสไตรก์ (เพลง) (revision 6195816)\nลุฟต์ฮันซา (revision 6116038)\nวิกฤตการณ์ผู้ย้ายถิ่นยุโรป (revision 6219634)\nวิกิพีเดีย (revision 6086299)\nวิกิพีเดียภาษาไทย (revision 6209148)\nสงครามครูเสด (revision 6228828)\nสงครามอังกฤษ–แซนซิบาร์ (revision 5829349)\nสติ (จิตวิทยา) (revision 6039161)\nสมมติฐาน (revision 6221744)\nสมเด็จพระราชินีมารีแห่งโรมาเนีย (revision 6211695)\nสมเด็จพระสันตะปาปาเออร์บันที่ 2 (revision 5828365)\nสารานุกรม (revision 6070482)\nอัลเฟรด โนเบล (revision 6214514)\nอาร์เธอร์ แมคโดนัลด์ (revision 6188035)\nเซนต์ปีเตอร์สเบิร์ก (revision 6162201)\nเทือกเขาฮินดูกูช (revision 5218921)\nเนื้อหาเสรี (revision 6160507)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2015-12-04 03:05:06.181487\n\n105 characters appeared 401052 times.\n\nFirst 64 characters:\n[ 0] Char า: 8.857704237854442 %\n[ 1] Char น: 6.7679502907353655 %\n[ 2] Char ร: 6.739026360671434 %\n[ 3] Char ก: 5.388079351306065 %\n[ 4] Char อ: 5.099837427565503 %\n[ 5] Char ง: 4.861713692987443 %\n[ 6] Char เ: 4.5198627609387305 %\n[ 7] Char ม: 4.133628556895365 %\n[ 8] Char ว: 3.864336794231172 %\n[ 9] Char ด: 3.3152808114658447 %\n[10] Char ย: 3.195844927839781 %\n[11] Char ล: 3.1312647736453125 %\n[12] Char ท: 2.69615910156289 %\n[13] Char ส: 2.6001615750575984 %\n[14] Char ะ: 2.392457835891605 %\n[15] Char ค: 2.384229476476866 %\n[16] Char บ: 2.3321165335168503 %\n[17] Char ต: 2.196473275285998 %\n[18] Char ห: 1.983782651626223 %\n[19] Char ป: 1.9192024974317545 %\n[20] Char แ: 1.7813151411787 %\n[21] Char จ: 1.76261432432702 %\n[22] Char พ: 1.5075351824701035 %\n[23] Char ข: 1.3519443862641254 %\n[24] Char ใ: 1.3295034060421091 %\n[25] Char ไ: 1.2227840778751882 %\n[26] Char ช: 1.0407627938521689 %\n[27] Char โ: 0.9382823175049619 %\n[28] Char ศ: 0.8078752879925796 %\n[29] Char ำ: 0.7393056262030859 %\n[30] Char ถ: 0.599672860377208 %\n[31] Char ซ: 0.541076967575277 %\n[32] Char e: 0.43734977010462484 %\n[33] Char ผ: 0.43585370475649043 %\n[34] Char ณ: 0.4019428901987772 %\n[35] Char a: 0.3897250231890129 %\n[36] Char i: 0.3657879776188624 %\n[37] Char ษ: 0.3647906007201061 %\n[38] Char ภ: 0.34185093204871186 %\n[39] Char ธ: 0.3181632307032505 %\n[40] Char o: 0.3176645422538723 %\n[41] Char n: 0.3139243788835363 %\n[42] Char ญ: 0.29248077556027646 %\n[43] Char r: 0.28350438347147006 %\n[44] Char t: 0.2705384837876385 %\n[45] Char s: 0.2488455362396896 %\n[46] Char l: 0.19598456060560726 %\n[47] Char ฟ: 0.19473783948216192 %\n[48] Char c: 0.16356981139602844 %\n[49] Char ฐ: 0.15833358267755804 %\n[50] Char ฤ: 0.15284800973439852 %\n[51] Char ๆ: 0.14910784636406252 %\n[52] Char d: 0.13090571796176056 %\n[53] Char ฮ: 0.1244227681198448 %\n[54] Char h: 0.12043326052481973 %\n[55] Char u: 0.12043326052481973 %\n[56] Char m: 0.09599752650529109 %\n[57] Char y: 0.08951457666337533 %\n[58] Char ฏ: 0.08677179019179557 %\n[59] Char p: 0.08253293837208142 %\n[60] Char f: 0.08153556147332515 %\n[61] Char S: 0.07604998853016566 %\n[62] Char ฝ: 0.07330720205858592 %\n[63] Char ฉ: 0.0673229406660483 %\n\nThe first 64 characters have an accumulated ratio of 0.989480167160368.\n\n2324 sequences found.\n\nFirst 512 (typical positive ratio): 0.8815720594354438\nNext 512 (512-1024): 7.480326740672033e-06\nRest: 0.026341928296264486\n\n- Processing end: 2015-12-04 03:05:06.800467\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangTurkishModel.log",
    "content": "= Logs of language model for Turkish (tr) =\n\n- Generated by BuildLangModel.py\n- Started: 2015-12-04 02:22:03.929245\n- Maximum depth: 3\n- Max number of pages: 50\n\n== Parsed pages ==\n\nAna_Sayfa (revision 16293313)\n1048 (revision 12894005)\n1131 (revision 14840814)\n16. yüzyıl (revision 15185081)\n1859 (revision 16014427)\n1866 (revision 16120346)\n1869 (revision 12888270)\n1892 (revision 13955858)\n1895 (revision 15334635)\n1902 (revision 16283638)\n1906 (revision 15874323)\n1918 (revision 16099474)\n1926 (revision 16180584)\n1927 (revision 15370980)\n1940 (revision 15370990)\n1943 (revision 16091797)\n1944 (revision 16247827)\n1945 (revision 16281147)\n1948 (revision 15443886)\n1961 (revision 15799529)\n1964 (revision 16085332)\n1975 (revision 15006928)\n1980 (revision 16213240)\n1981 (revision 16295456)\n1983 (revision 16327128)\n1993 (revision 16300456)\n2002 (revision 16297206)\n2015 (revision 16328338)\n24 Ekim (revision 16213661)\n4 Aralık (revision 16341162)\nABD (revision 16325951)\nABD Senatosu (revision 15970439)\nAdam Horowitz (revision 14362106)\nAkçe (revision 16261547)\nAltın Takım (revision 13503001)\nAmerican Broadcasting Company (revision 16055235)\nAmerika Birleşik Devletleri (revision 16325951)\nAna Sayfa/Kardeş projeler (revision 16293313)\nAna Sayfa/Kategoriler (revision 16293313)\nAptullah Kuran (revision 15744893)\nAvrupa (revision 16299756)\nAyasofya (revision 16305207)\nBM Güvenlik Konseyi (revision 16085518)\nBirleşmiş Milletler (revision 16258474)\nBudapeşte (revision 16219173)\nCIA (revision 16054325)\nCharlie Pace (revision 16129416)\nCuma (revision 14197127)\nDesmond Hume (revision 16035300)\nDiğerleri (Lost) (revision 16329444)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2015-12-04 02:24:44.728803\n\n48 characters appeared 267623 times.\n\nFirst 36 characters:\n[ 0] Char a: 12.311722086666691 %\n[ 1] Char e: 8.716365932673948 %\n[ 2] Char i: 8.507863673899479 %\n[ 3] Char n: 7.322987934519828 %\n[ 4] Char r: 6.979220769515326 %\n[ 5] Char l: 6.609297407173524 %\n[ 6] Char ı: 4.514933320379788 %\n[ 7] Char d: 4.3475336574210734 %\n[ 8] Char t: 4.2634601659797555 %\n[ 9] Char k: 4.240293248338147 %\n[10] Char s: 3.929781819948211 %\n[11] Char m: 3.429451130881875 %\n[12] Char u: 3.0998830444319063 %\n[13] Char y: 2.9212735826143494 %\n[14] Char o: 2.7135186437638024 %\n[15] Char b: 2.3129551645411643 %\n[16] Char ü: 1.8305601536489764 %\n[17] Char ş: 1.5988909772328985 %\n[18] Char z: 1.2267256551193282 %\n[19] Char h: 1.1983274980102607 %\n[20] Char v: 1.194964558352608 %\n[21] Char c: 1.143773143563894 %\n[22] Char g: 1.1004285879763698 %\n[23] Char p: 1.0178497363828969 %\n[24] Char ç: 0.8295251155543433 %\n[25] Char ğ: 0.8205572764672693 %\n[26] Char f: 0.7047226882592303 %\n[27] Char ö: 0.6710932916827029 %\n[28] Char j: 0.1296600068006113 %\n[29] Char w: 0.11359262843627041 %\n[30] Char â: 0.07846859201189733 %\n[31] Char î: 0.04147625577771716 %\n[32] Char x: 0.024287897527492032 %\n[33] Char é: 0.014946398478456635 %\n[34] Char q: 0.01083613889688106 %\n[35] Char û: 0.009341499049035397 %\n\nThe first 36 characters have an accumulated ratio of 0.99980569681978.\n\n935 sequences found.\n\nFirst 512 (typical positive ratio): 0.991865243864388\nNext 512 (512-1024): 3.7365996196141585e-06\nRest: 2.949029909160572e-17\n\n- Processing end: 2015-12-04 02:24:44.883537\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/BuildLangModelLogs/LangVietnameseModel.log",
    "content": "= Logs of language model for Vietnamese (vi) =\n\n- Generated by BuildLangModel.py\n- Started: 2016-02-13 03:37:17.480303\n- Maximum depth: 3\n- Max number of pages: 40\n\n== Parsed pages ==\n\nChữ_Quốc_ngữ (revision 22887853)\n1651 (revision 21455247)\n1773 (revision 21354755)\n1815 (revision 21361292)\n1838 (revision 21361314)\n1865 (revision 21361338)\n1869 (revision 21361342)\n1888 (revision 21389506)\n1902 (revision 21354811)\n1918 (revision 21354828)\n1919 (revision 21354829)\n1938 (revision 21354849)\n1945 (revision 21354857)\n22 tháng 2 (revision 21376086)\n26 tháng 11 (revision 22579845)\n28 tháng 12 (revision 22475308)\nA (revision 22549334)\nASCII (revision 22528409)\nAlexandre de Rhodes (revision 22859954)\nAntonio Barbosa (revision 22145269)\nB (revision 22836557)\nBBC (revision 22863903)\nBiên khảo (revision 22531516)\nBán nguyên âm (revision 22655600)\nBình luận (revision 22117664)\nBảng chữ cái Bồ Đào Nha (revision 22887853)\nBảng chữ cái Hy Lạp (revision 21362081)\nBảng chữ cái Latinh (revision 22442448)\nBắc Kỳ (revision 22393289)\nBồ Đào Nha (revision 22620858)\nC (revision 21341881)\nCao Xuân Dục (revision 22620201)\nChính tả (revision 22187359)\nChính tả tiếng Việt (revision 20897580)\nChữ Hán (revision 22889609)\nChữ Nôm (revision 22781506)\nChữ cái (revision 22169220)\nCông giáo (revision 22173119)\nD (revision 21447691)\n\n== End of Parsed pages ==\n\n- Wikipedia parsing ended at: 2016-02-13 03:42:06.560479\n\n101 characters appeared 222814 times.\n\nFirst 55 characters:\n[ 0] Char n: 11.262308472537633 %\n[ 1] Char h: 8.881398834902654 %\n[ 2] Char t: 7.022898022565907 %\n[ 3] Char c: 6.365398942615815 %\n[ 4] Char i: 6.198443544840091 %\n[ 5] Char g: 5.591210606155808 %\n[ 6] Char a: 3.5998635633308496 %\n[ 7] Char u: 2.8499106878382867 %\n[ 8] Char m: 2.615185760320267 %\n[ 9] Char o: 2.6012728105056238 %\n[10] Char đ: 2.222032726848403 %\n[11] Char r: 2.1102803234985235 %\n[12] Char à: 2.0447548179198796 %\n[13] Char v: 1.9437737305555307 %\n[14] Char l: 1.9119085874316697 %\n[15] Char á: 1.7539292863105551 %\n[16] Char p: 1.6453185167897888 %\n[17] Char b: 1.541195795596327 %\n[18] Char ư: 1.4397659033992478 %\n[19] Char s: 1.3760356171515256 %\n[20] Char y: 1.280440187779942 %\n[21] Char e: 1.2454334108269678 %\n[22] Char d: 1.1251537156552103 %\n[23] Char ế: 1.071745940560288 %\n[24] Char k: 1.0695019163966357 %\n[25] Char â: 0.9658280000359044 %\n[26] Char ữ: 0.9604423420431392 %\n[27] Char ê: 0.8374698178749989 %\n[28] Char ệ: 0.7459136319979893 %\n[29] Char ô: 0.7073164163831717 %\n[30] Char ạ: 0.6727584442629277 %\n[31] Char ộ: 0.6705144200992756 %\n[32] Char ố: 0.6476253736300233 %\n[33] Char ó: 0.6072329386842837 %\n[34] Char ả: 0.5484395055965963 %\n[35] Char ủ: 0.5475418959311353 %\n[36] Char q: 0.5138815334763525 %\n[37] Char ợ: 0.48560682901433483 %\n[38] Char ờ: 0.4851580241816044 %\n[39] Char ể: 0.4748355130288043 %\n[40] Char ớ: 0.4676546357051173 %\n[41] Char ấ: 0.418286104104769 %\n[42] Char ị: 0.40212913012647317 %\n[43] Char ầ: 0.3904602044754818 %\n[44] Char ọ: 0.3801376933226817 %\n[45] Char ề: 0.3787912788244904 %\n[46] Char ơ: 0.3590438661843511 %\n[47] Char í: 0.35679984202069887 %\n[48] Char ụ: 0.35276059852612496 %\n[49] Char ậ: 0.3469261357006292 %\n[50] Char ì: 0.32762752789322036 %\n[51] Char ă: 0.3253835037295682 %\n[52] Char ứ: 0.29665999443482005 %\n[53] Char ồ: 0.29665999443482005 %\n[54] Char x: 0.2939671654384374 %\n\nThe first 55 characters have an accumulated ratio of 0.9603301408349568.\n\n1494 sequences found.\n\nFirst 512 (typical positive ratio): 0.9321889118082535\nNext 512 (512-1024): 0.009604423420431392\nRest: 0.0068905733918831966\n\n- Processing end: 2016-02-13 03:42:07.174723\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/README",
    "content": "# Supporting new or Updating languages #\n\nWe generate statistical language data using Wikipedia as natural\nlanguage text resource.\n\nRight now, we have automated scripts only to generate statistical data\nfor single-byte encodings. Multi-byte encodings usually requires more\nin-depth knowledge of its specification.\n\n## New single-byte encoding ##\n\nUchardet uses language data, and therefore rather than supporting a\ncharset, we in fact support a couple (language, charset). So for\ninstance if uchardet supports (French, ISO-8859-15), it should be able\nto recognize French text encoded in ISO-8859-15, but may fail at\ndetecting ISO-8859-15 for non-supported languages.\n\nThis is why, though less flexible, it also makes uchardet much more\naccurate than other detection system, as well as making it an efficient\nlanguage recognition system.\nSince many single-byte charsets actually share the same layout (or very\nsimilar ones), it is actually impossible to have an accurate single-byte\nencoding detector for random text.\n\nTherefore you need to describe the language and the codepoint layouts of\nevery charset you want to add support for.\n\nI recommend having a look at langs/fr.py which is heavily commented as\na base of a new language description, and charsets/windows-1252.py as a\nbase for a new charset layout (note that charset layouts can be shared\nbetween languages. If yours is already there, you have nothing to do).\nThe important name in the charset file are:\n\n- `name`: an iconv-compatible name.\n- `charmap`: fill it with CTR (control character), SYM (symbol), NUM\n             (number), LET (letter), ILL (illegal codepoint).\n\n## Tools ##\n\nYou must install Python 3 and the [`Wikipedia` Python\ntool](https://github.com/goldsmith/Wikipedia).\n\n## Run script ##\n\nLet's say you added (or modified) support for French (`fr`), run:\n\n> ./BuildLangModel.py fr --max-page=100 --max-depth=4\n\nThe options can be changed to any value. Bigger values mean the script\nwill process more data, so more processing time now, but uchardet may\npossibly be more accurate in the end.\n\n## Updating core code ##\n\nIf you were only updating data for a language model, you have nothing\nelse to do. Just build `uchardet` again and test it.\n\nIf you were creating new models though, you will have to add these in\nsrc/nsSBCSGroupProber.cpp and src/nsSBCharSetProber.h, and increase the\nvalue of `NUM_OF_SBCS_PROBERS` in src/nsSBCSGroupProber.h.\nFinally add the new file in src/CMakeLists.txt.\n\nI will be looking to make this step more straightforward in the future.\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/codepoints.py",
    "content": "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\n# Illegal codepoints.\nILL = 255\n# Control characters\nCTR = 254\n# Symbols and punctuations.\nSYM = 253\n# Return/Line feeds.\nRET = 252\n# Numbers 0-9.\nNUM = 251\n\n# Letters (should be all the rest).\nLET = 0\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/db.py",
    "content": "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport importlib\nimport sys\nimport os\n\ndef load(charset_names):\n    '''\n    Load a list of charsets.\n\n    This function will return a dictionary of charsets from our\n    charset database.\n\n    :param charset_names: a list of supported charset names.\n    :return: a dictionary with all the loaded charsets.\n    :rtype: dict\n    '''\n    charsets = {}\n\n    # Temporarily change the search path for modules.\n    sys_path_backup = sys.path\n    current_dir = os.path.dirname(os.path.realpath(__file__))\n    sys.path = [current_dir + '/../charsets']\n\n    for name in charset_names:\n        try:\n            charset = importlib.import_module(name.lower())\n        except ImportError:\n            print('Unknown charset \"{}\": '\n                  'file \"charsets/{}.py\" does not exist.'.format(name, name.lower()))\n            exit(1)\n        charsets[charset.name] = charset\n    # Set back the default module paths.\n    sys.path = sys_path_backup\n    return charsets\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/ibm852.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'IBM852'\naliases = ['CP852']\n\nlanguage = \\\n{\n    'complete': [ 'bs', 'hr', 'cs', 'de', 'hu', 'pl', 'sr', 'sk', 'sl',\n                  'hsb', 'dsb', 'tk' ],\n    'incomplete': [ 'ro' ]\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 8X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,LET, # 9X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,SYM,SYM, # AX\n    SYM,SYM,SYM,SYM,SYM,LET,LET,LET,LET,SYM,SYM,SYM,SYM,LET,LET,SYM, # BX\n    SYM,SYM,SYM,SYM,SYM,SYM,LET,LET,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # CX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,LET,LET,SYM, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM, # EX\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,LET,LET,LET,SYM,SYM, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/iso-8859-1.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\n# ISO-8859-1 is the full 8-bit range, IANA-defined, superset of ISO/CEI 8859-1.\n# It is basically the same as ISO/CEI 8859-1, but with control characters.\n# As far as I can see, `iconv` has no support for the ISO/CEI 8859-1 subset,\n# so there is no need for us to support it anyway.\n\nname = 'ISO-8859-1'\naliases = ['ISO_8859-1:1987', 'ISO_8859-1', 'iso-ir-100',\n           'csISOLatin1', 'latin1', 'l1', 'IBM819', 'CP819']\n\nlanguage = \\\n{\n    # Languages with complete coverage.\n    # Some languages actually have several alphabets and only one of them is\n    # compatible with ISO-8859-1 (ex: Kurdish).\n    # Some don't have a ISO language code (like Leonese, for which I used\n    # a Glottolog code).\n    'complete': [ 'af', 'sq', 'eu', 'br', 'co', 'da', 'en', 'fo', 'gl', 'de',\n                  'is', 'id', 'it', 'ku', 'leon1250', 'lb', 'ms', 'gv', 'no',\n                  'oc', 'pt', 'rm', 'gd', 'es', 'sw', 'sv', 'wa' ],\n    'incomplete': [ 'ca', 'cs', 'nl', 'et', 'fi', 'fr', 'gn', 'hu', 'ga',\n                    'la', 'mi', 'ro', 'tr', 'cy' ]\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 8X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 9X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # AX\n    SYM,SYM,SYM,SYM,SYM,LET,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/iso-8859-10.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'ISO-8859-10'\naliases = ['ISO_8859-10:1992', 'ISO_8859-10', 'iso-ir-157',\n           'csISOLatin6', 'latin6', 'l6']\n\nlanguage = \\\n{\n    # Nordic languages. Supersedes ISO-8859-4.\n    'complete': [ 'et', 'lv', 'lt', 'kl', 'saam1281' ],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 8X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 9X\n    SYM,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,SYM,LET,LET, # AX\n    SYM,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/iso-8859-11.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\n# ISO-8859-1 is the full 8-bit range, IANA-defined, superset of ISO/CEI 8859-1.\n# It is basically the same as ISO/CEI 8859-1, but with control characters.\n# As far as I can see, `iconv` has no support for the ISO/CEI 8859-1 subset,\n# so there is no need for us to support it anyway.\n\nname = 'ISO-8859-11'\naliases = []\n\nlanguage = \\\n{\n    # Designed for Thai language.\n    'complete': ['th'],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 8X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 9X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # AX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,SYM,LET,LET,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,ILL,ILL,ILL,SYM, # DX\n    LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,LET, # EX\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,LET,LET,ILL,ILL,ILL,ILL, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/iso-8859-13.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'ISO-8859-13'\naliases = ['csISO885913']\n\nlanguage = \\\n{\n    # Designed to cover Baltic languages.\n    'complete': [ 'lv', 'lt' ],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 8X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 9X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,LET,SYM,LET,SYM,SYM,SYM,SYM,LET, # AX\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,LET,SYM,LET,SYM,SYM,SYM,SYM,LET, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,SYM, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/iso-8859-15.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\n# ISO-8859-15 is the full 8-bit range, IANA-defined, superset of ISO/CEI 8859-15.\n# It is basically the same as ISO/CEI 8859-15, but with control characters.\n# As far as I can see, `iconv` has no support for the ISO/CEI 8859-15 subset,\n# so there is no need for us to support it anyway.\n\nname = 'ISO-8859-15'\naliases = ['ISO_8859-15', 'csISO885915', 'Latin-9']\n\nlanguage = \\\n{\n    # Languages with complete coverage.\n    'complete': [ 'af', 'sq', 'br', 'ca', 'da', 'nl', 'en', 'et', 'fo', 'fi',\n                  'fr', 'gl', 'de', 'is', 'ga', 'it', 'ku', 'la', 'lb', 'ms',\n                  'no', 'oc', 'pt', 'rm', 'gd', 'sco', 'es', 'sw', 'sv', 'tl',\n                  'wa' ],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 8X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 9X\n    SYM,SYM,SYM,SYM,SYM,SYM,LET,SYM,LET,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # AX\n    SYM,SYM,SYM,SYM,LET,LET,SYM,SYM,LET,SYM,SYM,SYM,LET,LET,LET,SYM, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/iso-8859-16.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\n# ISO-8859-1 is the full 8-bit range, IANA-defined, superset of ISO/CEI 8859-1.\n# It is basically the same as ISO/CEI 8859-1, but with control characters.\n# As far as I can see, `iconv` has no support for the ISO/CEI 8859-1 subset,\n# so there is no need for us to support it anyway.\n\nname = 'ISO-8859-16'\naliases = ['ISO_8859-16:2001', 'ISO_8859-16', 'iso-ir-226',\n           'csISO885916', 'latin10', 'l10']\n\nlanguage = \\\n{\n    # Languages with complete coverage.\n    # Some languages actually have several alphabets and only one of them is\n    # compatible with ISO-8859-1 (ex: Kurdish).\n    # Some don't have a ISO language code (like Leonese, for which I used\n    # a Glottolog code).\n    'complete': [ 'sq', 'hr', 'hu', 'pl', 'ro', 'sr', 'sl',\n                  'fr', 'de', 'it', 'ga' ],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 8X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 9X\n    SYM,LET,LET,LET,SYM,SYM,LET,SYM,LET,SYM,LET,SYM,LET,SYM,LET,LET, # AX\n    SYM,SYM,LET,LET,LET,SYM,SYM,SYM,LET,LET,LET,SYM,LET,LET,LET,LET, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/iso-8859-2.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'ISO-8859-2'\naliases = ['ISO_8859-2:1987', 'ISO_8859-2', 'iso-ir-101',\n           'csISOLatin2', 'latin2', 'l2']\n\nlanguage = \\\n{\n    'complete': [ 'bs', 'hr', 'cs', 'de', 'hu', 'pl', 'sr', 'sk', 'sl',\n                  'hsb', 'dsb', 'tk' ],\n    'incomplete': [ 'ro' ]\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 8X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 9X\n    SYM,LET,SYM,LET,SYM,LET,LET,SYM,SYM,LET,LET,LET,LET,SYM,LET,LET, # AX\n    SYM,LET,SYM,LET,SYM,LET,LET,SYM,SYM,LET,LET,LET,LET,SYM,LET,LET, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,SYM, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/iso-8859-3.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\n# ISO-8859-3 is the full 8-bit range, IANA-defined, superset of ISO/CEI 8859-3.\n# It is basically the same as ISO/CEI 8859-3, but with control characters.\nname = 'ISO-8859-3'\naliases = ['ISO_8859-3:1988', 'ISO_8859-3', 'iso-ir-109',\n           'csISOLatin3', 'latin3', 'l3']\n\nlanguage = \\\n{\n    # Languages with complete coverage.\n    'complete': [ 'eo', 'tr', 'mt' ],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 8X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 9X\n    SYM,LET,SYM,SYM,SYM,ILL,LET,SYM,SYM,LET,LET,LET,LET,SYM,ILL,LET, # AX\n    SYM,LET,SYM,SYM,SYM,SYM,LET,SYM,SYM,LET,LET,LET,LET,SYM,ILL,LET, # BX\n    LET,LET,LET,ILL,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    ILL,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,ILL,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    ILL,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,SYM, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/iso-8859-4.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'ISO-8859-4'\naliases = ['ISO_8859-2:1988', 'ISO_8859-4', 'iso-ir-110',\n           'csISOLatin4', 'latin4', 'l4']\n\nlanguage = \\\n{\n    # Nordic languages. Largely superseded by ISO-8859-10.\n    'complete': [ 'et', 'lv', 'lt', 'kl', 'saam1281' ],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 8X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 9X\n    SYM,LET,LET,LET,SYM,LET,LET,SYM,SYM,LET,LET,LET,LET,SYM,LET,SYM, # AX\n    SYM,LET,SYM,LET,SYM,LET,LET,SYM,SYM,LET,LET,LET,LET,LET,LET,LET, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,SYM, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/iso-8859-6.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'ISO-8859-6'\naliases = ['ISO_8859-6:1987', 'ISO_8859-6', 'iso-ir-127',\n           'ECMA-114', 'ASMO-708', 'arabic', 'csISOLatinArabic']\n\nlanguage = \\\n{\n    # Dedicated to Arabic.\n    'complete': [ 'ar' ],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 8X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 9X\n    SYM,ILL,ILL,ILL,SYM,ILL,ILL,ILL,ILL,ILL,ILL,ILL,SYM,SYM,ILL,ILL, # AX\n    ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,SYM,ILL,ILL,ILL,SYM, # BX\n    ILL,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,ILL,ILL,ILL,ILL,ILL, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # EX\n    SYM,SYM,SYM,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/iso-8859-7.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'ISO-8859-7'\naliases = ['ISO_8859-7:1987', 'ISO_8859-7', 'iso-ir-126',\n           'ELOT_928', 'ECMA-118', 'greek', 'greek8', 'csISOLatinGreek']\n\nlanguage = \\\n{\n    # Dedicated to modern Greek.\n    'complete': [ 'el' ],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 8X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 9X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM, # AX\n    SYM,SYM,SYM,SYM,SYM,SYM,LET,SYM,LET,LET,LET,SYM,LET,SYM,LET,LET, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,ILL,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,ILL, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/iso-8859-9.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\n# ISO-8859-5 is the full 8-bit range, IANA-defined, superset of ISO/CEI 8859-5.\n# It is basically the same as ISO/CEI 8859-5, but with control characters.\n\nname = 'ISO-8859-9'\naliases = ['ISO_8859-9:1989', 'ISO_8859-9', 'iso-ir-148',\n           'csISOLatin5', 'latin5', 'l5']\n\nlanguage = \\\n{\n    # Specifically made to cover Turkish.\n    'complete': [ 'tr' ],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 8X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 9X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # AX\n    SYM,SYM,SYM,SYM,SYM,LET,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/mac-centraleurope.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'MAC-CENTRALEUROPE'\naliases = []\n\nlanguage = \\\n{\n    'complete': [ 'bs', 'hr', 'cs', 'de', 'hu', 'pl', 'sr', 'sk', 'sl',\n                  'hsb', 'dsb', 'tk' ],\n    'incomplete': [ 'ro' ]\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 8X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 9X\n    SYM,SYM,LET,SYM,SYM,SYM,SYM,LET,SYM,SYM,SYM,LET,SYM,SYM,LET,LET, # AX\n    LET,LET,SYM,SYM,LET,LET,SYM,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # BX\n    LET,LET,SYM,SYM,LET,LET,SYM,SYM,SYM,SYM,SYM,LET,LET,LET,LET,LET, # CX\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,LET,LET,LET,LET,SYM,SYM,LET,LET, # DX\n    LET,LET,SYM,SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/tis-620.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\n# ISO-8859-1 is the full 8-bit range, IANA-defined, superset of ISO/CEI 8859-1.\n# It is basically the same as ISO/CEI 8859-1, but with control characters.\n# As far as I can see, `iconv` has no support for the ISO/CEI 8859-1 subset,\n# so there is no need for us to support it anyway.\n\nname = 'TIS-620'\naliases = []\n\nlanguage = \\\n{\n    # Designed for Thai language.\n    'complete': ['th'],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 8X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 9X\n    ILL,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # AX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,SYM,LET,LET,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,ILL,ILL,ILL,SYM, # DX\n    LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,LET, # EX\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,LET,LET,ILL,ILL,ILL,ILL, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/viscii.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'VISCII'\naliases = ['csVISCII']\n\nlanguage = \\\n{\n    # Dedicated to Vietnamese.\n    'complete': ['vi'],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,LET,CTR,CTR,LET,LET,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,LET,CTR,CTR,CTR,CTR,LET,CTR,CTR,CTR,CTR,LET,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 8X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 9X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # AX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/windows-1250.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'WINDOWS-1250'\naliases = ['cswindows1250']\n\nlanguage = \\\n{\n    # used under Microsoft Windows to represent texts in Central European and\n    # Eastern European languages that use Latin script, such as Polish, Czech,\n    # Slovak, Hungarian, Slovene, Bosnian, Croatian, Serbian (Latin script),\n    # Romanian (before 1993 spelling reform) and Albanian.\n    'complete': [ 'pl', 'hu', 'sl', 'bs', 'hr', 'sr', 'ro', 'sq', 'de' ],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    SYM,ILL,SYM,ILL,SYM,SYM,SYM,SYM,ILL,SYM,LET,SYM,LET,LET,LET,LET, # 8X\n    ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,LET,SYM,LET,LET,LET,LET, # 9X\n    SYM,SYM,SYM,LET,SYM,LET,SYM,SYM,SYM,SYM,LET,SYM,SYM,SYM,SYM,LET, # AX\n    SYM,SYM,SYM,LET,SYM,SYM,SYM,SYM,SYM,LET,LET,SYM,LET,SYM,LET,LET, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,SYM, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/windows-1251.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\n# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n# Python 3.6: needs tmp renaming Python/Lib/encodings/cp1251.py as cp1252.py ???\n# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\nname = 'WINDOWS-1251'\naliases = ['CP-1251', 'cswindows1251']\n\nlanguage = \\\n{\n    # Languages with complete coverage.\n    # Basically a mix of ISO-8859-1 and ISO-8859-15.\n    'complete': [ 'be', 'mk', 'ru', 'sr' ],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    SYM,LET,SYM,LET,SYM,SYM,SYM,SYM,SYM,SYM,LET,SYM,LET,LET,LET,LET, # 8X\n    LET,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,LET,SYM,LET,LET,LET,LET, # 9X\n    CTR,LET,LET,LET,SYM,LET,SYM,SYM,LET,SYM,LET,SYM,SYM,CTR,SYM,LET, # AX\n    SYM,SYM,LET,LET,LET,LET,SYM,SYM,LET,SYM,LET,SYM,LET,LET,LET,LET, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/windows-1252.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'WINDOWS-1252'\naliases = ['CP-1252', 'cswindows1252']\n\nlanguage = \\\n{\n    # Languages with complete coverage.\n    # Basically a mix of ISO-8859-1 and ISO-8859-15.\n    'complete': [ 'af', 'sq', 'eu', 'br', 'co', 'da', 'en', 'fo', 'gl', 'de',\n                  'is', 'id', 'it', 'ku', 'leon1250', 'lb', 'ms', 'gv', 'no',\n                  'oc', 'pt', 'rm', 'gd', 'es', 'sw', 'sv', 'wa', 'ca', 'et',\n                  'fi', 'fr', 'ga', 'la' ],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    SYM,ILL,SYM,LET,SYM,SYM,SYM,SYM,SYM,SYM,LET,SYM,LET,ILL,LET,ILL, # 8X\n    ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,LET,SYM,LET,ILL,LET,LET, # 9X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # AX\n    SYM,SYM,SYM,SYM,SYM,LET,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/windows-1253.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'WINDOWS-1253'\naliases = ['cswindows1253']\n\nlanguage = \\\n{\n    # Greek support.\n    'complete': ['el'],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    SYM,ILL,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,ILL,SYM,ILL,ILL,ILL,ILL, # 8X\n    ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,ILL,SYM,ILL,ILL,ILL,ILL, # 9X\n    SYM,SYM,LET,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,SYM,SYM,SYM,SYM, # AX\n    SYM,SYM,SYM,SYM,SYM,LET,SYM,SYM,LET,LET,LET,SYM,LET,SYM,LET,LET, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,ILL,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,ILL, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/windows-1256.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'WINDOWS-1256'\naliases = ['cswindows1256']\n\nlanguage = \\\n{\n    # Dedicated to Arabic (and possibly some other languages that use Arabic\n    # script, like Persian and Urdu).\n    # Also contains some French characters for colonial historic reasons\n    # (upper-case letters with diacritics were not included).\n    'complete': ['ar', 'fr', 'fa', 'ur'],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    SYM,LET,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,LET,SYM,LET,LET,LET,LET, # 8X\n    LET,SYM,SYM,SYM,SYM,SYM,SYM,SYM,LET,SYM,LET,SYM,LET,SYM,SYM,LET, # 9X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,LET,SYM,SYM,SYM,SYM,SYM, # AX\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    SYM,SYM,SYM,SYM,LET,SYM,SYM,SYM,SYM,LET,SYM,LET,LET,SYM,SYM,LET, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/windows-1257.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'WINDOWS-1257'\naliases = ['CP-1257']\n\nlanguage = \\\n{\n    # Designed to support the Estonian, Latvian and Lithuanian languages.\n    'complete': [ 'et', 'lv', 'lt' ],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    SYM,ILL,SYM,ILL,SYM,SYM,SYM,SYM,ILL,SYM,ILL,SYM,ILL,SYM,SYM,SYM, # 8X\n    ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,ILL,SYM,ILL,SYM,SYM,ILL, # 9X\n    SYM,ILL,SYM,SYM,SYM,ILL,SYM,SYM,LET,SYM,LET,SYM,SYM,SYM,SYM,LET, # AX\n    SYM,SYM,SYM,SYM,SYM,LET,SYM,SYM,LET,SYM,LET,SYM,SYM,SYM,SYM,LET, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # CX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # EX\n    LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,SYM, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/charsets/windows-1258.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nfrom codepoints import *\n\nname = 'WINDOWS-1258'\naliases = ['cswindows1258']\n\nlanguage = \\\n{\n    # Dedicated to Vietnamese.\n    'complete': ['vi'],\n    'incomplete': []\n}\n\n#   X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF   #\ncharmap = \\\n[\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, # 0X\n    CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, # 1X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # 2X\n    NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, # 3X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 4X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,SYM, # 5X\n    SYM,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET, # 6X\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,SYM,SYM,SYM,CTR, # 7X\n    SYM,ILL,SYM,LET,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,LET,ILL,ILL,ILL, # 8X\n    ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,LET,ILL,ILL,LET, # 9X\n    SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # AX\n    SYM,SYM,SYM,SYM,SYM,LET,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, # BX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET, # CX\n    LET,LET,SYM,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,SYM,LET, # DX\n    LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,LET,SYM,LET,LET,LET, # EX\n    LET,LET,SYM,LET,LET,LET,LET,SYM,LET,LET,LET,LET,LET,LET,LET,LET, # FX\n]\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/debug.sh",
    "content": "mkdir --parents debug \\\n&& cd debug\n\ncmake \\\n\t-DCMAKE_BUILD_TYPE=Debug \\\n\t-DCMAKE_INSTALL_PREFIX=`pwd`/root \\\n\t.. \\\n&& make \\\n&& make install\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/gen.sh",
    "content": "#!/bin/bash\npython ./BuildLangModel.py ar --max-page=100 --max-depth=4\npython ./BuildLangModel.py cs --max-page=100 --max-depth=4\npython ./BuildLangModel.py da --max-page=100 --max-depth=4\npython ./BuildLangModel.py de --max-page=100 --max-depth=4\npython ./BuildLangModel.py el --max-page=100 --max-depth=4\npython ./BuildLangModel.py eo --max-page=100 --max-depth=4\npython ./BuildLangModel.py es --max-page=100 --max-depth=4\npython ./BuildLangModel.py et --max-page=100 --max-depth=4\npython ./BuildLangModel.py fi --max-page=100 --max-depth=4\npython ./BuildLangModel.py fr --max-page=100 --max-depth=4\npython ./BuildLangModel.py ga --max-page=100 --max-depth=4\npython ./BuildLangModel.py hr --max-page=100 --max-depth=4\npython ./BuildLangModel.py hu --max-page=100 --max-depth=4\npython ./BuildLangModel.py it --max-page=100 --max-depth=4\npython ./BuildLangModel.py lt --max-page=100 --max-depth=4\npython ./BuildLangModel.py lv --max-page=100 --max-depth=4\npython ./BuildLangModel.py mt --max-page=100 --max-depth=4\npython ./BuildLangModel.py pl --max-page=100 --max-depth=4\npython ./BuildLangModel.py pt --max-page=100 --max-depth=4\npython ./BuildLangModel.py ro --max-page=100 --max-depth=4\npython ./BuildLangModel.py sk --max-page=100 --max-depth=4\npython ./BuildLangModel.py sl --max-page=100 --max-depth=4\npython ./BuildLangModel.py sv --max-page=100 --max-depth=4\npython ./BuildLangModel.py th --max-page=100 --max-depth=4\npython ./BuildLangModel.py tr --max-page=100 --max-depth=4\npython ./BuildLangModel.py vi --max-page=100 --max-depth=4\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/header-template.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/af.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Africaans'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'af'\n# ASCII characters are also used in French.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['WINDOWS-1252', 'ISO-8859-1', 'ISO-8859-9', 'ISO-8859-15']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# If use_ascii=True, there is no need to add any ASCII characters.\n# If case_mapping=True, there is no need to add several cases of a same\n# character (provided Python algorithms know the right cases).\nalphabet = ['è', 'é', 'ê', 'ë', 'î', 'ï','ô', 'û']\n# The start page. Though optional, it is advised to choose one yourself.\nstart_pages = ['Tuisblad']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/ar.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\nname = 'Arabic'\ncode = 'ar'\nuse_ascii = False\ncharsets = ['ISO-8859-6', 'WINDOWS-1256']\n\n## Optional Properties ##\n\n# No alphabet. Arabic is complicated because letters have different\n# forms (glyphs) depending on positions. Some charsets would encode\n# glyphs while others would encode only the forms. In doubt, I will\n# just let the defaults for now.\n\nstart_pages = ['الصفحة_الرئيسية']\nwikipedia_code = code\ncase_mapping = False\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/be.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Belarusian'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'be'\n# ASCII characters are also used in French.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['WINDOWS-1251']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# If use_ascii=True, there is no need to add any ASCII characters.\n# If case_mapping=True, there is no need to add several cases of a same\n# character (provided Python algorithms know the right cases).\nalphabet = ['б', 'в', 'г', 'д', 'ж', 'з', 'и', 'й', 'к', 'л', 'м', 'н', 'т', 'ф', 'ц', 'ч', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я']\n# The start page. Though optional, it is advised to choose one yourself.\nstart_pages = ['Галоўная_старонка']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/cs.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Czech'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'cs'\n# ASCII characters are also used in French.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-2', 'Windows-1250', 'IBM852', 'MAC-CENTRALEUROPE']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# If use_ascii=True, there is no need to add any ASCII characters.\n# If case_mapping=True, there is no need to add several cases of a same\n# character (provided Python algorithms know the right cases).\nalphabet = 'áčďéěíňóřšťúůýž'\n# The starred page which was rewarded on the main page when I created\n# the data.\nstart_pages = ['Sociální fobie']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n\n# A function to clean content returned by the `wikipedia` python lib,\n# in case some unwanted data has been overlooked.\n# Note that we are already cleaning away the '=' from the title syntax\n# of Wikipedia, as well as double spaces. But sometimes, Wikipedia in\n# some language may return weird syntax or UI text which should be\n# discarded. If you encounter one of these cases, use this function.\ndef clean_wikipedia_content(content):\n    # Do your garbage text cleaning here.\n    return content\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/da.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Danish'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'da'\n# ASCII characters are also used in French.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-15', 'ISO-8859-1', 'WINDOWS-1252']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# If use_ascii=True, there is no need to add any ASCII characters.\n# If case_mapping=True, there is no need to add several cases of a same\n# character (provided Python algorithms know the right cases).\nalphabet = 'æøå'\n# The start page. Though optional, it is advised to choose one yourself.\nstart_pages = ['Forside']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/de.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'German'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'de'\n# ASCII characters are also used in French.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-1', 'WINDOWS-1252']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# If use_ascii=True, there is no need to add any ASCII characters.\n# If case_mapping=True, there is no need to add several cases of a same\n# character (provided Python algorithms know the right cases).\nalphabet = ['ä', 'ö', 'ü', 'ß']\n# The start page. Though optional, it is advised to choose one yourself.\nstart_pages = ['Wikipedia:Hauptseite']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/el.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\nname = 'Greek'\ncode = 'el'\nuse_ascii = False\ncharsets = ['ISO-8859-7', 'WINDOWS-1253']\n\n## Optional Properties ##\n\nalphabet = 'αβγδεζηθικλμνξοπρσςτυφχψωάέήίόύώ'\nstart_pages = ['Πύλη:Κύρια']\nwikipedia_code = code\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/eo.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Esperanto'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'eo'\n# Esperanto actually does use ASCII, but not q, w, x, or y.\n# So I just use the alphabet variable below instead.\nuse_ascii = False\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-3']\n\n## Optional Properties ##\n\n# Alphabet characters.\nalphabet = 'abcĉdefgĝhĥijĵklmnoprsŝtuŭvz'\n# The start page. Though optional, it is advised to choose one yourself.\nstart_pages = ['Vikipedio:Ĉefpaĝo']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/es.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Spanish'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'es'\n# ASCII characters are also used in French.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-15', 'ISO-8859-1', 'WINDOWS-1252']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# If use_ascii=True, there is no need to add any ASCII characters.\n# If case_mapping=True, there is no need to add several cases of a same\n# character (provided Python algorithms know the right cases).\nalphabet = 'ñáéíóúü'\n# The start page. Though optional, it is advised to choose one yourself.\nstart_pages = ['Wikipedia:Portada']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/et.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\nname = 'Estonian'\ncode = 'et'\nuse_ascii = True\ncharsets = ['ISO-8859-4', 'ISO-8859-13', 'ISO-8859-15',\n            'WINDOWS-1252', 'WINDOWS-1257']\n\n## Optional Properties ##\n\n# Alphabet characters.\nalphabet = 'äöüõšž'\nstart_pages = ['Harilik pohl']\nwikipedia_code = code\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/fi.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\nname = 'Finnish'\ncode = 'fi'\nuse_ascii = True\ncharsets = ['ISO-8859-1', 'ISO-8859-4', 'ISO-8859-9',\n            'ISO-8859-13', 'ISO-8859-15', 'WINDOWS-1252']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# 'å' (Swedish o), 'š' and 'ž' are rare enough that I don't want to include them\n# here.\nalphabet = 'äö'\n# Some random high quality page found on the Finnish home page.\nstart_pages = ['Yhdistynyt kuningaskunta']\nwikipedia_code = code\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/fr.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'French'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'fr'\n# ASCII characters are also used in French.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-15', 'ISO-8859-1', 'WINDOWS-1252']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# If use_ascii=True, there is no need to add any ASCII characters.\n# If case_mapping=True, there is no need to add several cases of a same\n# character (provided Python algorithms know the right cases).\nalphabet = ['œ', 'à', 'â', 'ç', 'è', 'é', 'î', 'ï', 'ù', 'û', 'ê']\n# The start page. Though optional, it is advised to choose one yourself.\nstart_pages = ['Wikipédia:Accueil_principal', 'Bœuf (animal)']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n\n# A function to clean content returned by the `wikipedia` python lib,\n# in case some unwanted data has been overlooked.\n# Note that we are already cleaning away the '=' from the title syntax\n# of Wikipedia, as well as double spaces. But sometimes, Wikipedia in\n# some language may return weird syntax or UI text which should be\n# discarded. If you encounter one of these cases, use this function.\ndef clean_wikipedia_content(content):\n    # Do your garbage text cleaning here.\n    return content\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/ga.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\nname = 'Irish'\ncode = 'ga'\n# ASCII characters are also used in French.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-15', 'ISO-8859-1', 'ISO-8859-9', 'WINDOWS-1252']\n\n## Optional Properties ##\n\n# XXX: Irish gaelic also uses sometimes the dotless 'i' but without any\n# semantic difference from the dotted 'i'. Only for stylistic reasons.\n# So I don't add it in the glyph list.\nalphabet = 'áéíóú'\nstart_pages = ['Tracy Caldwell Dyson']\nwikipedia_code = code\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/hr.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\nname = 'Croatian'\ncode = 'hr'\nuse_ascii = True\ncharsets = ['ISO-8859-2', 'ISO-8859-13', 'ISO-8859-16',\n            'Windows-1250', 'IBM852', 'MAC-CENTRALEUROPE']\n\n## Optional Properties ##\n\n# Alphabet characters.\nalphabet = 'čćđšž'\n# The starred page which was rewarded on the main page when I created\n# the data.\nstart_pages = ['Fizika čvrstog stanja']\nwikipedia_code = code\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/hu.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Hungarian'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'hu'\n# Q, W, X, Y are only used for foreign words.\nuse_ascii = False\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-2', 'WINDOWS-1250']\n\n## Optional Properties ##\n\n# Alphabet characters: I separate to make missing letters fully visible.\nalphabet = 'abcdefghijklmnop' + 'rstuv' + 'z' + 'áéíóöőúüű'\n# The start page. Though optional, it is advised to choose one yourself.\nstart_pages = ['Kezdőlap']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/it.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\nname = 'Italian'\ncode = 'it'\nuse_ascii = True\ncharsets = ['ISO-8859-1', 'ISO-8859-3', 'ISO-8859-9',\n            'ISO-8859-15', 'WINDOWS-1252']\n\n## Optional Properties ##\n\nalphabet = 'óéèò'\nstart_pages = ['Pieve Ligure']\nwikipedia_code = code\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/lt.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Lithuanian'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'lt'\n# ASCII characters are also used.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-4', 'ISO-8859-10', 'ISO-8859-13', ]\n\n## Optional Properties ##\n\n# Alphabet characters.\n# If use_ascii=True, there is no need to add any ASCII characters.\n# If case_mapping=True, there is no need to add several cases of a same\n# character (provided Python algorithms know the right cases).\nalphabet = 'ąčęėįšųūž'\n# The start page. Just taking the page which was in front page the day\n# I created the data.\nstart_pages = ['Karūna (laivas)']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/lv.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Latvian'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'lv'\n# ASCII characters are also used.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-4', 'ISO-8859-10', 'ISO-8859-13']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# If use_ascii=True, there is no need to add any ASCII characters.\n# If case_mapping=True, there is no need to add several cases of a same\n# character (provided Python algorithms know the right cases).\nalphabet = 'āčēģīķļņšūž'\n# The start page. Just taking a starred page.\nstart_pages = ['Zigfrīds Anna Meierovics']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/mt.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Maltese'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'mt'\n# ASCII characters are also used in French.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-3']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# If use_ascii=True, there is no need to add any ASCII characters.\n# If case_mapping=True, there is no need to add several cases of a same\n# character (provided Python algorithms know the right cases).\nalphabet = 'ċġħż'\n# The starred page which was rewarded on the main page when I created\n# the data.\nstart_pages = ['Unjoni Ewropea']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n\n# A function to clean content returned by the `wikipedia` python lib,\n# in case some unwanted data has been overlooked.\n# Note that we are already cleaning away the '=' from the title syntax\n# of Wikipedia, as well as double spaces. But sometimes, Wikipedia in\n# some language may return weird syntax or UI text which should be\n# discarded. If you encounter one of these cases, use this function.\ndef clean_wikipedia_content(content):\n    # Do your garbage text cleaning here.\n    return content\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/nl.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Nederlands'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'nl'\n# ASCII characters are also used in French.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['WINDOWS-1252', 'ISO-8859-1', 'ISO-8859-9', 'ISO-8859-15']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# If use_ascii=True, there is no need to add any ASCII characters.\n# If case_mapping=True, there is no need to add several cases of a same\n# character (provided Python algorithms know the right cases).\nalphabet = ['ë', 'ï', 'ö']\n# The start page. Though optional, it is advised to choose one yourself.\nstart_pages = ['Hoofdpagina']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/pl.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Polish'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'pl'\n# ASCII characters are also used in French.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-2', 'ISO-8859-13', 'ISO-8859-16',\n            'Windows-1250', 'IBM852', 'MAC-CENTRALEUROPE']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# If use_ascii=True, there is no need to add any ASCII characters.\n# If case_mapping=True, there is no need to add several cases of a same\n# character (provided Python algorithms know the right cases).\nalphabet = 'ąćęłńóśźż'\n# The starred page which was rewarded on the main page when I created\n# the data.\nstart_pages = ['Krasnyj Krym']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n\n# A function to clean content returned by the `wikipedia` python lib,\n# in case some unwanted data has been overlooked.\n# Note that we are already cleaning away the '=' from the title syntax\n# of Wikipedia, as well as double spaces. But sometimes, Wikipedia in\n# some language may return weird syntax or UI text which should be\n# discarded. If you encounter one of these cases, use this function.\ndef clean_wikipedia_content(content):\n    # Do your garbage text cleaning here.\n    return content\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/pt.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Portuguese'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'pt'\n# ASCII characters are also used in French.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-15', 'ISO-8859-1', 'WINDOWS-1252', 'ISO-8859-9']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# If use_ascii=True, there is no need to add any ASCII characters.\n# If case_mapping=True, there is no need to add several cases of a same\n# character (provided Python algorithms know the right cases).\nalphabet = 'áâãàçéêíóôõú'\n# The starred page which was rewarded on the main page when I created\n# the data.\nstart_pages = ['Papagaio-das-mascarenhas']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n\n# A function to clean content returned by the `wikipedia` python lib,\n# in case some unwanted data has been overlooked.\n# Note that we are already cleaning away the '=' from the title syntax\n# of Wikipedia, as well as double spaces. But sometimes, Wikipedia in\n# some language may return weird syntax or UI text which should be\n# discarded. If you encounter one of these cases, use this function.\ndef clean_wikipedia_content(content):\n    # Do your garbage text cleaning here.\n    return content\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/ro.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\nname = 'Romanian'\ncode = 'ro'\nuse_ascii = True\ncharsets = ['ISO-8859-2', 'ISO-8859-16',\n            'Windows-1250', 'IBM852']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# Note: Wikipedia explains that s and t with cedilla (şţ), or even\n# bare s and t, were often used in place of s and t with comma (șț)\n# because of missing characters in most common encoding at the time.\n# It may be worth adding some common_replacement_letters logics in\n# the training and models.\n# https://en.wikipedia.org/wiki/Romanian_alphabet#ISO_8859\nalphabet = 'ăâîșț'\n# The starred page which was rewarded on the main page when I created\n# the data.\nstart_pages = ['The Loving Kind']\nwikipedia_code = code\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/sk.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Slovak'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'sk'\n# ASCII characters are also used in French.\nuse_ascii = True\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-2', 'Windows-1250', 'IBM852', 'MAC-CENTRALEUROPE']\n\n## Optional Properties ##\n\n# Alphabet characters.\n# If use_ascii=True, there is no need to add any ASCII characters.\n# If case_mapping=True, there is no need to add several cases of a same\n# character (provided Python algorithms know the right cases).\nalphabet = 'áäčďĺľňóŕšťúýž'\n# The starred page which was rewarded on the main page when I created\n# the data.\nstart_pages = ['Dôkaz (matematika)']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# 'a' and 'A' will be considered the same character, and so on.\n# This uses Python algorithm to determine upper/lower-case of a given\n# character.\ncase_mapping = True\n\n# A function to clean content returned by the `wikipedia` python lib,\n# in case some unwanted data has been overlooked.\n# Note that we are already cleaning away the '=' from the title syntax\n# of Wikipedia, as well as double spaces. But sometimes, Wikipedia in\n# some language may return weird syntax or UI text which should be\n# discarded. If you encounter one of these cases, use this function.\ndef clean_wikipedia_content(content):\n    # Do your garbage text cleaning here.\n    return content\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/sl.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\nname = 'Slovene'\ncode = 'sl'\nuse_ascii = True\ncharsets = ['ISO-8859-2', 'ISO-8859-16',\n            'Windows-1250', 'IBM852', 'MAC-CENTRALEUROPE']\n\n## Optional Properties ##\n\n# Alphabet characters.\nalphabet = 'čšž'\n# The starred page which was rewarded on the main page when I created\n# the data.\nstart_pages = ['XCOM: Enemy Unknown']\nwikipedia_code = code\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/sv.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\nname = 'Swedish'\ncode = 'sv'\nuse_ascii = True\ncharsets = ['ISO-8859-1', 'ISO-8859-4', 'ISO-8859-9',\n            'ISO-8859-15', 'WINDOWS-1252']\n\n## Optional Properties ##\n\nalphabet = 'åäö'\nstart_pages = ['Kakapo']\nwikipedia_code = code\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/th.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\nname = 'Thai'\ncode = 'th'\nuse_ascii = False\ncharsets = ['ISO-8859-11', 'TIS-620']\n\n## Optional Properties ##\n\n# The start page. Though optional, it is advised to choose one yourself.\nstart_pages = ['หน้าหลัก']\nwikipedia_code = code\ncase_mapping = False\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/tr.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\n# The human name for the language, in English.\nname = 'Turkish'\n# Use 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,\n# or use another catalog as a last resort.\ncode = 'tr'\n# Turkish use most latin alphabet, but not all.\n# So I just use the alphabet variable below instead.\nuse_ascii = False\n# The charsets we want to support and create data for.\ncharsets = ['ISO-8859-3', 'ISO-8859-9']\n\n## Optional Properties ##\n\n# Alphabet characters.\nalphabet = 'abcçdefgğhıijklmnoöprsştuüvyzâîû'\n# The start page. Though optional, it is advised to choose one yourself.\nstart_pages = ['Ana_Sayfa']\n# give possibility to select another code for the Wikipedia URL.\nwikipedia_code = code\n# Python algorithm will lower 'I' in 'i' and 'İ' into a decomposed 'ı' + dot.\n# This is wrong when it comes to Turkish.\ncustom_case_mapping = { 'İ': 'i', 'I': 'ı' }\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/langs/vi.py",
    "content": "#!/bin/python3\n# -*- coding: utf-8 -*-\n\n# ##### BEGIN LICENSE BLOCK #####\n# Version: MPL 1.1/GPL 2.0/LGPL 2.1\n#\n# The contents of this file are subject to the Mozilla Public License Version\n# 1.1 (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n# http://www.mozilla.org/MPL/\n#\n# Software distributed under the License is distributed on an \"AS IS\" basis,\n# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n# for the specific language governing rights and limitations under the\n# License.\n#\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n#          Jehan <jehan@girinstud.io>\n#\n# Alternatively, the contents of this file may be used under the terms of\n# either the GNU General Public License Version 2 or later (the \"GPL\"), or\n# the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n# in which case the provisions of the GPL or the LGPL are applicable instead\n# of those above. If you wish to allow use of your version of this file only\n# under the terms of either the GPL or the LGPL, and not to allow others to\n# use your version of this file under the terms of the MPL, indicate your\n# decision by deleting the provisions above and replace them with the notice\n# and other provisions required by the GPL or the LGPL. If you do not delete\n# the provisions above, a recipient may use your version of this file under\n# the terms of any one of the MPL, the GPL or the LGPL.\n#\n# ##### END LICENSE BLOCK #####\n\nimport re\n\n## Mandatory Properties ##\n\nname = 'Vietnamese'\ncode = 'vi'\n# It actually uses ASCII, but not all of it.\nuse_ascii = False\n# From Wikipedia:\n# For systems that lack support for Unicode, dozens of 8-bit Vietnamese code\n# pages are available.[1] The most common are VISCII (TCVN 5712:1993), VPS, and\n# Windows-1258.[3] Where ASCII is required, such as when ensuring readability in\n# plain text e-mail, Vietnamese letters are often encoded according to Vietnamese\n# Quoted-Readable (VIQR) or VSCII Mnemonic (VSCII-MNEM),[4] though usage of either\n# variable-width scheme has declined dramatically following the adoption of\n# Unicode on the World Wide Web.\ncharsets = ['WINDOWS-1258', 'VISCII']\n\n## Optional Properties ##\n\nalphabet = 'aăâbcdđeêghiklmnoôơpqrstuưvxy'\nstart_pages = ['Chữ_Quốc_ngữ']\nwikipedia_code = code\ncase_mapping = True\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/release.sh",
    "content": "mkdir --parents release \\\n&& cd release\n\ncmake \\\n\t-DCMAKE_BUILD_TYPE=Release \\\n\t-DCMAKE_INSTALL_PREFIX=/usr \\\n\t.. \\\n&& make\n"
  },
  {
    "path": "third_party/uchardet/uchardet/script/requirements.txt",
    "content": "requests==2.13.0\nwikipedia==1.4.0"
  },
  {
    "path": "third_party/uchardet/uchardet/script/win32.sh",
    "content": "mkdir --parents win32 \\\n&& cd win32 \\\n&& cmake .. \\\n\t-G \"MSYS Makefiles\" \\\n\t-DCMAKE_BUILD_TYPE=Release \\\n\t-DCMAKE_INSTALL_PREFIX=\"\" \\\n&& make"
  },
  {
    "path": "third_party/uchardet/uchardet/src/CMakeLists.txt",
    "content": "set(\n\tUCHARDET_HEADERS\n\tuchardet.h\n)\n\nfile(\n\tGLOB\n\tUCHARDET_SOURCES\n\tLangModels/*.cpp\n\tCharDistribution.cpp\n\tJpCntx.cpp\n\tnsBig5Prober.cpp\n\tnsCharSetProber.cpp\n\tnsEscCharsetProber.cpp\n\tnsEscSM.cpp\n\tnsEUCJPProber.cpp\n\tnsEUCKRProber.cpp\n\tnsEUCTWProber.cpp\n#\tnsGB2312Prober.cpp\n\tnsGB18030Prober.cpp\n\tnsHebrewProber.cpp\n\tnsLatin1Prober.cpp\n\tnsMBCSGroupProber.cpp\n\tnsMBCSSM.cpp\n\tnsSBCharSetProber.cpp\n\tnsSBCSGroupProber.cpp\n\tnsSJISProber.cpp\n\tnsUniversalDetector.cpp\n\tnsUTF8Prober.cpp\n\tuchardet.cpp\n)\n\nset (UCHARDET_LIBRARY libuchardet)\nset (UCHARDET_LIBRARY libuchardet PARENT_SCOPE)\n\nif (BUILD_STATIC AND BUILD_SHARED_LIBS)\n\tset (UCHARDET_STATIC_LIBRARY libuchardet_static)\nendif ()\n\nadd_definitions(\n\t-DVERSION=\"${UCHARDET_VERSION}\"\n#\t-Wall\n)\n\nif (CMAKE_BUILD_TYPE MATCHES Debug)\n\tadd_definitions(\n\t\t-O0\n\t\t-g3\n\t)\nendif (CMAKE_BUILD_TYPE MATCHES Debug)\n\nadd_library(\n\t${UCHARDET_LIBRARY}\n\t${UCHARDET_SOURCES}\n)\ntarget_compile_definitions(\"${UCHARDET_LIBRARY}\" PRIVATE BUILDING_UCHARDET)\nif(BUILD_SHARED_LIBS)\n\ttarget_compile_definitions(\"${UCHARDET_LIBRARY}\" PUBLIC UCHARDET_SHARED)\nendif()\n\ntarget_include_directories(${UCHARDET_LIBRARY}\n\tPUBLIC\n\t\t\"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>\"\n\t\t\"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}>\"\n)\n\nif (UCHARDET_STATIC_LIBRARY)\n\tadd_library(\n\t\t${UCHARDET_STATIC_LIBRARY}\n\t\tSTATIC\n\t\t${UCHARDET_SOURCES}\n\t)\n\ttarget_compile_definitions(\"${UCHARDET_STATIC_LIBRARY}\" PRIVATE BUILDING_UCHARDET)\n\n\ttarget_include_directories(${UCHARDET_STATIC_LIBRARY}\n\t\tPUBLIC\n\t\t\t\"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>\"\n\t\t\t\"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}>\"\n\t)\nendif (UCHARDET_STATIC_LIBRARY)\n\nset_target_properties(\n\t${UCHARDET_LIBRARY}\n\tPROPERTIES\n\t\tLINKER_LANGUAGE\n\t\t\tCXX\n\t\tOUTPUT_NAME\n\t\t\t${PACKAGE_NAME}\n\t\tVERSION\n\t\t\t${UCHARDET_VERSION}\n\t\tSOVERSION\n\t\t\t${UCHARDET_VERSION_MAJOR}\n)\n\nif (UCHARDET_STATIC_LIBRARY)\n\tset_target_properties(\n\t\t${UCHARDET_STATIC_LIBRARY}\n\t\tPROPERTIES\n\t\t\tLINKER_LANGUAGE\n\t\t\t\tCXX\n\t\t\tOUTPUT_NAME\n\t\t\t\t${PACKAGE_NAME}\n\t)\nendif (UCHARDET_STATIC_LIBRARY)\n\nif (NOT WIN32)\n\tinstall(\n\t\tTARGETS\n\t\t\t${UCHARDET_LIBRARY}\n\t\tEXPORT\n\t\t\tUchardetTargets\n\t\tLIBRARY DESTINATION\n\t\t\t${CMAKE_INSTALL_LIBDIR}\n\t\tARCHIVE DESTINATION\n\t\t\t${CMAKE_INSTALL_LIBDIR}\n\t)\nelse (NOT WIN32)\n\tinstall(\n\t\tTARGETS\n\t\t\t${UCHARDET_LIBRARY}\n\t\tEXPORT\n\t\t\tUchardetTargets\n\t\tRUNTIME DESTINATION\n\t\t\t${CMAKE_INSTALL_BINDIR}\n\t\tARCHIVE DESTINATION\n\t\t\t${CMAKE_INSTALL_LIBDIR}\n\t)\nendif (NOT WIN32)\n\nif (UCHARDET_STATIC_LIBRARY)\n\tinstall(\n\t\tTARGETS\n\t\t\t${UCHARDET_STATIC_LIBRARY}\n\t\tEXPORT\n\t\t\tUchardetTargets\n\t\tARCHIVE DESTINATION\n\t\t\t${CMAKE_INSTALL_LIBDIR}\n\t)\nendif (UCHARDET_STATIC_LIBRARY)\n\ninstall(\n\tFILES\n\t\t${UCHARDET_HEADERS}\n\tDESTINATION\n\t\t${CMAKE_INSTALL_INCLUDEDIR}/${PACKAGE_NAME}\n)\n\ninclude(symbols.cmake)\n\nif (BUILD_BINARY)\n\tadd_subdirectory(tools)\nendif (BUILD_BINARY)\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/CharDistribution.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"CharDistribution.h\"\n\n#include \"tables/JISFreq.tab\"\n#include \"tables/Big5Freq.tab\"\n#include \"tables/EUCKRFreq.tab\"\n#include \"tables/EUCTWFreq.tab\"\n//#include \"tables/GB2312Freq.tab\"\n#include \"tables/GB18030Freq.tab\"\n\n//return confidence base on received data\nfloat CharDistributionAnalysis::GetConfidence() const\n{\n  //if we didn't receive any character in our consideration range, or the\n  // number of frequent characters is below the minimum threshold, return\n  // negative answer\n  if ((mTotalChars <= 0) || (mFreqChars < mDataThreshold))\n    return SURE_NO;\n\n  if (mTotalChars != mFreqChars) {\n    float r = (float)mFreqChars / ((mTotalChars - mFreqChars) * mTypicalDistributionRatio);\n\n    if (r < SURE_YES)\n      return r;\n  }\n  //normalize confidence, (we don't want to be 100% sure)\n  return SURE_YES;\n}\n\nEUCTWDistributionAnalysis::EUCTWDistributionAnalysis()\n{\n  mCharToFreqOrder = EUCTWCharToFreqOrder;\n  mTableSize = EUCTW_TABLE_SIZE;\n  mTypicalDistributionRatio = EUCTW_TYPICAL_DISTRIBUTION_RATIO;\n}\n\nEUCKRDistributionAnalysis::EUCKRDistributionAnalysis()\n{\n  mCharToFreqOrder = EUCKRCharToFreqOrder;\n  mTableSize = EUCKR_TABLE_SIZE;\n  mTypicalDistributionRatio = EUCKR_TYPICAL_DISTRIBUTION_RATIO;\n}\n\n//GB2312DistributionAnalysis::GB2312DistributionAnalysis()\n//{\n//  mCharToFreqOrder = GB2312CharToFreqOrder;\n//  mTableSize = GB2312_TABLE_SIZE;\n//  mTypicalDistributionRatio = GB2312_TYPICAL_DISTRIBUTION_RATIO;\n//}\n\nGB18030DistributionAnalysis::GB18030DistributionAnalysis()\n{\n  mCharToFreqOrder = GB18030CharToFreqOrder;\n  mTableSize = GB18030_TABLE_SIZE;\n  mTypicalDistributionRatio = GB18030_TYPICAL_DISTRIBUTION_RATIO;\n}\n\nBig5DistributionAnalysis::Big5DistributionAnalysis()\n{\n  mCharToFreqOrder = Big5CharToFreqOrder;\n  mTableSize = BIG5_TABLE_SIZE;\n  mTypicalDistributionRatio = BIG5_TYPICAL_DISTRIBUTION_RATIO;\n}\n\nSJISDistributionAnalysis::SJISDistributionAnalysis()\n{\n  mCharToFreqOrder = JISCharToFreqOrder;\n  mTableSize = JIS_TABLE_SIZE;\n  mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO;\n}\n\nEUCJPDistributionAnalysis::EUCJPDistributionAnalysis()\n{\n  mCharToFreqOrder = JISCharToFreqOrder;\n  mTableSize = JIS_TABLE_SIZE;\n  mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO;\n}\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/CharDistribution.h",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n * vim: et sw=2 ts=2 fdm=marker\n */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef CharDistribution_h__\n#define CharDistribution_h__\n\n#include \"nscore.h\"\n\nclass CharDistributionAnalysis\n{\npublic:\n  CharDistributionAnalysis()\n  : mCharToFreqOrder(nullptr)\n  , mTableSize(0)\n  , mTypicalDistributionRatio(0.0f)\n  { Reset(PR_FALSE); };\n\n  //feed a block of data and do distribution analysis\n  static void HandleData(const char*, PRUint32) { }\n\n  //Feed a character with known length\n  void HandleOneChar(const char* aStr, PRUint32 aCharLen)\n  {\n    PRInt32 order;\n\n    //we only care about 2-bytes character in our distribution analysis\n    order = (aCharLen == 2) ? GetOrder(aStr) : -1;\n\n    if (order >= 0)\n    {\n      mTotalChars++;\n      //order is valid\n      if ((PRUint32)order < mTableSize)\n      {\n        if (512 > mCharToFreqOrder[order])\n          mFreqChars++;\n      }\n    }\n  };\n\n  //return confidence base on existing data\n  float GetConfidence() const;\n\n  //Reset analyser, clear any state\n  void      Reset(PRBool aIsPreferredLanguage)\n  {\n    mDone = PR_FALSE;\n    mTotalChars = 0;\n    mFreqChars = 0;\n    mDataThreshold = aIsPreferredLanguage ? 0 : MINIMUM_DATA_THRESHOLD;\n  };\n\n  //This function is for future extension. Caller can use this function to control\n  //analyser's behavior\n  static void SetOpion(){}\n\n  //It is not necessary to receive all data to draw conclusion. For charset detection,\n  // certain amount of data is enough\n  PRBool GotEnoughData() const { return (mTotalChars >= ENOUGH_DATA_THRESHOLD); }\n\nprotected:\n  //we do not handle character base on its original encoding string, but\n  //convert this encoding string to a number, here called order.\n  //This allow multiple encoding of a language to share one frequency table\n  virtual PRInt32 GetOrder(const char*) { return -1; }\n\n  //If this flag is set to PR_TRUE, detection is done and conclusion has been made\n  PRBool   mDone;\n\n  //The number of characters whose frequency order is less than 512\n  PRUint32 mFreqChars;\n\n  //Total character encounted.\n  PRUint32 mTotalChars;\n\n  //Number of hi-byte characters needed to trigger detection\n  PRUint32 mDataThreshold;\n\n  //Mapping table to get frequency order from char order (get from GetOrder())\n  const PRInt16  *mCharToFreqOrder;\n\n  //Size of above table\n  PRUint32 mTableSize;\n\n  //This is a constant value varies from language to language, it is used in\n  //calculating confidence. See my paper for further detail.\n  float    mTypicalDistributionRatio;\n};\n\n\nclass EUCTWDistributionAnalysis: public CharDistributionAnalysis\n{\npublic:\n  EUCTWDistributionAnalysis();\nprotected:\n\n  //for EUC-TW encoding, we are interested\n  //  first  byte range: 0xc4 -- 0xfe\n  //  second byte range: 0xa1 -- 0xfe\n  //no validation needed here. State machine has done that\n  PRInt32 GetOrder(const char* str) override\n  { if ((unsigned char)*str >= (unsigned char)0xc4)\n      return 94*((unsigned char)str[0]-(unsigned char)0xc4) + (unsigned char)str[1] - (unsigned char)0xa1;\n    else\n      return -1;\n  };\n};\n\n\nclass EUCKRDistributionAnalysis : public CharDistributionAnalysis\n{\npublic:\n  EUCKRDistributionAnalysis();\nprotected:\n  //for euc-KR encoding, we are interested\n  //  first  byte range: 0xb0 -- 0xfe\n  //  second byte range: 0xa1 -- 0xfe\n  //no validation needed here. State machine has done that\n  PRInt32 GetOrder(const char* str) override\n  { if ((unsigned char)*str >= (unsigned char)0xb0)\n      return 94*((unsigned char)str[0]-(unsigned char)0xb0) + (unsigned char)str[1] - (unsigned char)0xa1;\n    else\n      return -1;\n  };\n};\n\n//class GB2312DistributionAnalysis : public CharDistributionAnalysis\n//{\n//public:\n//  GB2312DistributionAnalysis();\n//protected:\n//  //for GB2312 encoding, we are interested \n//  //  first  byte range: 0xa1 -- 0xf7\n//  //  second byte range: 0xa1 -- 0xfe\n//\n//  //no validation needed here. State machine has done that\n//  PRInt32 GetOrder(const char* str)\n//  {\n//    if ((unsigned char)* str >= (unsigned char)0xa1 && (unsigned char)str[1] >= (unsigned char)0xa1)\n//      return 94 * ((unsigned char)str[0] - (unsigned char)0xa1) + (unsigned char)str[1] - (unsigned char)0xa1;\n//    else\n//      return -1;\n//  }\n//};\n\nclass GB18030DistributionAnalysis : public CharDistributionAnalysis\n{\npublic:\n  GB18030DistributionAnalysis();\nprotected:\n  //for GB18030 encoding, we are interested \n  //  first  byte range: 0xb0 -- 0xfe\n  //  second byte range: 0xa1 -- 0xfe\n  //no validation needed here. State machine has done that\n  PRInt32 GetOrder(const char* str) override\n  {\n    if ((unsigned char)* str >= (unsigned char)0xb0 && (unsigned char)str[1] >= (unsigned char)0xa1)\n      return 94 * ((unsigned char)str[0] - (unsigned char)0xb0) + (unsigned char)str[1] - (unsigned char)0xa1;\n    else\n      return -1;\n  }\n};\n\n\nclass Big5DistributionAnalysis : public CharDistributionAnalysis\n{\npublic:\n  Big5DistributionAnalysis();\nprotected:\n  //for big5 encoding, we are interested\n  //  first  byte range: 0xa4 -- 0xfe\n  //  second byte range: 0x40 -- 0x7e , 0xa1 -- 0xfe\n  //no validation needed here. State machine has done that\n  PRInt32 GetOrder(const char* str) override\n  { if ((unsigned char)*str >= (unsigned char)0xa4)\n      if ((unsigned char)str[1] >= (unsigned char)0xa1)\n        return 157*((unsigned char)str[0]-(unsigned char)0xa4) + (unsigned char)str[1] - (unsigned char)0xa1 +63;\n      else\n        return 157*((unsigned char)str[0]-(unsigned char)0xa4) + (unsigned char)str[1] - (unsigned char)0x40;\n    else\n      return -1;\n  };\n};\n\nclass SJISDistributionAnalysis : public CharDistributionAnalysis\n{\npublic:\n  SJISDistributionAnalysis();\nprotected:\n  //for sjis encoding, we are interested\n  //  first  byte range: 0x81 -- 0x9f , 0xe0 -- 0xfe\n  //  second byte range: 0x40 -- 0x7e,  0x81 -- oxfe\n  //no validation needed here. State machine has done that\n  PRInt32 GetOrder(const char* str) override\n  {\n    PRInt32 order;\n    if ((unsigned char)*str >= (unsigned char)0x81 && (unsigned char)*str <= (unsigned char)0x9f)\n      order = 188 * ((unsigned char)str[0]-(unsigned char)0x81);\n    else if ((unsigned char)*str >= (unsigned char)0xe0 && (unsigned char)*str <= (unsigned char)0xef)\n      order = 188 * ((unsigned char)str[0]-(unsigned char)0xe0 + 31);\n    else\n      return -1;\n    order += (unsigned char)*(str+1) - 0x40;\n    if ((unsigned char)str[1] > (unsigned char)0x7f)\n      order--;\n    return order;\n  };\n};\n\nclass EUCJPDistributionAnalysis : public CharDistributionAnalysis\n{\npublic:\n  EUCJPDistributionAnalysis();\nprotected:\n  //for euc-JP encoding, we are interested\n  //  first  byte range: 0xa0 -- 0xfe\n  //  second byte range: 0xa1 -- 0xfe\n  //no validation needed here. State machine has done that\n  PRInt32 GetOrder(const char* str) override\n  { if ((unsigned char)*str >= (unsigned char)0xa0)\n      return 94*((unsigned char)str[0]-(unsigned char)0xa1) + (unsigned char)str[1] - (unsigned char)0xa1;\n    else\n      return -1;\n  };\n};\n\n#endif //CharDistribution_h__\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/JpCntx.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"nscore.h\"\n#include \"JpCntx.h\"\n\n//This is hiragana 2-char sequence table, the number in each cell represents its frequency category\nconst PRUint8 jp2CharContext[83][83] = \n{ \n{ 0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,},\n{ 2,4,0,4,0,3,0,4,0,3,4,4,4,2,4,3,3,4,3,2,3,3,4,2,3,3,3,2,4,1,4,3,3,1,5,4,3,4,3,4,3,5,3,0,3,5,4,2,0,3,1,0,3,3,0,3,3,0,1,1,0,4,3,0,3,3,0,4,0,2,0,3,5,5,5,5,4,0,4,1,0,3,4,},\n{ 0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,},\n{ 0,4,0,5,0,5,0,4,0,4,5,4,4,3,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0,3,0,0,0,0,0,0,0,0,0,0,0,1,3,1,0,0,0,0,0,1,0,0,2,1,0,0,0,0,0,0,0,0,2,},\n{ 0,4,0,4,0,4,0,3,0,4,4,3,4,2,4,3,2,0,4,4,4,3,5,3,5,3,3,2,4,2,4,3,4,3,1,4,0,2,3,4,4,4,3,3,3,4,4,4,3,4,1,3,4,3,2,1,2,1,3,3,3,4,4,3,3,5,0,4,0,3,0,4,3,3,3,2,1,0,3,0,0,3,3,},\n{ 0,4,0,3,0,3,0,3,0,3,5,5,3,3,3,3,4,3,4,3,3,3,4,4,4,3,3,3,3,4,3,5,3,3,1,3,2,4,5,5,5,5,4,3,4,5,5,3,2,2,3,3,3,3,2,3,3,1,2,3,2,4,3,3,3,4,0,4,0,2,0,4,3,2,2,1,2,0,3,0,0,4,1,},\n};\n\n#define MINIMUM_DATA_THRESHOLD  4\n\nvoid JapaneseContextAnalysis::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  PRUint32 charLen;\n  PRInt32 order;\n  PRUint32 i;\n\n  if (mDone)\n    return;\n\n  //The buffer we got is byte oriented, and a character may span in more than one\n  //buffers. In case the last one or two byte in last buffer is not complete, we\n  //record how many byte needed to complete that character and skip these bytes here.\n  //We can choose to record those bytes as well and analyse the character once it\n  //is complete, but since a character will not make much difference, by simply skipping\n  //this character will simply our logic and improve performance.\n  for (i = mNeedToSkipCharNum; i < aLen; )\n  {\n    order = GetOrder(aBuf+i, &charLen);\n    i+= charLen;\n    if (i > aLen){\n      mNeedToSkipCharNum = i - aLen;\n      mLastCharOrder = -1;\n    }\n    else\n    {\n      if (order != -1 && mLastCharOrder != -1)\n      {\n        mTotalRel ++;\n        if (mTotalRel > MAX_REL_THRESHOLD)\n        {\n          mDone = PR_TRUE;\n          break;\n        }\n        mRelSample[(int)jp2CharContext[mLastCharOrder][order]]++;\n      }\n      mLastCharOrder = order;\n    }\n  }\n\n  return;\n}\n\nvoid JapaneseContextAnalysis::Reset(PRBool aIsPreferredLanguage)\n{\n  mTotalRel = 0;\n  for (PRUint32 i = 0; i < NUM_OF_CATEGORY; i++)\n    mRelSample[i] = 0;\n  mNeedToSkipCharNum = 0;\n  mLastCharOrder = -1;\n  mDone = PR_FALSE;\n  mDataThreshold = aIsPreferredLanguage ? 0 : MINIMUM_DATA_THRESHOLD;\n}\n#define DONT_KNOW (float)-1\n\nfloat  JapaneseContextAnalysis::GetConfidence() const\n{\n  //This is just one way to calculate confidence. It works well for me.\n  if (mTotalRel > mDataThreshold)\n    return ((float)(mTotalRel - mRelSample[0]))/mTotalRel;\n  else\n    return (float)DONT_KNOW;\n}\n\n\nPRInt32 SJISContextAnalysis::GetOrder(const char* str, PRUint32 *charLen)\n{\n  //find out current char's byte length\n  if (((unsigned char)*str >= (unsigned char)0x81 && (unsigned char)*str <= (unsigned char)0x9f) ||\n      ((unsigned char)*str >= (unsigned char)0xe0 && (unsigned char)*str <= (unsigned char)0xfc) )\n      *charLen = 2;\n  else\n      *charLen = 1;\n\n  //return its order if it is hiragana\n  if (*str == '\\202' &&\n        (unsigned char)*(str+1) >= (unsigned char)0x9f &&\n        (unsigned char)*(str+1) <= (unsigned char)0xf1)\n    return (unsigned char)*(str+1) - (unsigned char)0x9f;\n  return -1;\n}\n\nPRInt32 EUCJPContextAnalysis::GetOrder(const char* str, PRUint32 *charLen)\n{\n  //find out current char's byte length\n  if ((unsigned char)*str == (unsigned char)0x8e ||\n      ((unsigned char)*str >= (unsigned char)0xa1 &&\n       (unsigned char)*str <= (unsigned char)0xfe))\n      *charLen = 2;\n  else if ((unsigned char)*str == (unsigned char)0x8f)\n    *charLen = 3;\n  else\n    *charLen = 1;\n\n  //return its order if it is hiragana\n  if ((unsigned char)*str == (unsigned char)0xa4 &&\n      (unsigned char)*(str+1) >= (unsigned char)0xa1 &&\n      (unsigned char)*(str+1) <= (unsigned char)0xf3)\n     return (unsigned char)*(str+1) - (unsigned char)0xa1;\n  return -1;\n}\n\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/JpCntx.h",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef __JPCNTX_H__\n#define __JPCNTX_H__\n\n#define NUM_OF_CATEGORY 6\n\n#include \"nscore.h\"\n\n#define ENOUGH_REL_THRESHOLD  100\n#define MAX_REL_THRESHOLD     1000\n\n//hiragana frequency category table\nextern const PRUint8 jp2CharContext[83][83];\n\nclass JapaneseContextAnalysis\n{\npublic:\n  JapaneseContextAnalysis() {Reset(PR_FALSE);}\n\n  void HandleData(const char* aBuf, PRUint32 aLen);\n\n  void HandleOneChar(const char* aStr, PRUint32 aCharLen)\n  {\n    PRInt32 order;\n\n    //if we received enough data, stop here\n    if (mTotalRel > MAX_REL_THRESHOLD)   mDone = PR_TRUE;\n    if (mDone)       return;\n\n    //Only 2-bytes characters are of our interest\n    order = (aCharLen == 2) ? GetOrder(aStr) : -1;\n    if (order != -1 && mLastCharOrder != -1)\n    {\n      mTotalRel++;\n      //count this sequence to its category counter\n      mRelSample[(int)jp2CharContext[mLastCharOrder][order]]++;\n    }\n    mLastCharOrder = order;\n  };\n\n  float GetConfidence(void) const;\n  void      Reset(PRBool aIsPreferredLanguage);\n  static void SetOpion(){}\n  PRBool GotEnoughData() const {return mTotalRel > ENOUGH_REL_THRESHOLD;}\n\nprotected:\n  virtual PRInt32 GetOrder(const char* str, PRUint32 *charLen) = 0;\n  virtual PRInt32 GetOrder(const char* str) = 0;\n\n  //category counters, each integer counts sequences in its category\n  PRUint32 mRelSample[NUM_OF_CATEGORY];\n\n  //total sequence received\n  PRUint32 mTotalRel;\n\n  //Number of sequences needed to trigger detection\n  PRUint32 mDataThreshold;\n\n  //The order of previous char\n  PRInt32  mLastCharOrder;\n\n  //if last byte in current buffer is not the last byte of a character, we\n  //need to know how many byte to skip in next buffer.\n  PRUint32 mNeedToSkipCharNum;\n\n  //If this flag is set to PR_TRUE, detection is done and conclusion has been made\n  PRBool   mDone;\n};\n\n\nclass SJISContextAnalysis : public JapaneseContextAnalysis\n{\n  //SJISContextAnalysis(){};\nprotected:\n  PRInt32 GetOrder(const char* str, PRUint32 *charLen) override;\n\n  PRInt32 GetOrder(const char* str) override\n  {\n    //We only interested in Hiragana, so first byte is '\\202'\n    if (*str == '\\202' &&\n          (unsigned char)*(str+1) >= (unsigned char)0x9f &&\n          (unsigned char)*(str+1) <= (unsigned char)0xf1)\n      return (unsigned char)*(str+1) - (unsigned char)0x9f;\n    return -1;\n  };\n};\n\nclass EUCJPContextAnalysis : public JapaneseContextAnalysis\n{\nprotected:\n  PRInt32 GetOrder(const char* str, PRUint32 *charLen) override;\n  PRInt32 GetOrder(const char* str) override\n    //We only interested in Hiragana, so first byte is '\\244'\n  {\n    if (*str == '\\244' &&\n          (unsigned char)*(str+1) >= (unsigned char)0xa1 &&\n          (unsigned char)*(str+1) <= (unsigned char)0xf3)\n      return (unsigned char)*(str+1) - (unsigned char)0xa1;\n    return -1;\n  }\n};\n\n#endif /* __JPCNTX_H__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangAfricaansModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Africaans *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2019-03-05 22:07:18.720938\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Windows_1252_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  3, 16, 21,  8,  0, 20, 10, 18,  1, 22, 11,  9, 14,  2,  6, /* 4X */\n   17, 29,  5,  4,  7, 13, 12, 15, 27, 19, 25,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  3, 16, 21,  8,  0, 20, 10, 18,  1, 22, 11,  9, 14,  2,  6, /* 6X */\n   17, 29,  5,  4,  7, 13, 12, 15, 27, 19, 25,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM, 53,SYM,SYM,SYM,SYM,SYM,SYM, 32,SYM, 54,ILL, 37,ILL, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 32,SYM, 55,ILL, 37, 56, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 57,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   48, 28, 45, 44, 43, 51, 42, 39, 35, 26, 24, 23, 52, 38, 49, 30, /* CX */\n   58, 59, 41, 31, 33, 60, 40,SYM, 36, 50, 61, 47, 34, 62, 63, 46, /* DX */\n   48, 28, 45, 44, 43, 51, 42, 39, 35, 26, 24, 23, 52, 38, 49, 30, /* EX */\n   64, 65, 41, 31, 33, 66, 40,SYM, 36, 50, 67, 47, 34, 68, 69, 70, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_1_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  3, 16, 21,  8,  0, 20, 10, 18,  1, 22, 11,  9, 14,  2,  6, /* 4X */\n   17, 29,  5,  4,  7, 13, 12, 15, 27, 19, 25,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  3, 16, 21,  8,  0, 20, 10, 18,  1, 22, 11,  9, 14,  2,  6, /* 6X */\n   17, 29,  5,  4,  7, 13, 12, 15, 27, 19, 25,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 88,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   48, 28, 45, 44, 43, 51, 42, 39, 35, 26, 24, 23, 52, 38, 49, 30, /* CX */\n   89, 90, 41, 31, 33, 91, 40,SYM, 36, 50, 92, 47, 34, 93, 94, 46, /* DX */\n   48, 28, 45, 44, 43, 51, 42, 39, 35, 26, 24, 23, 52, 38, 49, 30, /* EX */\n   95, 96, 41, 31, 33, 97, 40,SYM, 36, 50, 98, 47, 34, 99,100,101, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_9_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  3, 16, 21,  8,  0, 20, 10, 18,  1, 22, 11,  9, 14,  2,  6, /* 4X */\n   17, 29,  5,  4,  7, 13, 12, 15, 27, 19, 25,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  3, 16, 21,  8,  0, 20, 10, 18,  1, 22, 11,  9, 14,  2,  6, /* 6X */\n   17, 29,  5,  4,  7, 13, 12, 15, 27, 19, 25,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM,102,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   48, 28, 45, 44, 43, 51, 42, 39, 35, 26, 24, 23, 52, 38, 49, 30, /* CX */\n  103,104, 41, 31, 33,105, 40,SYM, 36, 50,106, 47, 34,107,108, 46, /* DX */\n   48, 28, 45, 44, 43, 51, 42, 39, 35, 26, 24, 23, 52, 38, 49, 30, /* EX */\n  109,110, 41, 31, 33,111, 40,SYM, 36, 50,112, 47, 34,113,114,115, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_15_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  3, 16, 21,  8,  0, 20, 10, 18,  1, 22, 11,  9, 14,  2,  6, /* 4X */\n   17, 29,  5,  4,  7, 13, 12, 15, 27, 19, 25,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  3, 16, 21,  8,  0, 20, 10, 18,  1, 22, 11,  9, 14,  2,  6, /* 6X */\n   17, 29,  5,  4,  7, 13, 12, 15, 27, 19, 25,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM, 32,SYM, 32,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM, 37, 71,SYM,SYM, 37,SYM,SYM,SYM, 72, 73, 74,SYM, /* BX */\n   48, 28, 45, 44, 43, 51, 42, 39, 35, 26, 24, 23, 52, 38, 49, 30, /* CX */\n   75, 76, 41, 31, 33, 77, 40,SYM, 36, 50, 78, 47, 34, 79, 80, 46, /* DX */\n   48, 28, 45, 44, 43, 51, 42, 39, 35, 26, 24, 23, 52, 38, 49, 30, /* EX */\n   81, 82, 41, 31, 33, 83, 40,SYM, 36, 50, 84, 47, 34, 85, 86, 87, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 825\n * First 512 sequences: 0.9986034713711631\n * Next 512 sequences (512-1024): 0.0013965286288368912\n * Rest: -1.1709383462843448e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 AfricaansLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,\n   3,0,3,0,2,3,2,2,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,\n   3,3,3,0,3,2,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3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angModel,\n  50,\n  (float)0.9986034713711631,\n  PR_TRUE,\n  \"WINDOWS-1252\"\n};\n\nconst SequenceModel Iso_8859_1AfricaansModel =\n{\n  Iso_8859_1_CharToOrderMap,\n  AfricaansLangModel,\n  50,\n  (float)0.9986034713711631,\n  PR_TRUE,\n  \"ISO-8859-1\"\n};\n\nconst SequenceModel Iso_8859_9AfricaansModel =\n{\n  Iso_8859_9_CharToOrderMap,\n  AfricaansLangModel,\n  50,\n  (float)0.9986034713711631,\n  PR_TRUE,\n  \"ISO-8859-9\"\n};\n\nconst SequenceModel Iso_8859_15AfricaansModel =\n{\n  Iso_8859_15_CharToOrderMap,\n  AfricaansLangModel,\n  50,\n  (float)0.9986034713711631,\n  PR_TRUE,\n  \"ISO-8859-15\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangArabicModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Arabic *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2015-12-13 18:33:58.848027\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_6_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM, 52, 72, 61, 68, 74, 69, 59, 78, 60, 90, 86, 67, 65, 71, 75, /* 4X */\n   64, 85, 76, 55, 57, 79, 81, 70, 82, 87, 91,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM, 37, 58, 49, 47, 38, 54, 66, 46, 39, 88, 63, 45, 51, 43, 40, /* 6X */\n   62, 89, 42, 44, 41, 50, 77, 73, 83, 56, 80,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,ILL,ILL,ILL,SYM,ILL,ILL,ILL,ILL,ILL,ILL,ILL,SYM,SYM,ILL,ILL, /* AX */\n  ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,SYM,ILL,ILL,ILL,SYM, /* BX */\n  ILL, 32, 34, 15, 35, 22, 31,  0,  9,  8,  7, 27, 19, 18, 25, 11, /* CX */\n   30,  5, 26, 12, 21, 23, 28,SYM, 33, 10, 29,ILL,ILL,ILL,ILL,ILL, /* DX */\n   36, 13, 14, 17,  1,  3,  6, 16,  4, 24,  2,SYM,SYM,SYM,SYM,SYM, /* EX */\n  SYM,SYM,SYM,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Windows_1256_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM, 52, 72, 61, 68, 74, 69, 59, 78, 60, 90, 86, 67, 65, 71, 75, /* 4X */\n   64, 85, 76, 55, 57, 79, 81, 70, 82, 87, 91,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM, 37, 58, 49, 47, 38, 54, 66, 46, 39, 88, 63, 45, 51, 43, 40, /* 6X */\n   62, 89, 42, 44, 41, 50, 77, 73, 83, 56, 80,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM, 48,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 95,SYM, 96, 92, 97, 98, /* 8X */\n   53,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 84,SYM, 99,SYM,100,SYM,SYM,101, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,102,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n  103, 32, 34, 15, 35, 22, 31,  0,  9,  8,  7, 27, 19, 18, 25, 11, /* CX */\n   30,  5, 26, 12, 21, 23, 28,SYM, 20, 33, 10, 29, 36, 13, 14, 17, /* DX */\n  104,  1, 93,  3,  6, 16,  4,105,106, 94,107,108, 24,  2,109,110, /* EX */\n  SYM,SYM,SYM,SYM,111,SYM,SYM,SYM,SYM,112,SYM,113,114,SYM,SYM,115, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 1479\n * First 512 sequences: 0.9696025116913417\n * Next 512 sequences (512-1024): 0.029166911858880054\n * Rest: 0.0012305764497782395\n * Negative sequences: TODO\n */\nconstexpr PRUint8 ArabicLangModel[] =\n{\n  2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,3,3,3,3,3,1,3,1,3,3,3,3,2,2,3,\n   3,2,1,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,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0,0,0,0,0,0,0,0,\n   0,0,0,0,0,2,1,0,1,0,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,0,\n  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Iso_8859_6ArabicModel =\n{\n  Iso_8859_6_CharToOrderMap,\n  ArabicLangModel,\n  64,\n  (float)0.9696025116913417,\n  PR_FALSE,\n  \"ISO-8859-6\"\n};\n\nconst SequenceModel Windows_1256ArabicModel =\n{\n  Windows_1256_CharToOrderMap,\n  ArabicLangModel,\n  64,\n  (float)0.9696025116913417,\n  PR_FALSE,\n  \"WINDOWS-1256\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangBelarusianModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Belarusian *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2019-03-05 18:36:38.571630\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Windows_1251_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM, 35, 48, 44, 47, 34, 56, 51, 54, 31, 57, 50, 42, 46, 38, 37, /* 4X */\n   49, 60, 40, 36, 39, 43, 45, 52, 41, 53, 55,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM, 35, 48, 44, 47, 34, 56, 51, 54, 31, 57, 50, 42, 46, 38, 37, /* 6X */\n   49, 60, 40, 36, 39, 43, 45, 52, 41, 53, 55,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM, 64,SYM, 65,SYM,SYM,SYM,SYM,SYM,SYM, 66,SYM, 67, 68, 69, 70, /* 8X */\n   71,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM, 72,SYM, 73, 74, 75, 76, /* 9X */\n  CTR, 20, 20, 77,SYM, 62,SYM,SYM, 32,SYM, 63,SYM,SYM,CTR,SYM, 61, /* AX */\n  SYM,SYM,  2,  2, 62, 78,SYM,SYM, 32,SYM, 63,SYM, 79, 80, 81, 61, /* BX */\n    0, 21, 13, 19, 11,  8, 28, 17, 33, 24,  6,  7, 14,  1, 12, 16, /* CX */\n    3,  4,  9, 15, 30, 25, 18, 22, 27, 59, 58,  5, 26, 23, 29, 10, /* DX */\n    0, 21, 13, 19, 11,  8, 28, 17, 33, 24,  6,  7, 14,  1, 12, 16, /* EX */\n    3,  4,  9, 15, 30, 25, 18, 22, 27, 59, 58,  5, 26, 23, 29, 10, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 1419\n * First 512 sequences: 0.9748335015136226\n * Next 512 sequences (512-1024): 0.023605173837262638\n * Rest: 0.0015613246491147821\n * Negative sequences: TODO\n */\nconstexpr PRUint8 BelarusianLangModel[] =\n{\n  3,3,3,3,3,0,3,3,3,3,3,3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,0,3,3,3,\n   3,1,3,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n  3,3,3,2,3,3,3,2,3,3,3,3,3,2,1,3,2,2,3,3,0,2,3,2,0,2,3,3,2,3,\n   3,2,3,3,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  2,3,3,3,3,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0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,\n   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n   0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n   0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Windows_1251BelarusianModel =\n{\n  Windows_1251_CharToOrderMap,\n  BelarusianLangModel,\n  61,\n  (float)0.9748335015136226,\n  PR_TRUE,\n  \"WINDOWS-1251\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangBulgarianModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n/****************************************************************\nCTR: Control characters that usually does not exist in any text\nRET: Carriage/Return\nSYM: symbol (punctuation) that does not belong to word\nNUM: 0 - 9\n\n*****************************************************************/\n\n//Character Mapping Table:\n//this talbe is modified base on win1251BulgarianCharToOrderMap, so \n//only number <64 is sure valid\n\nconstexpr unsigned char Latin5_BulgarianCharToOrderMap[] =\n{\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR,  //00\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,  //10\nSYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,  //20\nNUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM,  //30\nSYM, 77, 90, 99,100, 72,109,107,101, 79,185, 81,102, 76, 94, 82,  //40\n110,186,108, 91, 74,119, 84, 96,111,187,115,SYM,SYM,SYM,SYM,SYM,  //50\nSYM, 65, 69, 70, 66, 63, 68,112,103, 92,194,104, 95, 86, 87, 71,  //60\n116,195, 85, 93, 97,113,196,197,198,199,200,SYM,SYM,SYM,SYM,SYM,  //70\n194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,  //80\n210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,  //90\n 81,226,227,228,229,230,105,231,232,233,234,235,236, 45,237,238,  //a0\n 31, 32, 35, 43, 37, 44, 55, 47, 40, 59, 33, 46, 38, 36, 41, 30,  //b0\n 39, 28, 34, 51, 48, 49, 53, 50, 54, 57, 61,239, 67,240, 60, 56,  //c0\n  1, 18,  9, 20, 11,  3, 23, 15,  2, 26, 12, 10, 14,  6,  4, 13,  //d0\n  7,  8,  5, 19, 29, 25, 22, 21, 27, 24, 17, 75, 52,241, 42, 16,  //e0\n 62,242,243,244, 58,245, 98,246,247,248,249,250,251, 91,NUM,SYM,  //f0\n};\n\nconstexpr unsigned char win1251BulgarianCharToOrderMap[] =\n{\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR,  //00\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,  //10\nSYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,  //20\nNUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM,  //30\nSYM, 77, 90, 99,100, 72,109,107,101, 79,185, 81,102, 76, 94, 82,  //40\n110,186,108, 91, 74,119, 84, 96,111,187,115,SYM,SYM,SYM,SYM,SYM,  //50\nSYM, 65, 69, 70, 66, 63, 68,112,103, 92,194,104, 95, 86, 87, 71,  //60\n116,195, 85, 93, 97,113,196,197,198,199,200,SYM,SYM,SYM,SYM,SYM,  //70\n206,207,208,209,210,211,212,213,120,214,215,216,217,218,219,220,  //80\n221, 78, 64, 83,121, 98,117,105,ILL,223,224,225,226,227,228,229,  //90\n 88,230,231,232,233,122, 89,106,234,235,236,237,238, 45,239,240,  //a0\n 73, 80,118,114,241,242,243,244,245, 62, 58,246,247,248,249,250,  //b0\n 31, 32, 35, 43, 37, 44, 55, 47, 40, 59, 33, 46, 38, 36, 41, 30,  //c0\n 39, 28, 34, 51, 48, 49, 53, 50, 54, 57, 61,251, 67,NUM, 60, 56,  //d0\n  1, 18,  9, 20, 11,  3, 23, 15,  2, 26, 12, 10, 14,  6,  4, 13,  //e0\n  7,  8,  5, 19, 29, 25, 22, 21, 27, 24, 17, 75, 52,SYM, 42, 16,  //f0\n};\n\n//Model Table: \n//total sequences: 100%\n//first 512 sequences: 96.9392%\n//first 1024 sequences:3.0618%\n//rest  sequences:     0.2992%\n//negative sequences:  0.0020% \nconstexpr PRUint8 BulgarianLangModel[] = \n{\n0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,3,3,3,3,3,\n3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,2,2,3,2,2,1,2,2,\n3,1,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,3,3,3,0,3,0,1,\n0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,3,3,0,3,1,0,\n0,1,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,2,3,3,3,3,3,3,3,3,0,3,0,0,\n0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,1,3,2,3,3,3,3,3,3,3,3,0,3,0,0,\n0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,1,3,3,3,3,2,2,2,1,1,2,0,1,0,1,0,0,\n0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0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,0,0,1,0,2,0,0,2,0,1,0,0,1,0,0,1,\n1,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,\n1,1,1,1,1,1,1,2,0,0,0,0,0,0,2,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,\n2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,1,1,0,1,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,\n};\n\nconst SequenceModel Latin5BulgarianModel = \n{\n  Latin5_BulgarianCharToOrderMap,\n  BulgarianLangModel,\n  64,\n  (float)0.969392,\n  PR_FALSE,\n  \"ISO-8859-5\"\n};\n\nconst SequenceModel Win1251BulgarianModel = \n{\n  win1251BulgarianCharToOrderMap,\n  BulgarianLangModel,\n  64,\n  (float)0.969392,\n  PR_FALSE,\n  \"WINDOWS-1251\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangCroatianModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Croatian *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-25 23:50:27.590137\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Windows_1250_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 20, 15,  2, 22, 17, 21,  1,  7,  9, 10, 12,  4,  3, /* 4X */\n   14, 30,  6,  8,  5, 11, 13, 28, 29, 27, 16,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 20, 15,  2, 22, 17, 21,  1,  7,  9, 10, 12,  4,  3, /* 6X */\n   14, 30,  6,  8,  5, 11, 13, 28, 29, 27, 16,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM,ILL,SYM,SYM,SYM,SYM,ILL,SYM, 23,SYM, 49, 50, 24, 51, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM, 23,SYM, 52, 53, 24, 54, /* 9X */\n  SYM,SYM,SYM, 40,SYM, 55,SYM,SYM,SYM,SYM, 56,SYM,SYM,SYM,SYM, 57, /* AX */\n  SYM,SYM,SYM, 40,SYM,SYM,SYM,SYM,SYM, 58, 59,SYM, 60,SYM, 61, 62, /* BX */\n   63, 41, 43, 64, 36, 65, 25, 39, 18, 31, 66, 47, 67, 68, 69, 70, /* CX */\n   26, 71, 72, 44, 73, 74, 32,SYM, 75, 76, 48, 77, 33, 78, 79, 80, /* DX */\n   81, 41, 43, 82, 36, 83, 25, 39, 18, 31, 84, 47, 85, 86, 87, 88, /* EX */\n   26, 89, 90, 44, 91, 92, 32,SYM, 93, 94, 48, 95, 33, 96, 97,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_2_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 20, 15,  2, 22, 17, 21,  1,  7,  9, 10, 12,  4,  3, /* 4X */\n   14, 30,  6,  8,  5, 11, 13, 28, 29, 27, 16,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 20, 15,  2, 22, 17, 21,  1,  7,  9, 10, 12,  4,  3, /* 6X */\n   14, 30,  6,  8,  5, 11, 13, 28, 29, 27, 16,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 98,SYM, 40,SYM, 99,100,SYM,SYM, 23,101,102,103,SYM, 24,104, /* AX */\n  SYM,105,SYM, 40,SYM,106,107,SYM,SYM, 23,108,109,110,SYM, 24,111, /* BX */\n  112, 41, 43,113, 36,114, 25, 39, 18, 31,115, 47,116,117,118,119, /* CX */\n   26,120,121, 44,122,123, 32,SYM,124,125, 48,126, 33,127,128,129, /* DX */\n  130, 41, 43,131, 36,132, 25, 39, 18, 31,133, 47,134,135,136,137, /* EX */\n   26,138,139, 44,140,141, 32,SYM,142,143, 48,144, 33,145,146,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_16_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 20, 15,  2, 22, 17, 21,  1,  7,  9, 10, 12,  4,  3, /* 4X */\n   14, 30,  6,  8,  5, 11, 13, 28, 29, 27, 16,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 20, 15,  2, 22, 17, 21,  1,  7,  9, 10, 12,  4,  3, /* 6X */\n   14, 30,  6,  8,  5, 11, 13, 28, 29, 27, 16,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,147,148, 40,SYM,SYM, 23,SYM, 23,SYM,149,SYM,150,SYM,151,152, /* AX */\n  SYM,SYM, 18, 40, 24,SYM,SYM,SYM, 24, 18,153,SYM, 45, 45,154,155, /* BX */\n   46, 41, 43,156, 36, 25,157, 39, 35, 31, 42, 47,158,159,160,161, /* CX */\n   26,162,163, 44,164,165, 32,166,167,168, 48,169, 33,170,171,172, /* DX */\n   46, 41, 43,173, 36, 25,174, 39, 35, 31, 42, 47,175,176,177,178, /* EX */\n   26,179,180, 44,181,182, 32,183,184,185, 48,186, 33,187,188,189, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Mac_Centraleurope_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 20, 15,  2, 22, 17, 21,  1,  7,  9, 10, 12,  4,  3, /* 4X */\n   14, 30,  6,  8,  5, 11, 13, 28, 29, 27, 16,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 20, 15,  2, 22, 17, 21,  1,  7,  9, 10, 12,  4,  3, /* 6X */\n   14, 30,  6,  8,  5, 11, 13, 28, 29, 27, 16,SYM,SYM,SYM,SYM,CTR, /* 7X */\n   36,190,191, 31,192, 32, 33, 41,193, 18, 36, 18, 25, 25, 31,194, /* 8X */\n  195,196,197,198,199,200,201, 44,202,203, 32, 37, 48,204,205, 33, /* 9X */\n  SYM,SYM,206,SYM,SYM,SYM,SYM,207,SYM,SYM,SYM,208,SYM,SYM,209,210, /* AX */\n  211,212,SYM,SYM,213,214,SYM,SYM, 40,215,216,217,218,219,220,221, /* BX */\n  222,223,SYM,SYM,224,225,SYM,SYM,SYM,SYM,SYM,226,227, 37,228, 38, /* CX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 38,229,230,231,SYM,SYM,232,233, /* DX */\n  234, 23,SYM,SYM, 23,235,236, 41,237,238,239, 24, 24,240, 44,241, /* EX */\n  242,243, 48,244,245,246,247,248,249,249,249,249, 40,249,249,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_13_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 20, 15,  2, 22, 17, 21,  1,  7,  9, 10, 12,  4,  3, /* 4X */\n   14, 30,  6,  8,  5, 11, 13, 28, 29, 27, 16,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 20, 15,  2, 22, 17, 21,  1,  7,  9, 10, 12,  4,  3, /* 6X */\n   14, 30,  6,  8,  5, 11, 13, 28, 29, 27, 16,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 34,SYM,249,SYM,SYM,SYM,SYM,249, /* AX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 34,SYM,249,SYM,SYM,SYM,SYM,249, /* BX */\n  249,249,249, 25, 36,249,249,249, 18, 31,249,249,249,249,249,249, /* CX */\n   23,249,249, 44, 38, 37, 32,SYM,249, 40,249,249, 33,249, 24,249, /* DX */\n  249,249,249, 25, 36,249,249,249, 18, 31,249,249,249,249,249,249, /* EX */\n   23,249,249, 44, 38, 37, 32,SYM,249, 40,249,249, 33,249, 24,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Ibm852_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 20, 15,  2, 22, 17, 21,  1,  7,  9, 10, 12,  4,  3, /* 4X */\n   14, 30,  6,  8,  5, 11, 13, 28, 29, 27, 16,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 20, 15,  2, 22, 17, 21,  1,  7,  9, 10, 12,  4,  3, /* 6X */\n   14, 30,  6,  8,  5, 11, 13, 28, 29, 27, 16,SYM,SYM,SYM,SYM,CTR, /* 7X */\n   39, 33, 31, 43, 36,249, 25, 39, 40, 47,249,249,249,249, 36, 25, /* 8X */\n   31,249,249,249, 32,249,249,249,249, 32, 33,249,249, 40,SYM, 18, /* 9X */\n   41,249, 44, 48,249,249, 24, 24,249,249,SYM,249, 18,249,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 41, 43,249,249,SYM,SYM,SYM,SYM,249,249,SYM, /* BX */\n  SYM,SYM,SYM,SYM,SYM,SYM,249,249,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* CX */\n   26, 26,249, 47,249,249,249,249,249,SYM,SYM,SYM,SYM,249,249,SYM, /* DX */\n   44,249,249,249,249,249, 23, 23,249, 48,249,249,249,249,249,SYM, /* EX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,249,249,249,SYM,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 712\n * First 512 sequences: 0.9989731099787131\n * Next 512 sequences (512-1024): 0.0010268900212868262\n * Rest: 3.7513395167998453e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 CroatianLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,0,2,2,2,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,0,0,3,3,2,0,0,0,0,3,2,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,0,0,\n  3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,2,3,0,3,3,2,0,2,3,0,0,0,0,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,3,3,3,3,0,0,0,0,3,2,0,2,\n  3,3,3,3,3,3,3,3,3,0,3,3,3,3,2,2,0,3,3,0,3,2,0,3,0,2,0,2,3,0,0,\n  3,3,3,3,3,3,0,3,3,3,3,3,3,3,2,3,3,3,0,3,3,3,3,2,2,0,0,3,0,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,2,2,0,\n  3,3,3,3,3,2,3,3,3,3,3,3,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2,3,2,2,2,0,0,3,0,0,0,0,0,0,0,2,2,3,2,0,0,0,0,2,2,0,0,\n  2,3,2,0,0,0,2,0,0,0,0,2,0,2,3,0,0,2,0,0,0,0,2,0,0,0,0,0,3,0,0,\n  0,3,2,0,0,0,2,0,0,0,0,3,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,\n};\n\n\nconst SequenceModel Windows_1250CroatianModel =\n{\n  Windows_1250_CharToOrderMap,\n  CroatianLangModel,\n  31,\n  (float)0.9989731099787131,\n  PR_TRUE,\n  \"WINDOWS-1250\"\n};\n\nconst SequenceModel Iso_8859_2CroatianModel =\n{\n  Iso_8859_2_CharToOrderMap,\n  CroatianLangModel,\n  31,\n  (float)0.9989731099787131,\n  PR_TRUE,\n  \"ISO-8859-2\"\n};\n\nconst SequenceModel Iso_8859_16CroatianModel =\n{\n  Iso_8859_16_CharToOrderMap,\n  CroatianLangModel,\n  31,\n  (float)0.9989731099787131,\n  PR_TRUE,\n  \"ISO-8859-16\"\n};\n\nconst SequenceModel Mac_CentraleuropeCroatianModel =\n{\n  Mac_Centraleurope_CharToOrderMap,\n  CroatianLangModel,\n  31,\n  (float)0.9989731099787131,\n  PR_TRUE,\n  \"MAC-CENTRALEUROPE\"\n};\n\nconst SequenceModel Iso_8859_13CroatianModel =\n{\n  Iso_8859_13_CharToOrderMap,\n  CroatianLangModel,\n  31,\n  (float)0.9989731099787131,\n  PR_TRUE,\n  \"ISO-8859-13\"\n};\n\nconst SequenceModel Ibm852CroatianModel =\n{\n  Ibm852_CharToOrderMap,\n  CroatianLangModel,\n  31,\n  (float)0.9989731099787131,\n  PR_TRUE,\n  \"IBM852\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangCzechModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Czech *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-21 03:28:11.733089\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Windows_1250_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  3, 22, 14, 15,  1, 30, 32, 17,  4, 21, 12, 10, 16,  2,  0, /* 4X */\n    8, 40,  9,  6,  5, 13,  7, 36, 34, 20, 19,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  3, 22, 14, 15,  1, 30, 32, 17,  4, 21, 12, 10, 16,  2,  0, /* 6X */\n    8, 40,  9,  6,  5, 13,  7, 36, 34, 20, 19,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM,ILL,SYM,SYM,SYM,SYM,ILL,SYM, 29,SYM, 46, 38, 26, 47, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM, 29,SYM, 46, 38, 26, 48, /* 9X */\n  SYM,SYM,SYM, 49,SYM, 50,SYM,SYM,SYM,SYM, 51,SYM,SYM,SYM,SYM, 52, /* AX */\n  SYM,SYM,SYM, 53,SYM,SYM,SYM,SYM,SYM, 54, 55,SYM, 45,SYM, 45, 56, /* BX */\n   57, 18, 58, 59, 42, 60, 61, 62, 25, 24, 63, 64, 23, 11, 65, 39, /* CX */\n   66, 67, 35, 37, 68, 69, 41,SYM, 27, 31, 33, 70, 43, 28, 71, 72, /* DX */\n   73, 18, 74, 75, 42, 76, 77, 78, 25, 24, 79, 80, 23, 11, 81, 39, /* EX */\n   82, 83, 35, 37, 84, 85, 41,SYM, 27, 31, 33, 86, 43, 28, 87,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Mac_Centraleurope_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  3, 22, 14, 15,  1, 30, 32, 17,  4, 21, 12, 10, 16,  2,  0, /* 4X */\n    8, 40,  9,  6,  5, 13,  7, 36, 34, 20, 19,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  3, 22, 14, 15,  1, 30, 32, 17,  4, 21, 12, 10, 16,  2,  0, /* 6X */\n    8, 40,  9,  6,  5, 13,  7, 36, 34, 20, 19,SYM,SYM,SYM,SYM,CTR, /* 7X */\n   42, 88, 89, 24, 90, 41, 43, 18, 91, 25, 42, 25, 92, 93, 24, 94, /* 8X */\n   95, 39, 11, 39, 44, 44, 96, 37, 97, 98, 41, 99, 33, 23, 23, 43, /* 9X */\n  SYM,SYM,100,SYM,SYM,SYM,SYM,101,SYM,SYM,SYM,102,SYM,SYM,103,104, /* AX */\n  105,106,SYM,SYM,107,108,SYM,SYM,109,110,111, 45, 45,112,113,114, /* BX */\n  115,116,SYM,SYM,117, 35,SYM,SYM,SYM,SYM,SYM, 35,118,119,120,121, /* CX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,122,123,124, 27,SYM,SYM, 27,125, /* DX */\n  126, 29,SYM,SYM, 29, 46, 46, 18, 38, 38, 11, 26, 26,127, 37,128, /* EX */\n  129, 31, 33, 31,130,131,132,133, 28, 28,134,135,136,137,138,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Ibm852_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  3, 22, 14, 15,  1, 30, 32, 17,  4, 21, 12, 10, 16,  2,  0, /* 4X */\n    8, 40,  9,  6,  5, 13,  7, 36, 34, 20, 19,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  3, 22, 14, 15,  1, 30, 32, 17,  4, 21, 12, 10, 16,  2,  0, /* 6X */\n    8, 40,  9,  6,  5, 13,  7, 36, 34, 20, 19,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  139, 43, 24,140, 42, 31,141,142,143,144,145,146,147,148, 42,149, /* 8X */\n   24,150,151,152, 41, 45, 45, 46, 46, 41, 43, 38, 38,153,SYM, 25, /* 9X */\n   18, 11, 37, 33,154,155, 26, 26,156,157,SYM,158, 25,159,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 18,160, 23,161,SYM,SYM,SYM,SYM,162,163,SYM, /* BX */\n  SYM,SYM,SYM,SYM,SYM,SYM,164,165,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* CX */\n  166,167, 39,168, 39, 35, 11,169, 23,SYM,SYM,SYM,SYM,170, 31,SYM, /* DX */\n   37,171,172,173,174, 35, 29, 29,175, 33,176,177, 28, 28,178,SYM, /* EX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,179, 27, 27,SYM,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_2_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  3, 22, 14, 15,  1, 30, 32, 17,  4, 21, 12, 10, 16,  2,  0, /* 4X */\n    8, 40,  9,  6,  5, 13,  7, 36, 34, 20, 19,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  3, 22, 14, 15,  1, 30, 32, 17,  4, 21, 12, 10, 16,  2,  0, /* 6X */\n    8, 40,  9,  6,  5, 13,  7, 36, 34, 20, 19,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,180,SYM,181,SYM, 45, 46,SYM,SYM, 29,182, 38,183,SYM, 26,184, /* AX */\n  SYM,185,SYM,186,SYM, 45, 46,SYM,SYM, 29,187, 38,188,SYM, 26,189, /* BX */\n  190, 18,191,192, 42,193,194,195, 25, 24,196,197, 23, 11,198, 39, /* CX */\n  199,200, 35, 37,201,202, 41,SYM, 27, 31, 33,203, 43, 28,204,205, /* DX */\n  206, 18,207,208, 42,209,210,211, 25, 24,212,213, 23, 11,214, 39, /* EX */\n  215,216, 35, 37,217,218, 41,SYM, 27, 31, 33,219, 43, 28,220,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 1025\n * First 512 sequences: 0.9786035192432675\n * Next 512 sequences (512-1024): 0.02139445610866691\n * Rest: 2.0246480655940202e-06\n * Negative sequences: TODO\n */\nconstexpr PRUint8 CzechLangModel[] =\n{\n  2,2,3,2,3,3,3,3,3,3,3,2,3,3,3,3,3,3,2,3,\n   2,3,3,0,0,3,3,3,0,2,3,0,3,0,3,2,2,0,2,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,3,2,3,\n   2,3,3,0,0,3,3,3,0,3,3,2,3,2,3,2,2,2,2,2,2,\n  3,3,3,3,3,3,3,2,0,2,3,3,3,3,3,3,2,3,3,3,\n   3,2,2,3,3,2,2,0,3,2,3,3,3,0,2,0,0,2,0,0,2,\n  3,3,3,2,2,3,3,3,3,3,3,0,3,3,3,3,3,3,0,3,\n   3,3,3,0,0,3,3,3,0,3,3,0,3,0,3,2,2,0,2,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,\n   0,2,3,0,2,3,3,2,0,3,3,0,3,0,2,2,2,2,2,0,2,\n  3,3,3,3,3,2,2,3,2,3,3,3,3,3,2,2,2,3,3,3,\n   3,2,2,3,3,2,0,3,3,3,0,3,2,0,0,2,2,2,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,2,\n   3,2,3,0,2,2,0,0,2,0,2,2,2,2,0,2,2,0,2,0,0,\n  3,3,3,3,3,2,2,0,2,3,3,3,3,3,2,3,0,2,3,3,\n   3,2,2,3,3,2,2,2,3,3,0,3,0,0,0,2,0,2,0,0,0,\n  3,3,3,3,3,3,3,0,2,3,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,2,2,0,0,2,3,2,0,0,0,0,0,0,0,2,0,0,0,0,0,\n  3,3,3,3,3,2,2,2,2,3,3,0,0,2,2,2,2,2,2,0,\n   2,0,0,0,2,0,0,0,0,0,2,2,2,0,0,0,0,0,0,0,0,\n  0,0,2,0,0,2,3,2,2,2,2,0,2,0,2,2,2,2,0,3,\n   0,2,2,0,0,3,2,2,0,0,2,0,0,0,0,0,0,0,0,0,0,\n  2,2,2,2,3,3,0,0,3,2,2,2,2,2,2,2,2,0,2,0,\n   2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,2,0,0,0,0,\n  2,0,0,2,0,0,2,0,0,0,0,0,2,3,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,\n  2,2,2,2,3,0,2,0,0,0,2,0,2,2,2,0,0,2,0,0,\n   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,\n  0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,2,2,0,0,3,\n   0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,\n  2,0,0,2,0,0,0,0,0,0,0,0,2,2,0,0,0,0,2,0,\n   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  2,0,0,2,0,2,0,0,0,0,0,0,0,2,0,0,2,0,0,0,\n   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Windows_1250CzechModel =\n{\n  Windows_1250_CharToOrderMap,\n  CzechLangModel,\n  41,\n  (float)0.9786035192432675,\n  PR_TRUE,\n  \"WINDOWS-1250\"\n};\n\nconst SequenceModel Mac_CentraleuropeCzechModel =\n{\n  Mac_Centraleurope_CharToOrderMap,\n  CzechLangModel,\n  41,\n  (float)0.9786035192432675,\n  PR_TRUE,\n  \"MAC-CENTRALEUROPE\"\n};\n\nconst SequenceModel Ibm852CzechModel =\n{\n  Ibm852_CharToOrderMap,\n  CzechLangModel,\n  41,\n  (float)0.9786035192432675,\n  PR_TRUE,\n  \"IBM852\"\n};\n\nconst SequenceModel Iso_8859_2CzechModel =\n{\n  Iso_8859_2_CharToOrderMap,\n  CzechLangModel,\n  41,\n  (float)0.9786035192432675,\n  PR_TRUE,\n  \"ISO-8859-2\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangDanishModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Danish *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-02-19 17:56:42.163975\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_15_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  4, 15, 24,  7,  0, 13, 10, 18,  5, 23, 11,  8, 12,  2,  9, /* 4X */\n   17, 29,  1,  6,  3, 16, 14, 25, 27, 20, 26,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  4, 15, 24,  7,  0, 13, 10, 18,  5, 23, 11,  8, 12,  2,  9, /* 6X */\n   17, 29,  1,  6,  3, 16, 14, 25, 27, 20, 26,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM, 39,SYM, 39,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM, 53, 42,SYM,SYM, 54,SYM,SYM,SYM, 55, 56, 57,SYM, /* BX */\n   58, 33, 40, 35, 32, 21, 22, 38, 41, 28, 49, 45, 59, 34, 60, 50, /* CX */\n   43, 47, 51, 36, 52, 61, 30,SYM, 19, 62, 37, 44, 31, 46, 63, 48, /* DX */\n   64, 33, 40, 35, 32, 21, 22, 38, 41, 28, 49, 45, 65, 34, 66, 50, /* EX */\n   43, 47, 51, 36, 52, 67, 30,SYM, 19, 68, 37, 44, 31, 46, 69, 70, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_1_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  4, 15, 24,  7,  0, 13, 10, 18,  5, 23, 11,  8, 12,  2,  9, /* 4X */\n   17, 29,  1,  6,  3, 16, 14, 25, 27, 20, 26,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  4, 15, 24,  7,  0, 13, 10, 18,  5, 23, 11,  8, 12,  2,  9, /* 6X */\n   17, 29,  1,  6,  3, 16, 14, 25, 27, 20, 26,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 42,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   71, 33, 40, 35, 32, 21, 22, 38, 41, 28, 49, 45, 72, 34, 73, 50, /* CX */\n   43, 47, 51, 36, 52, 74, 30,SYM, 19, 75, 37, 44, 31, 46, 76, 48, /* DX */\n   77, 33, 40, 35, 32, 21, 22, 38, 41, 28, 49, 45, 78, 34, 79, 50, /* EX */\n   43, 47, 51, 36, 52, 80, 30,SYM, 19, 81, 37, 44, 31, 46, 82, 83, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Windows_1252_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  4, 15, 24,  7,  0, 13, 10, 18,  5, 23, 11,  8, 12,  2,  9, /* 4X */\n   17, 29,  1,  6,  3, 16, 14, 25, 27, 20, 26,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  4, 15, 24,  7,  0, 13, 10, 18,  5, 23, 11,  8, 12,  2,  9, /* 6X */\n   17, 29,  1,  6,  3, 16, 14, 25, 27, 20, 26,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM, 84,SYM,SYM,SYM,SYM,SYM,SYM, 39,SYM, 85,ILL, 86,ILL, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 39,SYM, 87,ILL, 88, 89, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 42,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   90, 33, 40, 35, 32, 21, 22, 38, 41, 28, 49, 45, 91, 34, 92, 50, /* CX */\n   43, 47, 51, 36, 52, 93, 30,SYM, 19, 94, 37, 44, 31, 46, 95, 48, /* DX */\n   96, 33, 40, 35, 32, 21, 22, 38, 41, 28, 49, 45, 97, 34, 98, 50, /* EX */\n   43, 47, 51, 36, 52, 99, 30,SYM, 19,100, 37, 44, 31, 46,101,102, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 964\n * First 512 sequences: 0.9968082796759031\n * Next 512 sequences (512-1024): 0.0031917203240968304\n * Rest: 3.903127820947816e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 DanishLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,3,3,3,2,3,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,2,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3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n  3,3,3,3,3,2,3,3,3,3,3,3,3,2,3,3,3,3,2,2,2,0,0,0,2,2,2,0,0,0,\n  3,3,3,3,2,0,3,3,3,2,3,3,2,2,3,3,0,2,2,2,0,0,0,0,0,0,0,0,0,0,\n  2,3,3,3,0,3,3,3,3,2,3,3,3,3,3,3,2,2,2,0,0,0,0,0,2,0,0,0,0,0,\n  3,3,2,3,3,3,3,3,3,3,2,2,2,2,2,2,3,2,2,3,3,2,3,2,2,0,0,0,0,0,\n  3,3,2,3,3,3,2,2,3,3,2,3,2,2,0,2,3,2,3,0,3,0,0,2,3,2,2,0,2,2,\n  3,2,2,2,3,3,2,2,2,3,0,2,2,2,0,2,2,0,2,0,2,0,0,0,2,2,2,0,0,0,\n  3,2,2,2,3,3,2,2,0,3,0,2,2,0,0,2,2,2,2,2,2,0,0,2,2,0,2,0,0,0,\n  3,2,0,2,2,3,2,0,2,2,0,0,2,2,2,2,2,2,2,2,0,0,0,0,2,2,0,0,2,0,\n  2,3,2,2,2,0,2,2,2,2,2,2,2,0,2,2,0,2,0,0,0,0,0,0,2,0,0,0,0,0,\n  0,0,0,0,3,2,2,2,2,2,0,0,0,0,2,2,3,0,2,0,0,0,0,0,0,0,0,0,0,2,\n};\n\n\nconst SequenceModel Iso_8859_15DanishModel =\n{\n  Iso_8859_15_CharToOrderMap,\n  DanishLangModel,\n  30,\n  (float)0.9968082796759031,\n  PR_TRUE,\n  \"ISO-8859-15\"\n};\n\nconst SequenceModel Iso_8859_1DanishModel =\n{\n  Iso_8859_1_CharToOrderMap,\n  DanishLangModel,\n  30,\n  (float)0.9968082796759031,\n  PR_TRUE,\n  \"ISO-8859-1\"\n};\n\nconst SequenceModel Windows_1252DanishModel =\n{\n  Windows_1252_CharToOrderMap,\n  DanishLangModel,\n  30,\n  (float)0.9968082796759031,\n  PR_TRUE,\n  \"WINDOWS-1252\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangEsperantoModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Esperanto *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2015-12-04 01:27:38.177516\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_3_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 18, 17, 10,  2, 19, 15, 21,  3, 11,  9,  7, 13,  4,  1, /* 4X */\n   14, 32,  5,  8,  6, 12, 16, 27, 33, 25, 20,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 18, 17, 10,  2, 19, 15, 21,  3, 11,  9,  7, 13,  4,  1, /* 6X */\n   14, 32,  5,  8,  6, 12, 16, 27, 33, 25, 20,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 56,SYM,SYM,SYM,ILL, 34,SYM,SYM, 57, 53, 58, 28,SYM,ILL, 40, /* AX */\n  SYM, 59,SYM,SYM,SYM,SYM, 34,SYM,SYM, 60, 53, 61, 28,SYM,ILL, 40, /* BX */\n   44, 29, 46,ILL, 43, 62, 24, 38, 41, 31, 48, 50, 54, 35, 49, 52, /* CX */\n  ILL, 42, 63, 30, 47, 64, 36,SYM, 22, 51, 39, 55, 37, 23, 26, 45, /* DX */\n   44, 29, 46,ILL, 43, 65, 24, 38, 41, 31, 48, 50, 54, 35, 49, 52, /* EX */\n  ILL, 42, 66, 30, 47, 67, 36,SYM, 22, 51, 39, 55, 37, 23, 26,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 989\n * First 512 sequences: 0.9942980632768038\n * Next 512 sequences (512-1024): 0.0057019367231962385\n * Rest: -5.0306980803327406e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 EsperantoLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,0,0,2,3,3,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,3,2,0,0,0,2,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,0,0,0,2,3,3,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,3,2,2,2,3,0,2,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,2,2,3,2,3,2,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,0,3,3,3,2,2,2,\n  3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,2,3,2,3,3,3,3,0,0,2,3,2,2,2,3,3,2,0,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,3,2,2,2,3,2,2,0,3,3,3,2,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,3,3,3,3,0,0,0,3,0,2,0,3,2,3,2,2,0,\n  3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,2,3,3,2,3,3,3,0,0,0,3,2,0,2,3,2,2,0,0,0,\n  3,3,3,3,3,3,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2,0,2,3,2,3,3,0,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  3,3,3,3,3,3,2,3,3,2,3,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,2,0,2,0,2,0,0,0,\n  3,3,3,3,2,2,3,2,0,2,0,2,3,2,2,0,3,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,\n  3,3,3,3,2,2,2,2,3,2,0,0,2,0,0,0,0,0,0,2,0,2,0,0,0,2,0,3,0,0,2,0,0,0,0,\n  3,3,2,2,2,2,0,2,0,2,0,0,3,0,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,0,2,0,3,3,3,3,3,2,3,0,0,2,2,2,2,3,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,0,0,0,3,3,2,2,2,2,2,2,0,0,2,2,2,0,2,2,3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,\n  2,2,2,0,3,3,3,3,3,2,2,0,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,\n  2,0,0,2,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,\n  2,2,2,3,0,0,2,2,0,0,0,0,2,2,2,2,0,0,0,2,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,\n  3,3,3,2,2,0,2,0,0,0,2,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Iso_8859_3EsperantoModel =\n{\n  Iso_8859_3_CharToOrderMap,\n  EsperantoLangModel,\n  35,\n  (float)0.9942980632768038,\n  PR_FALSE,\n  \"ISO-8859-3\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangEstonianModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Estonian *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-26 23:47:54.476870\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_4_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 23, 10,  2, 22, 15, 16,  1, 17,  8,  5, 12,  7,  9, /* 4X */\n   14, 28, 11,  3,  4,  6, 13, 27, 26, 25, 30,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 23, 10,  2, 22, 15, 16,  1, 17,  8,  5, 12,  7,  9, /* 6X */\n   14, 28, 11,  3,  4,  6, 13, 27, 26, 25, 30,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 55, 56, 57,SYM, 58, 59,SYM,SYM, 29, 45, 60, 61,SYM, 32,SYM, /* AX */\n  SYM, 62,SYM, 63,SYM, 64, 65,SYM,SYM, 29, 45, 66, 67, 68, 32, 69, /* BX */\n   37, 43, 70, 71, 18, 44, 47, 72, 73, 33, 74, 75, 76, 36, 77, 39, /* CX */\n   78, 79, 31, 80, 81, 20, 24,SYM, 38, 82, 52, 83, 21, 84, 34, 85, /* DX */\n   37, 43, 86, 87, 18, 44, 47, 88, 89, 33, 90, 91, 92, 36, 93, 39, /* EX */\n   94, 95, 31, 96, 97, 20, 24,SYM, 38, 98, 52, 99, 21,100, 34,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Windows_1252_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 23, 10,  2, 22, 15, 16,  1, 17,  8,  5, 12,  7,  9, /* 4X */\n   14, 28, 11,  3,  4,  6, 13, 27, 26, 25, 30,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 23, 10,  2, 22, 15, 16,  1, 17,  8,  5, 12,  7,  9, /* 6X */\n   14, 28, 11,  3,  4,  6, 13, 27, 26, 25, 30,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM,101,SYM,SYM,SYM,SYM,SYM,SYM, 29,SYM,102,ILL, 32,ILL, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 29,SYM,103,ILL, 32,104, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 50,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   40, 43,105,106, 18, 44, 47, 48, 41, 33,107,108, 35, 36,109,110, /* CX */\n   46,111, 53, 42,112, 20, 24,SYM, 38, 54, 52,113, 21,114,115,116, /* DX */\n   40, 43,117,118, 18, 44, 47, 48, 41, 33,119,120, 35, 36,121,122, /* EX */\n   46,123, 53, 42,124, 20, 24,SYM, 38, 54, 52,125, 21,126,127,128, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_15_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 23, 10,  2, 22, 15, 16,  1, 17,  8,  5, 12,  7,  9, /* 4X */\n   14, 28, 11,  3,  4,  6, 13, 27, 26, 25, 30,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 23, 10,  2, 22, 15, 16,  1, 17,  8,  5, 12,  7,  9, /* 6X */\n   14, 28, 11,  3,  4,  6, 13, 27, 26, 25, 30,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM, 29,SYM, 29,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM, 32, 50,SYM,SYM, 32,SYM,SYM,SYM,129,130,131,SYM, /* BX */\n   40, 43,132,133, 18, 44, 47, 48, 41, 33,134,135, 35, 36,136,137, /* CX */\n   46,138, 53, 42,139, 20, 24,SYM, 38, 54, 52,140, 21,141,142,143, /* DX */\n   40, 43,144,145, 18, 44, 47, 48, 41, 33,146,147, 35, 36,148,149, /* EX */\n   46,150, 53, 42,151, 20, 24,SYM, 38, 54, 52,152, 21,153,154,155, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_13_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 23, 10,  2, 22, 15, 16,  1, 17,  8,  5, 12,  7,  9, /* 4X */\n   14, 28, 11,  3,  4,  6, 13, 27, 26, 25, 30,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 23, 10,  2, 22, 15, 16,  1, 17,  8,  5, 12,  7,  9, /* 6X */\n   14, 28, 11,  3,  4,  6, 13, 27, 26, 25, 30,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 38,SYM,156,SYM,SYM,SYM,SYM, 47, /* AX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 38,SYM,157,SYM,SYM,SYM,SYM, 47, /* BX */\n  158,159, 37,160, 18, 44,161, 45,162, 33,163,164,165,166, 39,167, /* CX */\n   29,168,169, 42, 31, 20, 24,SYM,170, 51,171, 34, 21, 49, 32,172, /* DX */\n  173,174, 37,175, 18, 44,176, 45,177, 33,178,179,180,181, 39,182, /* EX */\n   29,183,184, 42, 31, 20, 24,SYM,185, 51,186, 34, 21, 49, 32,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Windows_1257_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 23, 10,  2, 22, 15, 16,  1, 17,  8,  5, 12,  7,  9, /* 4X */\n   14, 28, 11,  3,  4,  6, 13, 27, 26, 25, 30,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 23, 10,  2, 22, 15, 16,  1, 17,  8,  5, 12,  7,  9, /* 6X */\n   14, 28, 11,  3,  4,  6, 13, 27, 26, 25, 30,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM,ILL,SYM,SYM,SYM,SYM,ILL,SYM,ILL,SYM,ILL,SYM,SYM,SYM, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,ILL,SYM,ILL,SYM,SYM,ILL, /* 9X */\n  SYM,ILL,SYM,SYM,SYM,ILL,SYM,SYM, 38,SYM,187,SYM,SYM,SYM,SYM, 47, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 50,SYM,SYM, 38,SYM,188,SYM,SYM,SYM,SYM, 47, /* BX */\n  189,190, 37,191, 18, 44,192, 45,193, 33,194,195,196,197, 39,198, /* CX */\n   29,199,200, 42, 31, 20, 24,SYM,201, 51,202, 34, 21, 49, 32,203, /* DX */\n  204,205, 37,206, 18, 44,207, 45,208, 33,209,210,211,212, 39,213, /* EX */\n   29,214,215, 42, 31, 20, 24,SYM,216, 51,217, 34, 21, 49, 32,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 853\n * First 512 sequences: 0.9972721312183132\n * Next 512 sequences (512-1024): 0.0027278687816868537\n * Rest: -5.204170427930421e-18\n * Negative sequences: TODO\n */\nconstexpr PRUint8 EstonianLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,3,3,0,3,3,3,3,2,2,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,2,3,3,2,2,3,3,2,2,2,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,3,3,0,3,3,3,2,0,2,0,2,\n  3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,2,2,2,0,2,2,0,\n  3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,2,3,3,3,0,3,3,2,3,3,3,2,2,0,3,2,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,0,0,0,2,2,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,2,3,3,0,0,2,2,2,2,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,2,2,3,2,3,3,3,3,2,3,3,3,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,2,0,0,3,3,3,2,0,0,0,0,0,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,2,3,3,2,2,2,3,0,0,2,0,0,2,3,0,3,0,0,2,0,0,0,0,\n  2,3,3,3,3,3,0,3,3,2,3,3,2,3,3,3,2,2,0,3,0,0,0,0,3,0,0,0,0,0,0,0,0,\n  3,3,3,3,3,3,3,3,2,3,2,3,2,0,3,3,0,0,0,0,0,0,0,3,2,0,2,0,0,0,2,3,0,\n  3,3,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,2,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,\n  3,3,3,2,2,2,2,2,2,3,0,2,0,0,0,2,2,0,0,0,0,0,2,0,0,2,0,2,0,0,0,0,0,\n  3,3,2,0,0,0,3,0,0,2,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,\n  2,3,3,0,0,2,3,2,2,2,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,\n  2,3,2,2,0,2,2,2,2,3,2,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,\n  0,0,0,2,2,2,2,2,2,0,0,0,2,0,0,2,2,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  2,3,0,0,0,0,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Iso_8859_4EstonianModel =\n{\n  Iso_8859_4_CharToOrderMap,\n  EstonianLangModel,\n  33,\n  (float)0.9972721312183132,\n  PR_TRUE,\n  \"ISO-8859-4\"\n};\n\nconst SequenceModel Windows_1252EstonianModel =\n{\n  Windows_1252_CharToOrderMap,\n  EstonianLangModel,\n  33,\n  (float)0.9972721312183132,\n  PR_TRUE,\n  \"WINDOWS-1252\"\n};\n\nconst SequenceModel Iso_8859_15EstonianModel =\n{\n  Iso_8859_15_CharToOrderMap,\n  EstonianLangModel,\n  33,\n  (float)0.9972721312183132,\n  PR_TRUE,\n  \"ISO-8859-15\"\n};\n\nconst SequenceModel Iso_8859_13EstonianModel =\n{\n  Iso_8859_13_CharToOrderMap,\n  EstonianLangModel,\n  33,\n  (float)0.9972721312183132,\n  PR_TRUE,\n  \"ISO-8859-13\"\n};\n\nconst SequenceModel Windows_1257EstonianModel =\n{\n  Windows_1257_CharToOrderMap,\n  EstonianLangModel,\n  33,\n  (float)0.9972721312183132,\n  PR_TRUE,\n  \"WINDOWS-1257\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangFinnishModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Finnish *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-21 18:15:05.189948\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_15_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 21, 18,  4, 23, 20, 14,  1, 15,  9,  6, 12,  2,  7, /* 4X */\n   16, 29, 10,  5,  3,  8, 13, 24, 26, 17, 25,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 21, 18,  4, 23, 20, 14,  1, 15,  9,  6, 12,  2,  7, /* 6X */\n   16, 29, 10,  5,  3,  8, 13, 24, 26, 17, 25,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM, 27,SYM, 27,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM, 28, 61,SYM,SYM, 28,SYM,SYM,SYM, 62, 63, 64,SYM, /* BX */\n   49, 35, 65, 46, 11, 56, 39, 37, 40, 30, 51, 31, 66, 36, 67, 57, /* CX */\n   68, 58, 52, 33, 34, 59, 22,SYM, 69, 70, 38, 71, 32, 72, 73, 55, /* DX */\n   49, 35, 74, 46, 11, 56, 39, 37, 40, 30, 51, 31, 75, 36, 76, 57, /* EX */\n   77, 58, 52, 33, 34, 59, 22,SYM, 78, 79, 38, 80, 32, 81, 82, 83, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Windows_1252_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 21, 18,  4, 23, 20, 14,  1, 15,  9,  6, 12,  2,  7, /* 4X */\n   16, 29, 10,  5,  3,  8, 13, 24, 26, 17, 25,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 21, 18,  4, 23, 20, 14,  1, 15,  9,  6, 12,  2,  7, /* 6X */\n   16, 29, 10,  5,  3,  8, 13, 24, 26, 17, 25,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM, 84,SYM,SYM,SYM,SYM,SYM,SYM, 27,SYM, 85,ILL, 28,ILL, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 27,SYM, 86,ILL, 28, 87, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 88,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   49, 35, 89, 46, 11, 56, 39, 37, 40, 30, 51, 31, 90, 36, 91, 57, /* CX */\n   92, 58, 52, 33, 34, 59, 22,SYM, 93, 94, 38, 95, 32, 96, 97, 55, /* DX */\n   49, 35, 98, 46, 11, 56, 39, 37, 40, 30, 51, 31, 99, 36,100, 57, /* EX */\n  101, 58, 52, 33, 34, 59, 22,SYM,102,103, 38,104, 32,105,106,107, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_4_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 21, 18,  4, 23, 20, 14,  1, 15,  9,  6, 12,  2,  7, /* 4X */\n   16, 29, 10,  5,  3,  8, 13, 24, 26, 17, 25,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 21, 18,  4, 23, 20, 14,  1, 15,  9,  6, 12,  2,  7, /* 6X */\n   16, 29, 10,  5,  3,  8, 13, 24, 26, 17, 25,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,108,109, 47,SYM,110,111,SYM,SYM, 27,112,113,114,SYM, 28,SYM, /* AX */\n  SYM,115,SYM, 47,SYM,116,117,SYM,SYM, 27,118,119,120, 45, 28, 45, /* BX */\n   53, 35,121, 46, 11, 56, 39,122, 43, 30,123, 31,124, 36,125,126, /* CX */\n  127, 54,128,129, 34, 59, 22,SYM,130,131, 38,132, 32,133,134, 55, /* DX */\n   53, 35,135, 46, 11, 56, 39,136, 43, 30,137, 31,138, 36,139,140, /* EX */\n  141, 54,142,143, 34, 59, 22,SYM,144,145, 38,146, 32,147,148,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_13_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 21, 18,  4, 23, 20, 14,  1, 15,  9,  6, 12,  2,  7, /* 4X */\n   16, 29, 10,  5,  3,  8, 13, 24, 26, 17, 25,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 21, 18,  4, 23, 20, 14,  1, 15,  9,  6, 12,  2,  7, /* 6X */\n   16, 29, 10,  5,  3,  8, 13, 24, 26, 17, 25,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,149,SYM, 47,SYM,SYM,SYM,SYM, 39, /* AX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,150,SYM, 47,SYM,SYM,SYM,SYM, 39, /* BX */\n  151,152, 53, 41, 11, 56,153,154, 43, 30,155,156,157,158,159,160, /* CX */\n   27,161, 54, 33,162, 59, 22,SYM,163,164,165,166, 32, 60, 28, 55, /* DX */\n  167,168, 53, 41, 11, 56,169,170, 43, 30,171,172,173,174,175,176, /* EX */\n   27,177, 54, 33,178, 59, 22,SYM,179,180,181,182, 32, 60, 28,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_9_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 21, 18,  4, 23, 20, 14,  1, 15,  9,  6, 12,  2,  7, /* 4X */\n   16, 29, 10,  5,  3,  8, 13, 24, 26, 17, 25,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 21, 18,  4, 23, 20, 14,  1, 15,  9,  6, 12,  2,  7, /* 6X */\n   16, 29, 10,  5,  3,  8, 13, 24, 26, 17, 25,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM,183,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   49, 35,184, 46, 11, 56, 39, 37, 40, 30, 51, 31,185, 36,186, 57, /* CX */\n   50, 58, 52, 33, 34, 59, 22,SYM,187,188, 38,189, 32, 48, 42, 55, /* DX */\n   49, 35,190, 46, 11, 56, 39, 37, 40, 30, 51, 31,191, 36,192, 57, /* EX */\n   50, 58, 52, 33, 34, 59, 22,SYM,193,194, 38,195, 32, 44, 42,196, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_1_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 19, 21, 18,  4, 23, 20, 14,  1, 15,  9,  6, 12,  2,  7, /* 4X */\n   16, 29, 10,  5,  3,  8, 13, 24, 26, 17, 25,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 19, 21, 18,  4, 23, 20, 14,  1, 15,  9,  6, 12,  2,  7, /* 6X */\n   16, 29, 10,  5,  3,  8, 13, 24, 26, 17, 25,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM,197,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   49, 35,198, 46, 11, 56, 39, 37, 40, 30, 51, 31,199, 36,200, 57, /* CX */\n  201, 58, 52, 33, 34, 59, 22,SYM,202,203, 38,204, 32,205,206, 55, /* DX */\n   49, 35,207, 46, 11, 56, 39, 37, 40, 30, 51, 31,208, 36,209, 57, /* EX */\n  210, 58, 52, 33, 34, 59, 22,SYM,211,212, 38,213, 32,214,215,216, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 919\n * First 512 sequences: 0.9985378147555799\n * Next 512 sequences (512-1024): 0.0014621852444200612\n * Rest: 3.881443777498106e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 FinnishLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,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0,2,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,3,2,3,2,2,2,0,0,\n  3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,0,0,3,2,\n  3,3,3,3,3,3,3,3,3,3,3,2,2,0,3,2,0,3,3,3,2,3,2,0,2,2,0,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,2,3,3,3,3,3,3,3,2,3,2,0,0,0,0,\n  3,3,2,3,3,3,3,3,3,3,3,0,2,0,3,0,2,3,3,2,2,3,0,0,0,2,0,0,0,2,\n  2,3,3,3,2,3,3,2,0,3,3,3,3,3,3,3,3,3,3,2,0,0,3,2,0,0,0,0,0,0,\n  3,3,2,3,3,3,3,3,3,2,3,2,0,2,0,2,2,3,0,2,2,2,0,3,0,2,0,0,0,0,\n  3,3,3,2,3,3,2,3,2,2,3,0,2,0,3,0,0,2,2,2,2,2,0,2,2,0,0,0,0,0,\n  3,3,3,2,3,2,2,3,2,2,2,2,2,2,2,0,2,3,2,2,2,0,0,2,2,3,0,0,0,0,\n  3,3,0,2,2,2,3,2,0,0,0,0,2,2,3,0,2,0,0,2,0,2,0,3,2,0,2,0,0,0,\n  3,3,2,2,3,0,0,2,2,2,2,0,2,2,0,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,\n  3,2,0,0,2,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  2,2,0,0,0,2,0,0,3,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Iso_8859_15FinnishModel =\n{\n  Iso_8859_15_CharToOrderMap,\n  FinnishLangModel,\n  30,\n  (float)0.9985378147555799,\n  PR_TRUE,\n  \"ISO-8859-15\"\n};\n\nconst SequenceModel Windows_1252FinnishModel =\n{\n  Windows_1252_CharToOrderMap,\n  FinnishLangModel,\n  30,\n  (float)0.9985378147555799,\n  PR_TRUE,\n  \"WINDOWS-1252\"\n};\n\nconst SequenceModel Iso_8859_4FinnishModel =\n{\n  Iso_8859_4_CharToOrderMap,\n  FinnishLangModel,\n  30,\n  (float)0.9985378147555799,\n  PR_TRUE,\n  \"ISO-8859-4\"\n};\n\nconst SequenceModel Iso_8859_13FinnishModel =\n{\n  Iso_8859_13_CharToOrderMap,\n  FinnishLangModel,\n  30,\n  (float)0.9985378147555799,\n  PR_TRUE,\n  \"ISO-8859-13\"\n};\n\nconst SequenceModel Iso_8859_9FinnishModel =\n{\n  Iso_8859_9_CharToOrderMap,\n  FinnishLangModel,\n  30,\n  (float)0.9985378147555799,\n  PR_TRUE,\n  \"ISO-8859-9\"\n};\n\nconst SequenceModel Iso_8859_1FinnishModel =\n{\n  Iso_8859_1_CharToOrderMap,\n  FinnishLangModel,\n  30,\n  (float)0.9985378147555799,\n  PR_TRUE,\n  \"ISO-8859-1\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangFrenchModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: French *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2015-12-03 21:10:27.685575\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Windows_1252_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  2, 18, 11, 10,  0, 17, 15, 19,  4, 25, 26,  7, 13,  3,  8, /* 4X */\n   12, 20,  5,  1,  6,  9, 16, 30, 21, 22, 29,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  2, 18, 11, 10,  0, 17, 15, 19,  4, 25, 26,  7, 13,  3,  8, /* 6X */\n   12, 20,  5,  1,  6,  9, 16, 30, 21, 22, 29,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM, 56,SYM,SYM,SYM,SYM,SYM,SYM, 51,SYM, 35,ILL, 57,ILL, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 51,SYM, 35,ILL, 58, 59, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 60,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   24, 38, 32, 46, 49, 61, 47, 27, 23, 14, 28, 41, 62, 39, 33, 36, /* CX */\n   48, 45, 54, 40, 31, 55, 42,SYM, 52, 37, 43, 34, 44, 53, 50, 63, /* DX */\n   24, 38, 32, 46, 49, 64, 47, 27, 23, 14, 28, 41, 65, 39, 33, 36, /* EX */\n   48, 45, 54, 40, 31, 55, 42,SYM, 52, 37, 43, 34, 44, 53, 50, 66, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_1_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  2, 18, 11, 10,  0, 17, 15, 19,  4, 25, 26,  7, 13,  3,  8, /* 4X */\n   12, 20,  5,  1,  6,  9, 16, 30, 21, 22, 29,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  2, 18, 11, 10,  0, 17, 15, 19,  4, 25, 26,  7, 13,  3,  8, /* 6X */\n   12, 20,  5,  1,  6,  9, 16, 30, 21, 22, 29,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 67,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   24, 38, 32, 46, 49, 68, 47, 27, 23, 14, 28, 41, 69, 39, 33, 36, /* CX */\n   48, 45, 54, 40, 31, 55, 42,SYM, 52, 37, 43, 34, 44, 53, 50, 70, /* DX */\n   24, 38, 32, 46, 49, 71, 47, 27, 23, 14, 28, 41, 72, 39, 33, 36, /* EX */\n   48, 45, 54, 40, 31, 55, 42,SYM, 52, 37, 43, 34, 44, 53, 50, 73, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_15_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  2, 18, 11, 10,  0, 17, 15, 19,  4, 25, 26,  7, 13,  3,  8, /* 4X */\n   12, 20,  5,  1,  6,  9, 16, 30, 21, 22, 29,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  2, 18, 11, 10,  0, 17, 15, 19,  4, 25, 26,  7, 13,  3,  8, /* 6X */\n   12, 20,  5,  1,  6,  9, 16, 30, 21, 22, 29,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM, 51,SYM, 51,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM, 74, 75,SYM,SYM, 76,SYM,SYM,SYM, 35, 35, 77,SYM, /* BX */\n   24, 38, 32, 46, 49, 78, 47, 27, 23, 14, 28, 41, 79, 39, 33, 36, /* CX */\n   48, 45, 54, 40, 31, 55, 42,SYM, 52, 37, 43, 34, 44, 53, 50, 80, /* DX */\n   24, 38, 32, 46, 49, 81, 47, 27, 23, 14, 28, 41, 82, 39, 33, 36, /* EX */\n   48, 45, 54, 40, 31, 55, 42,SYM, 52, 37, 43, 34, 44, 53, 50, 83, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 914\n * First 512 sequences: 0.997057879992383\n * Next 512 sequences (512-1024): 0.002942120007616917\n * Rest: 3.8163916471489756e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 FrenchLangModel[] =\n{\n  3,3,3,3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992383,\n  PR_TRUE,\n  \"WINDOWS-1252\"\n};\n\nconst SequenceModel Iso_8859_1FrenchModel =\n{\n  Iso_8859_1_CharToOrderMap,\n  FrenchLangModel,\n  38,\n  (float)0.997057879992383,\n  PR_TRUE,\n  \"ISO-8859-1\"\n};\n\nconst SequenceModel Iso_8859_15FrenchModel =\n{\n  Iso_8859_15_CharToOrderMap,\n  FrenchLangModel,\n  38,\n  (float)0.997057879992383,\n  PR_TRUE,\n  \"ISO-8859-15\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangGermanModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: German *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2015-12-03 22:50:46.518374\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Windows_1252_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  5, 15, 12,  8,  0, 17, 14,  7,  3, 23, 16,  9, 13,  2, 11, /* 4X */\n   18, 30,  1,  4,  6, 10, 21, 19, 28, 25, 20,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  5, 15, 12,  8,  0, 17, 14,  7,  3, 23, 16,  9, 13,  2, 11, /* 6X */\n   18, 30,  1,  4,  6, 10, 21, 19, 28, 25, 20,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM, 59,SYM,SYM,SYM,SYM,SYM,SYM, 36,SYM, 54,ILL, 42,ILL, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 36,SYM, 54,ILL, 42, 56, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 60,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   41, 31, 37, 44, 22, 49, 50, 35, 32, 29, 48, 43, 57, 33, 47, 52, /* CX */\n   53, 39, 51, 34, 40, 55, 26,SYM, 38, 58, 46, 61, 24, 45, 62, 27, /* DX */\n   41, 31, 37, 44, 22, 49, 50, 35, 32, 29, 48, 43, 57, 33, 47, 52, /* EX */\n   53, 39, 51, 34, 40, 55, 26,SYM, 38, 58, 46, 63, 24, 45, 64, 56, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_1_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  5, 15, 12,  8,  0, 17, 14,  7,  3, 23, 16,  9, 13,  2, 11, /* 4X */\n   18, 30,  1,  4,  6, 10, 21, 19, 28, 25, 20,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  5, 15, 12,  8,  0, 17, 14,  7,  3, 23, 16,  9, 13,  2, 11, /* 6X */\n   18, 30,  1,  4,  6, 10, 21, 19, 28, 25, 20,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 65,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   41, 31, 37, 44, 22, 49, 50, 35, 32, 29, 48, 43, 57, 33, 47, 52, /* CX */\n   53, 39, 51, 34, 40, 55, 26,SYM, 38, 58, 46, 66, 24, 45, 67, 27, /* DX */\n   41, 31, 37, 44, 22, 49, 50, 35, 32, 29, 48, 43, 57, 33, 47, 52, /* EX */\n   53, 39, 51, 34, 40, 55, 26,SYM, 38, 58, 46, 68, 24, 45, 69, 56, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 1188\n * First 512 sequences: 0.9934041448127945\n * Next 512 sequences (512-1024): 0.006482829516922903\n * Rest: 0.0001130256702826099\n * Negative sequences: TODO\n */\nconstexpr PRUint8 GermanLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,2,3,3,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,2,3,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,1,2,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,0,2,2,3,3,2,3,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,0,0,3,2,\n  3,3,3,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,0,2,2,\n  3,2,2,3,2,3,2,0,2,2,2,3,1,2,2,2,2,2,2,2,2,2,2,1,0,2,3,0,0,2,1,\n  2,3,3,3,3,2,3,3,3,3,3,2,3,3,3,2,2,3,2,0,2,2,0,0,0,0,0,2,0,0,2,\n  3,2,2,3,2,3,2,2,2,2,3,3,2,2,2,1,2,1,2,0,2,0,3,2,3,2,2,0,0,2,0,\n  2,3,3,0,3,1,3,3,3,3,0,0,3,2,3,3,2,2,2,1,1,0,0,0,0,0,0,2,0,0,0,\n  3,3,3,2,3,3,2,2,2,3,2,3,3,3,2,2,3,2,3,2,2,2,0,2,2,2,1,0,0,1,0,\n  2,3,3,2,3,0,3,3,2,3,0,1,3,3,3,2,2,3,2,2,2,2,0,0,0,0,1,3,1,0,0,\n  3,2,2,3,2,2,3,2,1,2,2,2,0,2,2,3,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,\n  3,1,2,3,1,3,3,2,1,2,2,2,2,0,0,2,2,2,3,2,0,2,0,0,0,2,0,0,2,2,0,\n  2,3,2,0,2,2,2,2,2,2,2,2,2,2,2,3,2,2,2,1,2,2,0,2,0,0,0,0,0,0,2,\n  0,1,0,2,0,2,0,0,0,0,3,2,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Windows_1252GermanModel =\n{\n  Windows_1252_CharToOrderMap,\n  GermanLangModel,\n  31,\n  (float)0.9934041448127945,\n  PR_TRUE,\n  \"WINDOWS-1252\"\n};\n\nconst SequenceModel Iso_8859_1GermanModel =\n{\n  Iso_8859_1_CharToOrderMap,\n  GermanLangModel,\n  31,\n  (float)0.9934041448127945,\n  PR_TRUE,\n  \"ISO-8859-1\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangGreekModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Greek *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-05-25 15:21:50.073117\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Windows_1253_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM, 32, 46, 41, 40, 30, 52, 48, 42, 33, 56, 49, 39, 44, 36, 34, /* 4X */\n   47, 59, 35, 38, 37, 43, 54, 50, 58, 53, 57,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM, 32, 46, 41, 40, 30, 52, 48, 42, 33, 56, 49, 39, 44, 36, 34, /* 6X */\n   47, 59, 35, 38, 37, 43, 54, 50, 58, 53, 57,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,ILL,SYM,ILL,ILL,ILL,ILL, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,ILL,SYM,ILL,ILL,ILL,ILL, /* 9X */\n  SYM,SYM, 17,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 62,SYM,SYM, 19, 22, 15,SYM, 16,SYM, 24, 28, /* BX */\n   55,  0, 25, 18, 20,  5, 29, 10, 26,  3,  8, 14, 13,  4, 31,  1, /* CX */\n   11,  6,ILL,  7,  2, 12, 27, 23, 45, 21, 51, 60, 17, 19, 22, 15, /* DX */\n   61,  0, 25, 18, 20,  5, 29, 10, 26,  3,  8, 14, 13,  4, 31,  1, /* EX */\n   11,  6,  9,  7,  2, 12, 27, 23, 45, 21, 51, 60, 16, 24, 28,ILL, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_7_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM, 32, 46, 41, 40, 30, 52, 48, 42, 33, 56, 49, 39, 44, 36, 34, /* 4X */\n   47, 59, 35, 38, 37, 43, 54, 50, 58, 53, 57,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM, 32, 46, 41, 40, 30, 52, 48, 42, 33, 56, 49, 39, 44, 36, 34, /* 6X */\n   47, 59, 35, 38, 37, 43, 54, 50, 58, 53, 57,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM,SYM, 17,SYM, 19, 22, 15,SYM, 16,SYM, 24, 28, /* BX */\n   55,  0, 25, 18, 20,  5, 29, 10, 26,  3,  8, 14, 13,  4, 31,  1, /* CX */\n   11,  6,ILL,  7,  2, 12, 27, 23, 45, 21, 51, 60, 17, 19, 22, 15, /* DX */\n   61,  0, 25, 18, 20,  5, 29, 10, 26,  3,  8, 14, 13,  4, 31,  1, /* EX */\n   11,  6,  9,  7,  2, 12, 27, 23, 45, 21, 51, 60, 16, 24, 28,ILL, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 1579\n * First 512 sequences: 0.958419074626211\n * Next 512 sequences (512-1024): 0.03968891876305471\n * Rest: 0.0018920066107342773\n * Negative sequences: TODO\n */\nconstexpr PRUint8 GreekLangModel[] =\n{\n  1,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,2,2,3,2,3,1,2,\n   3,3,3,3,3,1,3,0,3,0,0,0,0,0,0,1,0,0,1,0,0,0,2,\n  2,2,3,3,3,3,3,3,3,3,2,3,3,3,3,3,1,2,3,2,3,1,2,\n   3,3,3,3,3,2,2,0,2,0,0,0,0,0,0,0,0,1,0,0,1,0,2,\n  3,3,2,3,2,3,3,3,2,3,3,1,3,2,2,3,3,3,2,3,0,3,3,\n   2,2,2,2,2,3,3,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,\n  3,3,3,2,3,3,3,3,3,3,3,3,1,3,3,1,3,3,3,3,3,3,2,\n   3,1,3,3,2,3,3,0,2,0,0,1,0,0,0,1,0,0,0,0,0,0,2,\n  3,3,3,3,3,3,2,3,2,2,3,1,2,2,2,3,3,3,3,3,3,3,3,\n   2,2,1,3,2,3,2,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,\n  2,3,3,3,3,2,3,3,3,3,2,3,3,3,3,3,2,2,3,1,3,3,1,\n   3,3,3,3,3,2,2,0,3,0,0,0,0,0,0,1,0,0,0,0,0,0,2,\n  3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,3,3,3,3,3,\n   3,3,2,3,2,3,2,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,1,\n  3,3,3,3,2,3,2,3,3,0,3,3,3,3,2,3,3,3,2,3,2,3,3,\n   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1,2,2,2,2,0,\n  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,3,0,3,3,2,1,1,2,2,2,2,1,1,2,2,0,\n  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,3,0,2,2,2,2,1,1,2,2,1,2,1,2,1,0,\n  0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,2,0,2,2,2,2,1,2,1,2,2,2,3,2,1,0,\n  0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,3,0,2,2,2,2,2,2,1,2,1,1,1,2,2,0,\n  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,2,0,2,2,1,2,2,2,2,2,2,2,1,1,2,0,\n  1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,\n   0,0,0,0,0,0,0,3,0,2,2,2,1,1,1,2,2,1,1,1,2,2,0,\n  2,2,0,2,0,3,0,0,0,0,3,0,2,0,0,2,1,1,0,1,0,1,2,\n   0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Windows_1253GreekModel =\n{\n  Windows_1253_CharToOrderMap,\n  GreekLangModel,\n  46,\n  (float)0.958419074626211,\n  PR_FALSE,\n  \"WINDOWS-1253\"\n};\n\nconst SequenceModel Iso_8859_7GreekModel =\n{\n  Iso_8859_7_CharToOrderMap,\n  GreekLangModel,\n  46,\n  (float)0.958419074626211,\n  PR_FALSE,\n  \"ISO-8859-7\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangHebrewModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n *          Simon Montagu <smontagu@smontagu.org>\n * Portions created by the Initial Developer are Copyright (C) 2005\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          Shoshannah Forbes <xslf@xslf.com>\n *          Shy Shalom <shooshX@gmail.com>\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n\n/****************************************************************\nCTR: Control characters that usually does not exist in any text\nRET: Carriage/Return\nSYM: symbol (punctuation) that does not belong to word\nNUM: 0 - 9\n\n*****************************************************************/\n\n//Windows-1255 language model\n//Character Mapping Table:\nconstexpr unsigned char win1255_CharToOrderMap[] =\n{\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR,  //00\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,  //10\nSYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,  //20\nNUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM,  //30\nSYM, 69, 91, 79, 80, 92, 89, 97, 90, 68,111,112, 82, 73, 95, 85,  //40\n 78,121, 86, 71, 67,102,107, 84,114,103,115,SYM,SYM,SYM,SYM,SYM,  //50\nSYM, 50, 74, 60, 61, 42, 76, 70, 64, 53,105, 93, 56, 65, 54, 49,  //60\n 66,110, 51, 43, 44, 63, 81, 77, 98, 75,108,SYM,SYM,SYM,SYM,SYM,  //70\n124,ILL,203,204,205, 40, 58,206,207,208,ILL,210,ILL,ILL,ILL,ILL,\nILL, 83, 52, 47, 46, 72, 32, 94,216,113,ILL,109,ILL,ILL,ILL,ILL,\n 34,116,222,118,100,223,224,117,119,104,125,225,226, 87, 99,227,\n106,122,123,228, 55,229,230,101,231,232,120,233, 48, 39, 57,234,\n 30, 59, 41, 88, 33, 37, 36, 31, 29, 35,235, 62, 28,236,126,237,\n238, 38, 45,239,240,241,242,243,127,ILL,ILL,ILL,ILL,ILL,ILL,ILL,\n  9,  8, 20, 16,  3,  2, 24, 14, 22,  1, 25, 15,  4, 11,  6, 23,\n 12, 19, 13, 26, 18, 27, 21, 17,  7, 10,  5,ILL,ILL,128, 96,ILL,\n};\n\n//Model Table: \n//total sequences: 100%\n//first 512 sequences: 98.4004%\n//first 1024 sequences: 1.5981%\n//rest  sequences:      0.087%\n//negative sequences:   0.0015% \nconstexpr PRUint8 HebrewLangModel[] = \n{\n0,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,2,3,2,1,2,0,1,0,0,\n3,0,3,1,0,0,1,3,2,0,1,1,2,0,2,2,2,1,1,1,1,2,1,1,1,2,0,0,2,2,0,1,\n3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,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0,0,\n0,0,0,0,0,0,0,0,0,0,1,2,1,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,1,1,0,0,\n};\n\nconst SequenceModel Win1255Model = \n{\n  win1255_CharToOrderMap,\n  HebrewLangModel,\n  64,\n  (float)0.984004,\n  PR_FALSE,\n  \"WINDOWS-1255\"\n};\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangHungarianModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Hungarian *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2015-12-12 18:02:46.730481\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_2_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 15, 23, 16,  0, 24, 13, 20,  7, 22,  9,  4, 12,  6,  8, /* 4X */\n   21, 34,  5,  3,  2, 19, 17, 32, 33, 18, 10,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 15, 23, 16,  0, 24, 13, 20,  7, 22,  9,  4, 12,  6,  8, /* 6X */\n   21, 34,  5,  3,  2, 19, 17, 32, 33, 18, 10,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 55,SYM, 42,SYM, 56, 46,SYM,SYM, 37, 52, 57, 58,SYM, 48, 59, /* AX */\n  SYM, 60,SYM, 42,SYM, 61, 46,SYM,SYM, 37, 52, 62, 63,SYM, 48, 64, /* BX */\n   65, 11, 40, 36, 35, 66, 38, 39, 41, 14, 50, 67, 53, 28, 45, 68, /* CX */\n   49, 43, 54, 26, 69, 27, 25,SYM, 44, 70, 30, 31, 29, 47, 51, 71, /* DX */\n   72, 11, 40, 36, 35, 73, 38, 39, 41, 14, 50, 74, 53, 28, 45, 75, /* EX */\n   49, 43, 54, 26, 76, 27, 25,SYM, 44, 77, 30, 31, 29, 47, 51,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Windows_1250_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 15, 23, 16,  0, 24, 13, 20,  7, 22,  9,  4, 12,  6,  8, /* 4X */\n   21, 34,  5,  3,  2, 19, 17, 32, 33, 18, 10,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 15, 23, 16,  0, 24, 13, 20,  7, 22,  9,  4, 12,  6,  8, /* 6X */\n   21, 34,  5,  3,  2, 19, 17, 32, 33, 18, 10,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM,ILL,SYM,SYM,SYM,SYM,ILL,SYM, 37,SYM, 46, 78, 48, 79, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM, 37,SYM, 46, 80, 48, 81, /* 9X */\n  SYM,SYM,SYM, 42,SYM, 82,SYM,SYM,SYM,SYM, 52,SYM,SYM,SYM,SYM, 83, /* AX */\n  SYM,SYM,SYM, 42,SYM,SYM,SYM,SYM,SYM, 84, 52,SYM, 85,SYM, 86, 87, /* BX */\n   88, 11, 40, 36, 35, 89, 38, 39, 41, 14, 50, 90, 53, 28, 45, 91, /* CX */\n   49, 43, 54, 26, 92, 27, 25,SYM, 44, 93, 30, 31, 29, 47, 51, 94, /* DX */\n   95, 11, 40, 36, 35, 96, 38, 39, 41, 14, 50, 97, 53, 28, 45, 98, /* EX */\n   49, 43, 54, 26, 99, 27, 25,SYM, 44,100, 30, 31, 29, 47, 51,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 1084\n * First 512 sequences: 0.9748272224933486\n * Next 512 sequences (512-1024): 0.024983863604162403\n * Rest: 0.0001889139024889644\n * Negative sequences: TODO\n */\nconstexpr PRUint8 HungarianLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,1,0,2,2,0,0,\n  3,2,3,3,3,3,3,3,2,3,3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,0,0,2,2,1,2,1,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,3,3,3,3,2,3,2,2,3,3,3,3,3,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,3,2,3,3,3,2,3,2,2,3,3,3,3,3,2,\n  3,3,3,3,3,2,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,3,3,3,3,3,3,2,\n  3,3,3,3,3,2,3,3,3,3,3,3,2,3,3,3,3,3,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,3,3,2,0,\n  3,3,3,2,2,2,3,2,3,2,2,3,2,2,3,2,3,2,0,3,2,2,2,2,2,2,3,0,2,2,3,2,\n  3,3,2,3,2,2,2,3,3,3,3,2,2,2,3,2,2,2,2,2,3,0,0,2,2,2,2,0,3,0,0,0,\n  3,3,2,2,2,3,2,3,3,0,0,2,2,2,3,2,2,2,2,3,0,2,2,2,2,3,2,3,2,3,2,2,\n  2,0,3,3,3,3,3,0,0,3,3,0,2,3,0,3,3,3,0,0,2,2,2,2,1,0,0,0,0,0,0,0,\n  2,2,3,3,3,3,3,3,2,3,3,2,3,3,2,3,3,3,0,0,2,3,3,2,2,2,0,0,1,2,2,0,\n  2,2,3,3,3,3,2,3,2,3,3,2,2,2,2,3,3,2,0,0,2,2,3,2,2,1,0,0,1,2,1,0,\n  0,2,3,2,2,3,3,2,2,2,3,0,3,3,0,2,2,3,0,2,1,2,3,2,2,0,0,0,0,0,0,0,\n  0,0,3,2,3,2,3,0,0,3,2,0,2,3,0,0,2,2,0,0,1,0,2,0,0,0,0,0,0,0,0,0,\n  2,2,3,3,3,2,3,0,0,2,2,0,0,3,0,2,2,2,0,0,2,2,3,2,1,0,0,0,0,0,0,0,\n  2,2,2,2,3,2,2,2,0,3,2,0,2,2,0,2,2,3,0,2,2,0,2,2,2,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Iso_8859_2HungarianModel =\n{\n  Iso_8859_2_CharToOrderMap,\n  HungarianLangModel,\n  32,\n  (float)0.9748272224933486,\n  PR_FALSE,\n  \"ISO-8859-2\"\n};\n\nconst SequenceModel Windows_1250HungarianModel =\n{\n  Windows_1250_CharToOrderMap,\n  HungarianLangModel,\n  32,\n  (float)0.9748272224933486,\n  PR_FALSE,\n  \"WINDOWS-1250\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangIrishModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Irish *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-27 00:33:40.158624\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_1_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 16,  8, 11,  5, 19, 12,  3,  1, 27, 25,  9, 13,  2, 10, /* 4X */\n   21, 30,  4,  6,  7, 15, 23, 26, 29, 24, 28,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 16,  8, 11,  5, 19, 12,  3,  1, 27, 25,  9, 13,  2, 10, /* 6X */\n   21, 30,  4,  6,  7, 15, 23, 26, 29, 24, 28,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 44,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   45, 14, 46, 47, 33, 48, 49, 39, 35, 18, 42, 37, 50, 17, 51, 40, /* CX */\n   52, 32, 43, 22, 53, 54, 38,SYM, 36, 55, 20, 56, 31, 57, 58, 59, /* DX */\n   60, 14, 61, 62, 33, 63, 64, 39, 35, 18, 42, 37, 65, 17, 66, 40, /* EX */\n   67, 32, 43, 22, 68, 69, 38,SYM, 36, 70, 20, 71, 31, 72, 73, 74, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Windows_1252_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 16,  8, 11,  5, 19, 12,  3,  1, 27, 25,  9, 13,  2, 10, /* 4X */\n   21, 30,  4,  6,  7, 15, 23, 26, 29, 24, 28,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 16,  8, 11,  5, 19, 12,  3,  1, 27, 25,  9, 13,  2, 10, /* 6X */\n   21, 30,  4,  6,  7, 15, 23, 26, 29, 24, 28,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM, 75,SYM,SYM,SYM,SYM,SYM,SYM, 34,SYM, 76,ILL, 77,ILL, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 34,SYM, 78,ILL, 79, 80, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 81,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   82, 14, 83, 84, 33, 85, 86, 39, 35, 18, 42, 37, 87, 17, 88, 40, /* CX */\n   89, 32, 43, 22, 90, 91, 38,SYM, 36, 92, 20, 93, 31, 94, 95, 96, /* DX */\n   97, 14, 98, 99, 33,100,101, 39, 35, 18, 42, 37,102, 17,103, 40, /* EX */\n  104, 32, 43, 22,105,106, 38,SYM, 36,107, 20,108, 31,109,110,111, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_15_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 16,  8, 11,  5, 19, 12,  3,  1, 27, 25,  9, 13,  2, 10, /* 4X */\n   21, 30,  4,  6,  7, 15, 23, 26, 29, 24, 28,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 16,  8, 11,  5, 19, 12,  3,  1, 27, 25,  9, 13,  2, 10, /* 6X */\n   21, 30,  4,  6,  7, 15, 23, 26, 29, 24, 28,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM, 34,SYM, 34,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,112,113,SYM,SYM,114,SYM,SYM,SYM,115,116,117,SYM, /* BX */\n  118, 14,119,120, 33,121,122, 39, 35, 18, 42, 37,123, 17,124, 40, /* CX */\n  125, 32, 43, 22,126,127, 38,SYM, 36,128, 20,129, 31,130,131,132, /* DX */\n  133, 14,134,135, 33,136,137, 39, 35, 18, 42, 37,138, 17,139, 40, /* EX */\n  140, 32, 43, 22,141,142, 38,SYM, 36,143, 20,144, 31,145,146,147, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_9_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 16,  8, 11,  5, 19, 12,  3,  1, 27, 25,  9, 13,  2, 10, /* 4X */\n   21, 30,  4,  6,  7, 15, 23, 26, 29, 24, 28,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 16,  8, 11,  5, 19, 12,  3,  1, 27, 25,  9, 13,  2, 10, /* 6X */\n   21, 30,  4,  6,  7, 15, 23, 26, 29, 24, 28,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM,148,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n  149, 14,150,151, 33,152,153, 39, 35, 18, 42, 37,154, 17,155, 40, /* CX */\n  156, 32, 43, 22,157,158, 38,SYM, 36,159, 20,160, 31,161,162,163, /* DX */\n  164, 14,165,166, 33,167,168, 39, 35, 18, 42, 37,169, 17,170, 40, /* EX */\n  171, 32, 43, 22,172,173, 38,SYM, 36,174, 20,175, 31, 41,176,177, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 701\n * First 512 sequences: 0.9974076651249096\n * Next 512 sequences (512-1024): 0.0025923348750903907\n * Rest: -2.7755575615628914e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 IrishLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,0,3,0,3,0,3,3,3,3,2,3,3,2,\n  3,3,3,2,3,3,3,3,3,3,3,3,3,3,2,3,3,0,2,3,3,3,3,3,3,3,0,3,3,3,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,0,2,3,0,2,\n  3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,2,0,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,2,3,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,3,0,3,3,3,3,3,3,2,3,3,0,\n  3,3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,3,3,3,3,3,2,3,3,3,0,3,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,0,2,3,3,3,3,3,3,2,3,0,3,3,3,3,2,2,3,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,2,0,3,3,3,2,3,3,3,3,2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,0,3,2,0,0,2,0,0,0,0,2,0,3,0,0,0,0,\n  3,3,3,3,3,3,3,0,0,3,3,0,0,2,2,3,2,0,2,0,0,2,0,2,3,2,2,0,0,0,0,\n  3,3,3,3,3,3,3,2,0,2,3,2,0,2,0,2,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,\n  3,3,2,0,2,3,0,0,0,0,3,0,0,0,0,3,0,0,0,0,0,0,2,0,0,2,0,0,0,0,0,\n  3,3,2,3,0,3,2,0,0,0,3,2,2,2,0,2,2,0,0,0,0,0,0,0,2,0,0,0,2,0,2,\n  3,3,0,0,0,2,0,0,0,0,2,0,0,0,0,0,0,0,0,3,0,3,0,2,2,0,0,0,0,0,0,\n  2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Iso_8859_1IrishModel =\n{\n  Iso_8859_1_CharToOrderMap,\n  IrishLangModel,\n  31,\n  (float)0.9974076651249096,\n  PR_TRUE,\n  \"ISO-8859-1\"\n};\n\nconst SequenceModel Windows_1252IrishModel =\n{\n  Windows_1252_CharToOrderMap,\n  IrishLangModel,\n  31,\n  (float)0.9974076651249096,\n  PR_TRUE,\n  \"WINDOWS-1252\"\n};\n\nconst SequenceModel Iso_8859_15IrishModel =\n{\n  Iso_8859_15_CharToOrderMap,\n  IrishLangModel,\n  31,\n  (float)0.9974076651249096,\n  PR_TRUE,\n  \"ISO-8859-15\"\n};\n\nconst SequenceModel Iso_8859_9IrishModel =\n{\n  Iso_8859_9_CharToOrderMap,\n  IrishLangModel,\n  31,\n  (float)0.9974076651249096,\n  PR_TRUE,\n  \"ISO-8859-9\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangItalianModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Italian *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-21 18:46:08.841217\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_3_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 16,  9, 10,  2, 17, 14, 19,  0, 27, 21,  5, 12,  4,  3, /* 4X */\n   13, 20,  6,  8,  7, 11, 15, 25, 26, 23, 18,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 16,  9, 10,  2, 17, 14, 19,  0, 27, 21,  5, 12,  4,  3, /* 6X */\n   13, 20,  6,  8,  7, 11, 15, 25, 26, 23, 18,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 59,SYM,SYM,SYM,ILL, 60,SYM,SYM, 61, 48, 47, 62,SYM,ILL, 58, /* AX */\n  SYM, 63,SYM,SYM,SYM,SYM, 64,SYM,SYM, 46, 48, 47, 65,SYM,ILL, 58, /* BX */\n   22, 32, 50,ILL, 39, 66, 67, 38, 24, 30, 55, 40, 31, 37, 42, 49, /* CX */\n  ILL, 44, 29, 33, 51, 68, 34,SYM, 69, 28, 45, 70, 36, 71, 72, 73, /* DX */\n   22, 32, 50,ILL, 39, 74, 75, 38, 24, 30, 55, 40, 31, 37, 42, 49, /* EX */\n  ILL, 44, 29, 33, 51, 76, 34,SYM, 77, 28, 45, 78, 36, 79, 80,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_15_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 16,  9, 10,  2, 17, 14, 19,  0, 27, 21,  5, 12,  4,  3, /* 4X */\n   13, 20,  6,  8,  7, 11, 15, 25, 26, 23, 18,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 16,  9, 10,  2, 17, 14, 19,  0, 27, 21,  5, 12,  4,  3, /* 6X */\n   13, 20,  6,  8,  7, 11, 15, 25, 26, 23, 18,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM, 35,SYM, 35,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM, 41, 81,SYM,SYM, 41,SYM,SYM,SYM, 52, 52, 82,SYM, /* BX */\n   22, 32, 50, 43, 39, 53, 54, 38, 24, 30, 55, 40, 31, 37, 42, 49, /* CX */\n   56, 44, 29, 33, 51, 83, 34,SYM, 57, 28, 45, 84, 36, 85, 86, 87, /* DX */\n   22, 32, 50, 43, 39, 53, 54, 38, 24, 30, 55, 40, 31, 37, 42, 49, /* EX */\n   56, 44, 29, 33, 51, 88, 34,SYM, 57, 28, 45, 89, 36, 90, 91, 92, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_9_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 16,  9, 10,  2, 17, 14, 19,  0, 27, 21,  5, 12,  4,  3, /* 4X */\n   13, 20,  6,  8,  7, 11, 15, 25, 26, 23, 18,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 16,  9, 10,  2, 17, 14, 19,  0, 27, 21,  5, 12,  4,  3, /* 6X */\n   13, 20,  6,  8,  7, 11, 15, 25, 26, 23, 18,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 93,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   22, 32, 50, 43, 39, 53, 54, 38, 24, 30, 55, 40, 31, 37, 42, 49, /* CX */\n   47, 44, 29, 33, 51, 94, 34,SYM, 57, 28, 45, 95, 36, 96, 48, 97, /* DX */\n   22, 32, 50, 43, 39, 53, 54, 38, 24, 30, 55, 40, 31, 37, 42, 49, /* EX */\n   47, 44, 29, 33, 51, 98, 34,SYM, 57, 28, 45, 99, 36, 46, 48,100, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_1_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 16,  9, 10,  2, 17, 14, 19,  0, 27, 21,  5, 12,  4,  3, /* 4X */\n   13, 20,  6,  8,  7, 11, 15, 25, 26, 23, 18,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 16,  9, 10,  2, 17, 14, 19,  0, 27, 21,  5, 12,  4,  3, /* 6X */\n   13, 20,  6,  8,  7, 11, 15, 25, 26, 23, 18,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM,101,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   22, 32, 50, 43, 39, 53, 54, 38, 24, 30, 55, 40, 31, 37, 42, 49, /* CX */\n   56, 44, 29, 33, 51,102, 34,SYM, 57, 28, 45,103, 36,104,105,106, /* DX */\n   22, 32, 50, 43, 39, 53, 54, 38, 24, 30, 55, 40, 31, 37, 42, 49, /* EX */\n   56, 44, 29, 33, 51,107, 34,SYM, 57, 28, 45,108, 36,109,110,111, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Windows_1252_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 16,  9, 10,  2, 17, 14, 19,  0, 27, 21,  5, 12,  4,  3, /* 4X */\n   13, 20,  6,  8,  7, 11, 15, 25, 26, 23, 18,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 16,  9, 10,  2, 17, 14, 19,  0, 27, 21,  5, 12,  4,  3, /* 6X */\n   13, 20,  6,  8,  7, 11, 15, 25, 26, 23, 18,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM,112,SYM,SYM,SYM,SYM,SYM,SYM, 35,SYM, 52,ILL, 41,ILL, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 35,SYM, 52,ILL, 41,113, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM,114,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   22, 32, 50, 43, 39, 53, 54, 38, 24, 30, 55, 40, 31, 37, 42, 49, /* CX */\n   56, 44, 29, 33, 51,115, 34,SYM, 57, 28, 45,116, 36,117,118,119, /* DX */\n   22, 32, 50, 43, 39, 53, 54, 38, 24, 30, 55, 40, 31, 37, 42, 49, /* EX */\n   56, 44, 29, 33, 51,120, 34,SYM, 57, 28, 45,121, 36,122,123,124, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 872\n * First 512 sequences: 0.9989484485502651\n * Next 512 sequences (512-1024): 0.0010515514497349433\n * Rest: -4.336808689942018e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 ItalianLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,2,0,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,0,3,3,3,0,0,0,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,0,3,3,3,0,2,0,0,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,0,0,0,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,3,2,3,2,3,0,3,3,2,2,0,\n  3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,2,2,3,2,0,3,3,3,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,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_TRUE,\n  \"ISO-8859-3\"\n};\n\nconst SequenceModel Iso_8859_15ItalianModel =\n{\n  Iso_8859_15_CharToOrderMap,\n  ItalianLangModel,\n  34,\n  (float)0.9989484485502651,\n  PR_TRUE,\n  \"ISO-8859-15\"\n};\n\nconst SequenceModel Iso_8859_9ItalianModel =\n{\n  Iso_8859_9_CharToOrderMap,\n  ItalianLangModel,\n  34,\n  (float)0.9989484485502651,\n  PR_TRUE,\n  \"ISO-8859-9\"\n};\n\nconst SequenceModel Iso_8859_1ItalianModel =\n{\n  Iso_8859_1_CharToOrderMap,\n  ItalianLangModel,\n  34,\n  (float)0.9989484485502651,\n  PR_TRUE,\n  \"ISO-8859-1\"\n};\n\nconst SequenceModel Windows_1252ItalianModel =\n{\n  Windows_1252_CharToOrderMap,\n  ItalianLangModel,\n  34,\n  (float)0.9989484485502651,\n  PR_TRUE,\n  \"WINDOWS-1252\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangLatvianModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Latvian *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-21 00:19:18.362275\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_4_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 17, 22, 13,  3, 25, 19, 28,  1, 16, 11,  9, 12,  7, 10, /* 4X */\n   15, 38,  4,  2,  5,  6, 14, 33, 35, 34, 20,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 17, 22, 13,  3, 25, 19, 28,  1, 16, 11,  9, 12,  7, 10, /* 6X */\n   15, 38,  4,  2,  5,  6, 14, 33, 35, 34, 20,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 55, 56, 57,SYM, 58, 26,SYM,SYM, 23, 21, 31, 59,SYM, 29,SYM, /* AX */\n  SYM, 60,SYM, 61,SYM, 62, 26,SYM,SYM, 23, 21, 31, 63, 48, 29, 48, /* BX */\n    8, 42, 64, 65, 40, 52, 53, 66, 32, 37, 67, 43, 46, 45, 49, 18, /* CX */\n   68, 24, 51, 30, 69, 70, 36,SYM, 71, 72, 73, 74, 39, 75, 27, 44, /* DX */\n    8, 42, 76, 77, 40, 52, 53, 78, 32, 37, 79, 43, 46, 45, 49, 18, /* EX */\n   80, 24, 51, 30, 81, 82, 36,SYM, 83, 84, 85, 86, 39, 87, 27,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_10_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 17, 22, 13,  3, 25, 19, 28,  1, 16, 11,  9, 12,  7, 10, /* 4X */\n   15, 38,  4,  2,  5,  6, 14, 33, 35, 34, 20,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 17, 22, 13,  3, 25, 19, 28,  1, 16, 11,  9, 12,  7, 10, /* 6X */\n   15, 38,  4,  2,  5,  6, 14, 33, 35, 34, 20,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 88, 21, 31, 18, 89, 30,SYM, 26, 90, 23, 91, 29,SYM, 27, 48, /* AX */\n  SYM, 92, 21, 31, 18, 93, 30,SYM, 26, 94, 23, 95, 29, 96, 27, 48, /* BX */\n    8, 42, 97, 98, 40, 52, 53, 99, 32, 37,100, 43, 46, 45, 49,101, /* CX */\n   50, 24, 51, 47,102,103, 36,104,105,106,107,108, 39,109, 54, 44, /* DX */\n    8, 42,110,111, 40, 52, 53,112, 32, 37,113, 43, 46, 45, 49,114, /* EX */\n   50, 24, 51, 47,115,116, 36,117,118,119,120,121, 39,122, 54,123, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_13_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 17, 22, 13,  3, 25, 19, 28,  1, 16, 11,  9, 12,  7, 10, /* 4X */\n   15, 38,  4,  2,  5,  6, 14, 33, 35, 34, 20,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 17, 22, 13,  3, 25, 19, 28,  1, 16, 11,  9, 12,  7, 10, /* 6X */\n   15, 38,  4,  2,  5,  6, 14, 33, 35, 34, 20,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,124,SYM,125,SYM,SYM,SYM,SYM, 53, /* AX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,126,SYM,127,SYM,SYM,SYM,SYM, 53, /* BX */\n  128,129,  8,130, 40, 52,131, 21, 32, 37,132, 46, 31, 30, 18, 26, /* CX */\n   23,133, 24, 47, 51,134, 36,SYM,135, 41,136, 27, 39,137, 29, 44, /* DX */\n  138,139,  8,140, 40, 52,141, 21, 32, 37,142, 46, 31, 30, 18, 26, /* EX */\n   23,143, 24, 47, 51,144, 36,SYM,145, 41,146, 27, 39,147, 29,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 970\n * First 512 sequences: 0.9904102202220861\n * Next 512 sequences (512-1024): 0.009589779777913882\n * Rest: -1.734723475976807e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 LatvianLangModel[] =\n{\n  2,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,3,2,3,3,2,3,3,3,3,3,0,3,3,2,2,3,2,2,2,0,0,0,\n  3,3,3,3,3,3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nconst SequenceModel Iso_8859_4LatvianModel =\n{\n  Iso_8859_4_CharToOrderMap,\n  LatvianLangModel,\n  39,\n  (float)0.9904102202220861,\n  PR_TRUE,\n  \"ISO-8859-4\"\n};\n\nconst SequenceModel Iso_8859_10LatvianModel =\n{\n  Iso_8859_10_CharToOrderMap,\n  LatvianLangModel,\n  39,\n  (float)0.9904102202220861,\n  PR_TRUE,\n  \"ISO-8859-10\"\n};\n\nconst SequenceModel Iso_8859_13LatvianModel =\n{\n  Iso_8859_13_CharToOrderMap,\n  LatvianLangModel,\n  39,\n  (float)0.9904102202220861,\n  PR_TRUE,\n  \"ISO-8859-13\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangLithuanianModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Lithuanian *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-21 00:25:34.775158\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_10_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 18, 23, 12,  4, 25, 16, 26,  0, 14,  9, 10, 11,  6,  3, /* 4X */\n   15, 37,  5,  2,  7,  8, 13, 33, 32, 19, 27,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 18, 23, 12,  4, 25, 16, 26,  0, 14,  9, 10, 11,  6,  3, /* 6X */\n   15, 37,  5,  2,  7,  8, 13, 33, 32, 19, 27,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 29, 50, 60, 47, 61, 62,SYM, 56, 55, 21, 63, 22,SYM, 28, 64, /* AX */\n  SYM, 29, 50, 65, 47, 66, 67,SYM, 56, 55, 21, 68, 22, 69, 28, 70, /* BX */\n   41, 39, 71, 53, 38, 43, 72, 30, 24, 36, 31, 73, 17, 40, 74, 46, /* CX */\n   75, 57, 34, 44, 59, 76, 35, 77, 48, 20, 54, 78, 45, 79, 80, 52, /* DX */\n   41, 39, 81, 53, 38, 43, 82, 30, 24, 36, 31, 83, 17, 40, 84, 46, /* EX */\n   85, 57, 34, 44, 59, 86, 35, 87, 48, 20, 54, 88, 45, 89, 90, 91, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_4_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 18, 23, 12,  4, 25, 16, 26,  0, 14,  9, 10, 11,  6,  3, /* 4X */\n   15, 37,  5,  2,  7,  8, 13, 33, 32, 19, 27,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 18, 23, 12,  4, 25, 16, 26,  0, 14,  9, 10, 11,  6,  3, /* 6X */\n   15, 37,  5,  2,  7,  8, 13, 33, 32, 19, 27,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 29, 92, 93,SYM, 94, 56,SYM,SYM, 21, 50, 95, 96,SYM, 22,SYM, /* AX */\n  SYM, 29,SYM, 97,SYM, 98, 56,SYM,SYM, 21, 50, 99,100,101, 22,102, /* BX */\n   41, 39,103, 53, 38, 43,104, 30, 24, 36, 31,105, 17, 40,106, 47, /* CX */\n   55, 57, 34,107, 59,108, 35,SYM, 48, 20, 54,109, 45,110, 28, 52, /* DX */\n   41, 39,111, 53, 38, 43,112, 30, 24, 36, 31,113, 17, 40,114, 47, /* EX */\n   55, 57, 34,115, 59,116, 35,SYM, 48, 20, 54,117, 45,118, 28,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_13_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 18, 23, 12,  4, 25, 16, 26,  0, 14,  9, 10, 11,  6,  3, /* 4X */\n   15, 37,  5,  2,  7,  8, 13, 33, 32, 19, 27,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 18, 23, 12,  4, 25, 16, 26,  0, 14,  9, 10, 11,  6,  3, /* 6X */\n   15, 37,  5,  2,  7,  8, 13, 33, 32, 19, 27,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 48,SYM,119,SYM,SYM,SYM,SYM,120, /* AX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 48,SYM,121,SYM,SYM,SYM,SYM,122, /* BX */\n   29, 30, 41, 49, 38, 43, 31, 50, 24, 36,123, 17,124,125, 47, 56, /* CX */\n   21, 51, 57, 44, 34,126, 35,SYM, 20, 42, 58, 28, 45,127, 22, 52, /* DX */\n   29, 30, 41, 49, 38, 43, 31, 50, 24, 36,128, 17,129,130, 47, 56, /* EX */\n   21, 51, 57, 44, 34,131, 35,SYM, 20, 42, 58, 28, 45,132, 22,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 1016\n * First 512 sequences: 0.9928710196247589\n * Next 512 sequences (512-1024): 0.0071289803752411715\n * Rest: -4.85722573273506e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 LithuanianLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,3,3,3,3,0,2,3,2,2,2,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,0,3,3,3,3,3,3,3,0,0,0,0,2,2,0,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,2,0,3,3,2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,0,3,0,0,3,0,0,0,0,0,0,0,0,0,0,\n  0,0,3,0,0,2,0,0,0,2,2,2,0,2,3,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,2,3,0,0,3,0,3,0,3,3,2,2,3,2,3,3,2,0,0,0,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  3,2,0,0,2,2,0,2,2,0,0,0,0,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,\n  3,3,2,2,3,2,2,0,2,0,2,0,0,0,0,0,2,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,0,0,\n  2,0,2,0,2,0,2,0,0,2,0,2,2,0,0,0,2,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,0,2,0,0,2,2,2,0,2,2,2,2,0,0,0,2,0,0,0,0,0,0,2,0,2,0,2,0,0,0,0,0,0,0,0,0,0,\n  0,0,2,0,0,2,2,0,0,0,0,2,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Iso_8859_10LithuanianModel =\n{\n  Iso_8859_10_CharToOrderMap,\n  LithuanianLangModel,\n  38,\n  (float)0.9928710196247589,\n  PR_TRUE,\n  \"ISO-8859-10\"\n};\n\nconst SequenceModel Iso_8859_4LithuanianModel =\n{\n  Iso_8859_4_CharToOrderMap,\n  LithuanianLangModel,\n  38,\n  (float)0.9928710196247589,\n  PR_TRUE,\n  \"ISO-8859-4\"\n};\n\nconst SequenceModel Iso_8859_13LithuanianModel =\n{\n  Iso_8859_13_CharToOrderMap,\n  LithuanianLangModel,\n  38,\n  (float)0.9928710196247589,\n  PR_TRUE,\n  \"ISO-8859-13\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangMalteseModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Maltese *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-21 02:07:45.509404\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_3_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 15, 28, 13,  4, 16, 19, 22,  1,  9, 12,  3, 10,  5,  8, /* 4X */\n   14, 27,  6, 11,  2,  7, 26, 18, 25, 30, 20,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 15, 28, 13,  4, 16, 19, 22,  1,  9, 12,  3, 10,  5,  8, /* 6X */\n   14, 27,  6, 11,  2,  7, 26, 18, 25, 30, 20,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 17,SYM,SYM,SYM,ILL, 48,SYM,SYM, 49, 50, 51, 52,SYM,ILL, 21, /* AX */\n  SYM, 17,SYM,SYM,SYM,SYM, 53,SYM,SYM, 54, 55, 56, 57,SYM,ILL, 21, /* BX */\n   29, 36, 47,ILL, 58, 24, 59, 40, 33, 31, 60, 39, 45, 35, 61, 62, /* CX */\n  ILL, 37, 32, 34, 44, 23, 38,SYM, 63, 43, 42, 64, 46, 65, 66, 41, /* DX */\n   29, 36, 47,ILL, 67, 24, 68, 40, 33, 31, 69, 39, 45, 35, 70, 71, /* EX */\n  ILL, 37, 32, 34, 44, 23, 38,SYM, 72, 43, 42, 73, 46, 74, 75,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 870\n * First 512 sequences: 0.9959115850692665\n * Next 512 sequences (512-1024): 0.004088414930733575\n * Rest: -4.423544863740858e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 MalteseLangModel[] =\n{\n  3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,0,2,3,3,3,3,3,2,0,3,0,0,3,3,3,2,3,3,\n  3,3,3,3,3,2,2,3,3,3,3,3,3,3,2,3,3,2,3,3,2,0,3,3,0,3,3,3,2,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,\n  3,3,3,3,3,3,2,3,3,3,2,3,3,3,2,3,3,3,3,3,3,3,3,3,3,2,3,3,3,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,3,3,2,3,3,3,3,3,2,3,0,3,\n  3,3,3,3,3,3,3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,2,\n  3,3,2,2,3,3,3,3,3,3,3,3,3,3,2,3,3,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3,3,0,2,2,0,3,2,0,2,0,0,0,3,0,0,3,2,0,2,0,0,\n  3,3,0,2,3,2,3,3,3,3,0,2,0,3,2,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,2,\n  3,3,3,2,3,0,3,3,3,3,2,3,2,3,0,3,3,0,3,3,0,0,2,2,2,2,0,3,0,2,0,\n  3,3,3,3,3,0,2,2,3,2,0,3,3,3,0,2,3,0,0,0,2,0,3,0,0,0,0,2,2,0,2,\n  0,2,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,0,0,0,0,0,0,0,2,0,2,0,2,\n};\n\n\nconst SequenceModel Iso_8859_3MalteseModel =\n{\n  Iso_8859_3_CharToOrderMap,\n  MalteseLangModel,\n  31,\n  (float)0.9959115850692665,\n  PR_TRUE,\n  \"ISO-8859-3\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangNederlandsModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Nederlands *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2019-03-05 22:48:03.613070\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Windows_1252_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  2, 17, 16,  7,  0, 22, 10, 13,  3, 20, 14,  9, 12,  1,  6, /* 4X */\n   18, 27,  4,  8,  5, 15, 11, 19, 25, 23, 21,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  2, 17, 16,  7,  0, 22, 10, 13,  3, 20, 14,  9, 12,  1,  6, /* 6X */\n   18, 27,  4,  8,  5, 15, 11, 19, 25, 23, 21,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM, 55,SYM,SYM,SYM,SYM,SYM,SYM, 45,SYM, 53,ILL, 44,ILL, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 45,SYM, 53,ILL, 44, 59, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 54,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   38, 33, 43, 41, 37, 52, 47, 35, 30, 26, 39, 24, 60, 34, 40, 28, /* CX */\n   56, 46, 58, 31, 36, 48, 32,SYM, 50, 61, 42, 62, 29, 63, 64, 65, /* DX */\n   38, 33, 43, 41, 37, 52, 47, 35, 30, 26, 39, 24, 66, 34, 40, 28, /* EX */\n   56, 46, 58, 31, 36, 48, 32,SYM, 50, 67, 42, 68, 29, 69, 70, 71, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_1_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  2, 17, 16,  7,  0, 22, 10, 13,  3, 20, 14,  9, 12,  1,  6, /* 4X */\n   18, 27,  4,  8,  5, 15, 11, 19, 25, 23, 21,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  2, 17, 16,  7,  0, 22, 10, 13,  3, 20, 14,  9, 12,  1,  6, /* 6X */\n   18, 27,  4,  8,  5, 15, 11, 19, 25, 23, 21,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 54,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   38, 33, 43, 41, 37, 52, 47, 35, 30, 26, 39, 24, 72, 34, 40, 28, /* CX */\n   56, 46, 58, 31, 36, 48, 32,SYM, 50, 73, 42, 74, 29, 75, 76, 77, /* DX */\n   38, 33, 43, 41, 37, 52, 47, 35, 30, 26, 39, 24, 78, 34, 40, 28, /* EX */\n   56, 46, 58, 31, 36, 48, 32,SYM, 50, 79, 42, 80, 29, 81, 82, 83, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_9_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  2, 17, 16,  7,  0, 22, 10, 13,  3, 20, 14,  9, 12,  1,  6, /* 4X */\n   18, 27,  4,  8,  5, 15, 11, 19, 25, 23, 21,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  2, 17, 16,  7,  0, 22, 10, 13,  3, 20, 14,  9, 12,  1,  6, /* 6X */\n   18, 27,  4,  8,  5, 15, 11, 19, 25, 23, 21,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 54,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   38, 33, 43, 41, 37, 52, 47, 35, 30, 26, 39, 24, 84, 34, 40, 28, /* CX */\n   57, 46, 58, 31, 36, 48, 32,SYM, 50, 85, 42, 86, 29, 87, 51, 88, /* DX */\n   38, 33, 43, 41, 37, 52, 47, 35, 30, 26, 39, 24, 89, 34, 40, 28, /* EX */\n   57, 46, 58, 31, 36, 48, 32,SYM, 50, 90, 42, 91, 29, 49, 51, 92, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_15_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  2, 17, 16,  7,  0, 22, 10, 13,  3, 20, 14,  9, 12,  1,  6, /* 4X */\n   18, 27,  4,  8,  5, 15, 11, 19, 25, 23, 21,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  2, 17, 16,  7,  0, 22, 10, 13,  3, 20, 14,  9, 12,  1,  6, /* 6X */\n   18, 27,  4,  8,  5, 15, 11, 19, 25, 23, 21,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM, 45,SYM, 45,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM, 44, 54,SYM,SYM, 44,SYM,SYM,SYM, 53, 53, 93,SYM, /* BX */\n   38, 33, 43, 41, 37, 52, 47, 35, 30, 26, 39, 24, 94, 34, 40, 28, /* CX */\n   56, 46, 58, 31, 36, 48, 32,SYM, 50, 95, 42, 96, 29, 97, 98, 99, /* DX */\n   38, 33, 43, 41, 37, 52, 47, 35, 30, 26, 39, 24,100, 34, 40, 28, /* EX */\n   56, 46, 58, 31, 36, 48, 32,SYM, 50,101, 42,102, 29,103,104,105, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 924\n * First 512 sequences: 0.9980487395086337\n * Next 512 sequences (512-1024): 0.0019512604913663406\n * Rest: -4.9439619065339e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 NederlandsLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,0,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,2,2,2,0,2,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,0,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,0,3,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,2,0,2,2,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,3,2,0,2,0,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,0,2,3,0,0,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,2,3,2,0,2,2,0,2,2,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,2,2,0,0,0,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,2,3,0,0,2,2,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,3,0,2,2,0,0,2,2,2,0,\n  3,2,3,3,3,2,3,3,3,3,2,2,2,0,2,3,2,2,2,2,3,2,2,3,0,0,2,0,0,0,0,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,3,3,0,2,2,0,0,2,0,0,0,\n  3,3,3,3,3,3,3,2,3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0,2,2,0,3,3,2,0,0,2,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,2,0,0,2,2,0,0,2,2,2,0,2,2,2,0,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,2,0,0,3,2,0,0,2,2,2,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,\n  0,2,0,0,2,2,0,0,0,0,0,0,2,2,2,0,0,2,2,2,0,2,0,0,0,0,0,0,0,0,0,2,0,\n  0,2,0,2,2,2,0,0,0,2,0,0,2,2,0,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Windows_1252NederlandsModel =\n{\n  Windows_1252_CharToOrderMap,\n  NederlandsLangModel,\n  33,\n  (float)0.9980487395086337,\n  PR_TRUE,\n  \"WINDOWS-1252\"\n};\n\nconst SequenceModel Iso_8859_1NederlandsModel =\n{\n  Iso_8859_1_CharToOrderMap,\n  NederlandsLangModel,\n  33,\n  (float)0.9980487395086337,\n  PR_TRUE,\n  \"ISO-8859-1\"\n};\n\nconst SequenceModel Iso_8859_9NederlandsModel =\n{\n  Iso_8859_9_CharToOrderMap,\n  NederlandsLangModel,\n  33,\n  (float)0.9980487395086337,\n  PR_TRUE,\n  \"ISO-8859-9\"\n};\n\nconst SequenceModel Iso_8859_15NederlandsModel =\n{\n  Iso_8859_15_CharToOrderMap,\n  NederlandsLangModel,\n  33,\n  (float)0.9980487395086337,\n  PR_TRUE,\n  \"ISO-8859-15\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangPolishModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Polish *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-21 17:21:04.405363\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Ibm852_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 20, 11, 14,  3, 26, 21, 22,  1, 18,  7, 15, 16,  5,  2, /* 4X */\n   13, 36,  4,  6, 10, 17, 31,  9, 33, 12,  8,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 20, 11, 14,  3, 26, 21, 22,  1, 18,  7, 15, 16,  5,  2, /* 6X */\n   13, 36,  4,  6, 10, 17, 31,  9, 33, 12,  8,SYM,SYM,SYM,SYM,CTR, /* 7X */\n   47, 39, 34, 54, 40, 78, 30, 47, 19, 58, 49, 49, 77, 32, 40, 30, /* 8X */\n   34, 79, 80, 55, 38, 74, 74, 28, 28, 38, 39, 76, 76, 19,SYM, 44, /* 9X */\n   35, 37, 24, 51, 25, 25, 45, 45, 23, 23,SYM, 32, 44, 56,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 35, 54, 46, 56,SYM,SYM,SYM,SYM, 27, 27,SYM, /* BX */\n  SYM,SYM,SYM,SYM,SYM,SYM, 53, 53,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* CX */\n   70, 70, 69, 58, 69, 81, 37, 77, 46,SYM,SYM,SYM,SYM, 65, 82,SYM, /* DX */\n   24, 57, 55, 29, 29, 83, 41, 41, 84, 51, 85, 86, 60, 60, 65,SYM, /* EX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 87, 50, 50,SYM,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_16_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 20, 11, 14,  3, 26, 21, 22,  1, 18,  7, 15, 16,  5,  2, /* 4X */\n   13, 36,  4,  6, 10, 17, 31,  9, 33, 12,  8,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 20, 11, 14,  3, 26, 21, 22,  1, 18,  7, 15, 16,  5,  2, /* 6X */\n   13, 36,  4,  6, 10, 17, 31,  9, 33, 12,  8,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 25, 25, 19,SYM,SYM, 41,SYM, 41,SYM, 62,SYM, 32,SYM, 32, 27, /* AX */\n  SYM,SYM, 44, 19, 45,SYM,SYM,SYM, 45, 44, 62,SYM, 75, 75, 88, 27, /* BX */\n   61, 35, 54, 53, 40, 30, 89, 47, 43, 34, 64, 58, 90, 37, 77, 91, /* CX */\n   70, 29, 66, 24, 55, 49, 38, 28, 92, 68, 51, 93, 39, 23, 72, 57, /* DX */\n   61, 35, 54, 53, 40, 30, 94, 47, 43, 34, 64, 58, 95, 37, 77, 96, /* EX */\n   70, 29, 66, 24, 55, 49, 38, 28, 97, 68, 51, 98, 39, 23, 72, 99, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_2_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 20, 11, 14,  3, 26, 21, 22,  1, 18,  7, 15, 16,  5,  2, /* 4X */\n   13, 36,  4,  6, 10, 17, 31,  9, 33, 12,  8,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 20, 11, 14,  3, 26, 21, 22,  1, 18,  7, 15, 16,  5,  2, /* 6X */\n   13, 36,  4,  6, 10, 17, 31,  9, 33, 12,  8,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 25,SYM, 19,SYM, 74, 28,SYM,SYM, 41, 56, 76, 32,SYM, 45, 27, /* AX */\n  SYM, 25,SYM, 19,SYM, 74, 28,SYM,SYM, 41, 56, 76, 32,SYM, 45, 27, /* BX */\n  100, 35, 54, 53, 40,101, 30, 47, 44, 34, 23, 58, 46, 37, 77, 69, /* CX */\n   70, 29,102, 24, 55, 49, 38,SYM, 50,103, 51,104, 39, 60, 65, 57, /* DX */\n  105, 35, 54, 53, 40,106, 30, 47, 44, 34, 23, 58, 46, 37, 77, 69, /* EX */\n   70, 29,107, 24, 55, 49, 38,SYM, 50,108, 51,109, 39, 60, 65,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Mac_Centraleurope_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 20, 11, 14,  3, 26, 21, 22,  1, 18,  7, 15, 16,  5,  2, /* 4X */\n   13, 36,  4,  6, 10, 17, 31,  9, 33, 12,  8,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 20, 11, 14,  3, 26, 21, 22,  1, 18,  7, 15, 16,  5,  2, /* 6X */\n   13, 36,  4,  6, 10, 17, 31,  9, 33, 12,  8,SYM,SYM,SYM,SYM,CTR, /* 7X */\n   40, 63, 63, 34, 25, 38, 39, 35, 25, 44, 40, 44, 30, 30, 34, 32, /* 8X */\n   32, 69, 37, 69,110,111, 71, 24, 71, 55, 38, 67, 51, 46, 46, 39, /* 9X */\n  SYM,SYM, 23,SYM,SYM,SYM,SYM, 57,SYM,SYM,SYM, 23,SYM,SYM,112,113, /* AX */\n  114, 73,SYM,SYM, 73,115,SYM,SYM, 19,116,117, 74, 74,118,119,120, /* BX */\n  121, 29,SYM,SYM, 29,122,SYM,SYM,SYM,SYM,SYM,123, 49, 67, 49, 42, /* CX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 42,124,125, 50,SYM,SYM, 50,126, /* DX */\n  127, 41,SYM,SYM, 41, 28, 28, 35, 76, 76, 37, 45, 45, 59, 24, 55, /* EX */\n   59,128, 51,129,130,131,132,133, 60, 60,134, 27, 19, 27,135,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_13_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 20, 11, 14,  3, 26, 21, 22,  1, 18,  7, 15, 16,  5,  2, /* 4X */\n   13, 36,  4,  6, 10, 17, 31,  9, 33, 12,  8,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 20, 11, 14,  3, 26, 21, 22,  1, 18,  7, 15, 16,  5,  2, /* 6X */\n   13, 36,  4,  6, 10, 17, 31,  9, 33, 12,  8,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 48,SYM,136,SYM,SYM,SYM,SYM,137, /* AX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 48,SYM,138,SYM,SYM,SYM,SYM,139, /* BX */\n   25,140, 63, 30, 40, 52, 23,141, 44, 34, 32, 71,142,143, 73,144, /* CX */\n   41, 29,145, 24, 42, 67, 38,SYM,146, 19, 28, 59, 39, 27, 45, 57, /* DX */\n   25,147, 63, 30, 40, 52, 23,148, 44, 34, 32, 71,149,150, 73,151, /* EX */\n   41, 29,152, 24, 42, 67, 38,SYM,153, 19, 28, 59, 39, 27, 45,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Windows_1250_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 20, 11, 14,  3, 26, 21, 22,  1, 18,  7, 15, 16,  5,  2, /* 4X */\n   13, 36,  4,  6, 10, 17, 31,  9, 33, 12,  8,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 20, 11, 14,  3, 26, 21, 22,  1, 18,  7, 15, 16,  5,  2, /* 6X */\n   13, 36,  4,  6, 10, 17, 31,  9, 33, 12,  8,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM,ILL,SYM,SYM,SYM,SYM,ILL,SYM, 41,SYM, 28, 76, 45, 32, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM, 41,SYM, 28, 76, 45, 32, /* 9X */\n  SYM,SYM,SYM, 19,SYM, 25,SYM,SYM,SYM,SYM, 56,SYM,SYM,SYM,SYM, 27, /* AX */\n  SYM,SYM,SYM, 19,SYM,SYM,SYM,SYM,SYM, 25, 56,SYM, 74,SYM, 74, 27, /* BX */\n  154, 35, 54, 53, 40,155, 30, 47, 44, 34, 23, 58, 46, 37, 77, 69, /* CX */\n   70, 29,156, 24, 55, 49, 38,SYM, 50,157, 51,158, 39, 60, 65, 57, /* DX */\n  159, 35, 54, 53, 40,160, 30, 47, 44, 34, 23, 58, 46, 37, 77, 69, /* EX */\n   70, 29,161, 24, 55, 49, 38,SYM, 50,162, 51,163, 39, 60, 65,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 1321\n * First 512 sequences: 0.9894531815946438\n * Next 512 sequences (512-1024): 0.010193795364991133\n * Rest: 0.0003530230403650733\n * Negative sequences: TODO\n */\nconstexpr PRUint8 PolishLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0,3,3,3,3,3,3,3,2,0,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,2,3,3,3,2,2,2,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,0,0,0,3,3,3,3,2,3,2,2,0,0,1,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,0,2,2,3,3,3,3,2,3,2,2,0,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,3,2,3,3,3,2,2,2,0,2,2,0,1,2,2,2,\n  3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,2,2,3,2,1,2,3,2,3,3,3,3,2,0,0,0,2,0,2,2,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,2,3,2,3,3,2,0,0,0,0,2,0,0,2,2,2,\n  3,3,3,3,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0,0,0,0,2,0,2,0,0,0,\n  2,1,2,2,2,2,2,0,1,0,2,2,1,1,2,2,2,1,1,0,1,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,\n  0,1,0,1,2,2,2,2,2,0,2,2,0,2,1,2,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,\n  1,2,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Ibm852PolishModel =\n{\n  Ibm852_CharToOrderMap,\n  PolishLangModel,\n  37,\n  (float)0.9894531815946438,\n  PR_TRUE,\n  \"IBM852\"\n};\n\nconst SequenceModel Iso_8859_16PolishModel =\n{\n  Iso_8859_16_CharToOrderMap,\n  PolishLangModel,\n  37,\n  (float)0.9894531815946438,\n  PR_TRUE,\n  \"ISO-8859-16\"\n};\n\nconst SequenceModel Iso_8859_2PolishModel =\n{\n  Iso_8859_2_CharToOrderMap,\n  PolishLangModel,\n  37,\n  (float)0.9894531815946438,\n  PR_TRUE,\n  \"ISO-8859-2\"\n};\n\nconst SequenceModel Mac_CentraleuropePolishModel =\n{\n  Mac_Centraleurope_CharToOrderMap,\n  PolishLangModel,\n  37,\n  (float)0.9894531815946438,\n  PR_TRUE,\n  \"MAC-CENTRALEUROPE\"\n};\n\nconst SequenceModel Iso_8859_13PolishModel =\n{\n  Iso_8859_13_CharToOrderMap,\n  PolishLangModel,\n  37,\n  (float)0.9894531815946438,\n  PR_TRUE,\n  \"ISO-8859-13\"\n};\n\nconst SequenceModel Windows_1250PolishModel =\n{\n  Windows_1250_CharToOrderMap,\n  PolishLangModel,\n  37,\n  (float)0.9894531815946438,\n  PR_TRUE,\n  \"WINDOWS-1250\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangPortugueseModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Portuguese *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-20 23:47:27.348423\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_1_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 17, 10,  7,  1, 16, 14, 18,  4, 28, 34, 12,  9,  6,  2, /* 4X */\n   13, 21,  5,  3,  8, 11, 15, 32, 24, 31, 26,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 17, 10,  7,  1, 16, 14, 18,  4, 28, 34, 12,  9,  6,  2, /* 6X */\n   13, 21,  5,  3,  8, 11, 15, 32, 24, 31, 26,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 51,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   36, 25, 35, 20, 41, 42, 43, 22, 39, 19, 29, 44, 52, 23, 45, 47, /* CX */\n   48, 53, 46, 27, 37, 30, 38,SYM, 54, 55, 33, 56, 40, 57, 58, 49, /* DX */\n   36, 25, 35, 20, 41, 42, 43, 22, 39, 19, 29, 44, 59, 23, 45, 47, /* EX */\n   48, 60, 46, 27, 37, 30, 38,SYM, 61, 62, 33, 63, 40, 64, 65, 50, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_9_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 17, 10,  7,  1, 16, 14, 18,  4, 28, 34, 12,  9,  6,  2, /* 4X */\n   13, 21,  5,  3,  8, 11, 15, 32, 24, 31, 26,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 17, 10,  7,  1, 16, 14, 18,  4, 28, 34, 12,  9,  6,  2, /* 6X */\n   13, 21,  5,  3,  8, 11, 15, 32, 24, 31, 26,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 66,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   36, 25, 35, 20, 41, 42, 43, 22, 39, 19, 29, 44, 67, 23, 45, 47, /* CX */\n   68, 69, 46, 27, 37, 30, 38,SYM, 70, 71, 33, 72, 40, 73, 74, 49, /* DX */\n   36, 25, 35, 20, 41, 42, 43, 22, 39, 19, 29, 44, 75, 23, 45, 47, /* EX */\n   76, 77, 46, 27, 37, 30, 38,SYM, 78, 79, 33, 80, 40, 81, 82, 50, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_15_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 17, 10,  7,  1, 16, 14, 18,  4, 28, 34, 12,  9,  6,  2, /* 4X */\n   13, 21,  5,  3,  8, 11, 15, 32, 24, 31, 26,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 17, 10,  7,  1, 16, 14, 18,  4, 28, 34, 12,  9,  6,  2, /* 6X */\n   13, 21,  5,  3,  8, 11, 15, 32, 24, 31, 26,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM, 83,SYM, 84,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM, 85, 86,SYM,SYM, 87,SYM,SYM,SYM, 88, 89, 50,SYM, /* BX */\n   36, 25, 35, 20, 41, 42, 43, 22, 39, 19, 29, 44, 90, 23, 45, 47, /* CX */\n   48, 91, 46, 27, 37, 30, 38,SYM, 92, 93, 33, 94, 40, 95, 96, 49, /* DX */\n   36, 25, 35, 20, 41, 42, 43, 22, 39, 19, 29, 44, 97, 23, 45, 47, /* EX */\n   48, 98, 46, 27, 37, 30, 38,SYM, 99,100, 33,101, 40,102,103, 50, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Windows_1252_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 17, 10,  7,  1, 16, 14, 18,  4, 28, 34, 12,  9,  6,  2, /* 4X */\n   13, 21,  5,  3,  8, 11, 15, 32, 24, 31, 26,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 17, 10,  7,  1, 16, 14, 18,  4, 28, 34, 12,  9,  6,  2, /* 6X */\n   13, 21,  5,  3,  8, 11, 15, 32, 24, 31, 26,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM,104,SYM,SYM,SYM,SYM,SYM,SYM,105,SYM,106,ILL,107,ILL, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,108,SYM,109,ILL,110, 50, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM,111,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   36, 25, 35, 20, 41, 42, 43, 22, 39, 19, 29, 44,112, 23, 45, 47, /* CX */\n   48,113, 46, 27, 37, 30, 38,SYM,114,115, 33,116, 40,117,118, 49, /* DX */\n   36, 25, 35, 20, 41, 42, 43, 22, 39, 19, 29, 44,119, 23, 45, 47, /* EX */\n   48,120, 46, 27, 37, 30, 38,SYM,121,122, 33,123, 40,124,125, 50, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 891\n * First 512 sequences: 0.9953179582313172\n * Next 512 sequences (512-1024): 0.0046820417686827855\n * Rest: 2.42861286636753e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 PortugueseLangModel[] =\n{\n  2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,0,3,3,3,3,0,3,2,3,0,0,3,2,2,3,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,0,2,3,3,2,3,2,3,2,3,0,2,3,3,2,2,2,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,3,2,3,2,3,2,3,0,2,3,3,0,3,0,0,0,\n  3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,3,0,3,0,3,2,3,0,2,3,3,2,2,3,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,0,3,3,3,3,2,3,3,2,2,2,3,2,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,3,2,3,3,3,2,2,3,3,0,3,\n  3,3,3,3,3,2,3,3,3,2,3,3,2,2,3,3,3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,0,2,0,2,3,0,0,0,0,0,0,0,2,0,0,0,0,2,2,0,2,0,0,0,\n  0,0,0,3,0,2,3,3,2,3,2,0,3,2,0,2,0,3,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,\n  3,3,3,2,3,2,2,0,0,3,2,2,2,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,2,0,0,0,\n  0,0,0,0,0,0,3,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,0,2,2,0,0,3,2,2,3,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Iso_8859_1PortugueseModel =\n{\n  Iso_8859_1_CharToOrderMap,\n  PortugueseLangModel,\n  38,\n  (float)0.9953179582313172,\n  PR_TRUE,\n  \"ISO-8859-1\"\n};\n\nconst SequenceModel Iso_8859_9PortugueseModel =\n{\n  Iso_8859_9_CharToOrderMap,\n  PortugueseLangModel,\n  38,\n  (float)0.9953179582313172,\n  PR_TRUE,\n  \"ISO-8859-9\"\n};\n\nconst SequenceModel Iso_8859_15PortugueseModel =\n{\n  Iso_8859_15_CharToOrderMap,\n  PortugueseLangModel,\n  38,\n  (float)0.9953179582313172,\n  PR_TRUE,\n  \"ISO-8859-15\"\n};\n\nconst SequenceModel Windows_1252PortugueseModel =\n{\n  Windows_1252_CharToOrderMap,\n  PortugueseLangModel,\n  38,\n  (float)0.9953179582313172,\n  PR_TRUE,\n  \"WINDOWS-1252\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangRomanianModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Romanian *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-28 18:58:13.757152\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_16_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  2, 17,  9, 11,  0, 16, 15, 23,  1, 26, 27,  6, 12,  4,  8, /* 4X */\n   13, 32,  3, 10,  5,  7, 21, 29, 25, 28, 22,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  2, 17,  9, 11,  0, 16, 15, 23,  1, 26, 27,  6, 12,  4,  8, /* 6X */\n   13, 32,  3, 10,  5,  7, 21, 29, 25, 28, 22,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 60, 61, 46,SYM,SYM, 38,SYM, 38,SYM, 19,SYM, 62,SYM, 63, 64, /* AX */\n  SYM,SYM, 41, 46, 40,SYM,SYM,SYM, 40, 41, 19,SYM, 65, 66, 67, 68, /* BX */\n   69, 30, 24, 14, 33, 35, 53, 42, 45, 31, 58, 49, 70, 37, 20, 48, /* CX */\n   43, 52, 59, 34, 71, 44, 36, 56, 50, 72, 47, 73, 39, 74, 18, 57, /* DX */\n   75, 30, 24, 14, 33, 35, 53, 42, 45, 31, 58, 49, 76, 37, 20, 48, /* EX */\n   43, 52, 59, 34, 77, 44, 36, 56, 50, 78, 47, 79, 39, 80, 18, 81, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_2_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  2, 17,  9, 11,  0, 16, 15, 23,  1, 26, 27,  6, 12,  4,  8, /* 4X */\n   13, 32,  3, 10,  5,  7, 21, 29, 25, 28, 22,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  2, 17,  9, 11,  0, 16, 15, 23,  1, 26, 27,  6, 12,  4,  8, /* 6X */\n   13, 32,  3, 10,  5,  7, 21, 29, 25, 28, 22,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 82,SYM, 46,SYM, 83, 56,SYM,SYM, 38, 84, 85, 86,SYM, 40, 87, /* AX */\n  SYM, 88,SYM, 46,SYM, 89, 56,SYM,SYM, 38, 90, 91, 92,SYM, 40, 93, /* BX */\n   94, 30, 24, 14, 33, 95, 35, 42, 41, 31, 96, 49, 51, 37, 20, 97, /* CX */\n   43, 52, 98, 34, 99, 44, 36,SYM, 55,100, 47, 50, 39, 54,101, 57, /* DX */\n  102, 30, 24, 14, 33,103, 35, 42, 41, 31,104, 49, 51, 37, 20,105, /* EX */\n   43, 52,106, 34,107, 44, 36,SYM, 55,108, 47, 50, 39, 54,109,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Windows_1250_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  2, 17,  9, 11,  0, 16, 15, 23,  1, 26, 27,  6, 12,  4,  8, /* 4X */\n   13, 32,  3, 10,  5,  7, 21, 29, 25, 28, 22,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  2, 17,  9, 11,  0, 16, 15, 23,  1, 26, 27,  6, 12,  4,  8, /* 6X */\n   13, 32,  3, 10,  5,  7, 21, 29, 25, 28, 22,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM,ILL,SYM,SYM,SYM,SYM,ILL,SYM, 38,SYM, 56,110, 40,111, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM, 38,SYM, 56,112, 40,113, /* 9X */\n  SYM,SYM,SYM, 46,SYM,114,SYM,SYM,SYM,SYM,115,SYM,SYM,SYM,SYM,116, /* AX */\n  SYM,SYM,SYM, 46,SYM,SYM,SYM,SYM,SYM,117,118,SYM,119,SYM,120,121, /* BX */\n  122, 30, 24, 14, 33,123, 35, 42, 41, 31,124, 49, 51, 37, 20,125, /* CX */\n   43, 52,126, 34,127, 44, 36,SYM, 55,128, 47, 50, 39, 54,129, 57, /* DX */\n  130, 30, 24, 14, 33,131, 35, 42, 41, 31,132, 49, 51, 37, 20,133, /* EX */\n   43, 52,134, 34,135, 44, 36,SYM, 55,136, 47, 50, 39, 54,137,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Ibm852_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  2, 17,  9, 11,  0, 16, 15, 23,  1, 26, 27,  6, 12,  4,  8, /* 4X */\n   13, 32,  3, 10,  5,  7, 21, 29, 25, 28, 22,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  2, 17,  9, 11,  0, 16, 15, 23,  1, 26, 27,  6, 12,  4,  8, /* 6X */\n   13, 32,  3, 10,  5,  7, 21, 29, 25, 28, 22,SYM,SYM,SYM,SYM,CTR, /* 7X */\n   42, 39, 31, 24, 33,138, 35, 42, 46, 49, 44, 44, 20,139, 33, 35, /* 8X */\n   31,140,141,142, 36,143,144, 56, 56, 36, 39,145,146, 46,SYM, 41, /* 9X */\n   30, 37, 34, 47,147,148, 40, 40,149,150,SYM,151, 41,152,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 30, 24, 51,153,SYM,SYM,SYM,SYM,154,155,SYM, /* BX */\n  SYM,SYM,SYM,SYM,SYM,SYM, 14, 14,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* CX */\n   43, 43,156, 49,157,158, 37, 20, 51,SYM,SYM,SYM,SYM,159,160,SYM, /* DX */\n   34, 57,161, 52, 52,162, 38, 38,163, 47,164, 50, 54, 54,165,SYM, /* EX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 50, 55, 55,SYM,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 981\n * First 512 sequences: 0.997762564143313\n * Next 512 sequences (512-1024): 0.002237435856687006\n * Rest: 3.0357660829594124e-18\n * Negative sequences: TODO\n */\nconstexpr PRUint8 RomanianLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,2,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,0,3,3,3,2,3,3,3,2,2,0,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,0,3,3,3,0,3,3,3,3,3,0,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,2,2,3,3,2,2,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,0,3,3,3,3,2,3,3,3,3,2,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,0,2,2,3,3,3,3,0,2,2,3,3,2,3,0,\n  3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,2,2,3,0,3,3,3,2,2,2,0,\n  3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,2,2,0,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,0,3,3,3,0,3,2,3,3,3,2,0,2,\n  3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,2,2,0,\n  0,3,0,3,3,3,3,3,0,2,2,2,3,0,0,0,0,0,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  3,3,3,2,0,3,0,3,3,3,2,0,0,3,3,0,3,0,0,0,0,3,0,2,2,3,0,0,3,0,0,0,0,\n  3,3,3,2,2,2,3,3,3,0,2,2,2,0,2,0,0,2,0,0,0,2,0,0,2,0,0,2,0,0,2,0,0,\n  3,3,3,3,2,3,3,3,3,2,3,2,3,2,2,2,2,2,2,2,2,2,0,3,0,0,0,2,3,2,2,2,0,\n  3,2,3,3,3,2,3,2,3,3,3,3,3,2,0,2,0,2,0,0,0,2,2,2,0,0,2,2,0,2,2,0,0,\n  3,3,3,2,3,2,2,2,3,2,3,2,2,2,0,0,2,2,0,0,0,0,0,3,0,0,0,0,2,3,0,0,0,\n  2,3,0,3,3,2,2,0,0,2,2,2,2,0,0,2,0,0,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0,\n  0,3,2,2,2,2,2,0,0,2,2,2,2,2,0,2,0,2,0,0,0,2,2,0,0,0,2,2,0,0,0,0,0,\n  0,0,2,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,\n};\n\n\nconst SequenceModel Iso_8859_16RomanianModel =\n{\n  Iso_8859_16_CharToOrderMap,\n  RomanianLangModel,\n  33,\n  (float)0.997762564143313,\n  PR_TRUE,\n  \"ISO-8859-16\"\n};\n\nconst SequenceModel Iso_8859_2RomanianModel =\n{\n  Iso_8859_2_CharToOrderMap,\n  RomanianLangModel,\n  33,\n  (float)0.997762564143313,\n  PR_TRUE,\n  \"ISO-8859-2\"\n};\n\nconst SequenceModel Windows_1250RomanianModel =\n{\n  Windows_1250_CharToOrderMap,\n  RomanianLangModel,\n  33,\n  (float)0.997762564143313,\n  PR_TRUE,\n  \"WINDOWS-1250\"\n};\n\nconst SequenceModel Ibm852RomanianModel =\n{\n  Ibm852_CharToOrderMap,\n  RomanianLangModel,\n  33,\n  (float)0.997762564143313,\n  PR_TRUE,\n  \"IBM852\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangRussianModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n\n\n//KOI8-R language model\n//Character Mapping Table:\nconstexpr unsigned char KOI8R_CharToOrderMap[] =\n{\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR,  //00\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,  //10\nSYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,  //20\nNUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM,  //30\nSYM,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154,  //40\n155,156,157,158,159,160,161,162,163,164,165,SYM,SYM,SYM,SYM,SYM,  //50\nSYM, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69,  //60\n 67,179, 78, 73,180,181, 79,182,183,184,185,SYM,SYM,SYM,SYM,SYM,  //70\n191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,  //80\n207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,  //90\n223,224,225, 68,226,227,228,229,230,231,232,233,234,235,236,237,  //a0\n238,239,240,241,242,243,244,245,246,247,248,249,250,251,NUM,SYM,  //b0\n 27,  3, 21, 28, 13,  2, 39, 19, 26,  4, 23, 11,  8, 12,  5,  1,  //c0\n 15, 16,  9,  7,  6, 14, 24, 10, 17, 18, 20, 25, 30, 29, 22, 54,  //d0\n 59, 37, 44, 58, 41, 48, 53, 46, 55, 42, 60, 36, 49, 38, 31, 34,  //e0\n 35, 43, 45, 32, 40, 52, 56, 33, 61, 62, 51, 57, 47, 63, 50, 70,  //f0\n};\n\nconstexpr unsigned char win1251_CharToOrderMap[] =\n{\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR,  //00\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,  //10\nSYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,  //20\nNUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM,  //30\nSYM,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154,  //40\n155,156,157,158,159,160,161,162,163,164,165,SYM,SYM,SYM,SYM,SYM,  //50\nSYM, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69,  //60\n 67,179, 78, 73,180,181, 79,182,183,184,185,SYM,SYM,SYM,SYM,SYM,  //70\n191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,\n207,208,209,210,211,212,213,214,ILL,216,217,218,219,220,221,222,\n223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,\n239,240,241,242,243,244,245,246, 68,247,248,249,250,251,NUM,SYM,\n 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35,\n 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43,\n  3, 21, 10, 19, 13,  2, 24, 20,  4, 23, 11,  8, 12,  5,  1, 15,\n  9,  7,  6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16,\n};\n\nconstexpr unsigned char latin5_CharToOrderMap[] =\n{\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR,  //00\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,  //10\nSYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,  //20\nNUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM,  //30\nSYM,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154,  //40\n155,156,157,158,159,160,161,162,163,164,165,SYM,SYM,SYM,SYM,SYM,  //50\nSYM, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69,  //60\n 67,179, 78, 73,180,181, 79,182,183,184,185,SYM,SYM,SYM,SYM,SYM,  //70\n191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,\n207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,\n223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,\n 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35,\n 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43,\n  3, 21, 10, 19, 13,  2, 24, 20,  4, 23, 11,  8, 12,  5,  1, 15,\n  9,  7,  6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16,\n239, 68,240,241,242,243,244,245,246,247,248,249,250,251,NUM,CTR,\n};\n\nconstexpr unsigned char macCyrillic_CharToOrderMap[] =\n{\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR,  //00\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,  //10\nSYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,  //20\nNUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM,  //30\nSYM,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154,  //40\n155,156,157,158,159,160,161,162,163,164,165,SYM,SYM,SYM,SYM,SYM,  //50\nSYM, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69,  //60\n 67,179, 78, 73,180,181, 79,182,183,184,185,SYM,SYM,SYM,SYM,SYM,  //70\n 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35,\n 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43,\n191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,\n207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,\n223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,\n239,240,241,242,243,244,245,246,247,248,249,250,251,NUM, 68, 16,\n  3, 21, 10, 19, 13,  2, 24, 20,  4, 23, 11,  8, 12,  5,  1, 15,\n  9,  7,  6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27,CTR,\n};\n\nconstexpr unsigned char IBM855_CharToOrderMap[] =\n{\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR,  //00\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,  //10\nSYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,  //20\nNUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM,  //30\nSYM,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154,  //40\n155,156,157,158,159,160,161,162,163,164,165,SYM,SYM,SYM,SYM,SYM,  //50\nSYM, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69,  //60\n 67,179, 78, 73,180,181, 79,182,183,184,185,SYM,SYM,SYM,SYM,SYM,  //70\n191,192,193,194, 68,195,196,197,198,199,200,201,202,203,204,205,\n206,207,208,209,210,211,212,213,214,215,216,217, 27, 59, 54, 70,\n  3, 37, 21, 44, 28, 58, 13, 41,  2, 48, 39, 53, 19, 46,218,219,\n220,221,222,223,224, 26, 55,  4, 42,225,226,227,228, 23, 60,229,\n230,231,232,233,234,235, 11, 36,236,237,238,239,240,241,242,243,\n  8, 49, 12, 38,  5, 31,  1, 34, 15,244,245,246,247, 35, 16,248,\n 43,  9, 45,  7, 32,  6, 40, 14, 52, 24, 56, 10, 33, 17, 61,249,\n250, 18, 62, 20, 51, 25, 57, 30, 47, 29, 63, 22, 50,251,NUM,CTR,\n};\n\nconstexpr unsigned char IBM866_CharToOrderMap[] =\n{\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR,  //00\nCTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,  //10\nSYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,  //20\nNUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM,  //30\nSYM,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154,  //40\n155,156,157,158,159,160,161,162,163,164,165,SYM,SYM,SYM,SYM,SYM,  //50\nSYM, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69,  //60\n 67,179, 78, 73,180,181, 79,182,183,184,185,SYM,SYM,SYM,SYM,SYM,  //70\n 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35,\n 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43,\n  3, 21, 10, 19, 13,  2, 24, 20,  4, 23, 11,  8, 12,  5,  1, 15,\n191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,\n207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,\n223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,\n  9,  7,  6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16,\n239, 68,240,241,242,243,244,245,246,247,248,249,250,251,NUM,CTR,\n};\n\n//Model Table: \n//total sequences: 100%\n//first 512 sequences: 97.6601%\n//first 1024 sequences: 2.3389%\n//rest  sequences:      0.1237%\n//negative sequences:   0.0009% \nconstexpr PRUint8 RussianLangModel[] = \n{\n0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,3,3,3,3,1,3,3,3,2,3,2,3,3,\n3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,2,2,2,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\n0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,\n};\n\n\nconst SequenceModel Koi8rRussianModel =\n{\n  KOI8R_CharToOrderMap,\n  RussianLangModel,\n  64,\n  (float)0.976601,\n  PR_FALSE,\n  \"KOI8-R\"\n};\n\nconst SequenceModel Win1251RussianModel =\n{\n  win1251_CharToOrderMap,\n  RussianLangModel,\n  64,\n  (float)0.976601,\n  PR_FALSE,\n  \"WINDOWS-1251\"\n};\n\nconst SequenceModel Latin5RussianModel =\n{\n  latin5_CharToOrderMap,\n  RussianLangModel,\n  64,\n  (float)0.976601,\n  PR_FALSE,\n  \"ISO-8859-5\"\n};\n\nconst SequenceModel MacCyrillicRussianModel =\n{\n  macCyrillic_CharToOrderMap,\n  RussianLangModel,\n  64,\n  (float)0.976601,\n  PR_FALSE,\n  \"MAC-CYRILLIC\"\n};\n\nconst SequenceModel Ibm866RussianModel =\n{\n  IBM866_CharToOrderMap,\n  RussianLangModel,\n  64,\n  (float)0.976601,\n  PR_FALSE,\n  \"IBM866\"\n};\n\nconst SequenceModel Ibm855RussianModel =\n{\n  IBM855_CharToOrderMap,\n  RussianLangModel,\n  64,\n  (float)0.976601,\n  PR_FALSE,\n  \"IBM855\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangSlovakModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Slovak *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-21 13:33:10.331339\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Ibm852_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 20, 15, 11,  2, 29, 30, 17,  4, 18,  7, 10, 12,  3,  0, /* 4X */\n   13, 40,  6,  8,  5, 14,  9, 37, 34, 19, 16,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 20, 15, 11,  2, 29, 30, 17,  4, 18,  7, 10, 12,  3,  0, /* 6X */\n   13, 40,  6,  8,  5, 14,  9, 37, 34, 19, 16,SYM,SYM,SYM,SYM,CTR, /* 7X */\n   51, 46, 25, 62, 38, 48, 47, 51, 49, 54, 50, 50, 63, 64, 38, 47, /* 8X */\n   25, 42, 42, 32, 43, 33, 33, 65, 66, 43, 46, 31, 31, 49,SYM, 24, /* 9X */\n   21, 23, 35, 27, 67, 68, 26, 26, 69, 70,SYM, 71, 24, 59,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 21, 72, 41, 59,SYM,SYM,SYM,SYM, 61, 61,SYM, /* BX */\n  SYM,SYM,SYM,SYM,SYM,SYM, 56, 56,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* CX */\n   55, 55, 39, 54, 39, 36, 23, 73, 41,SYM,SYM,SYM,SYM, 74, 48,SYM, /* DX */\n   35, 58, 32, 52, 52, 36, 28, 28, 44, 27, 44, 60, 22, 22, 75,SYM, /* EX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 60, 45, 45,SYM,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_2_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 20, 15, 11,  2, 29, 30, 17,  4, 18,  7, 10, 12,  3,  0, /* 4X */\n   13, 40,  6,  8,  5, 14,  9, 37, 34, 19, 16,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 20, 15, 11,  2, 29, 30, 17,  4, 18,  7, 10, 12,  3,  0, /* 6X */\n   13, 40,  6,  8,  5, 14,  9, 37, 34, 19, 16,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 76,SYM, 49,SYM, 33, 77,SYM,SYM, 28, 59, 31, 78,SYM, 26, 61, /* AX */\n  SYM, 79,SYM, 49,SYM, 33, 80,SYM,SYM, 28, 59, 31, 81,SYM, 26, 61, /* BX */\n   44, 21, 82, 56, 38, 42, 47, 51, 24, 25, 83, 54, 41, 23, 84, 39, /* CX */\n   55, 52, 36, 35, 32, 50, 43,SYM, 45, 48, 27, 60, 46, 22, 85, 58, /* DX */\n   44, 21, 86, 56, 38, 42, 47, 51, 24, 25, 87, 54, 41, 23, 88, 39, /* EX */\n   55, 52, 36, 35, 32, 50, 43,SYM, 45, 48, 27, 60, 46, 22, 89,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Mac_Centraleurope_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 20, 15, 11,  2, 29, 30, 17,  4, 18,  7, 10, 12,  3,  0, /* 4X */\n   13, 40,  6,  8,  5, 14,  9, 37, 34, 19, 16,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 20, 15, 11,  2, 29, 30, 17,  4, 18,  7, 10, 12,  3,  0, /* 6X */\n   13, 40,  6,  8,  5, 14,  9, 37, 34, 19, 16,SYM,SYM,SYM,SYM,CTR, /* 7X */\n   38, 90, 91, 25, 92, 43, 46, 21, 93, 24, 38, 24, 47, 47, 25, 94, /* 8X */\n   95, 39, 23, 39, 96, 97, 98, 35, 99, 32, 43,100, 27, 41, 41, 46, /* 9X */\n  SYM,SYM,101,SYM,SYM,SYM,SYM, 58,SYM,SYM,SYM,102,SYM,SYM,103,104, /* AX */\n  105, 57,SYM,SYM, 57,106,SYM,SYM, 49,107,108, 33, 33, 42, 42,109, /* BX */\n  110, 52,SYM,SYM, 52, 36,SYM,SYM,SYM,SYM,SYM, 36, 50,111, 50, 53, /* CX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 53, 44, 44, 45,SYM,SYM, 45,112, /* DX */\n  113, 28,SYM,SYM, 28,114,115, 21, 31, 31, 23, 26, 26,116, 35, 32, /* EX */\n  117, 48, 27, 48, 60, 60,118,119, 22, 22,120, 61, 49, 61,121,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Windows_1250_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 20, 15, 11,  2, 29, 30, 17,  4, 18,  7, 10, 12,  3,  0, /* 4X */\n   13, 40,  6,  8,  5, 14,  9, 37, 34, 19, 16,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 20, 15, 11,  2, 29, 30, 17,  4, 18,  7, 10, 12,  3,  0, /* 6X */\n   13, 40,  6,  8,  5, 14,  9, 37, 34, 19, 16,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM,ILL,SYM,SYM,SYM,SYM,ILL,SYM, 28,SYM,122, 31, 26,123, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM, 28,SYM,124, 31, 26,125, /* 9X */\n  SYM,SYM,SYM, 49,SYM,126,SYM,SYM,SYM,SYM, 59,SYM,SYM,SYM,SYM, 61, /* AX */\n  SYM,SYM,SYM, 49,SYM,SYM,SYM,SYM,SYM,127, 59,SYM, 33,SYM, 33, 61, /* BX */\n   44, 21,128, 56, 38, 42, 47, 51, 24, 25,129, 54, 41, 23,130, 39, /* CX */\n   55, 52, 36, 35, 32, 50, 43,SYM, 45, 48, 27, 60, 46, 22,131, 58, /* DX */\n   44, 21,132, 56, 38, 42, 47, 51, 24, 25,133, 54, 41, 23,134, 39, /* EX */\n   55, 52, 36, 35, 32, 50, 43,SYM, 45, 48, 27, 60, 46, 22,135,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 1181\n * First 512 sequences: 0.9733303573968434\n * Next 512 sequences (512-1024): 0.026317344239265295\n * Rest: 0.0003522983638913346\n * Negative sequences: TODO\n */\nconstexpr PRUint8 SlovakLangModel[] =\n{\n  2,2,2,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,\n   0,0,3,2,3,1,2,3,3,1,0,3,2,0,3,2,0,1,2,0,0,0,0,\n  2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,\n   0,0,3,0,3,0,3,3,3,3,0,2,3,1,2,2,0,2,2,0,0,0,0,\n  3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,\n   0,2,3,0,3,2,3,3,3,2,0,3,3,3,3,2,0,3,2,0,0,1,0,\n  3,3,3,3,3,3,2,3,3,2,2,3,2,2,3,3,2,2,2,3,2,3,\n   3,3,3,3,2,3,3,2,3,0,2,0,0,2,0,2,0,0,2,2,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,\n   0,3,3,2,3,0,3,3,3,3,0,2,2,3,2,2,0,0,2,0,0,0,0,\n  3,3,3,3,3,2,3,3,3,3,3,1,3,2,3,2,3,3,2,3,2,3,\n   3,3,2,3,0,3,2,2,2,1,0,2,0,3,2,2,2,2,1,2,1,1,2,\n  3,3,3,3,3,3,2,3,3,3,2,3,3,2,3,3,2,2,2,3,3,3,\n   3,3,3,3,2,2,2,2,3,2,3,0,2,3,2,2,2,0,2,0,0,1,0,\n  3,3,3,2,3,3,3,2,2,3,3,3,3,1,3,3,2,2,2,3,2,3,\n   3,2,2,3,2,3,2,2,2,0,3,2,0,2,2,2,0,0,0,0,0,2,1,\n  3,3,3,3,3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,0,2,0,0,1,0,0,0,0,2,0,0,0,0,0,0,2,\n   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,0,0,2,0,2,2,2,0,0,1,0,1,0,0,1,2,0,2,0,0,0,\n   0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,2,0,\n   0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,\n  0,0,0,2,0,2,2,0,2,0,1,2,1,0,0,0,0,2,0,0,2,0,\n   0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,2,0,0,0,0,\n   0,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Ibm852SlovakModel =\n{\n  Ibm852_CharToOrderMap,\n  SlovakLangModel,\n  45,\n  (float)0.9733303573968434,\n  PR_TRUE,\n  \"IBM852\"\n};\n\nconst SequenceModel Iso_8859_2SlovakModel =\n{\n  Iso_8859_2_CharToOrderMap,\n  SlovakLangModel,\n  45,\n  (float)0.9733303573968434,\n  PR_TRUE,\n  \"ISO-8859-2\"\n};\n\nconst SequenceModel Mac_CentraleuropeSlovakModel =\n{\n  Mac_Centraleurope_CharToOrderMap,\n  SlovakLangModel,\n  45,\n  (float)0.9733303573968434,\n  PR_TRUE,\n  \"MAC-CENTRALEUROPE\"\n};\n\nconst SequenceModel Windows_1250SlovakModel =\n{\n  Windows_1250_CharToOrderMap,\n  SlovakLangModel,\n  45,\n  (float)0.9733303573968434,\n  PR_TRUE,\n  \"WINDOWS-1250\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangSloveneModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Slovene *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-28 22:06:46.134717\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_2_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 18, 19, 13,  1, 24, 17, 20,  2,  8, 12,  9, 14,  4,  3, /* 4X */\n   11, 28,  5,  6,  7, 16, 10, 27, 25, 26, 15,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 18, 19, 13,  1, 24, 17, 20,  2,  8, 12,  9, 14,  4,  3, /* 6X */\n   11, 28,  5,  6,  7, 16, 10, 27, 25, 26, 15,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 41,SYM, 42,SYM, 43, 44,SYM,SYM, 22, 45, 46, 47,SYM, 23, 48, /* AX */\n  SYM, 49,SYM, 50,SYM, 51, 52,SYM,SYM, 22, 53, 54, 55,SYM, 23, 56, /* BX */\n   57, 32, 58, 59, 60, 61, 37, 34, 21, 29, 62, 36, 63, 30, 64, 65, /* CX */\n   66, 67, 68, 31, 35, 69, 70,SYM, 71, 72, 39, 73, 74, 40, 75, 76, /* DX */\n   77, 32, 78, 79, 80, 81, 37, 34, 21, 29, 82, 36, 83, 30, 84, 85, /* EX */\n   86, 87, 88, 31, 35, 89, 90,SYM, 91, 92, 39, 93, 94, 40, 95,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_16_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 18, 19, 13,  1, 24, 17, 20,  2,  8, 12,  9, 14,  4,  3, /* 4X */\n   11, 28,  5,  6,  7, 16, 10, 27, 25, 26, 15,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 18, 19, 13,  1, 24, 17, 20,  2,  8, 12,  9, 14,  4,  3, /* 6X */\n   11, 28,  5,  6,  7, 16, 10, 27, 25, 26, 15,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 96, 97, 98,SYM,SYM, 22,SYM, 22,SYM, 99,SYM,100,SYM,101,102, /* AX */\n  SYM,SYM, 21,103, 23,SYM,SYM,SYM, 23, 21,104,SYM,105,106,107,108, /* BX */\n  109, 32,110,111,112, 37,113, 34,114, 29, 33, 36,115, 30,116,117, /* CX */\n  118,119,120, 31, 35,121,122,123,124,125, 39,126,127,128,129,130, /* DX */\n  131, 32,132,133,134, 37,135, 34,136, 29, 33, 36,137, 30,138,139, /* EX */\n  140,141,142, 31, 35,143,144,145,146,147, 39,148,149,150,151,152, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Windows_1250_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 18, 19, 13,  1, 24, 17, 20,  2,  8, 12,  9, 14,  4,  3, /* 4X */\n   11, 28,  5,  6,  7, 16, 10, 27, 25, 26, 15,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 18, 19, 13,  1, 24, 17, 20,  2,  8, 12,  9, 14,  4,  3, /* 6X */\n   11, 28,  5,  6,  7, 16, 10, 27, 25, 26, 15,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM,ILL,SYM,SYM,SYM,SYM,ILL,SYM, 22,SYM,153,154, 23,155, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM, 22,SYM,156,157, 23,158, /* 9X */\n  SYM,SYM,SYM,159,SYM,160,SYM,SYM,SYM,SYM,161,SYM,SYM,SYM,SYM,162, /* AX */\n  SYM,SYM,SYM,163,SYM,SYM,SYM,SYM,SYM,164,165,SYM,166,SYM,167,168, /* BX */\n  169, 32,170,171,172,173, 37, 34, 21, 29,174, 36,175, 30,176,177, /* CX */\n  178,179,180, 31, 35,181,182,SYM,183,184, 39,185,186, 40,187,188, /* DX */\n  189, 32,190,191,192,193, 37, 34, 21, 29,194, 36,195, 30,196,197, /* EX */\n  198,199,200, 31, 35,201,202,SYM,203,204, 39,205,206, 40,207,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Mac_Centraleurope_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 18, 19, 13,  1, 24, 17, 20,  2,  8, 12,  9, 14,  4,  3, /* 4X */\n   11, 28,  5,  6,  7, 16, 10, 27, 25, 26, 15,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 18, 19, 13,  1, 24, 17, 20,  2,  8, 12,  9, 14,  4,  3, /* 6X */\n   11, 28,  5,  6,  7, 16, 10, 27, 25, 26, 15,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  208,209,210, 29,211,212,213, 32,214, 21,215, 21, 37, 37, 29,216, /* 8X */\n  217,218, 30,219, 38, 38,220, 31,221, 35,222,223, 39,224,225,226, /* 9X */\n  SYM,SYM,227,SYM,SYM,SYM,SYM,228,SYM,SYM,SYM,229,SYM,SYM,230,231, /* AX */\n  232,233,SYM,SYM,234,235,SYM,SYM,236,237,238,239,240,241,242,243, /* BX */\n  244,245,SYM,SYM,246,247,SYM,SYM,SYM,SYM,SYM,248,249,249,249,249, /* CX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,249,249,249,249,SYM,SYM,249,249, /* DX */\n  249, 22,SYM,SYM, 22,249,249, 32,249,249, 30, 23, 23,249, 31, 35, /* EX */\n  249,249, 39,249,249,249,249,249, 40, 40,249,249,249,249,249,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Ibm852_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 18, 19, 13,  1, 24, 17, 20,  2,  8, 12,  9, 14,  4,  3, /* 4X */\n   11, 28,  5,  6,  7, 16, 10, 27, 25, 26, 15,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 18, 19, 13,  1, 24, 17, 20,  2,  8, 12,  9, 14,  4,  3, /* 6X */\n   11, 28,  5,  6,  7, 16, 10, 27, 25, 26, 15,SYM,SYM,SYM,SYM,CTR, /* 7X */\n   34,249, 29,249,249,249, 37, 34,249, 36,249,249,249,249,249, 37, /* 8X */\n   29,249,249, 35,249,249,249,249,249,249,249,249,249,249,SYM, 21, /* 9X */\n   32, 30, 31, 39,249,249, 23, 23,249,249,SYM,249, 21,249,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 32,249,249,249,SYM,SYM,SYM,SYM,249,249,SYM, /* BX */\n  SYM,SYM,SYM,SYM,SYM,SYM,249,249,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* CX */\n  249,249,249, 36,249,249, 30,249,249,SYM,SYM,SYM,SYM,249,249,SYM, /* DX */\n   31,249, 35,249,249,249, 22, 22,249, 39,249,249, 40, 40,249,SYM, /* EX */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,249,249,249,SYM,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 727\n * First 512 sequences: 0.9983524317161332\n * Next 512 sequences (512-1024): 0.0016475682838668457\n * Rest: -3.859759734048396e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 SloveneLangModel[] =\n{\n  2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,2,3,2,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,2,\n  3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,2,3,2,3,3,3,2,0,0,3,2,3,3,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,0,0,0,3,2,3,3,0,\n  3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,2,3,2,3,3,3,2,3,0,0,0,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,2,3,2,3,3,2,3,2,0,\n  3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,2,3,3,3,3,2,2,2,2,0,0,\n  3,3,3,3,3,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\n  0,0,0,0,2,0,0,2,0,2,0,0,0,0,0,0,3,0,0,2,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Iso_8859_2SloveneModel =\n{\n  Iso_8859_2_CharToOrderMap,\n  SloveneLangModel,\n  29,\n  (float)0.9983524317161332,\n  PR_TRUE,\n  \"ISO-8859-2\"\n};\n\nconst SequenceModel Iso_8859_16SloveneModel =\n{\n  Iso_8859_16_CharToOrderMap,\n  SloveneLangModel,\n  29,\n  (float)0.9983524317161332,\n  PR_TRUE,\n  \"ISO-8859-16\"\n};\n\nconst SequenceModel Windows_1250SloveneModel =\n{\n  Windows_1250_CharToOrderMap,\n  SloveneLangModel,\n  29,\n  (float)0.9983524317161332,\n  PR_TRUE,\n  \"WINDOWS-1250\"\n};\n\nconst SequenceModel Mac_CentraleuropeSloveneModel =\n{\n  Mac_Centraleurope_CharToOrderMap,\n  SloveneLangModel,\n  29,\n  (float)0.9983524317161332,\n  PR_TRUE,\n  \"MAC-CENTRALEUROPE\"\n};\n\nconst SequenceModel Ibm852SloveneModel =\n{\n  Ibm852_CharToOrderMap,\n  SloveneLangModel,\n  29,\n  (float)0.9983524317161332,\n  PR_TRUE,\n  \"IBM852\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangSpanishModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Spanish *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2015-12-12 18:39:02.290370\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_1_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 14, 10,  8,  0, 16, 15, 20,  5, 23, 27,  7, 12,  3,  2, /* 4X */\n   13, 21,  6,  4,  9, 11, 18, 31, 28, 17, 24,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 14, 10,  8,  0, 16, 15, 20,  5, 23, 27,  7, 12,  3,  2, /* 6X */\n   13, 21,  6,  4,  9, 11, 18, 31, 28, 17, 24,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 52,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   33, 25, 39, 46, 37, 45, 47, 35, 36, 26, 48, 40, 53, 22, 41, 43, /* CX */\n   49, 29, 38, 19, 50, 54, 34,SYM, 44, 51, 30, 55, 32, 42, 56, 57, /* DX */\n   33, 25, 39, 46, 37, 45, 47, 35, 36, 26, 48, 40, 58, 22, 41, 43, /* EX */\n   49, 29, 38, 19, 50, 59, 34,SYM, 44, 51, 30, 60, 32, 42, 61, 62, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_15_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 14, 10,  8,  0, 16, 15, 20,  5, 23, 27,  7, 12,  3,  2, /* 4X */\n   13, 21,  6,  4,  9, 11, 18, 31, 28, 17, 24,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 14, 10,  8,  0, 16, 15, 20,  5, 23, 27,  7, 12,  3,  2, /* 6X */\n   13, 21,  6,  4,  9, 11, 18, 31, 28, 17, 24,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM, 63,SYM, 64,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM, 65, 66,SYM,SYM, 67,SYM,SYM,SYM, 68, 69, 70,SYM, /* BX */\n   33, 25, 39, 46, 37, 45, 47, 35, 36, 26, 48, 40, 71, 22, 41, 43, /* CX */\n   49, 29, 38, 19, 50, 72, 34,SYM, 44, 51, 30, 73, 32, 42, 74, 75, /* DX */\n   33, 25, 39, 46, 37, 45, 47, 35, 36, 26, 48, 40, 76, 22, 41, 43, /* EX */\n   49, 29, 38, 19, 50, 77, 34,SYM, 44, 51, 30, 78, 32, 42, 79, 80, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Windows_1252_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  1, 14, 10,  8,  0, 16, 15, 20,  5, 23, 27,  7, 12,  3,  2, /* 4X */\n   13, 21,  6,  4,  9, 11, 18, 31, 28, 17, 24,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  1, 14, 10,  8,  0, 16, 15, 20,  5, 23, 27,  7, 12,  3,  2, /* 6X */\n   13, 21,  6,  4,  9, 11, 18, 31, 28, 17, 24,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM, 81,SYM,SYM,SYM,SYM,SYM,SYM, 82,SYM, 83,ILL, 84,ILL, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 85,SYM, 86,ILL, 87, 88, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 89,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   33, 25, 39, 46, 37, 45, 47, 35, 36, 26, 48, 40, 90, 22, 41, 43, /* CX */\n   49, 29, 38, 19, 50, 91, 34,SYM, 44, 51, 30, 92, 32, 42, 93, 94, /* DX */\n   33, 25, 39, 46, 37, 45, 47, 35, 36, 26, 48, 40, 95, 22, 41, 43, /* EX */\n   49, 29, 38, 19, 50, 96, 34,SYM, 44, 51, 30, 97, 32, 42, 98, 99, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 897\n * First 512 sequences: 0.9970385677528184\n * Next 512 sequences (512-1024): 0.0029614322471815486\n * Rest: 4.597017211338539e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 SpanishLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,0,3,3,3,2,3,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,2,3,3,3,3,3,3,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,2,3,3,2,2,3,3,2,2,3,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,3,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,0,2,3,3,3,0,0,2,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,3,3,3,3,2,0,3,2,2,\n  3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,2,3,3,2,2,0,2,2,0,\n  3,3,3,2,3,3,3,3,2,2,2,3,3,2,2,3,2,3,3,3,3,2,3,2,2,3,3,2,0,0,2,2,2,\n  3,3,3,3,3,3,3,3,2,3,3,3,2,2,3,2,2,3,2,3,3,0,3,2,2,3,3,0,0,0,2,2,2,\n  3,3,3,3,3,3,3,3,2,3,3,3,2,2,2,2,2,3,0,3,3,2,3,0,2,3,3,3,0,0,2,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,2,3,0,2,0,\n  3,3,3,3,3,3,2,2,2,2,2,3,3,3,3,2,2,3,0,3,2,0,3,2,0,3,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,0,2,0,0,0,0,2,0,0,2,2,0,\n  3,3,3,2,2,3,2,2,2,3,3,3,2,3,2,0,2,2,3,2,2,2,0,2,0,2,2,2,3,0,0,2,0,\n  3,3,3,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,3,0,0,2,0,0,0,0,0,0,0,\n  2,3,2,3,3,0,2,3,2,3,2,0,3,2,3,0,2,0,0,0,0,0,0,2,2,0,0,0,0,2,0,0,0,\n  3,3,3,3,2,3,2,2,2,2,2,2,0,0,2,0,2,2,0,0,2,0,0,2,0,2,0,2,0,0,0,2,0,\n  3,0,0,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Iso_8859_1SpanishModel =\n{\n  Iso_8859_1_CharToOrderMap,\n  SpanishLangModel,\n  33,\n  (float)0.9970385677528184,\n  PR_TRUE,\n  \"ISO-8859-1\"\n};\n\nconst SequenceModel Iso_8859_15SpanishModel =\n{\n  Iso_8859_15_CharToOrderMap,\n  SpanishLangModel,\n  33,\n  (float)0.9970385677528184,\n  PR_TRUE,\n  \"ISO-8859-15\"\n};\n\nconst SequenceModel Windows_1252SpanishModel =\n{\n  Windows_1252_CharToOrderMap,\n  SpanishLangModel,\n  33,\n  (float)0.9970385677528184,\n  PR_TRUE,\n  \"WINDOWS-1252\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangSwedishModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Swedish *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-09-28 22:29:21.480940\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Windows_1252_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 22, 20,  9,  1, 14, 12, 18,  6, 23, 10,  7, 11,  3,  8, /* 4X */\n   15, 30,  2,  5,  4, 16, 13, 26, 25, 24, 27,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 22, 20,  9,  1, 14, 12, 18,  6, 23, 10,  7, 11,  3,  8, /* 6X */\n   15, 30,  2,  5,  4, 16, 13, 26, 25, 24, 27,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM, 34,SYM,SYM,SYM,SYM,SYM,SYM, 48,SYM, 49,ILL, 50,ILL, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, 51,SYM, 52,ILL, 53, 54, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 55,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   56, 44, 57, 58, 17, 19, 38, 40, 32, 28, 45, 59, 60, 61, 47, 62, /* CX */\n   63, 64, 65, 66, 35, 67, 21,SYM, 37, 68, 69, 70, 31, 71, 72, 73, /* DX */\n   74, 44, 75, 76, 17, 19, 38, 40, 32, 28, 45, 77, 78, 79, 47, 80, /* EX */\n   81, 82, 83, 84, 35, 85, 21,SYM, 37, 86, 87, 88, 31, 89, 90, 91, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_9_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 22, 20,  9,  1, 14, 12, 18,  6, 23, 10,  7, 11,  3,  8, /* 4X */\n   15, 30,  2,  5,  4, 16, 13, 26, 25, 24, 27,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 22, 20,  9,  1, 14, 12, 18,  6, 23, 10,  7, 11,  3,  8, /* 6X */\n   15, 30,  2,  5,  4, 16, 13, 26, 25, 24, 27,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 92,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   93, 44, 94, 95, 17, 19, 38, 40, 32, 28, 45, 96, 97, 98, 47, 99, /* CX */\n  100,101,102,103, 35,104, 21,SYM, 37,105,106,107, 31,108,109,110, /* DX */\n  111, 44,112,113, 17, 19, 38, 40, 32, 28, 45,114,115,116, 47,117, /* EX */\n  118,119,120,121, 35,122, 21,SYM, 37,123,124,125, 31, 42,126,127, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_1_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 22, 20,  9,  1, 14, 12, 18,  6, 23, 10,  7, 11,  3,  8, /* 4X */\n   15, 30,  2,  5,  4, 16, 13, 26, 25, 24, 27,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 22, 20,  9,  1, 14, 12, 18,  6, 23, 10,  7, 11,  3,  8, /* 6X */\n   15, 30,  2,  5,  4, 16, 13, 26, 25, 24, 27,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM,128,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n  129, 44,130,131, 17, 19, 38, 40, 32, 28, 45,132,133,134, 47,135, /* CX */\n  136,137,138,139, 35,140, 21,SYM, 37,141,142,143, 31,144,145,146, /* DX */\n  147, 44,148,149, 17, 19, 38, 40, 32, 28, 45,150,151,152, 47,153, /* EX */\n  154,155,156,157, 35,158, 21,SYM, 37,159,160,161, 31,162,163,164, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_4_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 22, 20,  9,  1, 14, 12, 18,  6, 23, 10,  7, 11,  3,  8, /* 4X */\n   15, 30,  2,  5,  4, 16, 13, 26, 25, 24, 27,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 22, 20,  9,  1, 14, 12, 18,  6, 23, 10,  7, 11,  3,  8, /* 6X */\n   15, 30,  2,  5,  4, 16, 13, 26, 25, 24, 27,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,165,166,167,SYM,168,169,SYM,SYM,170,171,172,173,SYM,174,SYM, /* AX */\n  SYM,175,SYM,176,SYM,177,178,SYM,SYM,179,180,181,182, 43,183, 43, /* BX */\n   29, 44,184,185, 17, 19, 38,186,187, 28,188,189, 39,190, 47, 41, /* CX */\n  191,192, 33,193, 35,194, 21,SYM, 37, 36,195,196, 31,197, 46,198, /* DX */\n   29, 44,199,200, 17, 19, 38,201,202, 28,203,204, 39,205, 47, 41, /* EX */\n  206,207, 33,208, 35,209, 21,SYM, 37, 36,210,211, 31,212, 46,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_15_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 22, 20,  9,  1, 14, 12, 18,  6, 23, 10,  7, 11,  3,  8, /* 4X */\n   15, 30,  2,  5,  4, 16, 13, 26, 25, 24, 27,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 22, 20,  9,  1, 14, 12, 18,  6, 23, 10,  7, 11,  3,  8, /* 6X */\n   15, 30,  2,  5,  4, 16, 13, 26, 25, 24, 27,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,213,SYM,214,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,215,216,SYM,SYM,217,SYM,SYM,SYM,218,219,220,SYM, /* BX */\n  221, 44,222,223, 17, 19, 38, 40, 32, 28, 45,224,225,226, 47,227, /* CX */\n  228,229,230,231, 35,232, 21,SYM, 37,233,234,235, 31,236,237,238, /* DX */\n  239, 44,240,241, 17, 19, 38, 40, 32, 28, 45,242,243,244, 47,245, /* EX */\n  246,247,248,249, 35,249, 21,SYM, 37,249,249,249, 31,249,249,249, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 748\n * First 512 sequences: 0.997323508584682\n * Next 512 sequences (512-1024): 0.0026764914153179875\n * Rest: 1.7780915628762273e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 SwedishLangModel[] =\n{\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,0,3,2,3,3,3,3,3,2,0,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,3,2,3,3,3,3,3,3,0,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,0,2,2,2,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,2,2,2,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,2,2,2,2,3,0,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,0,2,2,2,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,2,3,3,2,3,3,2,2,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,0,2,0,2,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,3,0,2,0,2,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,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0,3,0,2,0,0,0,0,0,2,0,2,0,0,0,2,0,2,0,0,2,0,0,0,\n  0,3,2,2,0,2,0,2,2,2,0,0,0,2,0,2,0,0,2,0,0,2,2,0,0,0,0,0,0,0,0,\n  0,0,0,2,0,0,2,0,3,0,2,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Windows_1252SwedishModel =\n{\n  Windows_1252_CharToOrderMap,\n  SwedishLangModel,\n  31,\n  (float)0.997323508584682,\n  PR_TRUE,\n  \"WINDOWS-1252\"\n};\n\nconst SequenceModel Iso_8859_9SwedishModel =\n{\n  Iso_8859_9_CharToOrderMap,\n  SwedishLangModel,\n  31,\n  (float)0.997323508584682,\n  PR_TRUE,\n  \"ISO-8859-9\"\n};\n\nconst SequenceModel Iso_8859_1SwedishModel =\n{\n  Iso_8859_1_CharToOrderMap,\n  SwedishLangModel,\n  31,\n  (float)0.997323508584682,\n  PR_TRUE,\n  \"ISO-8859-1\"\n};\n\nconst SequenceModel Iso_8859_4SwedishModel =\n{\n  Iso_8859_4_CharToOrderMap,\n  SwedishLangModel,\n  31,\n  (float)0.997323508584682,\n  PR_TRUE,\n  \"ISO-8859-4\"\n};\n\nconst SequenceModel Iso_8859_15SwedishModel =\n{\n  Iso_8859_15_CharToOrderMap,\n  SwedishLangModel,\n  31,\n  (float)0.997323508584682,\n  PR_TRUE,\n  \"ISO-8859-15\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangThaiModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Thai *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2015-12-04 03:05:06.182099\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Tis_620_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM, 66, 70, 67, 80, 78, 87, 85, 73, 79, 93, 88, 84, 68, 77, 81, /* 4X */\n   75,101, 74, 61, 71, 86, 96, 90,103,100, 99,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM, 35, 64, 48, 52, 32, 60, 65, 54, 36, 97, 76, 46, 56, 41, 40, /* 6X */\n   59,104, 43, 45, 44, 55, 72, 82, 94, 57, 92,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  ILL,  3, 23,105, 15,106, 89,  5, 21, 63, 26, 31,102, 42, 69, 58, /* AX */\n   49, 91, 83, 34,  9, 17, 30, 12, 39,  1, 16, 19, 33, 62, 22, 47, /* BX */\n   38,  7, 10,  2, 50, 11,107,  8, 28, 37, 13, 18, 98,  4, 53, 95, /* CX */\n   14,SYM,  0, 29,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,ILL,ILL,ILL,SYM, /* DX */\n    6, 20, 27, 24, 25,108, 51,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,109, /* EX */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,110,111,ILL,ILL,ILL,ILL, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_11_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM, 66, 70, 67, 80, 78, 87, 85, 73, 79, 93, 88, 84, 68, 77, 81, /* 4X */\n   75,101, 74, 61, 71, 86, 96, 90,103,100, 99,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM, 35, 64, 48, 52, 32, 60, 65, 54, 36, 97, 76, 46, 56, 41, 40, /* 6X */\n   59,104, 43, 45, 44, 55, 72, 82, 94, 57, 92,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,  3, 23,112, 15,113, 89,  5, 21, 63, 26, 31,102, 42, 69, 58, /* AX */\n   49, 91, 83, 34,  9, 17, 30, 12, 39,  1, 16, 19, 33, 62, 22, 47, /* BX */\n   38,  7, 10,  2, 50, 11,114,  8, 28, 37, 13, 18, 98,  4, 53, 95, /* CX */\n   14,SYM,  0, 29,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,ILL,ILL,ILL,SYM, /* DX */\n    6, 20, 27, 24, 25,115, 51,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,116, /* EX */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,117,118,ILL,ILL,ILL,ILL, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 2324\n * First 512 sequences: 0.8815720594354438\n * Next 512 sequences (512-1024): 0.0920860122682917\n * Rest: 0.026341928296264486\n * Negative sequences: TODO\n */\nconstexpr PRUint8 ThaiLangModel[] =\n{\n  0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,2,3,\n   0,2,3,0,0,3,2,3,0,0,2,0,0,0,0,2,0,1,1,1,0,2,0,0,0,0,1,0,0,0,1,1,\n  3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,\n   0,3,0,0,0,1,3,3,0,0,1,0,0,0,0,2,0,2,1,2,0,1,0,0,0,0,0,0,0,0,2,1,\n  3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,2,3,3,3,3,3,3,2,2,2,3,1,3,2,\n   0,2,3,0,0,2,2,1,0,0,0,0,0,0,0,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,2,1,\n  3,3,3,3,3,2,3,3,3,3,2,3,3,3,2,3,2,3,3,3,3,3,3,3,3,3,2,3,2,3,2,3,\n   0,2,1,0,0,3,2,1,0,0,0,0,0,0,0,1,0,3,3,1,0,1,0,0,0,0,3,0,0,0,1,1,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,2,2,2,2,3,3,2,2,1,2,2,2,\n   0,2,0,0,0,0,2,2,0,0,1,0,0,0,0,2,0,0,1,1,0,1,0,0,0,0,0,0,0,0,1,1,\n  3,3,3,3,3,2,3,3,3,3,3,3,3,3,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,\n   0,3,0,0,0,1,2,2,0,0,1,0,0,0,0,2,0,1,1,2,0,2,0,0,0,0,0,0,0,0,2,1,\n  0,3,3,3,3,2,0,3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0,2,0,0,2,1,1,2,0,0,0,0,0,0,0,2,1,1,2,0,1,0,0,0,0,\n  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n   2,0,0,1,2,0,0,0,2,1,0,2,1,0,0,0,0,0,0,0,0,0,0,2,0,1,0,0,2,0,0,0,\n  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n   1,0,0,1,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,0,0,1,1,1,1,0,1,1,1,0,0,\n  0,1,2,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  2,1,1,0,0,0,0,1,1,1,1,2,0,0,1,0,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n};\n\n\nconst SequenceModel Tis_620ThaiModel =\n{\n  Tis_620_CharToOrderMap,\n  ThaiLangModel,\n  64,\n  (float)0.8815720594354438,\n  PR_FALSE,\n  \"TIS-620\"\n};\n\nconst SequenceModel Iso_8859_11ThaiModel =\n{\n  Iso_8859_11_CharToOrderMap,\n  ThaiLangModel,\n  64,\n  (float)0.8815720594354438,\n  PR_FALSE,\n  \"ISO-8859-11\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangTurkishModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Turkish *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2015-12-04 02:24:44.730727\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Iso_8859_3_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 15, 21,  7,  1, 26, 22, 19,  6, 28,  9,  5, 11,  3, 14, /* 4X */\n   23, 34,  4, 10,  8, 12, 20, 29, 32, 13, 18,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 15, 21,  7,  1, 26, 22, 19,  2, 28,  9,  5, 11,  3, 14, /* 6X */\n   23, 34,  4, 10,  8, 12, 20, 29, 32, 13, 18,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM, 48,SYM,SYM,SYM,ILL, 49,SYM,SYM,  2, 17, 25, 50,SYM,ILL, 51, /* AX */\n  SYM, 52,SYM,SYM,SYM,SYM, 53,SYM,SYM,  6, 17, 25, 54,SYM,ILL, 55, /* BX */\n   41, 36, 30,ILL, 39, 56, 57, 24, 42, 33, 58, 45, 59, 37, 31, 60, /* CX */\n  ILL, 47, 61, 38, 62, 63, 27,SYM, 64, 65, 40, 35, 16, 66, 67, 68, /* DX */\n   41, 36, 30,ILL, 39, 69, 70, 24, 42, 33, 71, 45, 72, 37, 31, 73, /* EX */\n  ILL, 47, 74, 38, 75, 76, 27,SYM, 77, 78, 40, 35, 16, 79, 80,SYM, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Iso_8859_9_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  0, 15, 21,  7,  1, 26, 22, 19,  6, 28,  9,  5, 11,  3, 14, /* 4X */\n   23, 34,  4, 10,  8, 12, 20, 29, 32, 13, 18,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  0, 15, 21,  7,  1, 26, 22, 19,  2, 28,  9,  5, 11,  3, 14, /* 6X */\n   23, 34,  4, 10,  8, 12, 20, 29, 32, 13, 18,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM, 81,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   41, 36, 30, 44, 39, 82, 46, 24, 42, 33, 83, 45, 84, 37, 31, 85, /* CX */\n   25, 47, 86, 38, 87, 88, 27,SYM, 43, 89, 40, 35, 16,  2, 17, 90, /* DX */\n   41, 36, 30, 44, 39, 91, 46, 24, 42, 33, 92, 45, 93, 37, 31, 94, /* EX */\n   25, 47, 95, 38, 96, 97, 27,SYM, 43, 98, 40, 35, 16,  6, 17, 99, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 935\n * First 512 sequences: 0.991865243864388\n * Next 512 sequences (512-1024): 0.008134756135611957\n * Rest: 2.949029909160572e-17\n * Negative sequences: TODO\n */\nconstexpr PRUint8 TurkishLangModel[] =\n{\n  3,2,3,3,3,3,2,3,3,3,3,3,3,3,2,3,0,3,3,3,3,3,3,3,3,3,3,0,3,3,0,2,2,2,2,0,\n  3,3,3,3,3,3,0,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,3,3,3,0,3,3,2,0,3,0,2,0,\n  3,3,3,3,3,3,0,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,0,2,2,2,0,2,0,2,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,3,0,3,2,2,2,2,2,2,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,3,2,2,2,2,2,2,2,\n  3,3,3,2,2,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,2,3,3,2,3,0,3,2,2,2,2,3,0,2,2,2,\n  3,2,0,3,3,3,3,3,3,3,3,3,2,3,2,3,0,3,3,2,3,3,2,3,2,3,2,0,0,0,0,0,2,0,0,0,\n  3,3,3,2,3,3,3,3,2,2,2,2,3,3,3,2,3,0,2,2,2,2,2,2,0,0,0,3,2,3,2,2,0,0,0,0,\n  3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,0,2,3,3,2,2,2,3,0,2,3,2,2,3,2,2,0,0,0,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,3,2,2,2,2,3,0,2,3,2,2,3,0,0,0,0,2,\n  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,2,3,3,3,2,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n  Iso_8859_9_CharToOrderMap,\n  TurkishLangModel,\n  36,\n  (float)0.991865243864388,\n  PR_FALSE,\n  \"ISO-8859-9\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/LangModels/LangVietnameseModel.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"../nsSBCharSetProber.h\"\n\n/********* Language model for: Vietnamese *********/\n\n/**\n * Generated by BuildLangModel.py\n * On: 2016-02-13 03:42:06.561440\n **/\n\n/* Character Mapping Table:\n * ILL: illegal character.\n * CTR: control character specific to the charset.\n * RET: carriage/return.\n * SYM: symbol (punctuation) that does not belong to word.\n * NUM: 0 - 9.\n *\n * Other characters are ordered by probabilities\n * (0 is the most common character in the language).\n *\n * Orders are generic to a language. So the codepoint with order X in\n * CHARSET1 maps to the same character as the codepoint with the same\n * order X in CHARSET2 for the same language.\n * As such, it is possible to get missing order. For instance the\n * ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1\n * even though they are both used for French. Same for the euro sign.\n */\nconstexpr unsigned char Windows_1258_CharToOrderMap[] =\n{\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  6, 17,  3, 22, 21, 66,  5,  1,  4, 75, 24, 14,  8,  0,  9, /* 4X */\n   16, 36, 11, 19,  2,  7, 13, 69, 54, 20, 82,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  6, 17,  3, 22, 21, 66,  5,  1,  4, 75, 24, 14,  8,  0,  9, /* 6X */\n   16, 36, 11, 19,  2,  7, 13, 69, 54, 20, 82,SYM,SYM,SYM,SYM,CTR, /* 7X */\n  SYM,ILL,SYM,101,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,100,ILL,ILL,ILL, /* 8X */\n  ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,100,ILL,ILL,102, /* 9X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* AX */\n  SYM,SYM,SYM,SYM,SYM,103,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* BX */\n   12, 15, 25, 51, 97,104, 98, 91, 90, 62, 27,105,SYM, 47,106,107, /* CX */\n   10,108,SYM, 33, 29, 46, 93,SYM, 94, 58, 67,109, 96, 18,SYM, 99, /* DX */\n   12, 15, 25, 51, 97,110, 98, 91, 90, 62, 27,111,SYM, 47,112,113, /* EX */\n   10,114,SYM, 33, 29, 46, 93,SYM, 94, 58, 67,115, 96, 18,116,117, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\nconstexpr unsigned char Viscii_CharToOrderMap[] =\n{\n  CTR,CTR, 88,CTR,CTR, 95, 77,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */\n  CTR,CTR,CTR,CTR, 80,CTR,CTR,CTR,CTR, 79,CTR,CTR,CTR,CTR, 92,CTR, /* 1X */\n  SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */\n  NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */\n  SYM,  6, 17,  3, 22, 21, 66,  5,  1,  4, 75, 24, 14,  8,  0,  9, /* 4X */\n   16, 36, 11, 19,  2,  7, 13, 69, 54, 20, 82,SYM,SYM,SYM,SYM,SYM, /* 5X */\n  SYM,  6, 17,  3, 22, 21, 66,  5,  1,  4, 75, 24, 14,  8,  0,  9, /* 6X */\n   16, 36, 11, 19,  2,  7, 13, 69, 54, 20, 82,SYM,SYM,SYM,SYM,CTR, /* 7X */\n   30, 57, 71, 65, 41, 43, 78, 49, 83, 89, 23, 45, 39, 74, 28, 32, /* 8X */\n   53, 60, 84, 31, 37, 40, 38, 59, 42, 81, 44, 73, 35, 72, 48, 76, /* 9X */\n   86, 57, 71, 65, 41, 43, 78, 49, 83, 89, 23, 45, 39, 74, 28, 32, /* AX */\n   53, 60, 84, 87, 46, 31, 38, 59, 42, 56, 52, 55, 70, 46, 40, 18, /* BX */\n   12, 15, 25, 61, 34, 51, 88, 95, 90, 62, 27, 85, 50, 47, 64, 76, /* CX */\n   10, 52, 63, 33, 29, 30, 80, 55, 70, 58, 67, 79, 92, 68, 87, 18, /* DX */\n   12, 15, 25, 61, 34, 51, 26, 77, 90, 62, 27, 85, 50, 47, 64, 73, /* EX */\n   10, 56, 63, 33, 29, 86, 81, 44, 48, 58, 67, 72, 35, 68, 37, 26, /* FX */\n};\n/*X0  X1  X2  X3  X4  X5  X6  X7  X8  X9  XA  XB  XC  XD  XE  XF */\n\n\n/* Model Table:\n * Total sequences: 1494\n * First 512 sequences: 0.9321889118082535\n * Next 512 sequences (512-1024): 0.06092051479986333\n * Rest: 0.0068905733918831966\n * Negative sequences: TODO\n */\nconstexpr PRUint8 VietnameseLangModel[] =\n{\n  3,3,3,3,3,3,3,2,2,3,0,2,3,1,1,1,1,2,3,3,2,3,3,3,2,1,2,\n   3,0,3,2,2,2,3,1,0,1,1,2,0,0,1,0,1,0,2,2,1,0,0,0,3,0,0,2,\n  2,1,2,0,3,0,3,3,2,3,0,2,3,0,2,3,0,0,3,1,3,3,1,3,1,3,3,\n   3,3,3,3,3,3,3,3,3,0,3,3,3,2,3,3,3,3,2,3,3,3,3,3,2,3,2,0,\n  2,3,2,2,3,1,3,3,1,3,1,3,3,2,2,3,2,0,3,2,2,3,1,3,0,3,0,\n   3,1,3,3,3,3,2,3,2,0,0,2,1,2,2,2,2,0,0,1,3,2,3,2,2,2,2,0,\n  2,3,2,2,3,0,3,3,2,3,0,2,2,1,2,3,1,1,2,2,2,3,1,0,2,2,0,\n   0,0,3,2,3,2,3,3,3,1,1,2,0,0,2,0,3,0,0,2,0,2,2,0,2,3,1,1,\n  3,1,3,3,3,3,3,2,3,3,1,3,2,2,3,3,2,2,0,3,1,3,3,3,2,0,3,\n   3,3,1,0,0,3,1,3,0,2,0,2,3,3,2,0,0,2,3,0,0,0,1,0,1,0,0,2,\n  2,3,2,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0,0,0,0,0,3,0,0,0,2,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  3,0,0,0,0,0,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  3,0,1,1,1,0,0,0,3,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,\n   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  3,0,2,3,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  3,0,0,0,2,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n  1,1,2,1,2,0,3,3,0,1,0,0,0,2,0,3,1,2,2,0,1,3,0,2,0,2,0,\n   2,0,2,1,1,0,1,2,0,0,0,1,0,0,1,0,0,0,0,1,2,0,0,1,1,2,0,2,\n};\n\n\nconst SequenceModel Windows_1258VietnameseModel =\n{\n  Windows_1258_CharToOrderMap,\n  VietnameseLangModel,\n  55,\n  (float)0.9321889118082535,\n  PR_FALSE,\n  \"WINDOWS-1258\"\n};\n\nconst SequenceModel VisciiVietnameseModel =\n{\n  Viscii_CharToOrderMap,\n  VietnameseLangModel,\n  55,\n  (float)0.9321889118082535,\n  PR_FALSE,\n  \"VISCII\"\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsBig5Prober.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"nsBig5Prober.h\"\n\nvoid  nsBig5Prober::Reset(void)\n{\n  mCodingSM->Reset();\n  mState = eDetecting;\n  mDistributionAnalyser.Reset(mIsPreferredLanguage);\n}\n\nnsProbingState nsBig5Prober::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  nsSMState codingState;\n\n  for (PRUint32 i = 0; i < aLen; i++)\n  {\n    codingState = mCodingSM->NextState(aBuf[i]);\n    if (codingState == eItsMe)\n    {\n      mState = eFoundIt;\n      break;\n    }\n    if (codingState == eStart)\n    {\n      PRUint32 charLen = mCodingSM->GetCurrentCharLen();\n\n      if (i == 0)\n      {\n        mLastChar[1] = aBuf[0];\n        mDistributionAnalyser.HandleOneChar(mLastChar, charLen);\n      }\n      else\n        mDistributionAnalyser.HandleOneChar(aBuf+i-1, charLen);\n    }\n  }\n\n  mLastChar[0] = aBuf[aLen-1];\n\n  if (mState == eDetecting)\n    if (mDistributionAnalyser.GotEnoughData() && GetConfidence() >= SHORTCUT_THRESHOLD)\n      mState = eFoundIt;\n\n  return mState;\n}\n\nfloat nsBig5Prober::GetConfidence(void)\n{\n  float distribCf = mDistributionAnalyser.GetConfidence();\n\n  return (float)distribCf;\n}\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsBig5Prober.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef nsBig5Prober_h__\n#define nsBig5Prober_h__\n\n#include \"nsCharSetProber.h\"\n#include \"nsCodingStateMachine.h\"\n#include \"CharDistribution.h\"\n\nclass nsBig5Prober: public nsCharSetProber {\npublic:\n  nsBig5Prober(PRBool aIsPreferredLanguage)\n    :mIsPreferredLanguage(aIsPreferredLanguage) \n  {mCodingSM = new nsCodingStateMachine(&Big5SMModel); \n    Reset();}\n  virtual ~nsBig5Prober(void){delete mCodingSM;}\n  nsProbingState HandleData(const char* aBuf, PRUint32 aLen);\n  const char* GetCharSetName() {return \"BIG5\";}\n  nsProbingState GetState(void) {return mState;}\n  void      Reset(void);\n  float     GetConfidence(void);\n  void      SetOpion() {}\n\nprotected:\n  void      GetDistribution(PRUint32 aCharLen, const char* aStr);\n\n  nsCodingStateMachine* mCodingSM;\n  nsProbingState mState;\n\n  //Big5ContextAnalysis mContextAnalyser;\n  Big5DistributionAnalysis mDistributionAnalyser;\n  char mLastChar[2];\n  PRBool mIsPreferredLanguage;\n};\n\n\n#endif /* nsBig5Prober_h__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsCharSetProber.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          Shy Shalom <shooshX@gmail.com>\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"nsCharSetProber.h\"\n#include \"prmem.h\"\n\n//This filter applies to all scripts which do not use English characters\nPRBool nsCharSetProber::FilterWithoutEnglishLetters(const char* aBuf, PRUint32 aLen, char** newBuf, PRUint32& newLen)\n{\n  char *newptr;\n  char *prevPtr, *curPtr;\n\n  PRBool meetMSB = PR_FALSE;\n  newptr = *newBuf = (char*)PR_Malloc(aLen);\n  if (!newptr)\n    return PR_FALSE;\n\n  for (curPtr = prevPtr = (char*)aBuf; curPtr < aBuf+aLen; curPtr++)\n  {\n    if (*curPtr & 0x80)\n    {\n      meetMSB = PR_TRUE;\n    }\n    else if (*curPtr < 'A' || (*curPtr > 'Z' && *curPtr < 'a') || *curPtr > 'z')\n    {\n      //current char is a symbol, most likely a punctuation. we treat it as segment delimiter\n      if (meetMSB && curPtr > prevPtr)\n      //this segment contains more than single symbol, and it has upper ASCII, we need to keep it\n      {\n        while (prevPtr < curPtr) *newptr++ = *prevPtr++;\n        prevPtr++;\n        *newptr++ = ' ';\n        meetMSB = PR_FALSE;\n      }\n      else //ignore current segment. (either because it is just a symbol or just an English word)\n        prevPtr = curPtr+1;\n    }\n  }\n  if (meetMSB && curPtr > prevPtr)\n    while (prevPtr < curPtr) *newptr++ = *prevPtr++;\n\n  newLen = static_cast<PRUint32>(newptr - *newBuf);\n\n  return PR_TRUE;\n}\n\n//This filter applies to all scripts which contain both English characters and upper ASCII characters.\nPRBool nsCharSetProber::FilterWithEnglishLetters(const char* aBuf, PRUint32 aLen, char** newBuf, PRUint32& newLen)\n{\n  //do filtering to reduce load to probers\n  char *newptr;\n  char *prevPtr, *curPtr;\n  PRBool isInTag = PR_FALSE;\n\n  newptr = *newBuf = (char*)PR_Malloc(aLen);\n  if (!newptr)\n    return PR_FALSE;\n\n  for (curPtr = prevPtr = (char*)aBuf; curPtr < aBuf+aLen; curPtr++)\n  {\n    if (*curPtr == '>')\n      isInTag = PR_FALSE;\n    else if (*curPtr == '<')\n      isInTag = PR_TRUE;\n\n    if (!(*curPtr & 0x80) &&\n        (*curPtr < 'A' || (*curPtr > 'Z' && *curPtr < 'a') || *curPtr > 'z') )\n    {\n      if (curPtr > prevPtr && !isInTag) // Current segment contains more than just a symbol\n                                        // and it is not inside a tag, keep it.\n      {\n        while (prevPtr < curPtr) *newptr++ = *prevPtr++;\n        prevPtr++;\n        *newptr++ = ' ';\n      }\n      else\n        prevPtr = curPtr+1;\n    }\n  }\n\n  // If the current segment contains more than just a symbol\n  // and it is not inside a tag then keep it.\n  if (!isInTag)\n    while (prevPtr < curPtr)\n      *newptr++ = *prevPtr++;\n\n  newLen = static_cast<PRUint32>(newptr - *newBuf);\n\n  return PR_TRUE;\n}\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsCharSetProber.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          Shy Shalom <shooshX@gmail.com>\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n#ifndef nsCharSetProber_h__\n#define nsCharSetProber_h__\n\n#include \"nscore.h\"\n\n//#define DEBUG_chardet // Uncomment this for debug dump.\n\ntypedef enum {\n  eDetecting = 0,   //We are still detecting, no sure answer yet, but caller can ask for confidence.\n  eFoundIt = 1,     //That's a positive answer\n  eNotMe = 2        //Negative answer\n} nsProbingState;\n\n\nclass nsCharSetProber {\npublic:\n  // non copyable\n  nsCharSetProber() = default;\n  nsCharSetProber(const nsCharSetProber&) = delete;\n  nsCharSetProber& operator=(const nsCharSetProber&) = delete;\n  \n  virtual ~nsCharSetProber() {};\n  virtual const char* GetCharSetName() = 0;\n  virtual nsProbingState HandleData(const char* aBuf, PRUint32 aLen) = 0;\n  virtual nsProbingState GetState(void) = 0;\n  virtual void      Reset(void)  = 0;\n  virtual float     GetConfidence(void) = 0;\n  virtual void      SetOpion() = 0;\n\n#ifdef DEBUG_chardet\n  virtual void  DumpStatus() {};\n#endif\n\n  // Helper functions used in the Latin1 and Group probers.\n  // both functions Allocate a new buffer for newBuf. This buffer should be\n  // freed by the caller using PR_FREEIF.\n  // Both functions return PR_FALSE in case of memory allocation failure.\n  static PRBool FilterWithoutEnglishLetters(const char* aBuf, PRUint32 aLen, char** newBuf, PRUint32& newLen);\n  static PRBool FilterWithEnglishLetters(const char* aBuf, PRUint32 aLen, char** newBuf, PRUint32& newLen);\n\n};\n\n#endif /* nsCharSetProber_h__ */\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsCodingStateMachine.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n * vim: et sw=2 ts=2 fdm=marker\n */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n#ifndef nsCodingStateMachine_h__\n#define nsCodingStateMachine_h__\n\n#include \"nsPkgInt.h\"\n\n/* Apart from these 3 generic states, machine states are specific to\n * each charset prober.\n */\ntypedef enum {\n   eStart = 0,\n   eError = 1,\n   eItsMe = 2\n} nsSMState;\n\n#define GETCLASS(c) GETFROMPCK(((unsigned char)(c)), mModel->classTable)\n\n//state machine model\ntypedef struct\n{\n  nsPkgInt classTable;\n  PRUint32 classFactor;\n  nsPkgInt stateTable;\n  const PRUint32* charLenTable;\n  const char* name;\n} SMModel;\n\nclass nsCodingStateMachine {\npublic:\n  nsCodingStateMachine(const SMModel* sm) \n  : mModel(sm)\n  , mCurrentState(eStart)\n  , mCurrentBytePos(0)\n  , mCurrentCharLen(0)\n  { }\n  nsSMState NextState(char c){\n    //for each byte we get its class , if it is first byte, we also get byte length\n    PRUint32 byteCls = GETCLASS(c);\n    if (mCurrentState == eStart)\n    {\n      mCurrentBytePos = 0;\n      mCurrentCharLen = mModel->charLenTable[byteCls];\n    }\n    //from byte's class and stateTable, we get its next state\n    mCurrentState=(nsSMState)GETFROMPCK(mCurrentState*(mModel->classFactor)+byteCls,\n                                       mModel->stateTable);\n    mCurrentBytePos++;\n    return mCurrentState;\n  }\n  PRUint32  GetCurrentCharLen(void) {return mCurrentCharLen;}\n  void      Reset(void) {mCurrentState = eStart;}\n  const char * GetCodingStateMachine() {return mModel->name;}\n\nprotected:\n  nsSMState mCurrentState;\n  PRUint32 mCurrentCharLen;\n  PRUint32 mCurrentBytePos;\n\n  const SMModel *mModel;\n};\n\nextern const SMModel UTF8SMModel;\nextern const SMModel Big5SMModel;\nextern const SMModel EUCJPSMModel;\nextern const SMModel EUCKRSMModel;\nextern const SMModel EUCTWSMModel;\nextern const SMModel GB2312SMModel;\nextern const SMModel GB18030SMModel;\nextern const SMModel SJISSMModel;\nextern const SMModel UCS2BESMModel;\n\n\nextern const SMModel HZSMModel;\nextern const SMModel ISO2022CNSMModel;\nextern const SMModel ISO2022JPSMModel;\nextern const SMModel ISO2022KRSMModel;\n\n#endif /* nsCodingStateMachine_h__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsEUCJPProber.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n// for japanese encoding, obeserve characteristic:\n// 1, kana character (or hankaku?) often have hight frequency of appereance\n// 2, kana character often exist in group\n// 3, certain combination of kana is never used in japanese language\n\n#include \"nsEUCJPProber.h\"\n\nvoid  nsEUCJPProber::Reset(void)\n{\n  mCodingSM->Reset();\n  mState = eDetecting;\n  mContextAnalyser.Reset(mIsPreferredLanguage);\n  mDistributionAnalyser.Reset(mIsPreferredLanguage);\n}\n\nnsProbingState nsEUCJPProber::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  nsSMState codingState;\n\n  for (PRUint32 i = 0; i < aLen; i++)\n  {\n    codingState = mCodingSM->NextState(aBuf[i]);\n    if (codingState == eItsMe)\n    {\n      mState = eFoundIt;\n      break;\n    }\n    if (codingState == eStart)\n    {\n      PRUint32 charLen = mCodingSM->GetCurrentCharLen();\n\n      if (i == 0)\n      {\n        mLastChar[1] = aBuf[0];\n        mContextAnalyser.HandleOneChar(mLastChar, charLen);\n        mDistributionAnalyser.HandleOneChar(mLastChar, charLen);\n      }\n      else\n      {\n        mContextAnalyser.HandleOneChar(aBuf+i-1, charLen);\n        mDistributionAnalyser.HandleOneChar(aBuf+i-1, charLen);\n      }\n    }\n  }\n\n  mLastChar[0] = aBuf[aLen-1];\n\n  if (mState == eDetecting)\n    if (mContextAnalyser.GotEnoughData() && GetConfidence() >= SHORTCUT_THRESHOLD)\n      mState = eFoundIt;\n\n  return mState;\n}\n\nfloat nsEUCJPProber::GetConfidence(void)\n{\n  float contxtCf = mContextAnalyser.GetConfidence();\n  float distribCf = mDistributionAnalyser.GetConfidence();\n\n  return (contxtCf > distribCf ? contxtCf : distribCf);\n}\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsEUCJPProber.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n// for S-JIS encoding, obeserve characteristic:\n// 1, kana character (or hankaku?) often have hight frequency of appereance\n// 2, kana character often exist in group\n// 3, certain combination of kana is never used in japanese language\n\n#ifndef nsEUCJPProber_h__\n#define nsEUCJPProber_h__\n\n#include \"nsCharSetProber.h\"\n#include \"nsCodingStateMachine.h\"\n#include \"JpCntx.h\"\n#include \"CharDistribution.h\"\n\nclass nsEUCJPProber: public nsCharSetProber {\npublic:\n  nsEUCJPProber(PRBool aIsPreferredLanguage)\n    :mIsPreferredLanguage(aIsPreferredLanguage)\n  {mCodingSM = new nsCodingStateMachine(&EUCJPSMModel);\n    Reset();}\n  virtual ~nsEUCJPProber(void){delete mCodingSM;}\n  nsProbingState HandleData(const char* aBuf, PRUint32 aLen);\n  const char* GetCharSetName() {return \"EUC-JP\";}\n  nsProbingState GetState(void) {return mState;}\n  void      Reset(void);\n  float     GetConfidence(void);\n  void      SetOpion() {}\n\nprotected:\n  nsCodingStateMachine* mCodingSM;\n  nsProbingState mState;\n\n  EUCJPContextAnalysis mContextAnalyser;\n  EUCJPDistributionAnalysis mDistributionAnalyser;\n\n  char mLastChar[2];\n  PRBool mIsPreferredLanguage;\n};\n\n\n#endif /* nsEUCJPProber_h__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsEUCKRProber.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n * vim: et sw=2 ts=2 fdm=marker\n */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"nsEUCKRProber.h\"\n\nvoid  nsEUCKRProber::Reset(void)\n{\n  mCodingSM->Reset();\n  mState = eDetecting;\n  mDistributionAnalyser.Reset(mIsPreferredLanguage);\n  //mContextAnalyser.Reset();\n}\n\nnsProbingState nsEUCKRProber::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  nsSMState codingState;\n\n  for (PRUint32 i = 0; i < aLen; i++)\n  {\n    codingState = mCodingSM->NextState(aBuf[i]);\n    if (codingState == eItsMe)\n    {\n      mState = eFoundIt;\n      break;\n    }\n    if (codingState == eStart)\n    {\n      PRUint32 charLen = mCodingSM->GetCurrentCharLen();\n\n      if (i == 0)\n      {\n        mLastChar[1] = aBuf[0];\n        mDistributionAnalyser.HandleOneChar(mLastChar, charLen);\n      }\n      else\n        mDistributionAnalyser.HandleOneChar(aBuf+i-1, charLen);\n    }\n  }\n\n  mLastChar[0] = aBuf[aLen-1];\n\n  if (mState == eDetecting)\n    if (mDistributionAnalyser.GotEnoughData() && GetConfidence() >= SHORTCUT_THRESHOLD)\n      mState = eFoundIt;\n//    else\n//      mDistributionAnalyser.HandleData(aBuf, aLen);\n\n  return mState;\n}\n\nfloat nsEUCKRProber::GetConfidence(void)\n{\n  float distribCf = mDistributionAnalyser.GetConfidence();\n\n  return (float)distribCf;\n}\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsEUCKRProber.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef nsEUCKRProber_h__\n#define nsEUCKRProber_h__\n\n#include \"nsCharSetProber.h\"\n#include \"nsCodingStateMachine.h\"\n#include \"CharDistribution.h\"\n\nclass nsEUCKRProber: public nsCharSetProber {\npublic:\n  nsEUCKRProber(PRBool aIsPreferredLanguage)\n    :mIsPreferredLanguage(aIsPreferredLanguage)\n  {mCodingSM = new nsCodingStateMachine(&EUCKRSMModel);\n    Reset();\n  }\n  virtual ~nsEUCKRProber(void){delete mCodingSM;}\n  nsProbingState HandleData(const char* aBuf, PRUint32 aLen);\n  /* \"Unified Hangul Code\", also called \"CP949\" or \"Windows-949\" is a\n   * superset of EUC-KR. Though not fully ok to return UHC here (a\n   * separate prober would be better), it is acceptable, since many\n   * Korean documents are actually created with this character set.\n   */\n  const char* GetCharSetName() {return \"UHC\";}\n  nsProbingState GetState(void) {return mState;}\n  void      Reset(void);\n  float     GetConfidence(void);\n  void      SetOpion() {}\n\nprotected:\n  void      GetDistribution(PRUint32 aCharLen, const char* aStr);\n\n  nsCodingStateMachine* mCodingSM;\n  nsProbingState mState;\n\n  //EUCKRContextAnalysis mContextAnalyser;\n  EUCKRDistributionAnalysis mDistributionAnalyser;\n  char mLastChar[2];\n  PRBool mIsPreferredLanguage;\n};\n\n\n#endif /* nsEUCKRProber_h__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsEUCTWProber.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"nsEUCTWProber.h\"\n\nvoid  nsEUCTWProber::Reset(void)\n{\n  mCodingSM->Reset();\n  mState = eDetecting;\n  mDistributionAnalyser.Reset(mIsPreferredLanguage);\n  //mContextAnalyser.Reset();\n}\n\nnsProbingState nsEUCTWProber::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  nsSMState codingState;\n\n  for (PRUint32 i = 0; i < aLen; i++)\n  {\n    codingState = mCodingSM->NextState(aBuf[i]);\n    if (codingState == eItsMe)\n    {\n      mState = eFoundIt;\n      break;\n    }\n    if (codingState == eStart)\n    {\n      PRUint32 charLen = mCodingSM->GetCurrentCharLen();\n\n      if (i == 0)\n      {\n        mLastChar[1] = aBuf[0];\n        mDistributionAnalyser.HandleOneChar(mLastChar, charLen);\n      }\n      else\n        mDistributionAnalyser.HandleOneChar(aBuf+i-1, charLen);\n    }\n  }\n\n  mLastChar[0] = aBuf[aLen-1];\n\n  if (mState == eDetecting)\n    if (mDistributionAnalyser.GotEnoughData() && GetConfidence() >= SHORTCUT_THRESHOLD)\n      mState = eFoundIt;\n//    else\n//      mDistributionAnalyser.HandleData(aBuf, aLen);\n\n  return mState;\n}\n\nfloat nsEUCTWProber::GetConfidence(void)\n{\n  float distribCf = mDistributionAnalyser.GetConfidence();\n\n  return (float)distribCf;\n}\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsEUCTWProber.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef nsEUCTWProber_h__\n#define nsEUCTWProber_h__\n\n#include \"nsCharSetProber.h\"\n#include \"nsCodingStateMachine.h\"\n#include \"CharDistribution.h\"\n\nclass nsEUCTWProber: public nsCharSetProber {\npublic:\n  nsEUCTWProber(PRBool aIsPreferredLanguage)\n    :mIsPreferredLanguage(aIsPreferredLanguage)\n  {mCodingSM = new nsCodingStateMachine(&EUCTWSMModel);\n    Reset();}\n  virtual ~nsEUCTWProber(void){delete mCodingSM;}\n  nsProbingState HandleData(const char* aBuf, PRUint32 aLen);\n  const char* GetCharSetName() {return \"EUC-TW\";}\n  nsProbingState GetState(void) {return mState;}\n  void      Reset(void);\n  float     GetConfidence(void);\n  void      SetOpion() {}\n\nprotected:\n  void      GetDistribution(PRUint32 aCharLen, const char* aStr);\n\n  nsCodingStateMachine* mCodingSM;\n  nsProbingState mState;\n\n  //EUCTWContextAnalysis mContextAnalyser;\n  EUCTWDistributionAnalysis mDistributionAnalyser;\n  char mLastChar[2];\n  PRBool mIsPreferredLanguage;\n};\n\n\n#endif /* nsEUCTWProber_h__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsEscCharsetProber.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n\n#include \"nsEscCharsetProber.h\"\n#include \"nsUniversalDetector.h\"\n\nnsEscCharSetProber::nsEscCharSetProber(PRUint32 aLanguageFilter)\n{\n  for (PRUint32 i = 0; i < NUM_OF_ESC_CHARSETS; i++)\n    mCodingSM[i] = nsnull;\n  if (aLanguageFilter & NS_FILTER_CHINESE_SIMPLIFIED) \n  {\n    mCodingSM[0] = new nsCodingStateMachine(&HZSMModel);\n    mCodingSM[1] = new nsCodingStateMachine(&ISO2022CNSMModel);\n  }\n  if (aLanguageFilter & NS_FILTER_JAPANESE)\n    mCodingSM[2] = new nsCodingStateMachine(&ISO2022JPSMModel);\n  if (aLanguageFilter & NS_FILTER_KOREAN)\n    mCodingSM[3] = new nsCodingStateMachine(&ISO2022KRSMModel);\n  mActiveSM = NUM_OF_ESC_CHARSETS;\n  mState = eDetecting;\n  mDetectedCharset = nsnull;\n}\n\nnsEscCharSetProber::~nsEscCharSetProber(void)\n{\n  for (PRUint32 i = 0; i < NUM_OF_ESC_CHARSETS; i++)\n    delete mCodingSM[i];\n}\n\nvoid nsEscCharSetProber::Reset(void)\n{\n  mState = eDetecting;\n  for (PRUint32 i = 0; i < NUM_OF_ESC_CHARSETS; i++)\n    if (mCodingSM[i]) \n      mCodingSM[i]->Reset();\n  mActiveSM = NUM_OF_ESC_CHARSETS;\n  mDetectedCharset = nsnull;\n}\n\nnsProbingState nsEscCharSetProber::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  for (PRUint32 i = 0; i < aLen && mState == eDetecting; i++)\n  {\n      for (PRInt32 j = mActiveSM - 1; j >= 0; j--)\n    {\n      if (mCodingSM[j])\n      {\n        nsSMState const codingState = mCodingSM[j]->NextState(aBuf[i]);\n        if (codingState == eItsMe)\n        {\n          mState = eFoundIt;\n          mDetectedCharset = mCodingSM[j]->GetCodingStateMachine();\n          return mState;\n        }\n      }\n    }\n  }\n  return mState;\n}\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsEscCharsetProber.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef nsEscCharSetProber_h__\n#define nsEscCharSetProber_h__\n\n#include \"nsCharSetProber.h\"\n#include \"nsCodingStateMachine.h\"\n\n#define NUM_OF_ESC_CHARSETS   4\n\nclass nsEscCharSetProber: public nsCharSetProber {\npublic:\n  nsEscCharSetProber(PRUint32 aLanguageFilter);\n  virtual ~nsEscCharSetProber(void);\n  nsProbingState HandleData(const char* aBuf, PRUint32 aLen);\n  const char* GetCharSetName() {return mDetectedCharset;}\n  nsProbingState GetState(void) {return mState;}\n  void      Reset(void);\n  float     GetConfidence(void) { return NO_DOUBT; }\n  void      SetOpion() {}\n\nprotected:\n  void      GetDistribution(PRUint32 aCharLen, const char* aStr);\n\n  nsCodingStateMachine* mCodingSM[NUM_OF_ESC_CHARSETS] ;\n  PRUint32    mActiveSM;\n  nsProbingState mState;\n  const char *  mDetectedCharset;\n};\n\n#endif /* nsEscCharSetProber_h__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsEscSM.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n#include \"nsCodingStateMachine.h\"\n\nconstexpr  PRUint32 HZ_cls[ 256 / 8 ] = {\nPCK4BITS(1,0,0,0,0,0,0,0),  // 00 - 07\nPCK4BITS(0,0,0,0,0,0,0,0),  // 08 - 0f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 10 - 17\nPCK4BITS(0,0,0,1,0,0,0,0),  // 18 - 1f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 20 - 27\nPCK4BITS(0,0,0,0,0,0,0,0),  // 28 - 2f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 30 - 37\nPCK4BITS(0,0,0,0,0,0,0,0),  // 38 - 3f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 40 - 47\nPCK4BITS(0,0,0,0,0,0,0,0),  // 48 - 4f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 50 - 57\nPCK4BITS(0,0,0,0,0,0,0,0),  // 58 - 5f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 60 - 67\nPCK4BITS(0,0,0,0,0,0,0,0),  // 68 - 6f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 70 - 77\nPCK4BITS(0,0,0,4,0,5,2,0),  // 78 - 7f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 80 - 87\nPCK4BITS(1,1,1,1,1,1,1,1),  // 88 - 8f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 90 - 97\nPCK4BITS(1,1,1,1,1,1,1,1),  // 98 - 9f\nPCK4BITS(1,1,1,1,1,1,1,1),  // a0 - a7\nPCK4BITS(1,1,1,1,1,1,1,1),  // a8 - af\nPCK4BITS(1,1,1,1,1,1,1,1),  // b0 - b7\nPCK4BITS(1,1,1,1,1,1,1,1),  // b8 - bf\nPCK4BITS(1,1,1,1,1,1,1,1),  // c0 - c7\nPCK4BITS(1,1,1,1,1,1,1,1),  // c8 - cf\nPCK4BITS(1,1,1,1,1,1,1,1),  // d0 - d7\nPCK4BITS(1,1,1,1,1,1,1,1),  // d8 - df\nPCK4BITS(1,1,1,1,1,1,1,1),  // e0 - e7\nPCK4BITS(1,1,1,1,1,1,1,1),  // e8 - ef\nPCK4BITS(1,1,1,1,1,1,1,1),  // f0 - f7\nPCK4BITS(1,1,1,1,1,1,1,1)   // f8 - ff\n};\n\n\nconstexpr  PRUint32 HZ_st [ 6] = {\nPCK4BITS(eStart,eError,     3,eStart,eStart,eStart,eError,eError),//00-07\nPCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f\nPCK4BITS(eItsMe,eItsMe,eError,eError,eStart,eStart,     4,eError),//10-17\nPCK4BITS(     5,eError,     6,eError,     5,     5,     4,eError),//18-1f\nPCK4BITS(     4,eError,     4,     4,     4,eError,     4,eError),//20-27\nPCK4BITS(     4,eItsMe,eStart,eStart,eStart,eStart,eStart,eStart) //28-2f\n};\n\nstatic const PRUint32 HZCharLenTable[] = {0, 0, 0, 0, 0, 0};\n\nconst SMModel HZSMModel = {\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, HZ_cls },\n   6,\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, HZ_st },\n  HZCharLenTable,\n  \"HZ-GB-2312\",\n};\n\n\nconstexpr  PRUint32 ISO2022CN_cls [ 256 / 8 ] = {\nPCK4BITS(2,0,0,0,0,0,0,0),  // 00 - 07\nPCK4BITS(0,0,0,0,0,0,0,0),  // 08 - 0f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 10 - 17\nPCK4BITS(0,0,0,1,0,0,0,0),  // 18 - 1f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 20 - 27\nPCK4BITS(0,3,0,0,0,0,0,0),  // 28 - 2f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 30 - 37\nPCK4BITS(0,0,0,0,0,0,0,0),  // 38 - 3f\nPCK4BITS(0,0,0,4,0,0,0,0),  // 40 - 47\nPCK4BITS(0,0,0,0,0,0,0,0),  // 48 - 4f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 50 - 57\nPCK4BITS(0,0,0,0,0,0,0,0),  // 58 - 5f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 60 - 67\nPCK4BITS(0,0,0,0,0,0,0,0),  // 68 - 6f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 70 - 77\nPCK4BITS(0,0,0,0,0,0,0,0),  // 78 - 7f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 80 - 87\nPCK4BITS(2,2,2,2,2,2,2,2),  // 88 - 8f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 90 - 97\nPCK4BITS(2,2,2,2,2,2,2,2),  // 98 - 9f\nPCK4BITS(2,2,2,2,2,2,2,2),  // a0 - a7\nPCK4BITS(2,2,2,2,2,2,2,2),  // a8 - af\nPCK4BITS(2,2,2,2,2,2,2,2),  // b0 - b7\nPCK4BITS(2,2,2,2,2,2,2,2),  // b8 - bf\nPCK4BITS(2,2,2,2,2,2,2,2),  // c0 - c7\nPCK4BITS(2,2,2,2,2,2,2,2),  // c8 - cf\nPCK4BITS(2,2,2,2,2,2,2,2),  // d0 - d7\nPCK4BITS(2,2,2,2,2,2,2,2),  // d8 - df\nPCK4BITS(2,2,2,2,2,2,2,2),  // e0 - e7\nPCK4BITS(2,2,2,2,2,2,2,2),  // e8 - ef\nPCK4BITS(2,2,2,2,2,2,2,2),  // f0 - f7\nPCK4BITS(2,2,2,2,2,2,2,2)   // f8 - ff\n};\n\n\nconstexpr  PRUint32 ISO2022CN_st [ 8] = {\nPCK4BITS(eStart,     3,eError,eStart,eStart,eStart,eStart,eStart),//00-07\nPCK4BITS(eStart,eError,eError,eError,eError,eError,eError,eError),//08-0f\nPCK4BITS(eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe),//10-17\nPCK4BITS(eItsMe,eItsMe,eItsMe,eError,eError,eError,     4,eError),//18-1f\nPCK4BITS(eError,eError,eError,eItsMe,eError,eError,eError,eError),//20-27\nPCK4BITS(     5,     6,eError,eError,eError,eError,eError,eError),//28-2f\nPCK4BITS(eError,eError,eError,eItsMe,eError,eError,eError,eError),//30-37\nPCK4BITS(eError,eError,eError,eError,eError,eItsMe,eError,eStart) //38-3f\n};\n\nstatic const PRUint32 ISO2022CNCharLenTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};\n\nconst SMModel ISO2022CNSMModel = {\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022CN_cls },\n  9,\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022CN_st },\n  ISO2022CNCharLenTable,\n  \"ISO-2022-CN\",\n};\n\nconstexpr  PRUint32 ISO2022JP_cls [ 256 / 8 ] = {\nPCK4BITS(2,0,0,0,0,0,0,0),  // 00 - 07\nPCK4BITS(0,0,0,0,0,0,2,2),  // 08 - 0f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 10 - 17\nPCK4BITS(0,0,0,1,0,0,0,0),  // 18 - 1f\nPCK4BITS(0,0,0,0,7,0,0,0),  // 20 - 27\nPCK4BITS(3,0,0,0,0,0,0,0),  // 28 - 2f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 30 - 37\nPCK4BITS(0,0,0,0,0,0,0,0),  // 38 - 3f\nPCK4BITS(6,0,4,0,8,0,0,0),  // 40 - 47\nPCK4BITS(0,9,5,0,0,0,0,0),  // 48 - 4f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 50 - 57\nPCK4BITS(0,0,0,0,0,0,0,0),  // 58 - 5f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 60 - 67\nPCK4BITS(0,0,0,0,0,0,0,0),  // 68 - 6f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 70 - 77\nPCK4BITS(0,0,0,0,0,0,0,0),  // 78 - 7f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 80 - 87\nPCK4BITS(2,2,2,2,2,2,2,2),  // 88 - 8f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 90 - 97\nPCK4BITS(2,2,2,2,2,2,2,2),  // 98 - 9f\nPCK4BITS(2,2,2,2,2,2,2,2),  // a0 - a7\nPCK4BITS(2,2,2,2,2,2,2,2),  // a8 - af\nPCK4BITS(2,2,2,2,2,2,2,2),  // b0 - b7\nPCK4BITS(2,2,2,2,2,2,2,2),  // b8 - bf\nPCK4BITS(2,2,2,2,2,2,2,2),  // c0 - c7\nPCK4BITS(2,2,2,2,2,2,2,2),  // c8 - cf\nPCK4BITS(2,2,2,2,2,2,2,2),  // d0 - d7\nPCK4BITS(2,2,2,2,2,2,2,2),  // d8 - df\nPCK4BITS(2,2,2,2,2,2,2,2),  // e0 - e7\nPCK4BITS(2,2,2,2,2,2,2,2),  // e8 - ef\nPCK4BITS(2,2,2,2,2,2,2,2),  // f0 - f7\nPCK4BITS(2,2,2,2,2,2,2,2)   // f8 - ff\n};\n\n\nconstexpr  PRUint32 ISO2022JP_st [ 9] = {\nPCK4BITS(eStart,     3,eError,eStart,eStart,eStart,eStart,eStart),//00-07\nPCK4BITS(eStart,eStart,eError,eError,eError,eError,eError,eError),//08-0f\nPCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//10-17\nPCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eError),//18-1f\nPCK4BITS(eError,     5,eError,eError,eError,     4,eError,eError),//20-27\nPCK4BITS(eError,eError,eError,     6,eItsMe,eError,eItsMe,eError),//28-2f\nPCK4BITS(eError,eError,eError,eError,eError,eError,eItsMe,eItsMe),//30-37\nPCK4BITS(eError,eError,eError,eItsMe,eError,eError,eError,eError),//38-3f\nPCK4BITS(eError,eError,eError,eError,eItsMe,eError,eStart,eStart) //40-47\n};\n\n/* XXX: I needed to complete the 2 last classes for this CharLenTable\n * but I did it a bit randomly. Cf. bug 101030.\n * Let's check this piece of code again later when I understand it\n * better. */\nconstexpr PRUint32 ISO2022JPCharLenTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n\nconst SMModel ISO2022JPSMModel = {\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022JP_cls },\n  10,\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022JP_st },\n  ISO2022JPCharLenTable,\n  \"ISO-2022-JP\",\n};\n\nconstexpr  PRUint32 ISO2022KR_cls [ 256 / 8 ] = {\nPCK4BITS(2,0,0,0,0,0,0,0),  // 00 - 07\nPCK4BITS(0,0,0,0,0,0,0,0),  // 08 - 0f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 10 - 17\nPCK4BITS(0,0,0,1,0,0,0,0),  // 18 - 1f\nPCK4BITS(0,0,0,0,3,0,0,0),  // 20 - 27\nPCK4BITS(0,4,0,0,0,0,0,0),  // 28 - 2f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 30 - 37\nPCK4BITS(0,0,0,0,0,0,0,0),  // 38 - 3f\nPCK4BITS(0,0,0,5,0,0,0,0),  // 40 - 47\nPCK4BITS(0,0,0,0,0,0,0,0),  // 48 - 4f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 50 - 57\nPCK4BITS(0,0,0,0,0,0,0,0),  // 58 - 5f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 60 - 67\nPCK4BITS(0,0,0,0,0,0,0,0),  // 68 - 6f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 70 - 77\nPCK4BITS(0,0,0,0,0,0,0,0),  // 78 - 7f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 80 - 87\nPCK4BITS(2,2,2,2,2,2,2,2),  // 88 - 8f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 90 - 97\nPCK4BITS(2,2,2,2,2,2,2,2),  // 98 - 9f\nPCK4BITS(2,2,2,2,2,2,2,2),  // a0 - a7\nPCK4BITS(2,2,2,2,2,2,2,2),  // a8 - af\nPCK4BITS(2,2,2,2,2,2,2,2),  // b0 - b7\nPCK4BITS(2,2,2,2,2,2,2,2),  // b8 - bf\nPCK4BITS(2,2,2,2,2,2,2,2),  // c0 - c7\nPCK4BITS(2,2,2,2,2,2,2,2),  // c8 - cf\nPCK4BITS(2,2,2,2,2,2,2,2),  // d0 - d7\nPCK4BITS(2,2,2,2,2,2,2,2),  // d8 - df\nPCK4BITS(2,2,2,2,2,2,2,2),  // e0 - e7\nPCK4BITS(2,2,2,2,2,2,2,2),  // e8 - ef\nPCK4BITS(2,2,2,2,2,2,2,2),  // f0 - f7\nPCK4BITS(2,2,2,2,2,2,2,2)   // f8 - ff\n};\n\n\nconstexpr PRUint32 ISO2022KR_st [ 5] = {\nPCK4BITS(eStart,     3,eError,eStart,eStart,eStart,eError,eError),//00-07\nPCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f\nPCK4BITS(eItsMe,eItsMe,eError,eError,eError,     4,eError,eError),//10-17\nPCK4BITS(eError,eError,eError,eError,     5,eError,eError,eError),//18-1f\nPCK4BITS(eError,eError,eError,eItsMe,eStart,eStart,eStart,eStart) //20-27\n};\n\nconstexpr PRUint32 ISO2022KRCharLenTable[] = { 0, 0, 0, 0, 0, 0 };\n\nconst SMModel ISO2022KRSMModel = {\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022KR_cls },\n   6,\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022KR_st },\n  ISO2022KRCharLenTable,\n  \"ISO-2022-KR\",\n};\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsGB18030Prober.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n// for S-JIS encoding, obeserve characteristic:\n// 1, kana character (or hankaku?) often have hight frequency of appereance\n// 2, kana character often exist in group\n// 3, certain combination of kana is never used in japanese language\n\n#include \"nsGB18030Prober.h\"\n\nvoid  nsGB18030Prober::Reset(void)\n{\n  mCodingSM->Reset(); \n  mState = eDetecting;\n  mDistributionAnalyser.Reset(mIsPreferredLanguage);\n  //mContextAnalyser.Reset();\n}\n\nnsProbingState nsGB18030Prober::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  nsSMState codingState;\n\n  for (PRUint32 i = 0; i < aLen; i++)\n  {\n    codingState = mCodingSM->NextState(aBuf[i]);\n    if (codingState == eItsMe)\n    {\n      mState = eFoundIt;\n      break;\n    }\n    if (codingState == eStart)\n    {\n      PRUint32 charLen = mCodingSM->GetCurrentCharLen();\n\n      if (i == 0)\n      {\n        mLastChar[1] = aBuf[0];\n        mDistributionAnalyser.HandleOneChar(mLastChar, charLen);\n      }\n      else\n        mDistributionAnalyser.HandleOneChar(aBuf+i-1, charLen);\n    }\n  }\n\n  mLastChar[0] = aBuf[aLen-1];\n\n  if (mState == eDetecting)\n    if (mDistributionAnalyser.GotEnoughData() && GetConfidence() >= SHORTCUT_THRESHOLD)\n      mState = eFoundIt;\n//    else\n//      mDistributionAnalyser.HandleData(aBuf, aLen);\n\n  return mState;\n}\n\nfloat nsGB18030Prober::GetConfidence(void)\n{\n  return mDistributionAnalyser.GetConfidence();\n}\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsGB18030Prober.h",
    "content": "﻿/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef nsGB18030Prober_h__\n#define nsGB18030Prober_h__\n\n#include \"nsCharSetProber.h\"\n#include \"nsCodingStateMachine.h\"\n#include \"CharDistribution.h\"\n\n// NOT VALID: We use GB18030 to replace GB2312, because 18030 is a superset.\n// it superseded GB2312, but it is NOT a superset\n\nclass nsGB18030Prober : public nsCharSetProber {\npublic:\n  nsGB18030Prober(PRBool aIsPreferredLanguage)\n    :mIsPreferredLanguage(aIsPreferredLanguage)\n  {mCodingSM = new nsCodingStateMachine(&GB18030SMModel);\n    Reset();}\n  virtual ~nsGB18030Prober(void){delete mCodingSM;}\n  nsProbingState HandleData(const char* aBuf, PRUint32 aLen);\n  const char* GetCharSetName() {return \"GB18030\";}\n  nsProbingState GetState(void) {return mState;}\n  void      Reset(void);\n  float     GetConfidence(void);\n  void      SetOpion() {}\n\nprotected:\n  void      GetDistribution(PRUint32 aCharLen, const char* aStr);\n  \n  nsCodingStateMachine* mCodingSM;\n  nsProbingState mState;\n\n  //GB18030ContextAnalysis mContextAnalyser;\n  GB18030DistributionAnalysis mDistributionAnalyser;\n  char mLastChar[2];\n  PRBool mIsPreferredLanguage;\n\n};\n\n\n#endif /* nsGB18030Prober_h__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsGB2312Prober.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n// for S-JIS encoding, obeserve characteristic:\n// 1, kana character (or hankaku?) often have hight frequency of appereance\n// 2, kana character often exist in group\n// 3, certain combination of kana is never used in japanese language\n\n#include \"nsGB2312Prober.h\"\n\nvoid  nsGB2312Prober::Reset(void)\n{\n  mCodingSM->Reset();\n  mState = eDetecting;\n  mDistributionAnalyser.Reset(mIsPreferredLanguage);\n  //mContextAnalyser.Reset();\n}\n\nnsProbingState nsGB2312Prober::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  nsSMState codingState;\n\n  for (PRUint32 i = 0; i < aLen; i++)\n  {\n    codingState = mCodingSM->NextState(aBuf[i]);\n    if (codingState == eItsMe)\n    {\n      mState = eFoundIt;\n      break;\n    }\n    if (codingState == eStart)\n    {\n      PRUint32 charLen = mCodingSM->GetCurrentCharLen();\n\n      if (i == 0)\n      {\n        mLastChar[1] = aBuf[0];\n        mDistributionAnalyser.HandleOneChar(mLastChar, charLen);\n      }\n      else\n        mDistributionAnalyser.HandleOneChar(aBuf+i-1, charLen);\n    }\n  }\n\n  mLastChar[0] = aBuf[aLen-1];\n\n  if (mState == eDetecting)\n    if (mDistributionAnalyser.GotEnoughData() && GetConfidence() >= SHORTCUT_THRESHOLD)\n      mState = eFoundIt;\n//    else\n//      mDistributionAnalyser.HandleData(aBuf, aLen);\n\n  return mState;\n}\n\nfloat nsGB2312Prober::GetConfidence(void)\n{\n  float distribCf = mDistributionAnalyser.GetConfidence();\n\n  return (float)distribCf;\n}\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsGB2312Prober.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef nsGB2312Prober_h__\n#define nsGB2312Prober_h__\n\n#include \"nsCharSetProber.h\"\n#include \"nsCodingStateMachine.h\"\n#include \"CharDistribution.h\"\n\n// NOT VALID: We use GB18030 to replace GB2312, because 18030 is a superset.\n// it superseded GB2312, but it is NOT a superset\n\nclass nsGB2312Prober : public nsCharSetProber {\npublic:\n  nsGB2312Prober(PRBool aIsPreferredLanguage)\n    :mIsPreferredLanguage(aIsPreferredLanguage)\n  {mCodingSM = new nsCodingStateMachine(&GB2312SMModel);\n    Reset();}\n  virtual ~nsGB2312Prober(void){delete mCodingSM;}\n  nsProbingState HandleData(const char* aBuf, PRUint32 aLen);\n  const char* GetCharSetName() {return \"GB2312\";}\n  nsProbingState GetState(void) {return mState;}\n  void      Reset(void);\n  float     GetConfidence(void);\n  void      SetOpion() {}\n\nprotected:\n  void      GetDistribution(PRUint32 aCharLen, const char* aStr);\n\n  nsCodingStateMachine* mCodingSM;\n  nsProbingState mState;\n\n  //GB2312ContextAnalysis mContextAnalyser;\n  GB2312DistributionAnalysis mDistributionAnalyser;\n  char mLastChar[2];\n  PRBool mIsPreferredLanguage;\n};\n\n\n#endif /* nsGB2312Prober_h__ */\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsHebrewProber.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n *          Shy Shalom <shooshX@gmail.com>\n * Portions created by the Initial Developer are Copyright (C) 2005\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"nsHebrewProber.h\"\n#include <stdio.h>\n\n// Windows-1255 / ISO-8859-8 code points of interest\n#define FINAL_KAF ('\\xea')\n#define NORMAL_KAF ('\\xeb')\n#define FINAL_MEM ('\\xed')\n#define NORMAL_MEM ('\\xee')\n#define FINAL_NUN ('\\xef')\n#define NORMAL_NUN ('\\xf0')\n#define FINAL_PE ('\\xf3')\n#define NORMAL_PE ('\\xf4')\n#define FINAL_TSADI ('\\xf5')\n#define NORMAL_TSADI ('\\xf6')\n\n// Minimum Visual vs Logical final letter score difference.\n// If the difference is below this, don't rely solely on the final letter score distance.\n#define MIN_FINAL_CHAR_DISTANCE (5)\n\n// Minimum Visual vs Logical model score difference.\n// If the difference is below this, don't rely at all on the model score distance.\n#define MIN_MODEL_DISTANCE (0.01f)\n\n#define VISUAL_HEBREW_NAME (\"ISO-8859-8\")\n#define LOGICAL_HEBREW_NAME (\"WINDOWS-1255\")\n\nPRBool nsHebrewProber::isFinal(char c)\n{\n  return ((c == FINAL_KAF) || (c == FINAL_MEM) || (c == FINAL_NUN) || (c == FINAL_PE) || (c == FINAL_TSADI));\n}\n\nPRBool nsHebrewProber::isNonFinal(char c)\n{\n  return ((c == NORMAL_KAF) || (c == NORMAL_MEM) || (c == NORMAL_NUN) || (c == NORMAL_PE));\n  // The normal Tsadi is not a good Non-Final letter due to words like\n  // 'lechotet' (to chat) containing an apostrophe after the tsadi. This\n  // apostrophe is converted to a space in FilterWithoutEnglishLetters causing\n  // the Non-Final tsadi to appear at an end of a word even though this is not\n  // the case in the original text.\n  // The letters Pe and Kaf rarely display a related behavior of not being a\n  // good Non-Final letter. Words like 'Pop', 'Winamp' and 'Mubarak' for\n  // example legally end with a Non-Final Pe or Kaf. However, the benefit of\n  // these letters as Non-Final letters outweighs the damage since these words\n  // are quite rare.\n}\n\n/** HandleData\n * Final letter analysis for logical-visual decision.\n * Look for evidence that the received buffer is either logical Hebrew or\n * visual Hebrew.\n * The following cases are checked:\n * 1) A word longer than 1 letter, ending with a final letter. This is an\n *    indication that the text is laid out \"naturally\" since the final letter\n *    really appears at the end. +1 for logical score.\n * 2) A word longer than 1 letter, ending with a Non-Final letter. In normal\n *    Hebrew, words ending with Kaf, Mem, Nun, Pe or Tsadi, should not end with\n *    the Non-Final form of that letter. Exceptions to this rule are mentioned\n *    above in isNonFinal(). This is an indication that the text is laid out\n *    backwards. +1 for visual score\n * 3) A word longer than 1 letter, starting with a final letter. Final letters\n *    should not appear at the beginning of a word. This is an indication that\n *    the text is laid out backwards. +1 for visual score.\n *\n * The visual score and logical score are accumulated throughout the text and\n * are finally checked against each other in GetCharSetName().\n * No checking for final letters in the middle of words is done since that case\n * is not an indication for either Logical or Visual text.\n *\n * The input buffer should not contain any white spaces that are not (' ')\n * or any low-ascii punctuation marks.\n */\nnsProbingState nsHebrewProber::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  // Both model probers say it's not them. No reason to continue.\n  if (GetState() == eNotMe)\n    return eNotMe;\n\n  const char *curPtr, *endPtr = aBuf+aLen;\n  char cur;\n\n  for (curPtr = (char*)aBuf; curPtr < endPtr; ++curPtr)\n  {\n    cur = *curPtr;\n    if (cur == ' ') // We stand on a space - a word just ended\n    {\n      if (mBeforePrev != ' ') // *(curPtr-2) was not a space so prev is not a 1 letter word\n      {\n        if (isFinal(mPrev)) // case (1) [-2:not space][-1:final letter][cur:space]\n          ++mFinalCharLogicalScore;\n        else if (isNonFinal(mPrev)) // case (2) [-2:not space][-1:Non-Final letter][cur:space]\n          ++mFinalCharVisualScore;\n      }\n    }\n    else  // Not standing on a space\n    {\n      if ((mBeforePrev == ' ') && (isFinal(mPrev)) && (cur != ' ')) // case (3) [-2:space][-1:final letter][cur:not space]\n        ++mFinalCharVisualScore;\n    }\n    mBeforePrev = mPrev;\n    mPrev = cur;\n  }\n\n  // Forever detecting, till the end or until both model probers return eNotMe (handled above).\n  return eDetecting;\n}\n\n// Make the decision: is it Logical or Visual?\nconst char* nsHebrewProber::GetCharSetName()\n{\n  // If the final letter score distance is dominant enough, rely on it.\n  PRInt32 finalsub = mFinalCharLogicalScore - mFinalCharVisualScore;\n  if (finalsub >= MIN_FINAL_CHAR_DISTANCE)\n    return LOGICAL_HEBREW_NAME;\n  if (finalsub <= -(MIN_FINAL_CHAR_DISTANCE))\n    return VISUAL_HEBREW_NAME;\n\n  // It's not dominant enough, try to rely on the model scores instead.\n  float modelsub = mLogicalProb->GetConfidence() - mVisualProb->GetConfidence();\n  if (modelsub > MIN_MODEL_DISTANCE)\n    return LOGICAL_HEBREW_NAME;\n  if (modelsub < -(MIN_MODEL_DISTANCE))\n    return VISUAL_HEBREW_NAME;\n\n  // Still no good, back to final letter distance, maybe it'll save the day.\n  if (finalsub < 0)\n    return VISUAL_HEBREW_NAME;\n\n  // (finalsub > 0 - Logical) or (don't know what to do) default to Logical.\n  return LOGICAL_HEBREW_NAME;\n}\n\n\nvoid nsHebrewProber::Reset(void)\n{\n  mFinalCharLogicalScore = 0;\n  mFinalCharVisualScore = 0;\n\n  // mPrev and mBeforePrev are initialized to space in order to simulate a word\n  // delimiter at the beginning of the data\n  mPrev = ' ';\n  mBeforePrev = ' ';\n}\n\nnsProbingState nsHebrewProber::GetState(void)\n{\n  // Remain active as long as any of the model probers are active.\n  if ((mLogicalProb->GetState() == eNotMe) && (mVisualProb->GetState() == eNotMe))\n    return eNotMe;\n  return eDetecting;\n}\n\n#ifdef DEBUG_chardet\nvoid  nsHebrewProber::DumpStatus()\n{\n  printf(\"  HEB: %d - %d [Logical-Visual score]\\r\\n\", mFinalCharLogicalScore, mFinalCharVisualScore);\n}\n#endif\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsHebrewProber.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n *          Shy Shalom <shooshX@gmail.com>\n * Portions created by the Initial Developer are Copyright (C) 2005\n * the Initial Developer: All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef nsHebrewProber_h__\n#define nsHebrewProber_h__\n\n#include \"nsSBCharSetProber.h\"\n\n// This prober doesn't actually recognize a language or a charset.\n// It is a helper prober for the use of the Hebrew model probers\nclass nsHebrewProber: public nsCharSetProber\n{\npublic:\n  nsHebrewProber(void) :mLogicalProb(0), mVisualProb(0) { Reset(); }\n\n  virtual ~nsHebrewProber(void) {}\n  virtual nsProbingState HandleData(const char* aBuf, PRUint32 aLen);\n  virtual const char* GetCharSetName();\n  virtual void Reset(void);\n\n  virtual nsProbingState GetState(void);\n\n  virtual float     GetConfidence(void) { return (float)0.0; }\n  virtual void      SetOpion() {}\n\n  void SetModelProbers(nsCharSetProber *logicalPrb, nsCharSetProber *visualPrb)\n  { mLogicalProb = logicalPrb; mVisualProb = visualPrb; }\n\n#ifdef DEBUG_chardet\n  virtual void  DumpStatus();\n#endif\n\nprotected:\n  static PRBool isFinal(char c);\n  static PRBool isNonFinal(char c);\n\n  PRInt32 mFinalCharLogicalScore, mFinalCharVisualScore;\n\n  // The two last characters seen in the previous buffer.\n  char mPrev, mBeforePrev;\n\n  // These probers are owned by the group prober.\n  nsCharSetProber *mLogicalProb, *mVisualProb;\n};\n\n/**\n * ** General ideas of the Hebrew charset recognition **\n *\n * Four main charsets exist in Hebrew:\n * \"ISO-8859-8\" - Visual Hebrew\n * \"Windows-1255\" - Logical Hebrew\n * \"ISO-8859-8-I\" - Logical Hebrew\n * \"x-mac-hebrew\" - ?? Logical Hebrew ??\n *\n * Both \"ISO\" charsets use a completely identical set of code points, whereas\n * \"Windows-1255\" and \"x-mac-hebrew\" are two different proper supersets of\n * these code points. Windows-1255 defines additional characters in the range\n * 0x80-0x9F as some misc punctuation marks as well as some Hebrew-specific\n * diacritics and additional 'Yiddish' ligature letters in the range 0xc0-0xd6.\n * x-mac-hebrew defines similar additional code points but with a different\n * mapping.\n *\n * As far as an average Hebrew text with no diacritics is concerned, all four\n * charsets are identical with respect to code points. Meaning that for the\n * main Hebrew alphabet, all four map the same values to all 27 Hebrew letters\n * (including final letters).\n *\n * The dominant difference between these charsets is their directionality.\n * \"Visual\" directionality means that the text is ordered as if the renderer is\n * not aware of a BIDI rendering algorithm. The renderer sees the text and\n * draws it from left to right. The text itself when ordered naturally is read\n * backwards. A buffer of Visual Hebrew generally looks like so:\n * \"[last word of first line spelled backwards] [whole line ordered backwards\n * and spelled backwards] [first word of first line spelled backwards]\n * [end of line] [last word of second line] ... etc' \"\n * adding punctuation marks, numbers and English text to visual text is\n * naturally also \"visual\" and from left to right.\n *\n * \"Logical\" directionality means the text is ordered \"naturally\" according to\n * the order it is read. It is the responsibility of the renderer to display\n * the text from right to left. A BIDI algorithm is used to place general\n * punctuation marks, numbers and English text in the text.\n *\n * Texts in x-mac-hebrew are almost impossible to find on the Internet. From\n * what little evidence I could find, it seems that its general directionality\n * is Logical.\n *\n * To sum up all of the above, the Hebrew probing mechanism knows about two\n * charsets:\n * Visual Hebrew - \"ISO-8859-8\" - backwards text - Words and sentences are\n *    backwards while line order is natural. For charset recognition purposes\n *    the line order is unimportant (In fact, for this implementation, even\n *    word order is unimportant).\n * Logical Hebrew - \"Windows-1255\" - normal, naturally ordered text.\n *\n * \"ISO-8859-8-I\" is a subset of Windows-1255 and doesn't need to be\n *    specifically identified.\n * \"x-mac-hebrew\" is also identified as Windows-1255. A text in x-mac-hebrew\n *    that contain special punctuation marks or diacritics is displayed with\n *    some unconverted characters showing as question marks. This problem might\n *    be corrected using another model prober for x-mac-hebrew. Due to the fact\n *    that x-mac-hebrew texts are so rare, writing another model prober isn't\n *    worth the effort and performance hit.\n *\n * *** The Prober ***\n *\n * The prober is divided between two nsSBCharSetProbers and an nsHebrewProber,\n * all of which are managed, created, fed data, inquired and deleted by the\n * nsSBCSGroupProber. The two nsSBCharSetProbers identify that the text is in\n * fact some kind of Hebrew, Logical or Visual. The final decision about which\n * one is it is made by the nsHebrewProber by combining final-letter scores\n * with the scores of the two nsSBCharSetProbers to produce a final answer.\n *\n * The nsSBCSGroupProber is responsible for stripping the original text of HTML\n * tags, English characters, numbers, low-ASCII punctuation characters, spaces\n * and new lines. It reduces any sequence of such characters to a single space.\n * The buffer fed to each prober in the SBCS group prober is pure text in\n * high-ASCII.\n * The two nsSBCharSetProbers (model probers) share the same language model:\n * Win1255Model.\n * The first nsSBCharSetProber uses the model normally as any other\n * nsSBCharSetProber does, to recognize Windows-1255, upon which this model was\n * built. The second nsSBCharSetProber is told to make the pair-of-letter\n * lookup in the language model backwards. This in practice exactly simulates\n * a visual Hebrew model using the Windows-1255 logical Hebrew model.\n *\n * The nsHebrewProber is not using any language model. All it does is look for\n * final-letter evidence suggesting the text is either logical Hebrew or visual\n * Hebrew. Disjointed from the model probers, the results of the nsHebrewProber\n * alone are meaningless. nsHebrewProber always returns 0.00 as confidence\n * since it never identifies a charset by itself. Instead, the pointer to the\n * nsHebrewProber is passed to the model probers as a helper \"Name Prober\".\n * When the Group prober receives a positive identification from any prober,\n * it asks for the name of the charset identified. If the prober queried is a\n * Hebrew model prober, the model prober forwards the call to the\n * nsHebrewProber to make the final decision. In the nsHebrewProber, the\n * decision is made according to the final-letters scores maintained and Both\n * model probers scores. The answer is returned in the form of the name of the\n * charset identified, either \"Windows-1255\" or \"ISO-8859-8\".\n *\n */\n#endif /* nsHebrewProber_h__ */\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsLatin1Prober.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          Shy Shalom <shooshX@gmail.com>\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"nsLatin1Prober.h\"\n#include \"prmem.h\"\n#include <stdio.h>\n\n#define UDF    0        // undefined\n#define OTH    1        //other\n#define ASC    2        // ascii capital letter\n#define ASS    3        // ascii small letter\n#define ACV    4        // accent capital vowel\n#define ACO    5        // accent capital other\n#define ASV    6        // accent small vowel\n#define ASO    7        // accent small other\n#define CLASS_NUM   8    // total classes\n\nconstexpr unsigned char Latin1_CharToClass[] = \n{\n  OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH,   // 00 - 07\n  OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH,   // 08 - 0F\n  OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH,   // 10 - 17\n  OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH,   // 18 - 1F\n  OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH,   // 20 - 27\n  OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH,   // 28 - 2F\n  OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH,   // 30 - 37\n  OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH,   // 38 - 3F\n  OTH, ASC, ASC, ASC, ASC, ASC, ASC, ASC,   // 40 - 47\n  ASC, ASC, ASC, ASC, ASC, ASC, ASC, ASC,   // 48 - 4F\n  ASC, ASC, ASC, ASC, ASC, ASC, ASC, ASC,   // 50 - 57\n  ASC, ASC, ASC, OTH, OTH, OTH, OTH, OTH,   // 58 - 5F\n  OTH, ASS, ASS, ASS, ASS, ASS, ASS, ASS,   // 60 - 67\n  ASS, ASS, ASS, ASS, ASS, ASS, ASS, ASS,   // 68 - 6F\n  ASS, ASS, ASS, ASS, ASS, ASS, ASS, ASS,   // 70 - 77\n  ASS, ASS, ASS, OTH, OTH, OTH, OTH, OTH,   // 78 - 7F\n  OTH, UDF, OTH, ASO, OTH, OTH, OTH, OTH,   // 80 - 87\n  OTH, OTH, ACO, OTH, ACO, UDF, ACO, UDF,   // 88 - 8F\n  UDF, OTH, OTH, OTH, OTH, OTH, OTH, OTH,   // 90 - 97\n  OTH, OTH, ASO, OTH, ASO, UDF, ASO, ACO,   // 98 - 9F\n  OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH,   // A0 - A7\n  OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH,   // A8 - AF\n  OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH,   // B0 - B7\n  OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH,   // B8 - BF\n  ACV, ACV, ACV, ACV, ACV, ACV, ACO, ACO,   // C0 - C7\n  ACV, ACV, ACV, ACV, ACV, ACV, ACV, ACV,   // C8 - CF\n  ACO, ACO, ACV, ACV, ACV, ACV, ACV, OTH,   // D0 - D7\n  ACV, ACV, ACV, ACV, ACV, ACO, ACO, ACO,   // D8 - DF\n  ASV, ASV, ASV, ASV, ASV, ASV, ASO, ASO,   // E0 - E7\n  ASV, ASV, ASV, ASV, ASV, ASV, ASV, ASV,   // E8 - EF\n  ASO, ASO, ASV, ASV, ASV, ASV, ASV, OTH,   // F0 - F7\n  ASV, ASV, ASV, ASV, ASV, ASO, ASO, ASO,   // F8 - FF\n};\n\n\n/* 0 : illegal\n   1 : very unlikely\n   2 : normal\n   3 : very likely\n*/\nconstexpr unsigned char Latin1ClassModel[] = \n{\n/*      UDF OTH ASC ASS ACV ACO ASV ASO  */\n/*UDF*/  0,  0,  0,  0,  0,  0,  0,  0,\n/*OTH*/  0,  3,  3,  3,  3,  3,  3,  3,\n/*ASC*/  0,  3,  3,  3,  3,  3,  3,  3,\n/*ASS*/  0,  3,  3,  3,  1,  1,  3,  3,\n/*ACV*/  0,  3,  3,  3,  1,  2,  1,  2,\n/*ACO*/  0,  3,  3,  3,  3,  3,  3,  3,\n/*ASV*/  0,  3,  1,  3,  1,  1,  1,  3,\n/*ASO*/  0,  3,  1,  3,  1,  1,  3,  3,\n};\n\nvoid  nsLatin1Prober::Reset(void)\n{\n  mState = eDetecting;\n  mLastCharClass = OTH;\n  for (int i = 0; i < FREQ_CAT_NUM; i++)\n    mFreqCounter[i] = 0;\n}\n\n\nnsProbingState nsLatin1Prober::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  char *newBuf1 = 0;\n  PRUint32 newLen1 = 0;\n\n  if (!FilterWithEnglishLetters(aBuf, aLen, &newBuf1, newLen1)) {\n    newBuf1 = (char*)aBuf;\n    newLen1 = aLen;\n  }\n\n  unsigned char charClass;\n  unsigned char freq;\n  for (PRUint32 i = 0; i < newLen1; i++)\n  {\n    charClass = Latin1_CharToClass[(unsigned char)newBuf1[i]];\n    freq = Latin1ClassModel[mLastCharClass*CLASS_NUM + charClass];\n    if (freq == 0) {\n      mState = eNotMe;\n      break;\n    }\n    mFreqCounter[freq]++;\n    mLastCharClass = charClass;\n  }\n\n  if (newBuf1 != aBuf)\n    PR_FREEIF(newBuf1);\n\n  return mState;\n}\n\nfloat nsLatin1Prober::GetConfidence(void)\n{\n  if (mState == eNotMe)\n    return SURE_NO;\n\n  PRUint32 total = 0;\n  for (PRInt32 i = 0; i < FREQ_CAT_NUM; i++) {\n    total += mFreqCounter[i];\n  }\n\n  float confidence = 0.0f;\n\n  if (total)\n  {\n    confidence = (float)mFreqCounter[3] / (float)total;\n    confidence -= (float)mFreqCounter[1] * 20.0f / (float)total;\n  }\n\n  if (confidence < 0.0f) { confidence = 0.0f; }\n\n  // lower the confidence of latin1 so that other more accurate detector\n  // can take priority.\n  confidence *= 0.50f;\n\n  return confidence;\n}\n\n#ifdef DEBUG_chardet\nvoid  nsLatin1Prober::DumpStatus()\n{\n  printf(\" Latin1Prober: %1.3f [%s]\\r\\n\", GetConfidence(), GetCharSetName());\n}\n#endif\n\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsLatin1Prober.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n * vim: et sw=2 ts=2 fdm=marker\n */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          Shy Shalom <shooshX@gmail.com>\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef nsLatin1Prober_h__\n#define nsLatin1Prober_h__\n\n#include \"nsCharSetProber.h\"\n\n#define FREQ_CAT_NUM    4\n\nclass nsLatin1Prober: public nsCharSetProber {\npublic:\n  nsLatin1Prober(void){Reset();}\n  virtual ~nsLatin1Prober(void){}\n  nsProbingState HandleData(const char* aBuf, PRUint32 aLen);\n  const char* GetCharSetName() {return \"Windows-1252\";}\n  nsProbingState GetState(void) {return mState;}\n  void      Reset(void);\n  float     GetConfidence(void);\n  void      SetOpion() {}\n\n#ifdef DEBUG_chardet\n  virtual void  DumpStatus();\n#endif\n\nprotected:\n\n  nsProbingState mState;\n  char mLastCharClass;\n  PRUint32 mFreqCounter[FREQ_CAT_NUM];\n};\n\n\n#endif /* nsLatin1Prober_h__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsMBCSGroupProber.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          Shy Shalom <shooshX@gmail.com>\n *\t\t\tProofpoint, Inc.\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n#include <stdio.h>\n\n#include \"nsMBCSGroupProber.h\"\n#include \"nsUniversalDetector.h\"\n\n#if defined(DEBUG_chardet) || defined(DEBUG_jgmyers)\nconst char *ProberName[] = \n{\n  \"UTF-8\",\n  \"SJIS\",\n  \"EUC-JP\",\n  //\"GB2312\",\n  \"GB18030\",\n  \"EUC-KR\",\n  \"BIG5\",\n  \"EUC-TW\",\n};\n\n#endif\n\nnsMBCSGroupProber::nsMBCSGroupProber(PRUint32 aLanguageFilter)\n  : mNumOfProbers(MAX_NUM_OF_MBCS_PROBERS), mBestGuess(-1), mActiveNum(0)\n{\n  PRUint32 i = 0;\n  mProbers[i++] = new nsUTF8Prober();\n  if (aLanguageFilter & NS_FILTER_JAPANESE) \n  {\n    mProbers[i++] = new nsSJISProber(aLanguageFilter == NS_FILTER_JAPANESE);\n    mProbers[i++] = new nsEUCJPProber(aLanguageFilter == NS_FILTER_JAPANESE);\n  }\n  if (aLanguageFilter & NS_FILTER_CHINESE_SIMPLIFIED) \n  {\n    //mProbers[i++] = new nsGB2312Prober(aLanguageFilter == NS_FILTER_CHINESE_SIMPLIFIED);\n    mProbers[i++] = new nsGB18030Prober(aLanguageFilter == NS_FILTER_CHINESE_SIMPLIFIED);\n  }\n  if (aLanguageFilter & NS_FILTER_KOREAN)\n  {\n    mProbers[i++] = new nsEUCKRProber(aLanguageFilter == NS_FILTER_KOREAN);\n  }\n  if (aLanguageFilter & NS_FILTER_CHINESE_TRADITIONAL) \n  {\n    mProbers[i++] = new nsBig5Prober(aLanguageFilter == NS_FILTER_CHINESE_TRADITIONAL);\n    mProbers[i++] = new nsEUCTWProber(aLanguageFilter == NS_FILTER_CHINESE_TRADITIONAL);\n  }\n\n  mNumOfProbers = i;\n\n  for (; i < MAX_NUM_OF_MBCS_PROBERS; ++i) { mProbers[i] = nsnull; }\n\n  Reset();\n}\n\nnsMBCSGroupProber::~nsMBCSGroupProber()\n{\n  for (PRUint32 i = 0; i < MAX_NUM_OF_MBCS_PROBERS; ++i)\n  {\n    if (mProbers[i]) { delete mProbers[i]; }\n  }\n}\n\nconst char* nsMBCSGroupProber::GetCharSetName()\n{\n  if (mBestGuess == -1)\n  {\n    GetConfidence();\n\n    if (mBestGuess == -1) { mBestGuess = 0; }\n  }\n  return mProbers[mBestGuess]->GetCharSetName();\n}\n\nvoid  nsMBCSGroupProber::Reset(void)\n{\n  mActiveNum = 0;\n  for (PRUint32 i = 0; i < MAX_NUM_OF_MBCS_PROBERS; i++)\n  {\n    if (mProbers[i])\n    {\n      mProbers[i]->Reset();\n      mIsActive[i] = PR_TRUE;\n      ++mActiveNum;\n    }\n    else\n      mIsActive[i] = PR_FALSE;\n  }\n  mBestGuess = -1;\n  mState = eDetecting;\n  mKeepNext = 0;\n}\n\nnsProbingState nsMBCSGroupProber::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  nsProbingState st;\n  PRUint32 start = 0;\n  PRUint32 keepNext = mKeepNext;\n\n  //do filtering to reduce load to probers\n  for (PRUint32 pos = 0; pos < aLen; ++pos)\n  {\n    if (aBuf[pos] & 0x80)\n    {\n      if (!keepNext)\n        start = pos;\n      keepNext = 2;\n    }\n    else if (keepNext)\n    {\n      if (--keepNext == 0)\n      {\n        for (PRUint32 i = 0; i < mNumOfProbers; i++)\n        {\n          if (!mIsActive[i])\n            continue;\n          st = mProbers[i]->HandleData(aBuf + start, pos + 1 - start);\n          if (st == eFoundIt)\n          {\n            mBestGuess = i;\n            mState = eFoundIt;\n            return mState;\n          }\n        }\n      }\n    }\n  }\n\n  if (keepNext) {\n    for (PRUint32 i = 0; i < mNumOfProbers; i++)\n    {\n      if (!mIsActive[i])\n        continue;\n      //@@@st = mProbers[i]->HandleData(aBuf + start, aLen + 1 - start);\n      st = mProbers[i]->HandleData(aBuf + start, aLen - start);\n      if (st == eFoundIt)\n      {\n        mBestGuess = i;\n        mState = eFoundIt;\n        return mState;\n      }\n    }\n  }\n  mKeepNext = keepNext;\n\n  return mState;\n}\n\nfloat nsMBCSGroupProber::GetConfidence()\n{\n  float bestConf = 0.0f;\n\n  switch (mState)\n  {\n  case eFoundIt:\n    return SURE_YES;\n  case eNotMe:\n    return SURE_NO;\n  default:\n    for (PRUint32 i = 0; i < mNumOfProbers; i++)\n    {\n      if (!mIsActive[i])\n        continue;\n      float const cf = mProbers[i]->GetConfidence();\n      if (bestConf < cf)\n      {\n        bestConf = cf;\n        mBestGuess = i;\n      }\n    }\n  }\n  return bestConf;\n}\n\n#ifdef DEBUG_chardet\nvoid nsMBCSGroupProber::DumpStatus()\n{\n  GetConfidence();\n  for (PRUint32 i = 0; i < mNumOfProbers; i++)\n  {\n    if (!mIsActive[i])\n      printf(\"  MBCS inactive: [%s] (confidence is too low).\\r\\n\", ProberName[i]);\n    else\n    {\n      float const cf = mProbers[i]->GetConfidence();\n      printf(\"  MBCS %1.3f: [%s]\\r\\n\", cf, ProberName[i]);\n    }\n  }\n}\n#endif\n\n#ifdef DEBUG_jgmyers\nvoid nsMBCSGroupProber::GetDetectorState(nsUniversalDetector::DetectorState (&states)[nsUniversalDetector::NumDetectors], PRUint32 &offset)\n{\n  for (PRUint32 i = 0; i < mNumOfProbers; ++i) {\n    states[offset].name = ProberName[i];\n    states[offset].isActive = mIsActive[i];\n    states[offset].confidence = mIsActive[i] ? mProbers[i]->GetConfidence() : 0.0;\n    ++offset;\n  }\n}\n#endif /* DEBUG_jgmyers */\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsMBCSGroupProber.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\t\t\tProofpoint, Inc.\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef nsMBCSGroupProber_h__\n#define nsMBCSGroupProber_h__\n\n#include \"nsSJISProber.h\"\n#include \"nsUTF8Prober.h\"\n#include \"nsEUCJPProber.h\"\n//#include \"nsGB2312Prober.h\"\n#include \"nsGB18030Prober.h\"\n#include \"nsEUCKRProber.h\"\n#include \"nsBig5Prober.h\"\n#include \"nsEUCTWProber.h\"\n\n#define MAX_NUM_OF_MBCS_PROBERS    10\n\nclass nsMBCSGroupProber: public nsCharSetProber {\npublic:\n  nsMBCSGroupProber();\n  nsMBCSGroupProber(PRUint32 aLanguageFilter);\n  virtual ~nsMBCSGroupProber();\n  nsProbingState HandleData(const char* aBuf, PRUint32 aLen);\n  const char* GetCharSetName();\n  nsProbingState GetState(void) {return mState;}\n  void      Reset(void);\n  float     GetConfidence(void);\n  void      SetOpion() {}\n\n#ifdef DEBUG_chardet\n  void  DumpStatus();\n#endif\n#ifdef DEBUG_jgmyers\n  void GetDetectorState(nsUniversalDetector::DetectorState (&states)[nsUniversalDetector::NumDetectors], PRUint32 &offset);\n#endif\n\nprotected:\n  nsProbingState mState;\n  nsCharSetProber* mProbers[MAX_NUM_OF_MBCS_PROBERS];\n  PRBool          mIsActive[MAX_NUM_OF_MBCS_PROBERS];\n  PRUint32 mNumOfProbers;\n  PRInt32  mBestGuess;\n  PRUint32 mActiveNum;\n  PRUint32 mKeepNext;\n};\n\n#endif /* nsMBCSGroupProber_h__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsMBCSSM.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n#include \"nsCodingStateMachine.h\"\n\n/*\nModification from frank tang's original work:\n. 0x00 is allowed as a legal character. Since some web pages contains this char in\n  text stream.\n*/\n\n// BIG5\n\nconstexpr PRUint32 BIG5_cls [ 256 / 8 ] = {\n//PCK4BITS(0,1,1,1,1,1,1,1),  // 00 - 07\nPCK4BITS(1,1,1,1,1,1,1,1),  // 00 - 07    //allow 0x00 as legal value\nPCK4BITS(1,1,1,1,1,1,0,0),  // 08 - 0f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 10 - 17\nPCK4BITS(1,1,1,0,1,1,1,1),  // 18 - 1f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 20 - 27\nPCK4BITS(1,1,1,1,1,1,1,1),  // 28 - 2f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 30 - 37\nPCK4BITS(1,1,1,1,1,1,1,1),  // 38 - 3f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 40 - 47\nPCK4BITS(2,2,2,2,2,2,2,2),  // 48 - 4f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 50 - 57\nPCK4BITS(2,2,2,2,2,2,2,2),  // 58 - 5f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 60 - 67\nPCK4BITS(2,2,2,2,2,2,2,2),  // 68 - 6f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 70 - 77\nPCK4BITS(2,2,2,2,2,2,2,1),  // 78 - 7f\nPCK4BITS(4,4,4,4,4,4,4,4),  // 80 - 87\nPCK4BITS(4,4,4,4,4,4,4,4),  // 88 - 8f\nPCK4BITS(4,4,4,4,4,4,4,4),  // 90 - 97\nPCK4BITS(4,4,4,4,4,4,4,4),  // 98 - 9f\nPCK4BITS(4,3,3,3,3,3,3,3),  // a0 - a7\nPCK4BITS(3,3,3,3,3,3,3,3),  // a8 - af\nPCK4BITS(3,3,3,3,3,3,3,3),  // b0 - b7\nPCK4BITS(3,3,3,3,3,3,3,3),  // b8 - bf\nPCK4BITS(3,3,3,3,3,3,3,3),  // c0 - c7\nPCK4BITS(3,3,3,3,3,3,3,3),  // c8 - cf\nPCK4BITS(3,3,3,3,3,3,3,3),  // d0 - d7\nPCK4BITS(3,3,3,3,3,3,3,3),  // d8 - df\nPCK4BITS(3,3,3,3,3,3,3,3),  // e0 - e7\nPCK4BITS(3,3,3,3,3,3,3,3),  // e8 - ef\nPCK4BITS(3,3,3,3,3,3,3,3),  // f0 - f7\nPCK4BITS(3,3,3,3,3,3,3,0)   // f8 - ff\n};\n\n\nconstexpr PRUint32 BIG5_st [ 3] = {\nPCK4BITS(eError,eStart,eStart,     3,eError,eError,eError,eError),//00-07\nPCK4BITS(eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError),//08-0f\nPCK4BITS(eError,eStart,eStart,eStart,eStart,eStart,eStart,eStart) //10-17\n};\n\nconstexpr PRUint32 Big5CharLenTable[] = { 0, 1, 1, 2, 0 };\n\nSMModel const Big5SMModel = {\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, BIG5_cls },\n    5,\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, BIG5_st },\n  Big5CharLenTable,\n  \"BIG5\",\n};\n\nconstexpr PRUint32 EUCJP_cls [ 256 / 8 ] = {\n//PCK4BITS(5,4,4,4,4,4,4,4),  // 00 - 07\nPCK4BITS(4,4,4,4,4,4,4,4),  // 00 - 07\nPCK4BITS(4,4,4,4,4,4,5,5),  // 08 - 0f\nPCK4BITS(4,4,4,4,4,4,4,4),  // 10 - 17\nPCK4BITS(4,4,4,5,4,4,4,4),  // 18 - 1f\nPCK4BITS(4,4,4,4,4,4,4,4),  // 20 - 27\nPCK4BITS(4,4,4,4,4,4,4,4),  // 28 - 2f\nPCK4BITS(4,4,4,4,4,4,4,4),  // 30 - 37\nPCK4BITS(4,4,4,4,4,4,4,4),  // 38 - 3f\nPCK4BITS(4,4,4,4,4,4,4,4),  // 40 - 47\nPCK4BITS(4,4,4,4,4,4,4,4),  // 48 - 4f\nPCK4BITS(4,4,4,4,4,4,4,4),  // 50 - 57\nPCK4BITS(4,4,4,4,4,4,4,4),  // 58 - 5f\nPCK4BITS(4,4,4,4,4,4,4,4),  // 60 - 67\nPCK4BITS(4,4,4,4,4,4,4,4),  // 68 - 6f\nPCK4BITS(4,4,4,4,4,4,4,4),  // 70 - 77\nPCK4BITS(4,4,4,4,4,4,4,4),  // 78 - 7f\nPCK4BITS(5,5,5,5,5,5,5,5),  // 80 - 87\nPCK4BITS(5,5,5,5,5,5,1,3),  // 88 - 8f\nPCK4BITS(5,5,5,5,5,5,5,5),  // 90 - 97\nPCK4BITS(5,5,5,5,5,5,5,5),  // 98 - 9f\nPCK4BITS(5,2,2,2,2,2,2,2),  // a0 - a7\nPCK4BITS(2,2,2,2,2,2,2,2),  // a8 - af\nPCK4BITS(2,2,2,2,2,2,2,2),  // b0 - b7\nPCK4BITS(2,2,2,2,2,2,2,2),  // b8 - bf\nPCK4BITS(2,2,2,2,2,2,2,2),  // c0 - c7\nPCK4BITS(2,2,2,2,2,2,2,2),  // c8 - cf\nPCK4BITS(2,2,2,2,2,2,2,2),  // d0 - d7\nPCK4BITS(2,2,2,2,2,2,2,2),  // d8 - df\nPCK4BITS(0,0,0,0,0,0,0,0),  // e0 - e7\nPCK4BITS(0,0,0,0,0,0,0,0),  // e8 - ef\nPCK4BITS(0,0,0,0,0,0,0,0),  // f0 - f7\nPCK4BITS(0,0,0,0,0,0,0,5)   // f8 - ff\n};\n\n\nconstexpr PRUint32 EUCJP_st [ 5] = {\nPCK4BITS(     3,     4,     3,     5,eStart,eError,eError,eError),//00-07\nPCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f\nPCK4BITS(eItsMe,eItsMe,eStart,eError,eStart,eError,eError,eError),//10-17\nPCK4BITS(eError,eError,eStart,eError,eError,eError,     3,eError),//18-1f\nPCK4BITS(     3,eError,eError,eError,eStart,eStart,eStart,eStart) //20-27\n};\n\nconstexpr PRUint32 EUCJPCharLenTable[] = { 2, 2, 2, 3, 1, 0 };\n\nconst SMModel EUCJPSMModel = {\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, EUCJP_cls },\n   6,\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, EUCJP_st },\n  EUCJPCharLenTable,\n  \"EUC-JP\",\n};\n\nconstexpr PRUint32 EUCKR_cls [ 256 / 8 ] = {\n//PCK4BITS(0,1,1,1,1,1,1,1),  // 00 - 07\nPCK4BITS(1,1,1,1,1,1,1,1),  // 00 - 07\nPCK4BITS(1,1,1,1,1,1,0,0),  // 08 - 0f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 10 - 17\nPCK4BITS(1,1,1,0,1,1,1,1),  // 18 - 1f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 20 - 27\nPCK4BITS(1,1,1,1,1,1,1,1),  // 28 - 2f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 30 - 37\nPCK4BITS(1,1,1,1,1,1,1,1),  // 38 - 3f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 40 - 47\nPCK4BITS(1,1,1,1,1,1,1,1),  // 48 - 4f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 50 - 57\nPCK4BITS(1,1,1,1,1,1,1,1),  // 58 - 5f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 60 - 67\nPCK4BITS(1,1,1,1,1,1,1,1),  // 68 - 6f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 70 - 77\nPCK4BITS(1,1,1,1,1,1,1,1),  // 78 - 7f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 80 - 87\nPCK4BITS(0,0,0,0,0,0,0,0),  // 88 - 8f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 90 - 97\nPCK4BITS(0,0,0,0,0,0,0,0),  // 98 - 9f\nPCK4BITS(0,2,2,2,2,2,2,2),  // a0 - a7\nPCK4BITS(2,2,2,2,2,3,3,3),  // a8 - af\nPCK4BITS(2,2,2,2,2,2,2,2),  // b0 - b7\nPCK4BITS(2,2,2,2,2,2,2,2),  // b8 - bf\nPCK4BITS(2,2,2,2,2,2,2,2),  // c0 - c7\nPCK4BITS(2,3,2,2,2,2,2,2),  // c8 - cf\nPCK4BITS(2,2,2,2,2,2,2,2),  // d0 - d7\nPCK4BITS(2,2,2,2,2,2,2,2),  // d8 - df\nPCK4BITS(2,2,2,2,2,2,2,2),  // e0 - e7\nPCK4BITS(2,2,2,2,2,2,2,2),  // e8 - ef\nPCK4BITS(2,2,2,2,2,2,2,2),  // f0 - f7\nPCK4BITS(2,2,2,2,2,2,2,0)   // f8 - ff\n};\n\n\nconstexpr PRUint32 EUCKR_st [ 2] = {\nPCK4BITS(eError,eStart,     3,eError,eError,eError,eError,eError),//00-07\nPCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,eStart,eStart) //08-0f\n};\n\nconstexpr PRUint32 EUCKRCharLenTable[] = { 0, 1, 2, 0 };\n\nconst SMModel EUCKRSMModel = {\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, EUCKR_cls },\n  4,\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, EUCKR_st },\n  EUCKRCharLenTable,\n  \"EUC-KR\",\n};\n\nconstexpr PRUint32 EUCTW_cls [ 256 / 8 ] = {\n//PCK4BITS(0,2,2,2,2,2,2,2),  // 00 - 07\nPCK4BITS(2,2,2,2,2,2,2,2),  // 00 - 07\nPCK4BITS(2,2,2,2,2,2,0,0),  // 08 - 0f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 10 - 17\nPCK4BITS(2,2,2,0,2,2,2,2),  // 18 - 1f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 20 - 27\nPCK4BITS(2,2,2,2,2,2,2,2),  // 28 - 2f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 30 - 37\nPCK4BITS(2,2,2,2,2,2,2,2),  // 38 - 3f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 40 - 47\nPCK4BITS(2,2,2,2,2,2,2,2),  // 48 - 4f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 50 - 57\nPCK4BITS(2,2,2,2,2,2,2,2),  // 58 - 5f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 60 - 67\nPCK4BITS(2,2,2,2,2,2,2,2),  // 68 - 6f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 70 - 77\nPCK4BITS(2,2,2,2,2,2,2,2),  // 78 - 7f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 80 - 87\nPCK4BITS(0,0,0,0,0,0,6,0),  // 88 - 8f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 90 - 97\nPCK4BITS(0,0,0,0,0,0,0,0),  // 98 - 9f\nPCK4BITS(0,3,4,4,4,4,4,4),  // a0 - a7\nPCK4BITS(5,5,1,1,1,1,1,1),  // a8 - af\nPCK4BITS(1,1,1,1,1,1,1,1),  // b0 - b7\nPCK4BITS(1,1,1,1,1,1,1,1),  // b8 - bf\nPCK4BITS(1,1,3,1,3,3,3,3),  // c0 - c7\nPCK4BITS(3,3,3,3,3,3,3,3),  // c8 - cf\nPCK4BITS(3,3,3,3,3,3,3,3),  // d0 - d7\nPCK4BITS(3,3,3,3,3,3,3,3),  // d8 - df\nPCK4BITS(3,3,3,3,3,3,3,3),  // e0 - e7\nPCK4BITS(3,3,3,3,3,3,3,3),  // e8 - ef\nPCK4BITS(3,3,3,3,3,3,3,3),  // f0 - f7\nPCK4BITS(3,3,3,3,3,3,3,0)   // f8 - ff\n};\n\n\nconstexpr PRUint32 EUCTW_st [ 6] = {\nPCK4BITS(eError,eError,eStart,     3,     3,     3,     4,eError),//00-07\nPCK4BITS(eError,eError,eError,eError,eError,eError,eItsMe,eItsMe),//08-0f\nPCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eStart,eError),//10-17\nPCK4BITS(eStart,eStart,eStart,eError,eError,eError,eError,eError),//18-1f\nPCK4BITS(     5,eError,eError,eError,eStart,eError,eStart,eStart),//20-27\nPCK4BITS(eStart,eError,eStart,eStart,eStart,eStart,eStart,eStart) //28-2f\n};\n\nconstexpr PRUint32 EUCTWCharLenTable[] = {0, 0, 1, 2, 2, 2, 3};\n\nconst SMModel EUCTWSMModel = {\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, EUCTW_cls },\n   7,\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, EUCTW_st },\n  EUCTWCharLenTable,\n  \"EUC-TW\",\n};\n\n\n//  GB-2312\n#if 0 // obsolete GB2312 by gb18030\nstatic PRUint32 GB2312_cls [ 256 / 8 ] = {\n//PCK4BITS(0,1,1,1,1,1,1,1),  // 00 - 07\nPCK4BITS(1,1,1,1,1,1,1,1),  // 00 - 07\nPCK4BITS(1,1,1,1,1,1,0,0),  // 08 - 0f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 10 - 17\nPCK4BITS(1,1,1,0,1,1,1,1),  // 18 - 1f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 20 - 27\nPCK4BITS(1,1,1,1,1,1,1,1),  // 28 - 2f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 30 - 37\nPCK4BITS(1,1,1,1,1,1,1,1),  // 38 - 3f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 40 - 47\nPCK4BITS(1,1,1,1,1,1,1,1),  // 48 - 4f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 50 - 57\nPCK4BITS(1,1,1,1,1,1,1,1),  // 58 - 5f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 60 - 67\nPCK4BITS(1,1,1,1,1,1,1,1),  // 68 - 6f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 70 - 77\nPCK4BITS(1,1,1,1,1,1,1,1),  // 78 - 7f\nPCK4BITS(1,0,0,0,0,0,0,0),  // 80 - 87\nPCK4BITS(0,0,0,0,0,0,0,0),  // 88 - 8f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 90 - 97\nPCK4BITS(0,0,0,0,0,0,0,0),  // 98 - 9f\nPCK4BITS(0,2,2,2,2,2,2,2),  // a0 - a7\nPCK4BITS(2,2,3,3,3,3,3,3),  // a8 - af\nPCK4BITS(2,2,2,2,2,2,2,2),  // b0 - b7\nPCK4BITS(2,2,2,2,2,2,2,2),  // b8 - bf\nPCK4BITS(2,2,2,2,2,2,2,2),  // c0 - c7\nPCK4BITS(2,2,2,2,2,2,2,2),  // c8 - cf\nPCK4BITS(2,2,2,2,2,2,2,2),  // d0 - d7\nPCK4BITS(2,2,2,2,2,2,2,2),  // d8 - df\nPCK4BITS(2,2,2,2,2,2,2,2),  // e0 - e7\nPCK4BITS(2,2,2,2,2,2,2,2),  // e8 - ef\nPCK4BITS(2,2,2,2,2,2,2,2),  // f0 - f7\nPCK4BITS(2,2,2,2,2,2,2,0)   // f8 - ff\n};\n\n\nconstexpr PRUint32 GB2312_st [ 2] = {\nPCK4BITS(eError,eStart,     3,eError,eError,eError,eError,eError),//00-07\nPCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,eStart,eStart) //08-0f\n};\n\nconstexpr PRUint32 GB2312CharLenTable[] = {0, 1, 2, 0};\n\nconst SMModel GB2312SMModel = {\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, GB2312_cls },\n   4,\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, GB2312_st },\n  GB2312CharLenTable,\n  \"GB2312\",\n};\n#endif\n\n\n//  GB-18030\n\n// the following state machine data was created by perl script in \n// intl/chardet/tools. It should be the same as in PSM detector.\nconstexpr PRUint32 GB18030_cls [ 256 / 8 ] = {\nPCK4BITS(1,1,1,1,1,1,1,1),  // 00 - 07\nPCK4BITS(1,1,1,1,1,1,0,0),  // 08 - 0f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 10 - 17\nPCK4BITS(1,1,1,0,1,1,1,1),  // 18 - 1f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 20 - 27\nPCK4BITS(1,1,1,1,1,1,1,1),  // 28 - 2f\nPCK4BITS(3,3,3,3,3,3,3,3),  // 30 - 37\nPCK4BITS(3,3,1,1,1,1,1,1),  // 38 - 3f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 40 - 47\nPCK4BITS(2,2,2,2,2,2,2,2),  // 48 - 4f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 50 - 57\nPCK4BITS(2,2,2,2,2,2,2,2),  // 58 - 5f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 60 - 67\nPCK4BITS(2,2,2,2,2,2,2,2),  // 68 - 6f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 70 - 77\nPCK4BITS(2,2,2,2,2,2,2,4),  // 78 - 7f\nPCK4BITS(5,6,6,6,6,6,6,6),  // 80 - 87\nPCK4BITS(6,6,6,6,6,6,6,6),  // 88 - 8f\nPCK4BITS(6,6,6,6,6,6,6,6),  // 90 - 97\nPCK4BITS(6,6,6,6,6,6,6,6),  // 98 - 9f\nPCK4BITS(6,6,6,6,6,6,6,6),  // a0 - a7\nPCK4BITS(6,6,6,6,6,6,6,6),  // a8 - af\nPCK4BITS(6,6,6,6,6,6,6,6),  // b0 - b7\nPCK4BITS(6,6,6,6,6,6,6,6),  // b8 - bf\nPCK4BITS(6,6,6,6,6,6,6,6),  // c0 - c7\nPCK4BITS(6,6,6,6,6,6,6,6),  // c8 - cf\nPCK4BITS(6,6,6,6,6,6,6,6),  // d0 - d7\nPCK4BITS(6,6,6,6,6,6,6,6),  // d8 - df\nPCK4BITS(6,6,6,6,6,6,6,6),  // e0 - e7\nPCK4BITS(6,6,6,6,6,6,6,6),  // e8 - ef\nPCK4BITS(6,6,6,6,6,6,6,6),  // f0 - f7\nPCK4BITS(6,6,6,6,6,6,6,0)   // f8 - ff\n};\n\n\nconstexpr PRUint32 GB18030_st [6] = {\nPCK4BITS(eError,eStart,eStart,eStart,eStart,eStart,     3,eError),//00-07\nPCK4BITS(eError,eError,eError,eError,eError,eError,eItsMe,eItsMe),//08-0f\nPCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,eStart),//10-17\nPCK4BITS(     4,eError,eStart,eStart,eError,eError,eError,eError),//18-1f\nPCK4BITS(eError,eError,     5,eError,eError,eError,eItsMe,eError),//20-27\nPCK4BITS(eError,eError,eStart,eStart,eStart,eStart,eStart,eStart) //28-2f\n};\n\n// To be accurate, the length of class 6 can be either 2 or 4.\n// But it is not necessary to discriminate between the two since\n// it is used for frequency analysis only, and we are validing\n// each code range there as well. So it is safe to set it to be\n// 2 here.\nconstexpr PRUint32 GB18030CharLenTable[] = {0, 1, 1, 1, 1, 1, 2};\n\nconst SMModel GB18030SMModel = {\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, GB18030_cls },\n   7,\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, GB18030_st },\n  GB18030CharLenTable,\n  \"GB18030\",\n};\n\n// sjis\n\nconstexpr PRUint32 SJIS_cls [ 256 / 8 ] = {\n//PCK4BITS(0,1,1,1,1,1,1,1),  // 00 - 07\nPCK4BITS(1,1,1,1,1,1,1,1),  // 00 - 07\nPCK4BITS(1,1,1,1,1,1,0,0),  // 08 - 0f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 10 - 17\nPCK4BITS(1,1,1,0,1,1,1,1),  // 18 - 1f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 20 - 27\nPCK4BITS(1,1,1,1,1,1,1,1),  // 28 - 2f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 30 - 37\nPCK4BITS(1,1,1,1,1,1,1,1),  // 38 - 3f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 40 - 47\nPCK4BITS(2,2,2,2,2,2,2,2),  // 48 - 4f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 50 - 57\nPCK4BITS(2,2,2,2,2,2,2,2),  // 58 - 5f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 60 - 67\nPCK4BITS(2,2,2,2,2,2,2,2),  // 68 - 6f\nPCK4BITS(2,2,2,2,2,2,2,2),  // 70 - 77\nPCK4BITS(2,2,2,2,2,2,2,1),  // 78 - 7f\nPCK4BITS(3,3,3,3,3,3,3,3),  // 80 - 87\nPCK4BITS(3,3,3,3,3,3,3,3),  // 88 - 8f\nPCK4BITS(3,3,3,3,3,3,3,3),  // 90 - 97\nPCK4BITS(3,3,3,3,3,3,3,3),  // 98 - 9f\n//0xa0 is illegal in sjis encoding, but some pages does\n//contain such byte. We need to be more error forgiven.\nPCK4BITS(2,2,2,2,2,2,2,2),  // a0 - a7\nPCK4BITS(2,2,2,2,2,2,2,2),  // a8 - af\nPCK4BITS(2,2,2,2,2,2,2,2),  // b0 - b7\nPCK4BITS(2,2,2,2,2,2,2,2),  // b8 - bf\nPCK4BITS(2,2,2,2,2,2,2,2),  // c0 - c7\nPCK4BITS(2,2,2,2,2,2,2,2),  // c8 - cf\nPCK4BITS(2,2,2,2,2,2,2,2),  // d0 - d7\nPCK4BITS(2,2,2,2,2,2,2,2),  // d8 - df\nPCK4BITS(3,3,3,3,3,3,3,3),  // e0 - e7\nPCK4BITS(3,3,3,3,3,4,4,4),  // e8 - ef\nPCK4BITS(4,4,4,4,4,4,4,4),  // f0 - f7\nPCK4BITS(4,4,4,4,4,0,0,0)   // f8 - ff\n};\n\n\nconstexpr PRUint32 SJIS_st [ 3] = {\nPCK4BITS(eError,eStart,eStart,     3,eError,eError,eError,eError),//00-07\nPCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f\nPCK4BITS(eItsMe,eItsMe,eError,eError,eStart,eStart,eStart,eStart) //10-17\n};\n\nconstexpr PRUint32 SJISCharLenTable[] = {0, 1, 1, 2, 0, 0};\n\nconst SMModel SJISSMModel = {\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, SJIS_cls },\n   6,\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, SJIS_st },\n  SJISCharLenTable,\n  \"SHIFT_JIS\",\n};\n\nstatic PRUint32 UCS2BE_cls [ 256 / 8 ] = {\nPCK4BITS(0,0,0,0,0,0,0,0),  // 00 - 07\nPCK4BITS(0,0,1,0,0,2,0,0),  // 08 - 0f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 10 - 17\nPCK4BITS(0,0,0,3,0,0,0,0),  // 18 - 1f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 20 - 27\nPCK4BITS(0,3,3,3,3,3,0,0),  // 28 - 2f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 30 - 37\nPCK4BITS(0,0,0,0,0,0,0,0),  // 38 - 3f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 40 - 47\nPCK4BITS(0,0,0,0,0,0,0,0),  // 48 - 4f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 50 - 57\nPCK4BITS(0,0,0,0,0,0,0,0),  // 58 - 5f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 60 - 67\nPCK4BITS(0,0,0,0,0,0,0,0),  // 68 - 6f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 70 - 77\nPCK4BITS(0,0,0,0,0,0,0,0),  // 78 - 7f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 80 - 87\nPCK4BITS(0,0,0,0,0,0,0,0),  // 88 - 8f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 90 - 97\nPCK4BITS(0,0,0,0,0,0,0,0),  // 98 - 9f\nPCK4BITS(0,0,0,0,0,0,0,0),  // a0 - a7\nPCK4BITS(0,0,0,0,0,0,0,0),  // a8 - af\nPCK4BITS(0,0,0,0,0,0,0,0),  // b0 - b7\nPCK4BITS(0,0,0,0,0,0,0,0),  // b8 - bf\nPCK4BITS(0,0,0,0,0,0,0,0),  // c0 - c7\nPCK4BITS(0,0,0,0,0,0,0,0),  // c8 - cf\nPCK4BITS(0,0,0,0,0,0,0,0),  // d0 - d7\nPCK4BITS(0,0,0,0,0,0,0,0),  // d8 - df\nPCK4BITS(0,0,0,0,0,0,0,0),  // e0 - e7\nPCK4BITS(0,0,0,0,0,0,0,0),  // e8 - ef\nPCK4BITS(0,0,0,0,0,0,0,0),  // f0 - f7\nPCK4BITS(0,0,0,0,0,0,4,5)   // f8 - ff\n};\n\nstatic PRUint32 UCS2BE_st [ 7] = {\nPCK4BITS(     5,     7,     7,eError,     4,     3,eError,eError),//00-07\nPCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f\nPCK4BITS(eItsMe,eItsMe,     6,     6,     6,     6,eError,eError),//10-17\nPCK4BITS(     6,     6,     6,     6,     6,eItsMe,     6,     6),//18-1f\nPCK4BITS(     6,     6,     6,     6,     5,     7,     7,eError),//20-27\nPCK4BITS(     5,     8,     6,     6,eError,     6,     6,     6),//28-2f\nPCK4BITS(     6,     6,     6,     6,eError,eError,eStart,eStart) //30-37\n};\n\nconstexpr PRUint32 UCS2BECharLenTable[] = {2, 2, 2, 0, 2, 2};\n\nSMModel const UCS2BESMModel = {\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, UCS2BE_cls },\n   6,\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, UCS2BE_st },\n  UCS2BECharLenTable,\n  \"UTF-16BE\",\n};\n\nstatic PRUint32 UCS2LE_cls [ 256 / 8 ] = {\nPCK4BITS(0,0,0,0,0,0,0,0),  // 00 - 07\nPCK4BITS(0,0,1,0,0,2,0,0),  // 08 - 0f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 10 - 17\nPCK4BITS(0,0,0,3,0,0,0,0),  // 18 - 1f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 20 - 27\nPCK4BITS(0,3,3,3,3,3,0,0),  // 28 - 2f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 30 - 37\nPCK4BITS(0,0,0,0,0,0,0,0),  // 38 - 3f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 40 - 47\nPCK4BITS(0,0,0,0,0,0,0,0),  // 48 - 4f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 50 - 57\nPCK4BITS(0,0,0,0,0,0,0,0),  // 58 - 5f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 60 - 67\nPCK4BITS(0,0,0,0,0,0,0,0),  // 68 - 6f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 70 - 77\nPCK4BITS(0,0,0,0,0,0,0,0),  // 78 - 7f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 80 - 87\nPCK4BITS(0,0,0,0,0,0,0,0),  // 88 - 8f\nPCK4BITS(0,0,0,0,0,0,0,0),  // 90 - 97\nPCK4BITS(0,0,0,0,0,0,0,0),  // 98 - 9f\nPCK4BITS(0,0,0,0,0,0,0,0),  // a0 - a7\nPCK4BITS(0,0,0,0,0,0,0,0),  // a8 - af\nPCK4BITS(0,0,0,0,0,0,0,0),  // b0 - b7\nPCK4BITS(0,0,0,0,0,0,0,0),  // b8 - bf\nPCK4BITS(0,0,0,0,0,0,0,0),  // c0 - c7\nPCK4BITS(0,0,0,0,0,0,0,0),  // c8 - cf\nPCK4BITS(0,0,0,0,0,0,0,0),  // d0 - d7\nPCK4BITS(0,0,0,0,0,0,0,0),  // d8 - df\nPCK4BITS(0,0,0,0,0,0,0,0),  // e0 - e7\nPCK4BITS(0,0,0,0,0,0,0,0),  // e8 - ef\nPCK4BITS(0,0,0,0,0,0,0,0),  // f0 - f7\nPCK4BITS(0,0,0,0,0,0,4,5)   // f8 - ff\n};\n\nconstexpr PRUint32 UCS2LE_st [ 7] = {\nPCK4BITS(     6,     6,     7,     6,     4,     3,eError,eError),//00-07\nPCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f\nPCK4BITS(eItsMe,eItsMe,     5,     5,     5,eError,eItsMe,eError),//10-17\nPCK4BITS(     5,     5,     5,eError,     5,eError,     6,     6),//18-1f\nPCK4BITS(     7,     6,     8,     8,     5,     5,     5,eError),//20-27\nPCK4BITS(     5,     5,     5,eError,eError,eError,     5,     5),//28-2f\nPCK4BITS(     5,     5,     5,eError,     5,eError,eStart,eStart) //30-37\n};\n\nconstexpr PRUint32 UCS2LECharLenTable[] = {2, 2, 2, 2, 2, 2};\n\nSMModel UCS2LESMModel = {\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, UCS2LE_cls },\n   6,\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, UCS2LE_st },\n  UCS2LECharLenTable,\n  \"UTF-16LE\",\n};\n\n\nconstexpr PRUint32 UTF8_cls [ 256 / 8 ] = {\n//PCK4BITS(0,1,1,1,1,1,1,1),  // 00 - 07\nPCK4BITS(1,1,1,1,1,1,1,1),  // 00 - 07  //allow 0x00 as a legal value\nPCK4BITS(1,1,1,1,1,1,0,0),  // 08 - 0f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 10 - 17\nPCK4BITS(1,1,1,0,1,1,1,1),  // 18 - 1f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 20 - 27\nPCK4BITS(1,1,1,1,1,1,1,1),  // 28 - 2f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 30 - 37\nPCK4BITS(1,1,1,1,1,1,1,1),  // 38 - 3f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 40 - 47\nPCK4BITS(1,1,1,1,1,1,1,1),  // 48 - 4f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 50 - 57\nPCK4BITS(1,1,1,1,1,1,1,1),  // 58 - 5f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 60 - 67\nPCK4BITS(1,1,1,1,1,1,1,1),  // 68 - 6f\nPCK4BITS(1,1,1,1,1,1,1,1),  // 70 - 77\nPCK4BITS(1,1,1,1,1,1,1,1),  // 78 - 7f\nPCK4BITS(2,2,2,2,3,3,3,3),  // 80 - 87\nPCK4BITS(4,4,4,4,4,4,4,4),  // 88 - 8f\nPCK4BITS(4,4,4,4,4,4,4,4),  // 90 - 97\nPCK4BITS(4,4,4,4,4,4,4,4),  // 98 - 9f\nPCK4BITS(5,5,5,5,5,5,5,5),  // a0 - a7\nPCK4BITS(5,5,5,5,5,5,5,5),  // a8 - af\nPCK4BITS(5,5,5,5,5,5,5,5),  // b0 - b7\nPCK4BITS(5,5,5,5,5,5,5,5),  // b8 - bf\nPCK4BITS(0,0,6,6,6,6,6,6),  // c0 - c7\nPCK4BITS(6,6,6,6,6,6,6,6),  // c8 - cf\nPCK4BITS(6,6,6,6,6,6,6,6),  // d0 - d7\nPCK4BITS(6,6,6,6,6,6,6,6),  // d8 - df\nPCK4BITS(7,8,8,8,8,8,8,8),  // e0 - e7\nPCK4BITS(8,8,8,8,8,9,8,8),  // e8 - ef\nPCK4BITS(10,11,11,11,11,11,11,11),  // f0 - f7\nPCK4BITS(12,13,13,13,14,15,0,0)   // f8 - ff\n};\n\n\nconstexpr PRUint32 UTF8_st [ 26] = {\nPCK4BITS(eError,eStart,eError,eError,eError,eError,     12,     10),//00-07\nPCK4BITS(     9,     11,     8,     7,     6,     5,     4,     3),//08-0f\nPCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//10-17\nPCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//18-1f\nPCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe),//20-27\nPCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe),//28-2f\nPCK4BITS(eError,eError,     5,     5,     5,     5,eError,eError),//30-37\nPCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//38-3f\nPCK4BITS(eError,eError,eError,     5,     5,     5,eError,eError),//40-47\nPCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//48-4f\nPCK4BITS(eError,eError,     7,     7,     7,     7,eError,eError),//50-57\nPCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//58-5f\nPCK4BITS(eError,eError,eError,eError,     7,     7,eError,eError),//60-67\nPCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//68-6f\nPCK4BITS(eError,eError,     9,     9,     9,     9,eError,eError),//70-77\nPCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//78-7f\nPCK4BITS(eError,eError,eError,eError,eError,     9,eError,eError),//80-87\nPCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//88-8f\nPCK4BITS(eError,eError,     12,     12,     12,     12,eError,eError),//90-97\nPCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//98-9f\nPCK4BITS(eError,eError,eError,eError,eError,     12,eError,eError),//a0-a7\nPCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//a8-af\nPCK4BITS(eError,eError,     12,     12,     12,eError,eError,eError),//b0-b7\nPCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//b8-bf\nPCK4BITS(eError,eError,eStart,eStart,eStart,eStart,eError,eError),//c0-c7\nPCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError) //c8-cf\n};\n\nconstexpr PRUint32 UTF8CharLenTable[] = {0, 1, 0, 0, 0, 0, 2, 3,\n                            3, 3, 4, 4, 5, 5, 6, 6 };\n\nconst SMModel UTF8SMModel = {\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, UTF8_cls },\n   16,\n  {eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, UTF8_st },\n  UTF8CharLenTable,\n  \"UTF-8\",\n};\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsPkgInt.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef nsPkgInt_h__\n#define nsPkgInt_h__\n#include \"nscore.h\"\n\ntypedef enum {\n  eIdxSft4bits  = 3,\n  eIdxSft8bits  = 2,\n  eIdxSft16bits = 1\n} nsIdxSft;\n\ntypedef enum {\n  eSftMsk4bits  = 7,\n  eSftMsk8bits  = 3,\n  eSftMsk16bits = 1\n} nsSftMsk;\n\ntypedef enum {\n  eBitSft4bits  = 2,\n  eBitSft8bits  = 3,\n  eBitSft16bits = 4\n} nsBitSft;\n\ntypedef enum {\n  eUnitMsk4bits  = 0x0000000FL,\n  eUnitMsk8bits  = 0x000000FFL,\n  eUnitMsk16bits = 0x0000FFFFL\n} nsUnitMsk;\n\ntypedef struct nsPkgInt {\n  nsIdxSft  idxsft;\n  nsSftMsk  sftmsk;\n  nsBitSft  bitsft;\n  nsUnitMsk unitmsk;\n  const PRUint32* const data;\n} nsPkgInt;\n\n\n#define PCK16BITS(a,b)            ((PRUint32)(((b) << 16) | (a)))\n\n#define PCK8BITS(a,b,c,d)         PCK16BITS( ((PRUint32)(((b) << 8) | (a))),  \\\n                                             ((PRUint32)(((d) << 8) | (c))))\n\n#define PCK4BITS(a,b,c,d,e,f,g,h) PCK8BITS(  ((PRUint32)(((b) << 4) | (a))), \\\n                                             ((PRUint32)(((d) << 4) | (c))), \\\n                                             ((PRUint32)(((f) << 4) | (e))), \\\n                                             ((PRUint32)(((h) << 4) | (g))) )\n\n#define GETFROMPCK(i, c) \\\n (((((c).data)[(i)>>(c).idxsft])>>(((i)&(c).sftmsk)<<(c).bitsft))&(c).unitmsk)\n\n#endif /* nsPkgInt_h__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsSBCSGroupProber.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          Shy Shalom <shooshX@gmail.com>\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include <stdio.h>\n#include \"prmem.h\"\n\n#include \"nsSBCharSetProber.h\"\n#include \"nsSBCSGroupProber.h\"\n\n#include \"nsHebrewProber.h\"\n\n\nnsSBCSGroupProber::nsSBCSGroupProber()\n  : mNumOfProbers(MAX_NUM_OF_SBCS_PROBERS), mBestGuess(-1), mActiveNum(0)\n{\n  PRUint32 i = 0;\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1252GermanModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_1GermanModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1252FrenchModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_1FrenchModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_15FrenchModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1252SpanishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_1SpanishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_15SpanishModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1252PortugueseModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_1PortugueseModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_9PortugueseModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_15PortugueseModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1250HungarianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_2HungarianModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_3EsperantoModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1252AfricaansModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_1AfricaansModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_9AfricaansModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_15AfricaansModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1252NederlandsModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_1NederlandsModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_9NederlandsModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_15NederlandsModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1252DanishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_15DanishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_1DanishModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_13LithuanianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_10LithuanianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_4LithuanianModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_13LatvianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_10LatvianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_4LatvianModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_3MalteseModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1250CzechModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_2CzechModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Mac_CentraleuropeCzechModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Ibm852CzechModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1250SlovakModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_2SlovakModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Mac_CentraleuropeSlovakModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Ibm852SlovakModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1250PolishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_2PolishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_13PolishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_16PolishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Mac_CentraleuropePolishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Ibm852PolishModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1252FinnishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_1FinnishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_4FinnishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_9FinnishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_13FinnishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_15FinnishModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1252ItalianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_1ItalianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_3ItalianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_9ItalianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_15ItalianModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1250CroatianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_2CroatianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_13CroatianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_16CroatianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Mac_CentraleuropeCroatianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Ibm852CroatianModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1252EstonianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1257EstonianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_4EstonianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_13EstonianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_15EstonianModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1252IrishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_1IrishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_9IrishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_15IrishModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1250RomanianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_2RomanianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_16RomanianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Ibm852RomanianModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1250SloveneModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_2SloveneModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_16SloveneModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Mac_CentraleuropeSloveneModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Ibm852SloveneModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1252SwedishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_1SwedishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_4SwedishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_9SwedishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_15SwedishModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1251BelarusianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Win1251RussianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Koi8rRussianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Latin5RussianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&MacCyrillicRussianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Ibm866RussianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Ibm855RussianModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_7GreekModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1253GreekModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Latin5BulgarianModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Win1251BulgarianModel);\n\n  nsHebrewProber* hebprober = new nsHebrewProber();\n  // Notice: Any change in these indexes - 10,11,12 must be reflected\n  // in the code below as well.\n  PRUint32 const heb = i;\n  mProbers[i++] = hebprober;\n  mProbers[i++] = new nsSingleByteCharSetProber(&Win1255Model, PR_FALSE, hebprober); // Logical Hebrew\n  mProbers[i++] = new nsSingleByteCharSetProber(&Win1255Model, PR_TRUE, hebprober);  // Visual Hebrew\n  // Tell the Hebrew prober about the logical and visual probers\n  if (mProbers[heb] && mProbers[heb + 1] && mProbers[heb + 2]) // all are not null\n  {\n    hebprober->SetModelProbers(mProbers[heb + 1], mProbers[heb + 2]);\n  }\n  else // One or more is null. avoid any Hebrew probing, null them all\n  {\n    for (PRUint32 j = heb + 2; j >= heb; --j)\n    {\n      delete mProbers[j];\n      mProbers[j] = nsnull;\n    }\n  }\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_3TurkishModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_9TurkishModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1256ArabicModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_6ArabicModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Windows_1258VietnameseModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&VisciiVietnameseModel);\n\n  mProbers[i++] = new nsSingleByteCharSetProber(&Tis_620ThaiModel);\n  mProbers[i++] = new nsSingleByteCharSetProber(&Iso_8859_11ThaiModel);\n\n  mNumOfProbers = i;\n\n  for (; i < MAX_NUM_OF_SBCS_PROBERS; ++i) { mProbers[i] = nsnull; }\n\n  Reset();\n}\n\nnsSBCSGroupProber::~nsSBCSGroupProber()\n{\n  for (PRUint32 i = 0; i < MAX_NUM_OF_SBCS_PROBERS; i++)\n  {\n    if (mProbers[i]) { delete mProbers[i]; }\n  }\n}\n\n\nconst char* nsSBCSGroupProber::GetCharSetName()\n{\n  //if we have no answer yet\n  if (mBestGuess == -1)\n  {\n    GetConfidence();\n    //no charset seems positive\n    if (mBestGuess == -1)\n      //we will use default.\n      mBestGuess = 0;\n  }\n  return mProbers[mBestGuess]->GetCharSetName();\n}\n\nvoid  nsSBCSGroupProber::Reset(void)\n{\n  mActiveNum = 0;\n  for (PRUint32 i = 0; i < MAX_NUM_OF_SBCS_PROBERS; ++i)\n  {\n    if (mProbers[i]) // not null\n    {\n      mProbers[i]->Reset();\n      mIsActive[i] = PR_TRUE;\n      ++mActiveNum;\n    }\n    else {\n      mIsActive[i] = PR_FALSE;\n    }\n  }\n  mBestGuess = -1;\n  mState = eDetecting;\n}\n\n\nnsProbingState nsSBCSGroupProber::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  nsProbingState st;\n  PRUint32 i;\n  char *newBuf1 = 0;\n  PRUint32 newLen1 = 0;\n\n  //apply filter to original buffer, and we got new buffer back\n  //depend on what script it is, we will feed them the new buffer\n  //we got after applying proper filter\n  //this is done without any consideration to KeepEnglishLetters\n  //of each prober since as of now, there are no probers here which\n  //recognize languages with English characters.\n  if (!FilterWithoutEnglishLetters(aBuf, aLen, &newBuf1, newLen1))\n    goto done;\n\n  if (newLen1 == 0)\n    goto done; // Nothing to see here, move on.\n\n  for (i = 0; i < mNumOfProbers; i++)\n  {\n     if (!mIsActive[i])\n       continue;\n     st = mProbers[i]->HandleData(newBuf1, newLen1);\n     if (st == eFoundIt)\n     {\n       mBestGuess = i;\n       mState = eFoundIt;\n       break;\n     }\n     else if (st == eNotMe)\n     {\n       mIsActive[i] = PR_FALSE;\n       mActiveNum--;\n       if (mActiveNum <= 0)\n       {\n         mState = eNotMe;\n         break;\n       }\n     }\n  }\n\ndone:\n  PR_FREEIF(newBuf1);\n\n  return mState;\n}\n\nfloat nsSBCSGroupProber::GetConfidence(void)\n{\n  float bestConf = 0.0f;\n\n  switch (mState)\n  {\n  case eFoundIt:\n    return SURE_YES;\n  case eNotMe:\n    return SURE_NO;\n  default:\n    for (PRUint32 i = 0; i < mNumOfProbers; i++)\n    {\n      if (!mIsActive[i])\n        continue;\n      float const cf = mProbers[i]->GetConfidence();\n      if (bestConf < cf)\n      {\n        bestConf = cf;\n        mBestGuess = i;\n      }\n    }\n  }\n  return bestConf;\n}\n\n#ifdef DEBUG_chardet\nvoid nsSBCSGroupProber::DumpStatus()\n{\n  PRUint32 i;\n  float cf;\n\n  cf = GetConfidence();\n  printf(\" SBCS Group Prober --------begin status \\r\\n\");\n  for (i = 0; i < mNumOfProbers; i++)\n  {\n    if (!mIsActive[i])\n      printf(\"  inactive: [%s] (i.e. confidence is too low).\\r\\n\", mProbers[i]->GetCharSetName());\n    else\n      mProbers[i]->DumpStatus();\n  }\n  printf(\" SBCS Group found best match [%s] confidence %f.\\r\\n\",\n         mProbers[mBestGuess]->GetCharSetName(), cf);\n}\n#endif\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsSBCSGroupProber.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n * vim: et sw=2 ts=2 fdm=marker\n */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          Shy Shalom <shooshX@gmail.com>\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef nsSBCSGroupProber_h__\n#define nsSBCSGroupProber_h__\n\n\n#define MAX_NUM_OF_SBCS_PROBERS 160\n\nclass nsCharSetProber;\n\nclass nsSBCSGroupProber : public nsCharSetProber {\npublic:\n  nsSBCSGroupProber();\n  virtual ~nsSBCSGroupProber();\n  nsProbingState HandleData(const char* aBuf, PRUint32 aLen) override;\n  const char* GetCharSetName() override;\n  nsProbingState GetState(void) override { return mState; }\n  void      Reset(void) override;\n  float     GetConfidence(void) override;\n  void      SetOpion() override {}\n\n#ifdef DEBUG_chardet\n  void  DumpStatus();\n#endif\n\nprotected:\n  nsProbingState mState;\n  nsCharSetProber* mProbers[MAX_NUM_OF_SBCS_PROBERS];\n  PRBool          mIsActive[MAX_NUM_OF_SBCS_PROBERS];\n  PRUint32 mNumOfProbers;\n  PRInt32 mBestGuess;\n  PRUint32 mActiveNum;\n};\n\n#endif /* nsSBCSGroupProber_h__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsSBCharSetProber.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          Shy Shalom <shooshX@gmail.com>\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n#include <stdio.h>\n#include \"nsSBCharSetProber.h\"\n\nnsProbingState nsSingleByteCharSetProber::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  for (PRUint32 i = 0; i < aLen; i++)\n  {\n    unsigned char const order = mModel->charToOrderMap[(unsigned char)aBuf[i]];\n\n    if (order < SYMBOL_CAT_ORDER)\n    {\n      mTotalChar++;\n    }\n    else if (order == ILL)\n    {\n      /* When encountering an illegal codepoint, no need\n       * to continue analyzing data. */\n      mState = eNotMe;\n      break;\n    }\n    else if (order == CTR)\n    {\n      mCtrlChar++;\n    }\n    if (order < mModel->freqCharCount)\n    {\n      ++mFreqChar;\n\n      if (mLastOrder < mModel->freqCharCount)\n      {\n        ++mTotalSeqs;\n        if (!mReversed)\n          ++(mSeqCounters[(int)mModel->precedenceMatrix[mLastOrder*mModel->freqCharCount+order]]);\n        else // reverse the order of the letters in the lookup\n          ++(mSeqCounters[(int)mModel->precedenceMatrix[order*mModel->freqCharCount+mLastOrder]]);\n      }\n    }\n    mLastOrder = order;\n  }\n\n  if (mState == eDetecting)\n    if (mTotalSeqs > SB_ENOUGH_REL_THRESHOLD)\n    {\n      float const cf = GetConfidence();\n      if (cf >= POSITIVE_SHORTCUT_THRESHOLD)\n        mState = eFoundIt;\n      else if (cf <= NEGATIVE_SHORTCUT_THRESHOLD)\n        mState = eNotMe;\n    }\n\n  return mState;\n}\n\nvoid  nsSingleByteCharSetProber::Reset(void)\n{\n  mState = eDetecting;\n  mLastOrder = 255;\n  for (PRUint32 i = 0; i < NUMBER_OF_SEQ_CAT; i++)\n    mSeqCounters[i] = 0;\n  mTotalSeqs = 0;\n  mTotalChar = 0;\n  mCtrlChar  = 0;\n  mFreqChar = 0;\n}\n\nconstexpr float rfactor(PRUint32 m, PRUint32 d) { \n  return ((d >= 1) ? (static_cast<float>(m) / static_cast<float>(d)) : static_cast<float>(m));\n}\n\nfloat nsSingleByteCharSetProber::GetConfidence()\n{\n  PRUint32 const neutralChar = mSeqCounters[NEUTRAL_CAT] + mCtrlChar;\n  PRUint32 const netChars = (mTotalChar > neutralChar) ? (mTotalChar - neutralChar) : mTotalSeqs;\n\n  if ((mTotalChar > 0) && (mTotalSeqs > 0))\n  {\n    // weighted good sequence count\n    //PRUint32 const probableSeqs = mSeqCounters[POSITIVE_CAT] + (mSeqCounters[PROBABLE_CAT] >> 2);\n    PRUint32 const validSeqs = mTotalSeqs - mSeqCounters[NEGATIVE_CAT];\n\n    float r = rfactor(mSeqCounters[POSITIVE_CAT], mTotalSeqs) / mModel->mTypicalPositiveRatio;\n\n    // negative sequence correction factor\n    r *= rfactor(validSeqs, (mTotalSeqs + (netChars * mSeqCounters[NEGATIVE_CAT])));\n\n    /* Multiply by a ratio of positive sequences per characters.\n     * This would help in particular to distinguish close winners.\n     * Indeed if you add a letter, you'd expect the positive sequence count\n     * to increase as well. If it doesn't, it may mean that this new codepoint\n     * may not have been a letter, but instead a symbol (or some other\n     * character). This could make the difference between very closely related\n     * charsets used for the same language.\n     */\n     r *= rfactor(validSeqs, netChars);\n\n     /* The more control characters (proportionally to the size of the text), the\n     * less confident we become in the current charset.\n     */\n    r *= rfactor(netChars, mTotalChar);\n    \n    // normalizing\n    r *= rfactor(mFreqChar, mTotalChar);\n\n    if (r > NO_DOUBT) { r = NO_DOUBT; }\n\n    return r;\n  }\n  return SURE_NO;\n}\n\nconst char* nsSingleByteCharSetProber::GetCharSetName()\n{\n  if (!mNameProber)\n    return mModel->charsetName;\n  return mNameProber->GetCharSetName();\n}\n\n#ifdef DEBUG_chardet\nvoid nsSingleByteCharSetProber::DumpStatus()\n{\n  printf(\"  SBCS: %1.3f [%s]\\r\\n\", GetConfidence(), GetCharSetName());\n}\n#endif\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsSBCharSetProber.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          Shy Shalom <shooshX@gmail.com>\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n#ifndef nsSingleByteCharSetProber_h__\n#define nsSingleByteCharSetProber_h__\n\n#include \"nsCharSetProber.h\"\n\n/** Codepoints **/\n\n/* Illegal codepoints.*/\n#define ILL 255\n/* Control character. */\n#define CTR 254\n/* Symbols and punctuation that does not belong to words. */\n#define SYM 253\n/* Return/Line feeds. */\n#define RET 252\n/* Numbers 0-9. */\n#define NUM 251\n\n#define SB_ENOUGH_REL_THRESHOLD  (ENOUGH_DATA_THRESHOLD >> 1)\n#define POSITIVE_SHORTCUT_THRESHOLD  SHORTCUT_THRESHOLD\n#define NEGATIVE_SHORTCUT_THRESHOLD  (0.05f)\n#define SYMBOL_CAT_ORDER  250\n#define NUMBER_OF_SEQ_CAT 4\n#define POSITIVE_CAT   (NUMBER_OF_SEQ_CAT-1)\n#define PROBABLE_CAT   (NUMBER_OF_SEQ_CAT-2)\n#define NEUTRAL_CAT    (NUMBER_OF_SEQ_CAT-3)\n#define NEGATIVE_CAT   0\n\ntypedef struct\n{\n  /* [256] table mapping codepoints to chararacter orders. */\n  const unsigned char* const charToOrderMap;\n  /* freqCharCount x freqCharCount table of 2-char sequence's frequencies. */\n  const PRUint8* const precedenceMatrix;\n  /* The count of frequent characters. */\n  int freqCharCount;\n  float  mTypicalPositiveRatio;     // = freqSeqs / totalSeqs\n  PRBool keepEnglishLetter;         // says if this script contains English characters (not implemented)\n  const char* const charsetName;\n} SequenceModel;\n\n\nclass nsSingleByteCharSetProber : public nsCharSetProber{\npublic:\n  nsSingleByteCharSetProber(const SequenceModel *model) \n    :mModel(model), mReversed(PR_FALSE), mNameProber(0) { Reset(); }\n\n  nsSingleByteCharSetProber(const SequenceModel *model, PRBool reversed, nsCharSetProber* nameProber)\n    :mModel(model), mReversed(reversed), mNameProber(nameProber) { Reset(); }\n\n  virtual const char* GetCharSetName();\n  virtual nsProbingState HandleData(const char* aBuf, PRUint32 aLen);\n  virtual nsProbingState GetState(void) {return mState;}\n  virtual void      Reset(void);\n  virtual float     GetConfidence(void);\n  virtual void      SetOpion() {}\n\n  // This feature is not implemented yet. any current language model\n  // contain this parameter as PR_FALSE. No one is looking at this\n  // parameter or calling this method.\n  // Moreover, the nsSBCSGroupProber which calls the HandleData of this\n  // prober has a hard-coded call to FilterWithoutEnglishLetters which gets rid\n  // of the English letters.\n  PRBool KeepEnglishLetters() {return mModel->keepEnglishLetter;} // (not implemented)\n\n#ifdef DEBUG_chardet\n  virtual void  DumpStatus();\n#endif\n\nprotected:\n  nsProbingState mState;\n  const SequenceModel* const mModel;\n  const PRBool mReversed; // PR_TRUE if we need to reverse every pair in the model lookup\n\n  //char order of last character\n  unsigned char mLastOrder;\n\n  PRUint32 mTotalSeqs;\n  PRUint32 mSeqCounters[NUMBER_OF_SEQ_CAT];\n\n  PRUint32 mTotalChar;\n  PRUint32 mCtrlChar;\n  //characters that fall in our sampling range\n  PRUint32 mFreqChar;\n\n  // Optional auxiliary prober for name decision. created and destroyed by the GroupProber\n  nsCharSetProber* mNameProber;\n\n};\n\nextern const SequenceModel Windows_1256ArabicModel;\nextern const SequenceModel Iso_8859_6ArabicModel;\n\nextern const SequenceModel Koi8rRussianModel;\nextern const SequenceModel Win1251RussianModel;\nextern const SequenceModel Latin5RussianModel;\nextern const SequenceModel MacCyrillicRussianModel;\nextern const SequenceModel Ibm866RussianModel;\nextern const SequenceModel Ibm855RussianModel;\n\nextern const SequenceModel Iso_8859_7GreekModel;\nextern const SequenceModel Windows_1253GreekModel;\n\nextern const SequenceModel Latin5BulgarianModel;\nextern const SequenceModel Win1251BulgarianModel;\n\nextern const SequenceModel Iso_8859_2HungarianModel;\nextern const SequenceModel Windows_1250HungarianModel;\n\nextern const SequenceModel Win1255Model;\n\nextern const SequenceModel Tis_620ThaiModel;\nextern const SequenceModel Iso_8859_11ThaiModel;\n\nextern const SequenceModel Iso_8859_15FrenchModel;\nextern const SequenceModel Iso_8859_1FrenchModel;\nextern const SequenceModel Windows_1252FrenchModel;\n\nextern const SequenceModel Iso_8859_15SpanishModel;\nextern const SequenceModel Iso_8859_1SpanishModel;\nextern const SequenceModel Windows_1252SpanishModel;\n\nextern const SequenceModel Iso_8859_1GermanModel;\nextern const SequenceModel Windows_1252GermanModel;\n\nextern const SequenceModel Iso_8859_3EsperantoModel;\n\nextern const SequenceModel Iso_8859_3TurkishModel;\nextern const SequenceModel Iso_8859_9TurkishModel;\n\nextern const SequenceModel VisciiVietnameseModel;\nextern const SequenceModel Windows_1258VietnameseModel;\n\nextern const SequenceModel Iso_8859_15DanishModel;\nextern const SequenceModel Iso_8859_1DanishModel;\nextern const SequenceModel Windows_1252DanishModel;\n\nextern const SequenceModel Iso_8859_13LithuanianModel;\nextern const SequenceModel Iso_8859_10LithuanianModel;\nextern const SequenceModel Iso_8859_4LithuanianModel;\n\nextern const SequenceModel Iso_8859_13LatvianModel;\nextern const SequenceModel Iso_8859_10LatvianModel;\nextern const SequenceModel Iso_8859_4LatvianModel;\n\nextern const SequenceModel Iso_8859_1PortugueseModel;\nextern const SequenceModel Iso_8859_9PortugueseModel;\nextern const SequenceModel Iso_8859_15PortugueseModel;\nextern const SequenceModel Windows_1252PortugueseModel;\n\nextern const SequenceModel Iso_8859_3MalteseModel;\n\nextern const SequenceModel Windows_1250CzechModel;\nextern const SequenceModel Iso_8859_2CzechModel;\nextern const SequenceModel Ibm852CzechModel;\nextern const SequenceModel Mac_CentraleuropeCzechModel;\n\nextern const SequenceModel Windows_1250SlovakModel;\nextern const SequenceModel Iso_8859_2SlovakModel;\nextern const SequenceModel Ibm852SlovakModel;\nextern const SequenceModel Mac_CentraleuropeSlovakModel;\n\nextern const SequenceModel Windows_1250PolishModel;\nextern const SequenceModel Iso_8859_2PolishModel;\nextern const SequenceModel Iso_8859_13PolishModel;\nextern const SequenceModel Iso_8859_16PolishModel;\nextern const SequenceModel Ibm852PolishModel;\nextern const SequenceModel Mac_CentraleuropePolishModel;\n\nextern const SequenceModel Iso_8859_1FinnishModel;\nextern const SequenceModel Iso_8859_4FinnishModel;\nextern const SequenceModel Iso_8859_9FinnishModel;\nextern const SequenceModel Iso_8859_13FinnishModel;\nextern const SequenceModel Iso_8859_15FinnishModel;\nextern const SequenceModel Windows_1252FinnishModel;\n\nextern const SequenceModel Iso_8859_1ItalianModel;\nextern const SequenceModel Iso_8859_3ItalianModel;\nextern const SequenceModel Iso_8859_9ItalianModel;\nextern const SequenceModel Iso_8859_15ItalianModel;\nextern const SequenceModel Windows_1252ItalianModel;\n\nextern const SequenceModel Windows_1250CroatianModel;\nextern const SequenceModel Iso_8859_2CroatianModel;\nextern const SequenceModel Iso_8859_13CroatianModel;\nextern const SequenceModel Iso_8859_16CroatianModel;\nextern const SequenceModel Ibm852CroatianModel;\nextern const SequenceModel Mac_CentraleuropeCroatianModel;\n\nextern const SequenceModel Windows_1252EstonianModel;\nextern const SequenceModel Windows_1257EstonianModel;\nextern const SequenceModel Iso_8859_4EstonianModel;\nextern const SequenceModel Iso_8859_13EstonianModel;\nextern const SequenceModel Iso_8859_15EstonianModel;\n\nextern const SequenceModel Iso_8859_15IrishModel;\nextern const SequenceModel Iso_8859_9IrishModel;\nextern const SequenceModel Iso_8859_1IrishModel;\nextern const SequenceModel Windows_1252IrishModel;\n\nextern const SequenceModel Windows_1250RomanianModel;\nextern const SequenceModel Iso_8859_2RomanianModel;\nextern const SequenceModel Iso_8859_16RomanianModel;\nextern const SequenceModel Ibm852RomanianModel;\n\nextern const SequenceModel Windows_1250SloveneModel;\nextern const SequenceModel Iso_8859_2SloveneModel;\nextern const SequenceModel Iso_8859_16SloveneModel;\nextern const SequenceModel Ibm852SloveneModel;\nextern const SequenceModel Mac_CentraleuropeSloveneModel;\n\nextern const SequenceModel Windows_1252SwedishModel;\nextern const SequenceModel Iso_8859_1SwedishModel;\nextern const SequenceModel Iso_8859_4SwedishModel;\nextern const SequenceModel Iso_8859_9SwedishModel;\nextern const SequenceModel Iso_8859_15SwedishModel;\n\nextern const SequenceModel Windows_1252AfricaansModel;\nextern const SequenceModel Iso_8859_15AfricaansModel;\nextern const SequenceModel Iso_8859_1AfricaansModel;\nextern const SequenceModel Iso_8859_9AfricaansModel;\n\nextern const SequenceModel Windows_1251BelarusianModel;\n\nextern const SequenceModel Windows_1252NederlandsModel;\nextern const SequenceModel Iso_8859_1NederlandsModel;\nextern const SequenceModel Iso_8859_9NederlandsModel;\nextern const SequenceModel Iso_8859_15NederlandsModel;\n\n\n#endif /* nsSingleByteCharSetProber_h__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsSJISProber.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n// for S-JIS encoding, obeserve characteristic:\n// 1, kana character (or hankaku?) often have hight frequency of appereance\n// 2, kana character often exist in group\n// 3, certain combination of kana is never used in japanese language\n\n#include \"nsSJISProber.h\"\n\nvoid  nsSJISProber::Reset(void)\n{\n  mCodingSM->Reset();\n  mState = eDetecting;\n  mContextAnalyser.Reset(mIsPreferredLanguage);\n  mDistributionAnalyser.Reset(mIsPreferredLanguage);\n}\n\nnsProbingState nsSJISProber::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  nsSMState codingState;\n\n  for (PRUint32 i = 0; i < aLen; i++)\n  {\n    codingState = mCodingSM->NextState(aBuf[i]);\n    if (codingState == eItsMe)\n    {\n      mState = eFoundIt;\n      break;\n    }\n    if (codingState == eStart)\n    {\n      PRUint32 charLen = mCodingSM->GetCurrentCharLen();\n      if (i == 0)\n      {\n        mLastChar[1] = aBuf[0];\n        mContextAnalyser.HandleOneChar(mLastChar+2-charLen, charLen);\n        mDistributionAnalyser.HandleOneChar(mLastChar, charLen);\n      }\n      else\n      {\n        mContextAnalyser.HandleOneChar(aBuf+i+1-charLen, charLen);\n        mDistributionAnalyser.HandleOneChar(aBuf+i-1, charLen);\n      }\n    }\n  }\n\n  mLastChar[0] = aBuf[aLen-1];\n\n  if (mState == eDetecting)\n    if (mContextAnalyser.GotEnoughData() && GetConfidence() >= SHORTCUT_THRESHOLD)\n      mState = eFoundIt;\n\n  return mState;\n}\n\nfloat nsSJISProber::GetConfidence(void)\n{\n  float contxtCf = mContextAnalyser.GetConfidence();\n  float distribCf = mDistributionAnalyser.GetConfidence();\n\n  return (contxtCf > distribCf ? contxtCf : distribCf);\n}\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsSJISProber.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n// for S-JIS encoding, obeserve characteristic:\n// 1, kana character (or hankaku?) often have hight frequency of appereance\n// 2, kana character often exist in group\n// 3, certain combination of kana is never used in japanese language\n\n#ifndef nsSJISProber_h__\n#define nsSJISProber_h__\n\n#include \"nsCharSetProber.h\"\n#include \"nsCodingStateMachine.h\"\n#include \"JpCntx.h\"\n#include \"CharDistribution.h\"\n\n\nclass nsSJISProber: public nsCharSetProber {\npublic:\n  nsSJISProber(PRBool aIsPreferredLanguage)\n    :mIsPreferredLanguage(aIsPreferredLanguage)\n  {mCodingSM = new nsCodingStateMachine(&SJISSMModel);\n    Reset();}\n  virtual ~nsSJISProber(void){delete mCodingSM;}\n  nsProbingState HandleData(const char* aBuf, PRUint32 aLen);\n  const char* GetCharSetName() {return \"Shift_JIS\";}\n  nsProbingState GetState(void) {return mState;}\n  void      Reset(void);\n  float     GetConfidence(void);\n  void      SetOpion() {}\n\nprotected:\n  nsCodingStateMachine* mCodingSM;\n  nsProbingState mState;\n\n  SJISContextAnalysis mContextAnalyser;\n  SJISDistributionAnalysis mDistributionAnalyser;\n\n  char mLastChar[2];\n  PRBool mIsPreferredLanguage;\n};\n\n\n#endif /* nsSJISProber_h__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsUTF8Prober.cpp",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"nsUTF8Prober.h\"\n\nvoid  nsUTF8Prober::Reset(void)\n{\n  mCodingSM->Reset();\n  mNumOfMBChar = 0;\n  mState = eDetecting;\n}\n\nnsProbingState nsUTF8Prober::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  nsSMState codingState;\n\n  for (PRUint32 i = 0; i < aLen; i++)\n  {\n    codingState = mCodingSM->NextState(aBuf[i]);\n    if (codingState == eItsMe)\n    {\n      mState = eFoundIt;\n      break;\n    }\n    if (codingState == eStart)\n    {\n      if (mCodingSM->GetCurrentCharLen() >= 2)\n        mNumOfMBChar++;\n    }\n  }\n\n  if (mState == eDetecting)\n    if (GetConfidence() >= SHORTCUT_THRESHOLD)\n      mState = eFoundIt;\n\n  return mState;\n}\n\n#define ONE_CHAR_PROB  (0.50f)\n\nfloat nsUTF8Prober::GetConfidence(void)\n{\n  if (mNumOfMBChar < 6)\n  {\n    float unlike = SURE_YES;\n    for (PRUint32 i = 0; i < mNumOfMBChar; ++i)\n      unlike *= ONE_CHAR_PROB;\n    return (NO_DOUBT - unlike);\n  }\n  else\n      return SURE_YES + (NO_DOUBT - SURE_YES)/2.0f;\n}\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsUTF8Prober.h",
    "content": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is mozilla.org code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef nsUTF8Prober_h__\n#define nsUTF8Prober_h__\n\n#include \"nsCharSetProber.h\"\n#include \"nsCodingStateMachine.h\"\n\nclass nsUTF8Prober: public nsCharSetProber {\npublic:\n  nsUTF8Prober(){mNumOfMBChar = 0;\n                mCodingSM = new nsCodingStateMachine(&UTF8SMModel);\n                Reset(); }\n  virtual ~nsUTF8Prober(){delete mCodingSM;}\n  nsProbingState HandleData(const char* aBuf, PRUint32 aLen);\n  const char* GetCharSetName() {return \"UTF-8\";}\n  nsProbingState GetState(void) {return mState;}\n  void      Reset(void);\n  float     GetConfidence(void);\n  void      SetOpion() {}\n\nprotected:\n  nsCodingStateMachine* mCodingSM;\n  nsProbingState mState;\n  PRUint32 mNumOfMBChar;\n};\n\n#endif /* nsUTF8Prober_h__ */\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsUniversalDetector.cpp",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          Shy Shalom <shooshX@gmail.com>\n *          JoungKyun.Kim <http://oops.org>\n *            - Add mDetectedConfidence\n *            - Add mDetectedIsBOM\n *\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#include \"nscore.h\"\n\n#include \"nsUniversalDetector.h\"\n\n#include \"nsMBCSGroupProber.h\"\n#include \"nsSBCSGroupProber.h\"\n#include \"nsEscCharsetProber.h\"\n#include \"nsLatin1Prober.h\"\n\nnsUniversalDetector::nsUniversalDetector(PRUint32 aLanguageFilter)\n{\n  mNbspFound = PR_FALSE;\n  mDone = PR_FALSE;\n  mInTag = PR_FALSE;\n  mEscCharSetProber = nsnull;\n\n  mStart = PR_TRUE;\n  mDetectedCharset = nsnull;\n  mDetectedConfidence = 0.0;\n  mDetectedIsBOM = 0;\n  mGotData = PR_FALSE;\n  mInputState = ePureAscii;\n  mLastChar = '\\0';\n  mLanguageFilter = aLanguageFilter;\n\n  PRUint32 i;\n  for (i = 0; i < NUM_OF_CHARSET_PROBERS; i++)\n    mCharSetProbers[i] = nsnull;\n}\n\nnsUniversalDetector::~nsUniversalDetector()\n{\n  for (PRInt32 i = 0; i < NUM_OF_CHARSET_PROBERS; i++)\n    delete mCharSetProbers[i];\n\n  delete mEscCharSetProber;\n}\n\nvoid\nnsUniversalDetector::Reset()\n{\n  mNbspFound = PR_FALSE;\n  mDone = PR_FALSE;\n  mInTag = PR_FALSE;\n\n  mStart = PR_TRUE;\n  mDetectedCharset = nsnull;\n  mDetectedConfidence = 0.0;\n  mDetectedIsBOM = 0;\n  mGotData = PR_FALSE;\n  mInputState = ePureAscii;\n  mLastChar = '\\0';\n\n  if (mEscCharSetProber)\n    mEscCharSetProber->Reset();\n\n  PRUint32 i;\n  for (i = 0; i < NUM_OF_CHARSET_PROBERS; i++)\n    if (mCharSetProbers[i])\n      mCharSetProbers[i]->Reset();\n}\n\n//---------------------------------------------------------------------\n\nnsresult nsUniversalDetector::HandleData(const char* aBuf, PRUint32 aLen)\n{\n  if(mDone)\n    return NS_OK;\n\n  if (aLen > 0)\n    mGotData = PR_TRUE;\n\n  //If the data starts with BOM, we know it is UTF\n  if (mStart)\n  {\n    mStart = PR_FALSE;\n    if (aLen > 3)\n      switch (aBuf[0])\n        {\n        case '\\xEF':\n          if (('\\xBB' == aBuf[1]) && ('\\xBF' == aBuf[2])) {\n            // EF BB BF  UTF-8 encoded BOM\n            mDetectedCharset = \"UTF-8\";\n            mDetectedConfidence = 1.0;\n            mDetectedIsBOM = 1;\n          }\n        break;\n        case '\\xFE':\n          if (('\\xFF' == aBuf[1]) && ('\\x00' == aBuf[2]) && ('\\x00' == aBuf[3])) {\n            // FE FF 00 00  UCS-4, unusual octet order BOM (3412)\n            mDetectedCharset = \"X-ISO-10646-UCS-4-3412\";\n            mDetectedConfidence = 1.0;\n            mDetectedIsBOM = 1;\n          } else if ('\\xFF' == aBuf[1]) {\n            // FE FF  UTF-16, big endian BOM\n            mDetectedCharset = \"UTF-16BE\";\n            mDetectedConfidence = 1.0;\n            mDetectedIsBOM = 1;\n          }\n        break;\n        case '\\x00':\n          if (('\\x00' == aBuf[1]) && ('\\xFE' == aBuf[2]) && ('\\xFF' == aBuf[3])) {\n            // 00 00 FE FF  UTF-32, big-endian BOM\n            mDetectedCharset = \"UTF-32BE\";\n            mDetectedConfidence = 1.0;\n            mDetectedIsBOM = 1;\n          } else if (('\\x00' == aBuf[1]) && ('\\xFF' == aBuf[2]) && ('\\xFE' == aBuf[3])) {\n            // 00 00 FF FE  UCS-4, unusual octet order BOM (2143)\n            mDetectedCharset = \"X-ISO-10646-UCS-4-2143\";\n            mDetectedConfidence = 1.0;\n            mDetectedIsBOM = 1;\n          }\n        break;\n        case '\\xFF':\n          if (('\\xFE' == aBuf[1]) && ('\\x00' == aBuf[2]) && ('\\x00' == aBuf[3])) {\n            // FF FE 00 00  UTF-32, little-endian BOM\n            mDetectedCharset = \"UTF-32LE\";\n            mDetectedConfidence = 1.0;\n            mDetectedIsBOM = 1;\n          } else if ('\\xFE' == aBuf[1]) {\n            // FF FE  UTF-16, little endian BOM\n            mDetectedCharset = \"UTF-16LE\";\n            mDetectedConfidence = 1.0;\n            mDetectedIsBOM = 1;\n          }\n        break;\n        case '\\x2B':\n          if (('\\x2F' == aBuf[1]) && ('\\x76' == aBuf[2])) {\n            switch (aBuf[3]) {\n              case '\\x38':\n              case '\\x39':\n              case '\\x2B':\n              case '\\x2F':\n                // https://en.wikipedia.org/wiki/Byte_order_mark#Byte_order_marks_by_encoding\n                // 2B 2F 76 38  UTF-7\n                // 2B 2F 76 39  UTF-7\n                // 2B 2F 76 2B  UTF-7\n                // 2B 2F 76 2F  UTF-7\n                mDetectedCharset = \"UTF-7\";\n                mDetectedConfidence = 1.0;\n                mDetectedIsBOM = 1;\n              break;\n            }\n          }\n        break;\n        case '\\xE7':\n          if (('\\x64' == aBuf[1]) && ('\\x4C' == aBuf[2])) {\n            // E7 64 4c  UTF-1 encoded BOM\n            mDetectedCharset = \"UTF-1\";\n            mDetectedConfidence = 1.0;\n            mDetectedIsBOM = 1;\n          }\n        break;\n        case '\\xDD':\n          if (('\\x73' == aBuf[1]) && ('\\x66' == aBuf[2]) && ('\\x73' == aBuf[3])) {\n            // DD 73 66 73  UTF-EBCDIC encoded BOM\n            mDetectedCharset = \"UTF-EBCDIC\";\n            mDetectedConfidence = 1.0;\n            mDetectedIsBOM = 1;\n          } \n        break;\n        case '\\x0E':\n          if (('\\xFE' == aBuf[1]) && ('\\xFF' == aBuf[2])) {\n            // 0E FE FF  SCSU encoded BOM\n            mDetectedCharset = \"SCSU\";\n            mDetectedConfidence = 1.0;\n            mDetectedIsBOM = 1;\n          }\n        break;\n        case '\\xFB':\n          if (('\\xEE' == aBuf[1]) && ('\\x28' == aBuf[2])) {\n            // FB EE 28  BOCU-1 encoded BOM\n            mDetectedCharset = \"BOCU-1\";\n            mDetectedConfidence = 1.0;\n            mDetectedIsBOM = 1;\n          }\n        break;\n        case '\\x84':\n          if (('\\x31' == aBuf[1]) && ('\\x95' == aBuf[2]) && ('\\x33' == aBuf[3])) {\n            // 84 31 95 33  GB18030 encoded BOM\n            mDetectedCharset = \"GB18030\";\n            mDetectedConfidence = 1.0;\n            mDetectedIsBOM = 1;\n          } \n        break;\n      }  // switch\n\n      if (mDetectedCharset)\n      {\n        mDone = PR_TRUE;\n        return NS_OK;\n      }\n  }\n\n  PRUint32 i;\n  for (i = 0; i < aLen; i++)\n  {\n    //other than 0xa0, if every othe character is ascii, the page is ascii\n    if (aBuf[i] & '\\x80' && aBuf[i] != '\\xA0')  //Since many Ascii only page contains NBSP\n    {\n      //we got a non-ascii byte (high-byte)\n      if (mInputState != eHighbyte)\n      {\n        //adjust state\n        mInputState = eHighbyte;\n\n        //kill mEscCharSetProber if it is active\n        if (mEscCharSetProber) {\n          delete mEscCharSetProber;\n          mEscCharSetProber = nsnull;\n        }\n\n        //start multibyte and singlebyte charset prober\n        if (nsnull == mCharSetProbers[0])\n        {\n          mCharSetProbers[0] = new nsMBCSGroupProber(mLanguageFilter);\n          if (nsnull == mCharSetProbers[0])\n            return NS_ERROR_OUT_OF_MEMORY;\n        }\n        if (nsnull == mCharSetProbers[1] &&\n            (mLanguageFilter & NS_FILTER_NON_CJK))\n        {\n          mCharSetProbers[1] = new nsSBCSGroupProber;\n          if (nsnull == mCharSetProbers[1])\n            return NS_ERROR_OUT_OF_MEMORY;\n        }\n        if (nsnull == mCharSetProbers[2])\n        {\n          mCharSetProbers[2] = new nsLatin1Prober;\n          if (nsnull == mCharSetProbers[2])\n            return NS_ERROR_OUT_OF_MEMORY;\n        }\n      }\n    }\n    else\n    {\n      if (aBuf[i] == '\\xA0')\n      {\n        mNbspFound = PR_TRUE;\n      }\n      //ok, just pure ascii so far\n      else if ( ePureAscii == mInputState &&\n        (aBuf[i] == '\\033' || (aBuf[i] == '{' && mLastChar == '~')) )\n      {\n        //found escape character or HZ \"~{\"\n        mInputState = eEscAscii;\n      }\n      mLastChar = aBuf[i];\n    }\n  }\n\n  nsProbingState st;\n  switch (mInputState)\n  {\n  case eEscAscii:\n    if (nsnull == mEscCharSetProber) {\n      mEscCharSetProber = new nsEscCharSetProber(mLanguageFilter);\n      if (nsnull == mEscCharSetProber)\n        return NS_ERROR_OUT_OF_MEMORY;\n    }\n    st = mEscCharSetProber->HandleData(aBuf, aLen);\n    mDone = PR_TRUE;\n    if (st == eFoundIt)\n    {\n      mDetectedCharset = mEscCharSetProber->GetCharSetName();\n      mDetectedConfidence = mEscCharSetProber->GetConfidence();\n    }\n    else\n    {\n      mDetectedCharset = mNbspFound ? \"ISO-8859-1\" : \"ASCII\";\n      mDetectedConfidence = 1.0;\n    }\n    break;\n  case eHighbyte:\n    for (i = 0; i < NUM_OF_CHARSET_PROBERS; i++)\n    {\n      if (mCharSetProbers[i])\n      {\n        st = mCharSetProbers[i]->HandleData(aBuf, aLen);\n        if (st == eFoundIt) \n        {\n          mDone = PR_TRUE;\n          mDetectedCharset = mCharSetProbers[i]->GetCharSetName();\n          mDetectedConfidence = mCharSetProbers[i]->GetConfidence();\n          return NS_OK;\n        }\n      }\n    }\n    break;\n\n  default:  //pure ascii\n    mDone = PR_TRUE;\n    mDetectedCharset = mNbspFound ? \"ISO-8859-1\" : \"ASCII\";\n    mDetectedConfidence = 1.0;\n    mDetectedIsBOM = 0;\n  }\n  return NS_OK;\n}\n\n\n//---------------------------------------------------------------------\nvoid nsUniversalDetector::DataEnd()\n{\n  if (!mGotData)\n  {\n    // we haven't got any data yet, return immediately\n    // caller program sometimes call DataEnd before anything has been sent to detector\n    return;\n  }\n\n  if (mDetectedCharset)\n  {\n    mDone = PR_TRUE;\n    Report(mDetectedCharset, mDetectedConfidence);\n    return;\n  }\n\n  switch (mInputState)\n  {\n  case eHighbyte:\n    {\n      float maxProberConfidence = (float)0.0;\n      PRInt32 maxProber = 0;\n\n      for (PRInt32 i = 0; i < NUM_OF_CHARSET_PROBERS; ++i)\n      {\n        if (mCharSetProbers[i])\n        {\n          float const proberConfidence = mCharSetProbers[i]->GetConfidence();\n          if (proberConfidence > maxProberConfidence)\n          {\n            maxProberConfidence = proberConfidence;\n            maxProber = i;\n          }\n        }\n      }\n      mDetectedConfidence = maxProberConfidence;\n\n      //do not report anything because we are not confident of it, that's in fact a negative answer\n      if (maxProberConfidence > MINIMUM_THRESHOLD) {\n        Report(mCharSetProbers[maxProber]->GetCharSetName(), maxProberConfidence);\n        mDetectedConfidence = mCharSetProbers[maxProber]->GetConfidence();\n      }\n    }\n    break;\n  case eEscAscii:\n    break;\n  default:\n    break;\n  }\n  return;\n}\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nsUniversalDetector.h",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          JoungKyun.Kim <http://oops.org>\n *            - Add mDetectedConfidence\n *            - Add mDetectedIsBOM\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef nsUniversalDetector_h__\n#define nsUniversalDetector_h__\n\nclass nsCharSetProber;\n\n#define NUM_OF_CHARSET_PROBERS  3\n\ntypedef enum {\n  ePureAscii = 0,\n  eEscAscii  = 1,\n  eHighbyte  = 2\n} nsInputState;\n\n#define NS_FILTER_CHINESE_SIMPLIFIED  0x01\n#define NS_FILTER_CHINESE_TRADITIONAL 0x02\n#define NS_FILTER_JAPANESE            0x04\n#define NS_FILTER_KOREAN              0x08\n#define NS_FILTER_NON_CJK             0x10\n#define NS_FILTER_ALL                 0x1F\n#define NS_FILTER_CHINESE (NS_FILTER_CHINESE_SIMPLIFIED | \\\n                           NS_FILTER_CHINESE_TRADITIONAL)\n#define NS_FILTER_CJK (NS_FILTER_CHINESE_SIMPLIFIED | \\\n                       NS_FILTER_CHINESE_TRADITIONAL | \\\n                       NS_FILTER_JAPANESE | \\\n                       NS_FILTER_KOREAN)\n\nclass nsUniversalDetector {\npublic:\n   nsUniversalDetector(PRUint32 aLanguageFilter);\n   virtual ~nsUniversalDetector();\n   virtual nsresult HandleData(const char* aBuf, PRUint32 aLen);\n   virtual void DataEnd(void);\n\nprotected:\n   virtual void Report(const char* aCharset, float aConfidence) = 0;\n   virtual void Reset();\n   nsInputState  mInputState;\n   PRBool  mNbspFound;\n   PRBool  mDone;\n   PRBool  mInTag;\n   PRBool  mStart;\n   PRBool  mGotData;\n   char    mLastChar;\n   const char *  mDetectedCharset;\n   float mDetectedConfidence;\n   short   mDetectedIsBOM;\n   PRUint32 mLanguageFilter;\n\n   nsCharSetProber  *mCharSetProbers[NUM_OF_CHARSET_PROBERS];\n   nsCharSetProber  *mEscCharSetProber;\n};\n\n#endif\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/nscore.h",
    "content": "/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          Kohei TAKETA <k-tak@void.in>\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n#ifndef nsDummyCore_h__\n#define nsDummyCore_h__\n\ntypedef bool PRBool;\ntypedef int PRInt32;\ntypedef unsigned int PRUint32;\ntypedef short PRInt16;\ntypedef unsigned short PRUint16;\ntypedef signed char PRInt8;\ntypedef unsigned char PRUint8;\n\n#define nsnull nullptr\n\n#define PR_FALSE false\n#define PR_TRUE true\n\n#define MINIMUM_DATA_THRESHOLD  4\n#define ENOUGH_DATA_THRESHOLD  1024\n\n#define SURE_YES  (0.95f)\n#define NO_DOUBT  (1.00f)\n#define SURE_NO (NO_DOUBT - SURE_YES)\n\n#define SHORTCUT_THRESHOLD  (SURE_YES - 0.02f)\n#define MINIMUM_THRESHOLD   (0.20f)\n\n#ifndef min\n#define min(x,y)  (((x) < (y)) ? (x) : (y))\n#endif\n\n#ifdef _MSC_VER\n#ifdef strdup\n#undef strdup\n#endif\n#define strdup _strdup\n#endif\n\nenum nsresult\n{\n    NS_OK,\n    NS_ERROR_OUT_OF_MEMORY\n};\n\n#endif\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/prmem.h",
    "content": "/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          Kohei TAKETA <k-tak@void.in>\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n#ifndef nsDummyPrmem_h__\n#define nsDummyPrmem_h__\n\n#include <stdlib.h>\n\ninline void* PR_Malloc(size_t len)\n{\n    return malloc(len);\n}\n\n#define PR_FREEIF(p) if (p) free(p)\n\n#endif\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/symbols.cmake",
    "content": "set(\n\tUCHARDET_SYMBOLS\n\tuchardet_new\n\tuchardet_delete\n\tuchardet_handle_data\n\tuchardet_data_end\n\tuchardet_reset\n\tuchardet_get_charset\n\tuchardet_get_confidence\n)\n\nset (LINK_FLAGS \"\")\n\nif (APPLE)\n\t# Create a symbols_list file for the Darwin linker.\n\tstring(REPLACE \";\" \"\\n_\" _symbols \"${UCHARDET_SYMBOLS}\")\n\tset(_symbols_list \"${CMAKE_CURRENT_BINARY_DIR}/symbols.list\")\n\tfile(WRITE ${_symbols_list} \"_${_symbols}\\n\")\n\n\tset(LINK_FLAGS\n\t\t\"${LINK_FLAGS} -Wl,-exported_symbols_list,'${_symbols_list}'\")\nelseif (CMAKE_CXX_COMPILER_ID STREQUAL GNU)\n\t# Create a version script for the GNU ld.\n\tset(_symbols \"{ global: ${UCHARDET_SYMBOLS}; local: *; };\")\n\tset(_version_script \"${CMAKE_CURRENT_BINARY_DIR}/version.script\")\n\tfile(WRITE ${_version_script} \"${_symbols}\\n\")\n\n\tset(LINK_FLAGS \"${LINK_FLAGS} -Wl,--version-script,\\\"${_version_script}\\\"\")\nendif (APPLE)\n\nset_target_properties(\n\t${UCHARDET_LIBRARY}\n\tPROPERTIES\n\t\tLINK_FLAGS\n\t\t\t\"${LINK_FLAGS}\"\n)\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/tables/Big5Freq.tab",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n// Big5 frequency table\n// by Taiwan's Mandarin Promotion Council \n// <http://www.edu.tw:81/mandr/>\n\n/******************************************************************************\n * 128  --> 0.42261\n * 256  --> 0.57851\n * 512  --> 0.74851\n * 1024 --> 0.89384\n * 2048 --> 0.97583\n *\n * Idea Distribution Ratio = 0.74851/(1-0.74851) =2.98\n * Random Distribution Ration = 512/(5401-512)=0.105\n * \n * Typical Distribution Ratio about 25% of Ideal one, still much higher than RDR\n *****************************************************************************/\n\n#define BIG5_TYPICAL_DISTRIBUTION_RATIO (float)0.75\n\n\n//Char to FreqOrder table , \n#define BIG5_TABLE_SIZE  5376\n\nstatic const PRInt16 Big5CharToFreqOrder[] =\n{\n   1,1801,1506, 255,1431, 198,   9,  82,   6,5008, 177, 202,3681,1256,2821, 110, //   16\n3814,  33,3274, 261,  76,  44,2114,  16,2946,2187,1176, 659,3971,  26,3451,2653, //   32\n1198,3972,3350,4202, 410,2215, 302, 590, 361,1964,   8, 204,  58,4510,5009,1932, //   48\n  63,5010,5011, 317,1614,  75, 222, 159,4203,2417,1480,5012,3555,3091, 224,2822, //   64\n3682,   3,  10,3973,1471,  29,2787,1135,2866,1940, 873, 130,3275,1123, 312,5013, //   80\n4511,2052, 507, 252, 682,5014, 142,1915, 124, 206,2947,  34,3556,3204,  64, 604, //   96\n5015,2501,1977,1978, 155,1991, 645, 641,1606,5016,3452, 337,  72, 406,5017,  80, //  112\n 630, 238,3205,1509, 263, 939,1092,2654, 756,1440,1094,3453, 449,  69,2987, 591, //  128\n 179,2096, 471, 115,2035,1844,  60,  50,2988, 134, 806,1869, 734,2036,3454, 180, //  144\n 995,1607, 156, 537,2907, 688,5018, 319,1305, 779,2145, 514,2379, 298,4512, 359, //  160\n2502,  90,2716,1338, 663,  11, 906,1099,2553,  20,2441, 182, 532,1716,5019, 732, //  176\n1376,4204,1311,1420,3206,  25,2317,1056, 113, 399, 382,1950, 242,3455,2474, 529, //  192\n3276, 475,1447,3683,5020, 117,  21, 656, 810,1297,2300,2334,3557,5021, 126,4205, //  208\n 706, 456, 150, 613,4513,  71,1118,2037,4206, 145,3092,  85, 835, 486,2115,1246, //  224\n1426, 428, 727,1285,1015, 800, 106, 623, 303,1281,5022,2128,2359, 347,3815, 221, //  240\n3558,3135,5023,1956,1153,4207,  83, 296,1199,3093, 192, 624,  93,5024, 822,1898, //  256\n2823,3136, 795,2065, 991,1554,1542,1592,  27,  43,2867, 859, 139,1456, 860,4514, //  272\n 437, 712,3974, 164,2397,3137, 695, 211,3037,2097, 195,3975,1608,3559,3560,3684, //  288\n3976, 234, 811,2989,2098,3977,2233,1441,3561,1615,2380, 668,2077,1638, 305, 228, //  304\n1664,4515, 467, 415,5025, 262,2099,1593, 239, 108, 300, 200,1033, 512,1247,2078, //  320\n5026,5027,2176,3207,3685,2682, 593, 845,1062,3277,  88,1723,2038,3978,1951, 212, //  336\n 266, 152, 149, 468,1899,4208,4516,  77, 187,5028,3038,  37,   5,2990,5029,3979, //  352\n5030,5031,  39,2524,4517,2908,3208,2079,  55, 148,  74,4518, 545, 483,1474,1029, //  368\n1665, 217,1870,1531,3138,1104,2655,4209,  24, 172,3562, 900,3980,3563,3564,4519, //  384\n  32,1408,2824,1312, 329, 487,2360,2251,2717, 784,2683,   4,3039,3351,1427,1789, //  400\n 188, 109, 499,5032,3686,1717,1790, 888,1217,3040,4520,5033,3565,5034,3352,1520, //  416\n3687,3981, 196,1034, 775,5035,5036, 929,1816, 249, 439,  38,5037,1063,5038, 794, //  432\n3982,1435,2301,  46, 178,3278,2066,5039,2381,5040, 214,1709,4521, 804,  35, 707, //  448\n 324,3688,1601,2554, 140, 459,4210,5041,5042,1365, 839, 272, 978,2262,2580,3456, //  464\n2129,1363,3689,1423, 697, 100,3094,  48,  70,1231, 495,3139,2196,5043,1294,5044, //  480\n2080, 462, 586,1042,3279, 853, 256, 988, 185,2382,3457,1698, 434,1084,5045,3458, //  496\n 314,2625,2788,4522,2335,2336, 569,2285, 637,1817,2525, 757,1162,1879,1616,3459, //  512\n 287,1577,2116, 768,4523,1671,2868,3566,2526,1321,3816, 909,2418,5046,4211, 933, //  528\n3817,4212,2053,2361,1222,4524, 765,2419,1322, 786,4525,5047,1920,1462,1677,2909, //  544\n1699,5048,4526,1424,2442,3140,3690,2600,3353,1775,1941,3460,3983,4213, 309,1369, //  560\n1130,2825, 364,2234,1653,1299,3984,3567,3985,3986,2656, 525,1085,3041, 902,2001, //  576\n1475, 964,4527, 421,1845,1415,1057,2286, 940,1364,3141, 376,4528,4529,1381,   7, //  592\n2527, 983,2383, 336,1710,2684,1846, 321,3461, 559,1131,3042,2752,1809,1132,1313, //  608\n 265,1481,1858,5049, 352,1203,2826,3280, 167,1089, 420,2827, 776, 792,1724,3568, //  624\n4214,2443,3281,5050,4215,5051, 446, 229, 333,2753, 901,3818,1200,1557,4530,2657, //  640\n1921, 395,2754,2685,3819,4216,1836, 125, 916,3209,2626,4531,5052,5053,3820,5054, //  656\n5055,5056,4532,3142,3691,1133,2555,1757,3462,1510,2318,1409,3569,5057,2146, 438, //  672\n2601,2910,2384,3354,1068, 958,3043, 461, 311,2869,2686,4217,1916,3210,4218,1979, //  688\n 383, 750,2755,2627,4219, 274, 539, 385,1278,1442,5058,1154,1965, 384, 561, 210, //  704\n  98,1295,2556,3570,5059,1711,2420,1482,3463,3987,2911,1257, 129,5060,3821, 642, //  720\n 523,2789,2790,2658,5061, 141,2235,1333,  68, 176, 441, 876, 907,4220, 603,2602, //  736\n 710, 171,3464, 404, 549,  18,3143,2398,1410,3692,1666,5062,3571,4533,2912,4534, //  752\n5063,2991, 368,5064, 146, 366,  99, 871,3693,1543, 748, 807,1586,1185,  22,2263, //  768\n 379,3822,3211,5065,3212, 505,1942,2628,1992,1382,2319,5066, 380,2362, 218, 702, //  784\n1818,1248,3465,3044,3572,3355,3282,5067,2992,3694, 930,3283,3823,5068,  59,5069, //  800\n 585, 601,4221, 497,3466,1112,1314,4535,1802,5070,1223,1472,2177,5071, 749,1837, //  816\n 690,1900,3824,1773,3988,1476, 429,1043,1791,2236,2117, 917,4222, 447,1086,1629, //  832\n5072, 556,5073,5074,2021,1654, 844,1090, 105, 550, 966,1758,2828,1008,1783, 686, //  848\n1095,5075,2287, 793,1602,5076,3573,2603,4536,4223,2948,2302,4537,3825, 980,2503, //  864\n 544, 353, 527,4538, 908,2687,2913,5077, 381,2629,1943,1348,5078,1341,1252, 560, //  880\n3095,5079,3467,2870,5080,2054, 973, 886,2081, 143,4539,5081,5082, 157,3989, 496, //  896\n4224,  57, 840, 540,2039,4540,4541,3468,2118,1445, 970,2264,1748,1966,2082,4225, //  912\n3144,1234,1776,3284,2829,3695, 773,1206,2130,1066,2040,1326,3990,1738,1725,4226, //  928\n 279,3145,  51,1544,2604, 423,1578,2131,2067, 173,4542,1880,5083,5084,1583, 264, //  944\n 610,3696,4543,2444, 280, 154,5085,5086,5087,1739, 338,1282,3096, 693,2871,1411, //  960\n1074,3826,2445,5088,4544,5089,5090,1240, 952,2399,5091,2914,1538,2688, 685,1483, //  976\n4227,2475,1436, 953,4228,2055,4545, 671,2400,  79,4229,2446,3285, 608, 567,2689, //  992\n3469,4230,4231,1691, 393,1261,1792,2401,5092,4546,5093,5094,5095,5096,1383,1672, // 1008\n3827,3213,1464, 522,1119, 661,1150, 216, 675,4547,3991,1432,3574, 609,4548,2690, // 1024\n2402,5097,5098,5099,4232,3045,   0,5100,2476, 315, 231,2447, 301,3356,4549,2385, // 1040\n5101, 233,4233,3697,1819,4550,4551,5102,  96,1777,1315,2083,5103, 257,5104,1810, // 1056\n3698,2718,1139,1820,4234,2022,1124,2164,2791,1778,2659,5105,3097, 363,1655,3214, // 1072\n5106,2993,5107,5108,5109,3992,1567,3993, 718, 103,3215, 849,1443, 341,3357,2949, // 1088\n1484,5110,1712, 127,  67, 339,4235,2403, 679,1412, 821,5111,5112, 834, 738, 351, // 1104\n2994,2147, 846, 235,1497,1881, 418,1993,3828,2719, 186,1100,2148,2756,3575,1545, // 1120\n1355,2950,2872,1377, 583,3994,4236,2581,2995,5113,1298,3699,1078,2557,3700,2363, // 1136\n  78,3829,3830, 267,1289,2100,2002,1594,4237, 348, 369,1274,2197,2178,1838,4552, // 1152\n1821,2830,3701,2757,2288,2003,4553,2951,2758, 144,3358, 882,4554,3995,2759,3470, // 1168\n4555,2915,5114,4238,1726, 320,5115,3996,3046, 788,2996,5116,2831,1774,1327,2873, // 1184\n3997,2832,5117,1306,4556,2004,1700,3831,3576,2364,2660, 787,2023, 506, 824,3702, // 1200\n 534, 323,4557,1044,3359,2024,1901, 946,3471,5118,1779,1500,1678,5119,1882,4558, // 1216\n 165, 243,4559,3703,2528, 123, 683,4239, 764,4560,  36,3998,1793, 589,2916, 816, // 1232\n 626,1667,3047,2237,1639,1555,1622,3832,3999,5120,4000,2874,1370,1228,1933, 891, // 1248\n2084,2917, 304,4240,5121, 292,2997,2720,3577, 691,2101,4241,1115,4561, 118, 662, // 1264\n5122, 611,1156, 854,2386,1316,2875,   2, 386, 515,2918,5123,5124,3286, 868,2238, // 1280\n1486, 855,2661, 785,2216,3048,5125,1040,3216,3578,5126,3146, 448,5127,1525,5128, // 1296\n2165,4562,5129,3833,5130,4242,2833,3579,3147, 503, 818,4001,3148,1568, 814, 676, // 1312\n1444, 306,1749,5131,3834,1416,1030, 197,1428, 805,2834,1501,4563,5132,5133,5134, // 1328\n1994,5135,4564,5136,5137,2198,  13,2792,3704,2998,3149,1229,1917,5138,3835,2132, // 1344\n5139,4243,4565,2404,3580,5140,2217,1511,1727,1120,5141,5142, 646,3836,2448, 307, // 1360\n5143,5144,1595,3217,5145,5146,5147,3705,1113,1356,4002,1465,2529,2530,5148, 519, // 1376\n5149, 128,2133,  92,2289,1980,5150,4003,1512, 342,3150,2199,5151,2793,2218,1981, // 1392\n3360,4244, 290,1656,1317, 789, 827,2365,5152,3837,4566, 562, 581,4004,5153, 401, // 1408\n4567,2252,  94,4568,5154,1399,2794,5155,1463,2025,4569,3218,1944,5156, 828,1105, // 1424\n4245,1262,1394,5157,4246, 605,4570,5158,1784,2876,5159,2835, 819,2102, 578,2200, // 1440\n2952,5160,1502, 436,3287,4247,3288,2836,4005,2919,3472,3473,5161,2721,2320,5162, // 1456\n5163,2337,2068,  23,4571, 193, 826,3838,2103, 699,1630,4248,3098, 390,1794,1064, // 1472\n3581,5164,1579,3099,3100,1400,5165,4249,1839,1640,2877,5166,4572,4573, 137,4250, // 1488\n 598,3101,1967, 780, 104, 974,2953,5167, 278, 899, 253, 402, 572, 504, 493,1339, // 1504\n5168,4006,1275,4574,2582,2558,5169,3706,3049,3102,2253, 565,1334,2722, 863,  41, // 1520\n5170,5171,4575,5172,1657,2338,  19, 463,2760,4251, 606,5173,2999,3289,1087,2085, // 1536\n1323,2662,3000,5174,1631,1623,1750,4252,2691,5175,2878, 791,2723,2663,2339, 232, // 1552\n2421,5176,3001,1498,5177,2664,2630, 755,1366,3707,3290,3151,2026,1609, 119,1918, // 1568\n3474, 862,1026,4253,5178,4007,3839,4576,4008,4577,2265,1952,2477,5179,1125, 817, // 1584\n4254,4255,4009,1513,1766,2041,1487,4256,3050,3291,2837,3840,3152,5180,5181,1507, // 1600\n5182,2692, 733,  40,1632,1106,2879, 345,4257, 841,2531, 230,4578,3002,1847,3292, // 1616\n3475,5183,1263, 986,3476,5184, 735, 879, 254,1137, 857, 622,1300,1180,1388,1562, // 1632\n4010,4011,2954, 967,2761,2665,1349, 592,2134,1692,3361,3003,1995,4258,1679,4012, // 1648\n1902,2188,5185, 739,3708,2724,1296,1290,5186,4259,2201,2202,1922,1563,2605,2559, // 1664\n1871,2762,3004,5187, 435,5188, 343,1108, 596,  17,1751,4579,2239,3477,3709,5189, // 1680\n4580, 294,3582,2955,1693, 477, 979, 281,2042,3583, 643,2043,3710,2631,2795,2266, // 1696\n1031,2340,2135,2303,3584,4581, 367,1249,2560,5190,3585,5191,4582,1283,3362,2005, // 1712\n 240,1762,3363,4583,4584, 836,1069,3153, 474,5192,2149,2532, 268,3586,5193,3219, // 1728\n1521,1284,5194,1658,1546,4260,5195,3587,3588,5196,4261,3364,2693,1685,4262, 961, // 1744\n1673,2632, 190,2006,2203,3841,4585,4586,5197, 570,2504,3711,1490,5198,4587,2633, // 1760\n3293,1957,4588, 584,1514, 396,1045,1945,5199,4589,1968,2449,5200,5201,4590,4013, // 1776\n 619,5202,3154,3294, 215,2007,2796,2561,3220,4591,3221,4592, 763,4263,3842,4593, // 1792\n5203,5204,1958,1767,2956,3365,3712,1174, 452,1477,4594,3366,3155,5205,2838,1253, // 1808\n2387,2189,1091,2290,4264, 492,5206, 638,1169,1825,2136,1752,4014, 648, 926,1021, // 1824\n1324,4595, 520,4596, 997, 847,1007, 892,4597,3843,2267,1872,3713,2405,1785,4598, // 1840\n1953,2957,3103,3222,1728,4265,2044,3714,4599,2008,1701,3156,1551,  30,2268,4266, // 1856\n5207,2027,4600,3589,5208, 501,5209,4267, 594,3478,2166,1822,3590,3479,3591,3223, // 1872\n 829,2839,4268,5210,1680,3157,1225,4269,5211,3295,4601,4270,3158,2341,5212,4602, // 1888\n4271,5213,4015,4016,5214,1848,2388,2606,3367,5215,4603, 374,4017, 652,4272,4273, // 1904\n 375,1140, 798,5216,5217,5218,2366,4604,2269, 546,1659, 138,3051,2450,4605,5219, // 1920\n2254, 612,1849, 910, 796,3844,1740,1371, 825,3845,3846,5220,2920,2562,5221, 692, // 1936\n 444,3052,2634, 801,4606,4274,5222,1491, 244,1053,3053,4275,4276, 340,5223,4018, // 1952\n1041,3005, 293,1168,  87,1357,5224,1539, 959,5225,2240, 721, 694,4277,3847, 219, // 1968\n1478, 644,1417,3368,2666,1413,1401,1335,1389,4019,5226,5227,3006,2367,3159,1826, // 1984\n 730,1515, 184,2840,  66,4607,5228,1660,2958, 246,3369, 378,1457, 226,3480, 975, // 2000\n4020,2959,1264,3592, 674, 696,5229, 163,5230,1141,2422,2167, 713,3593,3370,4608, // 2016\n4021,5231,5232,1186,  15,5233,1079,1070,5234,1522,3224,3594, 276,1050,2725, 758, // 2032\n1126, 653,2960,3296,5235,2342, 889,3595,4022,3104,3007, 903,1250,4609,4023,3481, // 2048\n3596,1342,1681,1718, 766,3297, 286,  89,2961,3715,5236,1713,5237,2607,3371,3008, // 2064\n5238,2962,2219,3225,2880,5239,4610,2505,2533, 181, 387,1075,4024, 731,2190,3372, // 2080\n5240,3298, 310, 313,3482,2304, 770,4278,  54,3054, 189,4611,3105,3848,4025,5241, // 2096\n1230,1617,1850, 355,3597,4279,4612,3373, 111,4280,3716,1350,3160,3483,3055,4281, // 2112\n2150,3299,3598,5242,2797,4026,4027,3009, 722,2009,5243,1071, 247,1207,2343,2478, // 2128\n1378,4613,2010, 864,1437,1214,4614, 373,3849,1142,2220, 667,4615, 442,2763,2563, // 2144\n3850,4028,1969,4282,3300,1840, 837, 170,1107, 934,1336,1883,5244,5245,2119,4283, // 2160\n2841, 743,1569,5246,4616,4284, 582,2389,1418,3484,5247,1803,5248, 357,1395,1729, // 2176\n3717,3301,2423,1564,2241,5249,3106,3851,1633,4617,1114,2086,4285,1532,5250, 482, // 2192\n2451,4618,5251,5252,1492, 833,1466,5253,2726,3599,1641,2842,5254,1526,1272,3718, // 2208\n4286,1686,1795, 416,2564,1903,1954,1804,5255,3852,2798,3853,1159,2321,5256,2881, // 2224\n4619,1610,1584,3056,2424,2764, 443,3302,1163,3161,5257,5258,4029,5259,4287,2506, // 2240\n3057,4620,4030,3162,2104,1647,3600,2011,1873,4288,5260,4289, 431,3485,5261, 250, // 2256\n  97,  81,4290,5262,1648,1851,1558, 160, 848,5263, 866, 740,1694,5264,2204,2843, // 2272\n3226,4291,4621,3719,1687, 950,2479, 426, 469,3227,3720,3721,4031,5265,5266,1188, // 2288\n 424,1996, 861,3601,4292,3854,2205,2694, 168,1235,3602,4293,5267,2087,1674,4622, // 2304\n3374,3303, 220,2565,1009,5268,3855, 670,3010, 332,1208, 717,5269,5270,3603,2452, // 2320\n4032,3375,5271, 513,5272,1209,2882,3376,3163,4623,1080,5273,5274,5275,5276,2534, // 2336\n3722,3604, 815,1587,4033,4034,5277,3605,3486,3856,1254,4624,1328,3058,1390,4035, // 2352\n1741,4036,3857,4037,5278, 236,3858,2453,3304,5279,5280,3723,3859,1273,3860,4625, // 2368\n5281, 308,5282,4626, 245,4627,1852,2480,1307,2583, 430, 715,2137,2454,5283, 270, // 2384\n 199,2883,4038,5284,3606,2727,1753, 761,1754, 725,1661,1841,4628,3487,3724,5285, // 2400\n5286, 587,  14,3305, 227,2608, 326, 480,2270, 943,2765,3607, 291, 650,1884,5287, // 2416\n1702,1226, 102,1547,  62,3488, 904,4629,3489,1164,4294,5288,5289,1224,1548,2766, // 2432\n 391, 498,1493,5290,1386,1419,5291,2056,1177,4630, 813, 880,1081,2368, 566,1145, // 2448\n4631,2291,1001,1035,2566,2609,2242, 394,1286,5292,5293,2069,5294,  86,1494,1730, // 2464\n4039, 491,1588, 745, 897,2963, 843,3377,4040,2767,2884,3306,1768, 998,2221,2070, // 2480\n 397,1827,1195,1970,3725,3011,3378, 284,5295,3861,2507,2138,2120,1904,5296,4041, // 2496\n2151,4042,4295,1036,3490,1905, 114,2567,4296, 209,1527,5297,5298,2964,2844,2635, // 2512\n2390,2728,3164, 812,2568,5299,3307,5300,1559, 737,1885,3726,1210, 885,  28,2695, // 2528\n3608,3862,5301,4297,1004,1780,4632,5302, 346,1982,2222,2696,4633,3863,1742, 797, // 2544\n1642,4043,1934,1072,1384,2152, 896,4044,3308,3727,3228,2885,3609,5303,2569,1959, // 2560\n4634,2455,1786,5304,5305,5306,4045,4298,1005,1308,3728,4299,2729,4635,4636,1528, // 2576\n2610, 161,1178,4300,1983, 987,4637,1101,4301, 631,4046,1157,3229,2425,1343,1241, // 2592\n1016,2243,2570, 372, 877,2344,2508,1160, 555,1935, 911,4047,5307, 466,1170, 169, // 2608\n1051,2921,2697,3729,2481,3012,1182,2012,2571,1251,2636,5308, 992,2345,3491,1540, // 2624\n2730,1201,2071,2406,1997,2482,5309,4638, 528,1923,2191,1503,1874,1570,2369,3379, // 2640\n3309,5310, 557,1073,5311,1828,3492,2088,2271,3165,3059,3107, 767,3108,2799,4639, // 2656\n1006,4302,4640,2346,1267,2179,3730,3230, 778,4048,3231,2731,1597,2667,5312,4641, // 2672\n5313,3493,5314,5315,5316,3310,2698,1433,3311, 131,  95,1504,4049, 723,4303,3166, // 2688\n1842,3610,2768,2192,4050,2028,2105,3731,5317,3013,4051,1218,5318,3380,3232,4052, // 2704\n4304,2584, 248,1634,3864, 912,5319,2845,3732,3060,3865, 654,  53,5320,3014,5321, // 2720\n1688,4642, 777,3494,1032,4053,1425,5322, 191, 820,2121,2846, 971,4643, 931,3233, // 2736\n 135, 664, 783,3866,1998, 772,2922,1936,4054,3867,4644,2923,3234, 282,2732, 640, // 2752\n1372,3495,1127, 922, 325,3381,5323,5324, 711,2045,5325,5326,4055,2223,2800,1937, // 2768\n4056,3382,2224,2255,3868,2305,5327,4645,3869,1258,3312,4057,3235,2139,2965,4058, // 2784\n4059,5328,2225, 258,3236,4646, 101,1227,5329,3313,1755,5330,1391,3314,5331,2924, // 2800\n2057, 893,5332,5333,5334,1402,4305,2347,5335,5336,3237,3611,5337,5338, 878,1325, // 2816\n1781,2801,4647, 259,1385,2585, 744,1183,2272,4648,5339,4060,2509,5340, 684,1024, // 2832\n4306,5341, 472,3612,3496,1165,3315,4061,4062, 322,2153, 881, 455,1695,1152,1340, // 2848\n 660, 554,2154,4649,1058,4650,4307, 830,1065,3383,4063,4651,1924,5342,1703,1919, // 2864\n5343, 932,2273, 122,5344,4652, 947, 677,5345,3870,2637, 297,1906,1925,2274,4653, // 2880\n2322,3316,5346,5347,4308,5348,4309,  84,4310, 112, 989,5349, 547,1059,4064, 701, // 2896\n3613,1019,5350,4311,5351,3497, 942, 639, 457,2306,2456, 993,2966, 407, 851, 494, // 2912\n4654,3384, 927,5352,1237,5353,2426,3385, 573,4312, 680, 921,2925,1279,1875, 285, // 2928\n 790,1448,1984, 719,2168,5354,5355,4655,4065,4066,1649,5356,1541, 563,5357,1077, // 2944\n5358,3386,3061,3498, 511,3015,4067,4068,3733,4069,1268,2572,3387,3238,4656,4657, // 2960\n5359, 535,1048,1276,1189,2926,2029,3167,1438,1373,2847,2967,1134,2013,5360,4313, // 2976\n1238,2586,3109,1259,5361, 700,5362,2968,3168,3734,4314,5363,4315,1146,1876,1907, // 2992\n4658,2611,4070, 781,2427, 132,1589, 203, 147, 273,2802,2407, 898,1787,2155,4071, // 3008\n4072,5364,3871,2803,5365,5366,4659,4660,5367,3239,5368,1635,3872, 965,5369,1805, // 3024\n2699,1516,3614,1121,1082,1329,3317,4073,1449,3873,  65,1128,2848,2927,2769,1590, // 3040\n3874,5370,5371,  12,2668,  45, 976,2587,3169,4661, 517,2535,1013,1037,3240,5372, // 3056\n3875,2849,5373,3876,5374,3499,5375,2612, 614,1999,2323,3877,3110,2733,2638,5376, // 3072\n2588,4316, 599,1269,5377,1811,3735,5378,2700,3111, 759,1060, 489,1806,3388,3318, // 3088\n1358,5379,5380,2391,1387,1215,2639,2256, 490,5381,5382,4317,1759,2392,2348,5383, // 3104\n4662,3878,1908,4074,2640,1807,3241,4663,3500,3319,2770,2349, 874,5384,5385,3501, // 3120\n3736,1859,  91,2928,3737,3062,3879,4664,5386,3170,4075,2669,5387,3502,1202,1403, // 3136\n3880,2969,2536,1517,2510,4665,3503,2511,5388,4666,5389,2701,1886,1495,1731,4076, // 3152\n2370,4667,5390,2030,5391,5392,4077,2702,1216, 237,2589,4318,2324,4078,3881,4668, // 3168\n4669,2703,3615,3504, 445,4670,5393,5394,5395,5396,2771,  61,4079,3738,1823,4080, // 3184\n5397, 687,2046, 935, 925, 405,2670, 703,1096,1860,2734,4671,4081,1877,1367,2704, // 3200\n3389, 918,2106,1782,2483, 334,3320,1611,1093,4672, 564,3171,3505,3739,3390, 945, // 3216\n2641,2058,4673,5398,1926, 872,4319,5399,3506,2705,3112, 349,4320,3740,4082,4674, // 3232\n3882,4321,3741,2156,4083,4675,4676,4322,4677,2408,2047, 782,4084, 400, 251,4323, // 3248\n1624,5400,5401, 277,3742, 299,1265, 476,1191,3883,2122,4324,4325,1109, 205,5402, // 3264\n2590,1000,2157,3616,1861,5403,5404,5405,4678,5406,4679,2573, 107,2484,2158,4085, // 3280\n3507,3172,5407,1533, 541,1301, 158, 753,4326,2886,3617,5408,1696, 370,1088,4327, // 3296\n4680,3618, 579, 327, 440, 162,2244, 269,1938,1374,3508, 968,3063,  56,1396,3113, // 3312\n2107,3321,3391,5409,1927,2159,4681,3016,5410,3619,5411,5412,3743,4682,2485,5413, // 3328\n2804,5414,1650,4683,5415,2613,5416,5417,4086,2671,3392,1149,3393,4087,3884,4088, // 3344\n5418,1076,  49,5419, 951,3242,3322,3323, 450,2850, 920,5420,1812,2805,2371,4328, // 3360\n1909,1138,2372,3885,3509,5421,3243,4684,1910,1147,1518,2428,4685,3886,5422,4686, // 3376\n2393,2614, 260,1796,3244,5423,5424,3887,3324, 708,5425,3620,1704,5426,3621,1351, // 3392\n1618,3394,3017,1887, 944,4329,3395,4330,3064,3396,4331,5427,3744, 422, 413,1714, // 3408\n3325, 500,2059,2350,4332,2486,5428,1344,1911, 954,5429,1668,5430,5431,4089,2409, // 3424\n4333,3622,3888,4334,5432,2307,1318,2512,3114, 133,3115,2887,4687, 629,  31,2851, // 3440\n2706,3889,4688, 850, 949,4689,4090,2970,1732,2089,4335,1496,1853,5433,4091, 620, // 3456\n3245, 981,1242,3745,3397,1619,3746,1643,3326,2140,2457,1971,1719,3510,2169,5434, // 3472\n3246,5435,5436,3398,1829,5437,1277,4690,1565,2048,5438,1636,3623,3116,5439, 869, // 3488\n2852, 655,3890,3891,3117,4092,3018,3892,1310,3624,4691,5440,5441,5442,1733, 558, // 3504\n4692,3747, 335,1549,3065,1756,4336,3748,1946,3511,1830,1291,1192, 470,2735,2108, // 3520\n2806, 913,1054,4093,5443,1027,5444,3066,4094,4693, 982,2672,3399,3173,3512,3247, // 3536\n3248,1947,2807,5445, 571,4694,5446,1831,5447,3625,2591,1523,2429,5448,2090, 984, // 3552\n4695,3749,1960,5449,3750, 852, 923,2808,3513,3751, 969,1519, 999,2049,2325,1705, // 3568\n5450,3118, 615,1662, 151, 597,4095,2410,2326,1049, 275,4696,3752,4337, 568,3753, // 3584\n3626,2487,4338,3754,5451,2430,2275, 409,3249,5452,1566,2888,3514,1002, 769,2853, // 3600\n 194,2091,3174,3755,2226,3327,4339, 628,1505,5453,5454,1763,2180,3019,4096, 521, // 3616\n1161,2592,1788,2206,2411,4697,4097,1625,4340,4341, 412,  42,3119, 464,5455,2642, // 3632\n4698,3400,1760,1571,2889,3515,2537,1219,2207,3893,2643,2141,2373,4699,4700,3328, // 3648\n1651,3401,3627,5456,5457,3628,2488,3516,5458,3756,5459,5460,2276,2092, 460,5461, // 3664\n4701,5462,3020, 962, 588,3629, 289,3250,2644,1116,  52,5463,3067,1797,5464,5465, // 3680\n5466,1467,5467,1598,1143,3757,4342,1985,1734,1067,4702,1280,3402, 465,4703,1572, // 3696\n 510,5468,1928,2245,1813,1644,3630,5469,4704,3758,5470,5471,2673,1573,1534,5472, // 3712\n5473, 536,1808,1761,3517,3894,3175,2645,5474,5475,5476,4705,3518,2929,1912,2809, // 3728\n5477,3329,1122, 377,3251,5478, 360,5479,5480,4343,1529, 551,5481,2060,3759,1769, // 3744\n2431,5482,2930,4344,3330,3120,2327,2109,2031,4706,1404, 136,1468,1479, 672,1171, // 3760\n3252,2308, 271,3176,5483,2772,5484,2050, 678,2736, 865,1948,4707,5485,2014,4098, // 3776\n2971,5486,2737,2227,1397,3068,3760,4708,4709,1735,2931,3403,3631,5487,3895, 509, // 3792\n2854,2458,2890,3896,5488,5489,3177,3178,4710,4345,2538,4711,2309,1166,1010, 552, // 3808\n 681,1888,5490,5491,2972,2973,4099,1287,1596,1862,3179, 358, 453, 736, 175, 478, // 3824\n1117, 905,1167,1097,5492,1854,1530,5493,1706,5494,2181,3519,2292,3761,3520,3632, // 3840\n4346,2093,4347,5495,3404,1193,2489,4348,1458,2193,2208,1863,1889,1421,3331,2932, // 3856\n3069,2182,3521, 595,2123,5496,4100,5497,5498,4349,1707,2646, 223,3762,1359, 751, // 3872\n3121, 183,3522,5499,2810,3021, 419,2374, 633, 704,3897,2394, 241,5500,5501,5502, // 3888\n 838,3022,3763,2277,2773,2459,3898,1939,2051,4101,1309,3122,2246,1181,5503,1136, // 3904\n2209,3899,2375,1446,4350,2310,4712,5504,5505,4351,1055,2615, 484,3764,5506,4102, // 3920\n 625,4352,2278,3405,1499,4353,4103,5507,4104,4354,3253,2279,2280,3523,5508,5509, // 3936\n2774, 808,2616,3765,3406,4105,4355,3123,2539, 526,3407,3900,4356, 955,5510,1620, // 3952\n4357,2647,2432,5511,1429,3766,1669,1832, 994, 928,5512,3633,1260,5513,5514,5515, // 3968\n1949,2293, 741,2933,1626,4358,2738,2460, 867,1184, 362,3408,1392,5516,5517,4106, // 3984\n4359,1770,1736,3254,2934,4713,4714,1929,2707,1459,1158,5518,3070,3409,2891,1292, // 4000\n1930,2513,2855,3767,1986,1187,2072,2015,2617,4360,5519,2574,2514,2170,3768,2490, // 4016\n3332,5520,3769,4715,5521,5522, 666,1003,3023,1022,3634,4361,5523,4716,1814,2257, // 4032\n 574,3901,1603, 295,1535, 705,3902,4362, 283, 858, 417,5524,5525,3255,4717,4718, // 4048\n3071,1220,1890,1046,2281,2461,4107,1393,1599, 689,2575, 388,4363,5526,2491, 802, // 4064\n5527,2811,3903,2061,1405,2258,5528,4719,3904,2110,1052,1345,3256,1585,5529, 809, // 4080\n5530,5531,5532, 575,2739,3524, 956,1552,1469,1144,2328,5533,2329,1560,2462,3635, // 4096\n3257,4108, 616,2210,4364,3180,2183,2294,5534,1833,5535,3525,4720,5536,1319,3770, // 4112\n3771,1211,3636,1023,3258,1293,2812,5537,5538,5539,3905, 607,2311,3906, 762,2892, // 4128\n1439,4365,1360,4721,1485,3072,5540,4722,1038,4366,1450,2062,2648,4367,1379,4723, // 4144\n2593,5541,5542,4368,1352,1414,2330,2935,1172,5543,5544,3907,3908,4724,1798,1451, // 4160\n5545,5546,5547,5548,2936,4109,4110,2492,2351, 411,4111,4112,3637,3333,3124,4725, // 4176\n1561,2674,1452,4113,1375,5549,5550,  47,2974, 316,5551,1406,1591,2937,3181,5552, // 4192\n1025,2142,3125,3182, 354,2740, 884,2228,4369,2412, 508,3772, 726,3638, 996,2433, // 4208\n3639, 729,5553, 392,2194,1453,4114,4726,3773,5554,5555,2463,3640,2618,1675,2813, // 4224\n 919,2352,2975,2353,1270,4727,4115,  73,5556,5557, 647,5558,3259,2856,2259,1550, // 4240\n1346,3024,5559,1332, 883,3526,5560,5561,5562,5563,3334,2775,5564,1212, 831,1347, // 4256\n4370,4728,2331,3909,1864,3073, 720,3910,4729,4730,3911,5565,4371,5566,5567,4731, // 4272\n5568,5569,1799,4732,3774,2619,4733,3641,1645,2376,4734,5570,2938, 669,2211,2675, // 4288\n2434,5571,2893,5572,5573,1028,3260,5574,4372,2413,5575,2260,1353,5576,5577,4735, // 4304\n3183, 518,5578,4116,5579,4373,1961,5580,2143,4374,5581,5582,3025,2354,2355,3912, // 4320\n 516,1834,1454,4117,2708,4375,4736,2229,2620,1972,1129,3642,5583,2776,5584,2976, // 4336\n1422, 577,1470,3026,1524,3410,5585,5586, 432,4376,3074,3527,5587,2594,1455,2515, // 4352\n2230,1973,1175,5588,1020,2741,4118,3528,4737,5589,2742,5590,1743,1361,3075,3529, // 4368\n2649,4119,4377,4738,2295, 895, 924,4378,2171, 331,2247,3076, 166,1627,3077,1098, // 4384\n5591,1232,2894,2231,3411,4739, 657, 403,1196,2377, 542,3775,3412,1600,4379,3530, // 4400\n5592,4740,2777,3261, 576, 530,1362,4741,4742,2540,2676,3776,4120,5593, 842,3913, // 4416\n5594,2814,2032,1014,4121, 213,2709,3413, 665, 621,4380,5595,3777,2939,2435,5596, // 4432\n2436,3335,3643,3414,4743,4381,2541,4382,4744,3644,1682,4383,3531,1380,5597, 724, // 4448\n2282, 600,1670,5598,1337,1233,4745,3126,2248,5599,1621,4746,5600, 651,4384,5601, // 4464\n1612,4385,2621,5602,2857,5603,2743,2312,3078,5604, 716,2464,3079, 174,1255,2710, // 4480\n4122,3645, 548,1320,1398, 728,4123,1574,5605,1891,1197,3080,4124,5606,3081,3082, // 4496\n3778,3646,3779, 747,5607, 635,4386,4747,5608,5609,5610,4387,5611,5612,4748,5613, // 4512\n3415,4749,2437, 451,5614,3780,2542,2073,4388,2744,4389,4125,5615,1764,4750,5616, // 4528\n4390, 350,4751,2283,2395,2493,5617,4391,4126,2249,1434,4127, 488,4752, 458,4392, // 4544\n4128,3781, 771,1330,2396,3914,2576,3184,2160,2414,1553,2677,3185,4393,5618,2494, // 4560\n2895,2622,1720,2711,4394,3416,4753,5619,2543,4395,5620,3262,4396,2778,5621,2016, // 4576\n2745,5622,1155,1017,3782,3915,5623,3336,2313, 201,1865,4397,1430,5624,4129,5625, // 4592\n5626,5627,5628,5629,4398,1604,5630, 414,1866, 371,2595,4754,4755,3532,2017,3127, // 4608\n4756,1708, 960,4399, 887, 389,2172,1536,1663,1721,5631,2232,4130,2356,2940,1580, // 4624\n5632,5633,1744,4757,2544,4758,4759,5634,4760,5635,2074,5636,4761,3647,3417,2896, // 4640\n4400,5637,4401,2650,3418,2815, 673,2712,2465, 709,3533,4131,3648,4402,5638,1148, // 4656\n 502, 634,5639,5640,1204,4762,3649,1575,4763,2623,3783,5641,3784,3128, 948,3263, // 4672\n 121,1745,3916,1110,5642,4403,3083,2516,3027,4132,3785,1151,1771,3917,1488,4133, // 4688\n1987,5643,2438,3534,5644,5645,2094,5646,4404,3918,1213,1407,2816, 531,2746,2545, // 4704\n3264,1011,1537,4764,2779,4405,3129,1061,5647,3786,3787,1867,2897,5648,2018, 120, // 4720\n4406,4407,2063,3650,3265,2314,3919,2678,3419,1955,4765,4134,5649,3535,1047,2713, // 4736\n1266,5650,1368,4766,2858, 649,3420,3920,2546,2747,1102,2859,2679,5651,5652,2000, // 4752\n5653,1111,3651,2977,5654,2495,3921,3652,2817,1855,3421,3788,5655,5656,3422,2415, // 4768\n2898,3337,3266,3653,5657,2577,5658,3654,2818,4135,1460, 856,5659,3655,5660,2899, // 4784\n2978,5661,2900,3922,5662,4408, 632,2517, 875,3923,1697,3924,2296,5663,5664,4767, // 4800\n3028,1239, 580,4768,4409,5665, 914, 936,2075,1190,4136,1039,2124,5666,5667,5668, // 4816\n5669,3423,1473,5670,1354,4410,3925,4769,2173,3084,4137, 915,3338,4411,4412,3339, // 4832\n1605,1835,5671,2748, 398,3656,4413,3926,4138, 328,1913,2860,4139,3927,1331,4414, // 4848\n3029, 937,4415,5672,3657,4140,4141,3424,2161,4770,3425, 524, 742, 538,3085,1012, // 4864\n5673,5674,3928,2466,5675, 658,1103, 225,3929,5676,5677,4771,5678,4772,5679,3267, // 4880\n1243,5680,4142, 963,2250,4773,5681,2714,3658,3186,5682,5683,2596,2332,5684,4774, // 4896\n5685,5686,5687,3536, 957,3426,2547,2033,1931,2941,2467, 870,2019,3659,1746,2780, // 4912\n2781,2439,2468,5688,3930,5689,3789,3130,3790,3537,3427,3791,5690,1179,3086,5691, // 4928\n3187,2378,4416,3792,2548,3188,3131,2749,4143,5692,3428,1556,2549,2297, 977,2901, // 4944\n2034,4144,1205,3429,5693,1765,3430,3189,2125,1271, 714,1689,4775,3538,5694,2333, // 4960\n3931, 533,4417,3660,2184, 617,5695,2469,3340,3539,2315,5696,5697,3190,5698,5699, // 4976\n3932,1988, 618, 427,2651,3540,3431,5700,5701,1244,1690,5702,2819,4418,4776,5703, // 4992\n3541,4777,5704,2284,1576, 473,3661,4419,3432, 972,5705,3662,5706,3087,5707,5708, // 5008\n4778,4779,5709,3793,4145,4146,5710, 153,4780, 356,5711,1892,2902,4420,2144, 408, // 5024\n 803,2357,5712,3933,5713,4421,1646,2578,2518,4781,4782,3934,5714,3935,4422,5715, // 5040\n2416,3433, 752,5716,5717,1962,3341,2979,5718, 746,3030,2470,4783,4423,3794, 698, // 5056\n4784,1893,4424,3663,2550,4785,3664,3936,5719,3191,3434,5720,1824,1302,4147,2715, // 5072\n3937,1974,4425,5721,4426,3192, 823,1303,1288,1236,2861,3542,4148,3435, 774,3938, // 5088\n5722,1581,4786,1304,2862,3939,4787,5723,2440,2162,1083,3268,4427,4149,4428, 344, // 5104\n1173, 288,2316, 454,1683,5724,5725,1461,4788,4150,2597,5726,5727,4789, 985, 894, // 5120\n5728,3436,3193,5729,1914,2942,3795,1989,5730,2111,1975,5731,4151,5732,2579,1194, // 5136\n 425,5733,4790,3194,1245,3796,4429,5734,5735,2863,5736, 636,4791,1856,3940, 760, // 5152\n1800,5737,4430,2212,1508,4792,4152,1894,1684,2298,5738,5739,4793,4431,4432,2213, // 5168\n 479,5740,5741, 832,5742,4153,2496,5743,2980,2497,3797, 990,3132, 627,1815,2652, // 5184\n4433,1582,4434,2126,2112,3543,4794,5744, 799,4435,3195,5745,4795,2113,1737,3031, // 5200\n1018, 543, 754,4436,3342,1676,4796,4797,4154,4798,1489,5746,3544,5747,2624,2903, // 5216\n4155,5748,5749,2981,5750,5751,5752,5753,3196,4799,4800,2185,1722,5754,3269,3270, // 5232\n1843,3665,1715, 481, 365,1976,1857,5755,5756,1963,2498,4801,5757,2127,3666,3271, // 5248\n 433,1895,2064,2076,5758, 602,2750,5759,5760,5761,5762,5763,3032,1628,3437,5764, // 5264\n3197,4802,4156,2904,4803,2519,5765,2551,2782,5766,5767,5768,3343,4804,2905,5769, // 5280\n4805,5770,2864,4806,4807,1221,2982,4157,2520,5771,5772,5773,1868,1990,5774,5775, // 5296\n5776,1896,5777,5778,4808,1897,4158, 318,5779,2095,4159,4437,5780,5781, 485,5782, // 5312\n 938,3941, 553,2680, 116,5783,3942,3667,5784,3545,2681,2783,3438,3344,2820,5785, // 5328\n3668,2943,4160,1747,2944,2983,5786,5787, 207,5788,4809,5789,4810,2521,5790,3033, // 5344\n 890,3669,3943,5791,1878,3798,3439,5792,2186,2358,3440,1652,5793,5794,5795, 941, // 5360\n2299, 208,3546,4161,2020, 330,4438,3944,2906,2499,3799,4439,4811,5796,5797,5798, // 5376  //last 512\n\n/*************************************************************************************** \n *Everything below is of no interest for detection purpose\t\t\t\t\t\t\t   *\n ***************************************************************************************\n\n2522,1613,4812,5799,3345,3945,2523,5800,4162,5801,1637,4163,2471,4813,3946,5802, // 5392\n2500,3034,3800,5803,5804,2195,4814,5805,2163,5806,5807,5808,5809,5810,5811,5812, // 5408\n5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828, // 5424\n5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844, // 5440\n5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860, // 5456\n5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876, // 5472\n5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892, // 5488\n5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,5908, // 5504\n5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924, // 5520\n5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940, // 5536\n5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,5953,5954,5955,5956, // 5552\n5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972, // 5568\n5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988, // 5584\n5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6000,6001,6002,6003,6004, // 5600\n6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020, // 5616\n6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036, // 5632\n6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052, // 5648\n6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068, // 5664\n6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084, // 5680\n6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100, // 5696\n6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116, // 5712\n6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,6132, // 5728\n6133,6134,6135,6136,6137,6138,6139,6140,6141,6142,6143,6144,6145,6146,6147,6148, // 5744\n6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164, // 5760\n6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6180, // 5776\n6181,6182,6183,6184,6185,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196, // 5792\n6197,6198,6199,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212, // 5808\n6213,6214,6215,6216,6217,6218,6219,6220,6221,6222,6223,3670,6224,6225,6226,6227, // 5824\n6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,6242,6243, // 5840\n6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,6254,6255,6256,6257,6258,6259, // 5856\n6260,6261,6262,6263,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275, // 5872\n6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,4815,6286,6287,6288,6289,6290, // 5888\n6291,6292,4816,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,6303,6304,6305, // 5904\n6306,6307,6308,6309,6310,6311,4817,4818,6312,6313,6314,6315,6316,6317,6318,4819, // 5920\n6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334, // 5936\n6335,6336,6337,4820,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347,6348,6349, // 5952\n6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365, // 5968\n6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381, // 5984\n6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397, // 6000\n6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,3441,6411,6412, // 6016\n6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6424,6425,4440,6426,6427, // 6032\n6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443, // 6048\n6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,4821,6455,6456,6457,6458, // 6064\n6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474, // 6080\n6475,6476,6477,3947,3948,6478,6479,6480,6481,3272,4441,6482,6483,6484,6485,4442, // 6096\n6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,4822,6497,6498,6499,6500, // 6112\n6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516, // 6128\n6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532, // 6144\n6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548, // 6160\n6549,6550,6551,6552,6553,6554,6555,6556,2784,6557,4823,6558,6559,6560,6561,6562, // 6176\n6563,6564,6565,6566,6567,6568,6569,3949,6570,6571,6572,4824,6573,6574,6575,6576, // 6192\n6577,6578,6579,6580,6581,6582,6583,4825,6584,6585,6586,3950,2785,6587,6588,6589, // 6208\n6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6602,6603,6604,6605, // 6224\n6606,6607,6608,6609,6610,6611,6612,4826,6613,6614,6615,4827,6616,6617,6618,6619, // 6240\n6620,6621,6622,6623,6624,6625,4164,6626,6627,6628,6629,6630,6631,6632,6633,6634, // 6256\n3547,6635,4828,6636,6637,6638,6639,6640,6641,6642,3951,2984,6643,6644,6645,6646, // 6272\n6647,6648,6649,4165,6650,4829,6651,6652,4830,6653,6654,6655,6656,6657,6658,6659, // 6288\n6660,6661,6662,4831,6663,6664,6665,6666,6667,6668,6669,6670,6671,4166,6672,4832, // 6304\n3952,6673,6674,6675,6676,4833,6677,6678,6679,4167,6680,6681,6682,3198,6683,6684, // 6320\n6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,4834,6698,6699, // 6336\n6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715, // 6352\n6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731, // 6368\n6732,6733,6734,4443,6735,6736,6737,6738,6739,6740,6741,6742,6743,6744,6745,4444, // 6384\n6746,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,6758,6759,6760,6761, // 6400\n6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777, // 6416\n6778,6779,6780,6781,4168,6782,6783,3442,6784,6785,6786,6787,6788,6789,6790,6791, // 6432\n4169,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806, // 6448\n6807,6808,6809,6810,6811,4835,6812,6813,6814,4445,6815,6816,4446,6817,6818,6819, // 6464\n6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835, // 6480\n3548,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,4836,6847,6848,6849, // 6496\n6850,6851,6852,6853,6854,3953,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864, // 6512\n6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,3199,6878,6879, // 6528\n6880,6881,6882,4447,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894, // 6544\n6895,6896,6897,6898,6899,6900,6901,6902,6903,6904,4170,6905,6906,6907,6908,6909, // 6560\n6910,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925, // 6576\n6926,6927,4837,6928,6929,6930,6931,6932,6933,6934,6935,6936,3346,6937,6938,4838, // 6592\n6939,6940,6941,4448,6942,6943,6944,6945,6946,4449,6947,6948,6949,6950,6951,6952, // 6608\n6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968, // 6624\n6969,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984, // 6640\n6985,6986,6987,6988,6989,6990,6991,6992,6993,6994,3671,6995,6996,6997,6998,4839, // 6656\n6999,7000,7001,7002,3549,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013, // 6672\n7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,7029, // 6688\n7030,4840,7031,7032,7033,7034,7035,7036,7037,7038,4841,7039,7040,7041,7042,7043, // 6704\n7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059, // 6720\n7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,2985,7071,7072,7073,7074, // 6736\n7075,7076,7077,7078,7079,7080,4842,7081,7082,7083,7084,7085,7086,7087,7088,7089, // 6752\n7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105, // 6768\n7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,4450,7119,7120, // 6784\n7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136, // 6800\n7137,7138,7139,7140,7141,7142,7143,4843,7144,7145,7146,7147,7148,7149,7150,7151, // 6816\n7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167, // 6832\n7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183, // 6848\n7184,7185,7186,7187,7188,4171,4172,7189,7190,7191,7192,7193,7194,7195,7196,7197, // 6864\n7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,7208,7209,7210,7211,7212,7213, // 6880\n7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229, // 6896\n7230,7231,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245, // 6912\n7246,7247,7248,7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261, // 6928\n7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277, // 6944\n7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293, // 6960\n7294,7295,7296,4844,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308, // 6976\n7309,7310,7311,7312,7313,7314,7315,7316,4451,7317,7318,7319,7320,7321,7322,7323, // 6992\n7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339, // 7008\n7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,4173,7354, // 7024\n7355,4845,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369, // 7040\n7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385, // 7056\n7386,7387,7388,4846,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,7400, // 7072\n7401,7402,7403,7404,7405,3672,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415, // 7088\n7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431, // 7104\n7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7446,7447, // 7120\n7448,7449,7450,7451,7452,7453,4452,7454,3200,7455,7456,7457,7458,7459,7460,7461, // 7136\n7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,4847,7475,7476, // 7152\n7477,3133,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,7488,7489,7490,7491, // 7168\n7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,3347,7503,7504,7505,7506, // 7184\n7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,4848, // 7200\n7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537, // 7216\n7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,3801,4849,7550,7551, // 7232\n7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567, // 7248\n7568,7569,3035,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582, // 7264\n7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598, // 7280\n7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614, // 7296\n7615,7616,4850,7617,7618,3802,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628, // 7312\n7629,7630,7631,7632,4851,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643, // 7328\n7644,7645,7646,7647,7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659, // 7344\n7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,4453,7671,7672,7673,7674, // 7360\n7675,7676,7677,7678,7679,7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690, // 7376\n7691,7692,7693,7694,7695,7696,7697,3443,7698,7699,7700,7701,7702,4454,7703,7704, // 7392\n7705,7706,7707,7708,7709,7710,7711,7712,7713,2472,7714,7715,7716,7717,7718,7719, // 7408\n7720,7721,7722,7723,7724,7725,7726,7727,7728,7729,7730,7731,3954,7732,7733,7734, // 7424\n7735,7736,7737,7738,7739,7740,7741,7742,7743,7744,7745,7746,7747,7748,7749,7750, // 7440\n3134,7751,7752,4852,7753,7754,7755,4853,7756,7757,7758,7759,7760,4174,7761,7762, // 7456\n7763,7764,7765,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7778, // 7472\n7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,7792,7793,7794, // 7488\n7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,4854,7806,7807,7808,7809, // 7504\n7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825, // 7520\n4855,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840, // 7536\n7841,7842,7843,7844,7845,7846,7847,3955,7848,7849,7850,7851,7852,7853,7854,7855, // 7552\n7856,7857,7858,7859,7860,3444,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870, // 7568\n7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886, // 7584\n7887,7888,7889,7890,7891,4175,7892,7893,7894,7895,7896,4856,4857,7897,7898,7899, // 7600\n7900,2598,7901,7902,7903,7904,7905,7906,7907,7908,4455,7909,7910,7911,7912,7913, // 7616\n7914,3201,7915,7916,7917,7918,7919,7920,7921,4858,7922,7923,7924,7925,7926,7927, // 7632\n7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943, // 7648\n7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959, // 7664\n7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975, // 7680\n7976,7977,7978,7979,7980,7981,4859,7982,7983,7984,7985,7986,7987,7988,7989,7990, // 7696\n7991,7992,7993,7994,7995,7996,4860,7997,7998,7999,8000,8001,8002,8003,8004,8005, // 7712\n8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,4176,8017,8018,8019,8020, // 7728\n8021,8022,8023,4861,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035, // 7744\n8036,4862,4456,8037,8038,8039,8040,4863,8041,8042,8043,8044,8045,8046,8047,8048, // 7760\n8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064, // 7776\n8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080, // 7792\n8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096, // 7808\n8097,8098,8099,4864,4177,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110, // 7824\n8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,4178,8121,8122,8123,8124,8125, // 7840\n8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141, // 7856\n8142,8143,8144,8145,4865,4866,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155, // 7872\n8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,4179,8166,8167,8168,8169,8170, // 7888\n8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,4457,8182,8183,8184,8185, // 7904\n8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201, // 7920\n8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217, // 7936\n8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233, // 7952\n8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249, // 7968\n8250,8251,8252,8253,8254,8255,8256,3445,8257,8258,8259,8260,8261,8262,4458,8263, // 7984\n8264,8265,8266,8267,8268,8269,8270,8271,8272,4459,8273,8274,8275,8276,3550,8277, // 8000\n8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,4460,8290,8291,8292, // 8016\n8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,4867, // 8032\n8308,8309,8310,8311,8312,3551,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322, // 8048\n8323,8324,8325,8326,4868,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337, // 8064\n8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353, // 8080\n8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,4869,4461,8364,8365,8366,8367, // 8096\n8368,8369,8370,4870,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382, // 8112\n8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398, // 8128\n8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,4871,8411,8412,8413, // 8144\n8414,8415,8416,8417,8418,8419,8420,8421,8422,4462,8423,8424,8425,8426,8427,8428, // 8160\n8429,8430,8431,8432,8433,2986,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443, // 8176\n8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459, // 8192\n8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475, // 8208\n8476,8477,8478,4180,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490, // 8224\n8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506, // 8240\n8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522, // 8256\n8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538, // 8272\n8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554, // 8288\n8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,4872,8565,8566,8567,8568,8569, // 8304\n8570,8571,8572,8573,4873,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584, // 8320\n8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600, // 8336\n8601,8602,8603,8604,8605,3803,8606,8607,8608,8609,8610,8611,8612,8613,4874,3804, // 8352\n8614,8615,8616,8617,8618,8619,8620,8621,3956,8622,8623,8624,8625,8626,8627,8628, // 8368\n8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,2865,8639,8640,8641,8642,8643, // 8384\n8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,4463,8657,8658, // 8400\n8659,4875,4876,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672, // 8416\n8673,8674,8675,8676,8677,8678,8679,8680,8681,4464,8682,8683,8684,8685,8686,8687, // 8432\n8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703, // 8448\n8704,8705,8706,8707,8708,8709,2261,8710,8711,8712,8713,8714,8715,8716,8717,8718, // 8464\n8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,4181, // 8480\n8734,8735,8736,8737,8738,8739,8740,8741,8742,8743,8744,8745,8746,8747,8748,8749, // 8496\n8750,8751,8752,8753,8754,8755,8756,8757,8758,8759,8760,8761,8762,8763,4877,8764, // 8512\n8765,8766,8767,8768,8769,8770,8771,8772,8773,8774,8775,8776,8777,8778,8779,8780, // 8528\n8781,8782,8783,8784,8785,8786,8787,8788,4878,8789,4879,8790,8791,8792,4880,8793, // 8544\n8794,8795,8796,8797,8798,8799,8800,8801,4881,8802,8803,8804,8805,8806,8807,8808, // 8560\n8809,8810,8811,8812,8813,8814,8815,3957,8816,8817,8818,8819,8820,8821,8822,8823, // 8576\n8824,8825,8826,8827,8828,8829,8830,8831,8832,8833,8834,8835,8836,8837,8838,8839, // 8592\n8840,8841,8842,8843,8844,8845,8846,8847,4882,8848,8849,8850,8851,8852,8853,8854, // 8608\n8855,8856,8857,8858,8859,8860,8861,8862,8863,8864,8865,8866,8867,8868,8869,8870, // 8624\n8871,8872,8873,8874,8875,8876,8877,8878,8879,8880,8881,8882,8883,8884,3202,8885, // 8640\n8886,8887,8888,8889,8890,8891,8892,8893,8894,8895,8896,8897,8898,8899,8900,8901, // 8656\n8902,8903,8904,8905,8906,8907,8908,8909,8910,8911,8912,8913,8914,8915,8916,8917, // 8672\n8918,8919,8920,8921,8922,8923,8924,4465,8925,8926,8927,8928,8929,8930,8931,8932, // 8688\n4883,8933,8934,8935,8936,8937,8938,8939,8940,8941,8942,8943,2214,8944,8945,8946, // 8704\n8947,8948,8949,8950,8951,8952,8953,8954,8955,8956,8957,8958,8959,8960,8961,8962, // 8720\n8963,8964,8965,4884,8966,8967,8968,8969,8970,8971,8972,8973,8974,8975,8976,8977, // 8736\n8978,8979,8980,8981,8982,8983,8984,8985,8986,8987,8988,8989,8990,8991,8992,4885, // 8752\n8993,8994,8995,8996,8997,8998,8999,9000,9001,9002,9003,9004,9005,9006,9007,9008, // 8768\n9009,9010,9011,9012,9013,9014,9015,9016,9017,9018,9019,9020,9021,4182,9022,9023, // 8784\n9024,9025,9026,9027,9028,9029,9030,9031,9032,9033,9034,9035,9036,9037,9038,9039, // 8800\n9040,9041,9042,9043,9044,9045,9046,9047,9048,9049,9050,9051,9052,9053,9054,9055, // 8816\n9056,9057,9058,9059,9060,9061,9062,9063,4886,9064,9065,9066,9067,9068,9069,4887, // 8832\n9070,9071,9072,9073,9074,9075,9076,9077,9078,9079,9080,9081,9082,9083,9084,9085, // 8848\n9086,9087,9088,9089,9090,9091,9092,9093,9094,9095,9096,9097,9098,9099,9100,9101, // 8864\n9102,9103,9104,9105,9106,9107,9108,9109,9110,9111,9112,9113,9114,9115,9116,9117, // 8880\n9118,9119,9120,9121,9122,9123,9124,9125,9126,9127,9128,9129,9130,9131,9132,9133, // 8896\n9134,9135,9136,9137,9138,9139,9140,9141,3958,9142,9143,9144,9145,9146,9147,9148, // 8912\n9149,9150,9151,4888,9152,9153,9154,9155,9156,9157,9158,9159,9160,9161,9162,9163, // 8928\n9164,9165,9166,9167,9168,9169,9170,9171,9172,9173,9174,9175,4889,9176,9177,9178, // 8944\n9179,9180,9181,9182,9183,9184,9185,9186,9187,9188,9189,9190,9191,9192,9193,9194, // 8960\n9195,9196,9197,9198,9199,9200,9201,9202,9203,4890,9204,9205,9206,9207,9208,9209, // 8976\n9210,9211,9212,9213,9214,9215,9216,9217,9218,9219,9220,9221,9222,4466,9223,9224, // 8992\n9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240, // 9008\n9241,9242,9243,9244,9245,4891,9246,9247,9248,9249,9250,9251,9252,9253,9254,9255, // 9024\n9256,9257,4892,9258,9259,9260,9261,4893,4894,9262,9263,9264,9265,9266,9267,9268, // 9040\n9269,9270,9271,9272,9273,4467,9274,9275,9276,9277,9278,9279,9280,9281,9282,9283, // 9056\n9284,9285,3673,9286,9287,9288,9289,9290,9291,9292,9293,9294,9295,9296,9297,9298, // 9072\n9299,9300,9301,9302,9303,9304,9305,9306,9307,9308,9309,9310,9311,9312,9313,9314, // 9088\n9315,9316,9317,9318,9319,9320,9321,9322,4895,9323,9324,9325,9326,9327,9328,9329, // 9104\n9330,9331,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345, // 9120\n9346,9347,4468,9348,9349,9350,9351,9352,9353,9354,9355,9356,9357,9358,9359,9360, // 9136\n9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9372,9373,4896,9374,4469, // 9152\n9375,9376,9377,9378,9379,4897,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389, // 9168\n9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,9400,9401,9402,9403,9404,9405, // 9184\n9406,4470,9407,2751,9408,9409,3674,3552,9410,9411,9412,9413,9414,9415,9416,9417, // 9200\n9418,9419,9420,9421,4898,9422,9423,9424,9425,9426,9427,9428,9429,3959,9430,9431, // 9216\n9432,9433,9434,9435,9436,4471,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446, // 9232\n9447,9448,9449,9450,3348,9451,9452,9453,9454,9455,9456,9457,9458,9459,9460,9461, // 9248\n9462,9463,9464,9465,9466,9467,9468,9469,9470,9471,9472,4899,9473,9474,9475,9476, // 9264\n9477,4900,9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,3349,9489,9490, // 9280\n9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506, // 9296\n9507,9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,4901,9521, // 9312\n9522,9523,9524,9525,9526,4902,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536, // 9328\n9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,9548,9549,9550,9551,9552, // 9344\n9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568, // 9360\n9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584, // 9376\n3805,9585,9586,9587,9588,9589,9590,9591,9592,9593,9594,9595,9596,9597,9598,9599, // 9392\n9600,9601,9602,4903,9603,9604,9605,9606,9607,4904,9608,9609,9610,9611,9612,9613, // 9408\n9614,4905,9615,9616,9617,9618,9619,9620,9621,9622,9623,9624,9625,9626,9627,9628, // 9424\n9629,9630,9631,9632,4906,9633,9634,9635,9636,9637,9638,9639,9640,9641,9642,9643, // 9440\n4907,9644,9645,9646,9647,9648,9649,9650,9651,9652,9653,9654,9655,9656,9657,9658, // 9456\n9659,9660,9661,9662,9663,9664,9665,9666,9667,9668,9669,9670,9671,9672,4183,9673, // 9472\n9674,9675,9676,9677,4908,9678,9679,9680,9681,4909,9682,9683,9684,9685,9686,9687, // 9488\n9688,9689,9690,4910,9691,9692,9693,3675,9694,9695,9696,2945,9697,9698,9699,9700, // 9504\n9701,9702,9703,9704,9705,4911,9706,9707,9708,9709,9710,9711,9712,9713,9714,9715, // 9520\n9716,9717,9718,9719,9720,9721,9722,9723,9724,9725,9726,9727,9728,9729,9730,9731, // 9536\n9732,9733,9734,9735,4912,9736,9737,9738,9739,9740,4913,9741,9742,9743,9744,9745, // 9552\n9746,9747,9748,9749,9750,9751,9752,9753,9754,9755,9756,9757,9758,4914,9759,9760, // 9568\n9761,9762,9763,9764,9765,9766,9767,9768,9769,9770,9771,9772,9773,9774,9775,9776, // 9584\n9777,9778,9779,9780,9781,9782,4915,9783,9784,9785,9786,9787,9788,9789,9790,9791, // 9600\n9792,9793,4916,9794,9795,9796,9797,9798,9799,9800,9801,9802,9803,9804,9805,9806, // 9616\n9807,9808,9809,9810,9811,9812,9813,9814,9815,9816,9817,9818,9819,9820,9821,9822, // 9632\n9823,9824,9825,9826,9827,9828,9829,9830,9831,9832,9833,9834,9835,9836,9837,9838, // 9648\n9839,9840,9841,9842,9843,9844,9845,9846,9847,9848,9849,9850,9851,9852,9853,9854, // 9664\n9855,9856,9857,9858,9859,9860,9861,9862,9863,9864,9865,9866,9867,9868,4917,9869, // 9680\n9870,9871,9872,9873,9874,9875,9876,9877,9878,9879,9880,9881,9882,9883,9884,9885, // 9696\n9886,9887,9888,9889,9890,9891,9892,4472,9893,9894,9895,9896,9897,3806,9898,9899, // 9712\n9900,9901,9902,9903,9904,9905,9906,9907,9908,9909,9910,9911,9912,9913,9914,4918, // 9728\n9915,9916,9917,4919,9918,9919,9920,9921,4184,9922,9923,9924,9925,9926,9927,9928, // 9744\n9929,9930,9931,9932,9933,9934,9935,9936,9937,9938,9939,9940,9941,9942,9943,9944, // 9760\n9945,9946,4920,9947,9948,9949,9950,9951,9952,9953,9954,9955,4185,9956,9957,9958, // 9776\n9959,9960,9961,9962,9963,9964,9965,4921,9966,9967,9968,4473,9969,9970,9971,9972, // 9792\n9973,9974,9975,9976,9977,4474,9978,9979,9980,9981,9982,9983,9984,9985,9986,9987, // 9808\n9988,9989,9990,9991,9992,9993,9994,9995,9996,9997,9998,9999,10000,10001,10002,10003, // 9824\n10004,10005,10006,10007,10008,10009,10010,10011,10012,10013,10014,10015,10016,10017,10018,10019, // 9840\n10020,10021,4922,10022,4923,10023,10024,10025,10026,10027,10028,10029,10030,10031,10032,10033, // 9856\n10034,10035,10036,10037,10038,10039,10040,10041,10042,10043,10044,10045,10046,10047,10048,4924, // 9872\n10049,10050,10051,10052,10053,10054,10055,10056,10057,10058,10059,10060,10061,10062,10063,10064, // 9888\n10065,10066,10067,10068,10069,10070,10071,10072,10073,10074,10075,10076,10077,10078,10079,10080, // 9904\n10081,10082,10083,10084,10085,10086,10087,4475,10088,10089,10090,10091,10092,10093,10094,10095, // 9920\n10096,10097,4476,10098,10099,10100,10101,10102,10103,10104,10105,10106,10107,10108,10109,10110, // 9936\n10111,2174,10112,10113,10114,10115,10116,10117,10118,10119,10120,10121,10122,10123,10124,10125, // 9952\n10126,10127,10128,10129,10130,10131,10132,10133,10134,10135,10136,10137,10138,10139,10140,3807, // 9968\n4186,4925,10141,10142,10143,10144,10145,10146,10147,4477,4187,10148,10149,10150,10151,10152, // 9984\n10153,4188,10154,10155,10156,10157,10158,10159,10160,10161,4926,10162,10163,10164,10165,10166, //10000\n10167,10168,10169,10170,10171,10172,10173,10174,10175,10176,10177,10178,10179,10180,10181,10182, //10016\n10183,10184,10185,10186,10187,10188,10189,10190,10191,10192,3203,10193,10194,10195,10196,10197, //10032\n10198,10199,10200,4478,10201,10202,10203,10204,4479,10205,10206,10207,10208,10209,10210,10211, //10048\n10212,10213,10214,10215,10216,10217,10218,10219,10220,10221,10222,10223,10224,10225,10226,10227, //10064\n10228,10229,10230,10231,10232,10233,10234,4927,10235,10236,10237,10238,10239,10240,10241,10242, //10080\n10243,10244,10245,10246,10247,10248,10249,10250,10251,10252,10253,10254,10255,10256,10257,10258, //10096\n10259,10260,10261,10262,10263,10264,10265,10266,10267,10268,10269,10270,10271,10272,10273,4480, //10112\n4928,4929,10274,10275,10276,10277,10278,10279,10280,10281,10282,10283,10284,10285,10286,10287, //10128\n10288,10289,10290,10291,10292,10293,10294,10295,10296,10297,10298,10299,10300,10301,10302,10303, //10144\n10304,10305,10306,10307,10308,10309,10310,10311,10312,10313,10314,10315,10316,10317,10318,10319, //10160\n10320,10321,10322,10323,10324,10325,10326,10327,10328,10329,10330,10331,10332,10333,10334,4930, //10176\n10335,10336,10337,10338,10339,10340,10341,10342,4931,10343,10344,10345,10346,10347,10348,10349, //10192\n10350,10351,10352,10353,10354,10355,3088,10356,2786,10357,10358,10359,10360,4189,10361,10362, //10208\n10363,10364,10365,10366,10367,10368,10369,10370,10371,10372,10373,10374,10375,4932,10376,10377, //10224\n10378,10379,10380,10381,10382,10383,10384,10385,10386,10387,10388,10389,10390,10391,10392,4933, //10240\n10393,10394,10395,4934,10396,10397,10398,10399,10400,10401,10402,10403,10404,10405,10406,10407, //10256\n10408,10409,10410,10411,10412,3446,10413,10414,10415,10416,10417,10418,10419,10420,10421,10422, //10272\n10423,4935,10424,10425,10426,10427,10428,10429,10430,4936,10431,10432,10433,10434,10435,10436, //10288\n10437,10438,10439,10440,10441,10442,10443,4937,10444,10445,10446,10447,4481,10448,10449,10450, //10304\n10451,10452,10453,10454,10455,10456,10457,10458,10459,10460,10461,10462,10463,10464,10465,10466, //10320\n10467,10468,10469,10470,10471,10472,10473,10474,10475,10476,10477,10478,10479,10480,10481,10482, //10336\n10483,10484,10485,10486,10487,10488,10489,10490,10491,10492,10493,10494,10495,10496,10497,10498, //10352\n10499,10500,10501,10502,10503,10504,10505,4938,10506,10507,10508,10509,10510,2552,10511,10512, //10368\n10513,10514,10515,10516,3447,10517,10518,10519,10520,10521,10522,10523,10524,10525,10526,10527, //10384\n10528,10529,10530,10531,10532,10533,10534,10535,10536,10537,10538,10539,10540,10541,10542,10543, //10400\n4482,10544,4939,10545,10546,10547,10548,10549,10550,10551,10552,10553,10554,10555,10556,10557, //10416\n10558,10559,10560,10561,10562,10563,10564,10565,10566,10567,3676,4483,10568,10569,10570,10571, //10432\n10572,3448,10573,10574,10575,10576,10577,10578,10579,10580,10581,10582,10583,10584,10585,10586, //10448\n10587,10588,10589,10590,10591,10592,10593,10594,10595,10596,10597,10598,10599,10600,10601,10602, //10464\n10603,10604,10605,10606,10607,10608,10609,10610,10611,10612,10613,10614,10615,10616,10617,10618, //10480\n10619,10620,10621,10622,10623,10624,10625,10626,10627,4484,10628,10629,10630,10631,10632,4940, //10496\n10633,10634,10635,10636,10637,10638,10639,10640,10641,10642,10643,10644,10645,10646,10647,10648, //10512\n10649,10650,10651,10652,10653,10654,10655,10656,4941,10657,10658,10659,2599,10660,10661,10662, //10528\n10663,10664,10665,10666,3089,10667,10668,10669,10670,10671,10672,10673,10674,10675,10676,10677, //10544\n10678,10679,10680,4942,10681,10682,10683,10684,10685,10686,10687,10688,10689,10690,10691,10692, //10560\n10693,10694,10695,10696,10697,4485,10698,10699,10700,10701,10702,10703,10704,4943,10705,3677, //10576\n10706,10707,10708,10709,10710,10711,10712,4944,10713,10714,10715,10716,10717,10718,10719,10720, //10592\n10721,10722,10723,10724,10725,10726,10727,10728,4945,10729,10730,10731,10732,10733,10734,10735, //10608\n10736,10737,10738,10739,10740,10741,10742,10743,10744,10745,10746,10747,10748,10749,10750,10751, //10624\n10752,10753,10754,10755,10756,10757,10758,10759,10760,10761,4946,10762,10763,10764,10765,10766, //10640\n10767,4947,4948,10768,10769,10770,10771,10772,10773,10774,10775,10776,10777,10778,10779,10780, //10656\n10781,10782,10783,10784,10785,10786,10787,10788,10789,10790,10791,10792,10793,10794,10795,10796, //10672\n10797,10798,10799,10800,10801,10802,10803,10804,10805,10806,10807,10808,10809,10810,10811,10812, //10688\n10813,10814,10815,10816,10817,10818,10819,10820,10821,10822,10823,10824,10825,10826,10827,10828, //10704\n10829,10830,10831,10832,10833,10834,10835,10836,10837,10838,10839,10840,10841,10842,10843,10844, //10720\n10845,10846,10847,10848,10849,10850,10851,10852,10853,10854,10855,10856,10857,10858,10859,10860, //10736\n10861,10862,10863,10864,10865,10866,10867,10868,10869,10870,10871,10872,10873,10874,10875,10876, //10752\n10877,10878,4486,10879,10880,10881,10882,10883,10884,10885,4949,10886,10887,10888,10889,10890, //10768\n10891,10892,10893,10894,10895,10896,10897,10898,10899,10900,10901,10902,10903,10904,10905,10906, //10784\n10907,10908,10909,10910,10911,10912,10913,10914,10915,10916,10917,10918,10919,4487,10920,10921, //10800\n10922,10923,10924,10925,10926,10927,10928,10929,10930,10931,10932,4950,10933,10934,10935,10936, //10816\n10937,10938,10939,10940,10941,10942,10943,10944,10945,10946,10947,10948,10949,4488,10950,10951, //10832\n10952,10953,10954,10955,10956,10957,10958,10959,4190,10960,10961,10962,10963,10964,10965,10966, //10848\n10967,10968,10969,10970,10971,10972,10973,10974,10975,10976,10977,10978,10979,10980,10981,10982, //10864\n10983,10984,10985,10986,10987,10988,10989,10990,10991,10992,10993,10994,10995,10996,10997,10998, //10880\n10999,11000,11001,11002,11003,11004,11005,11006,3960,11007,11008,11009,11010,11011,11012,11013, //10896\n11014,11015,11016,11017,11018,11019,11020,11021,11022,11023,11024,11025,11026,11027,11028,11029, //10912\n11030,11031,11032,4951,11033,11034,11035,11036,11037,11038,11039,11040,11041,11042,11043,11044, //10928\n11045,11046,11047,4489,11048,11049,11050,11051,4952,11052,11053,11054,11055,11056,11057,11058, //10944\n4953,11059,11060,11061,11062,11063,11064,11065,11066,11067,11068,11069,11070,11071,4954,11072, //10960\n11073,11074,11075,11076,11077,11078,11079,11080,11081,11082,11083,11084,11085,11086,11087,11088, //10976\n11089,11090,11091,11092,11093,11094,11095,11096,11097,11098,11099,11100,11101,11102,11103,11104, //10992\n11105,11106,11107,11108,11109,11110,11111,11112,11113,11114,11115,3808,11116,11117,11118,11119, //11008\n11120,11121,11122,11123,11124,11125,11126,11127,11128,11129,11130,11131,11132,11133,11134,4955, //11024\n11135,11136,11137,11138,11139,11140,11141,11142,11143,11144,11145,11146,11147,11148,11149,11150, //11040\n11151,11152,11153,11154,11155,11156,11157,11158,11159,11160,11161,4956,11162,11163,11164,11165, //11056\n11166,11167,11168,11169,11170,11171,11172,11173,11174,11175,11176,11177,11178,11179,11180,4957, //11072\n11181,11182,11183,11184,11185,11186,4958,11187,11188,11189,11190,11191,11192,11193,11194,11195, //11088\n11196,11197,11198,11199,11200,3678,11201,11202,11203,11204,11205,11206,4191,11207,11208,11209, //11104\n11210,11211,11212,11213,11214,11215,11216,11217,11218,11219,11220,11221,11222,11223,11224,11225, //11120\n11226,11227,11228,11229,11230,11231,11232,11233,11234,11235,11236,11237,11238,11239,11240,11241, //11136\n11242,11243,11244,11245,11246,11247,11248,11249,11250,11251,4959,11252,11253,11254,11255,11256, //11152\n11257,11258,11259,11260,11261,11262,11263,11264,11265,11266,11267,11268,11269,11270,11271,11272, //11168\n11273,11274,11275,11276,11277,11278,11279,11280,11281,11282,11283,11284,11285,11286,11287,11288, //11184\n11289,11290,11291,11292,11293,11294,11295,11296,11297,11298,11299,11300,11301,11302,11303,11304, //11200\n11305,11306,11307,11308,11309,11310,11311,11312,11313,11314,3679,11315,11316,11317,11318,4490, //11216\n11319,11320,11321,11322,11323,11324,11325,11326,11327,11328,11329,11330,11331,11332,11333,11334, //11232\n11335,11336,11337,11338,11339,11340,11341,11342,11343,11344,11345,11346,11347,4960,11348,11349, //11248\n11350,11351,11352,11353,11354,11355,11356,11357,11358,11359,11360,11361,11362,11363,11364,11365, //11264\n11366,11367,11368,11369,11370,11371,11372,11373,11374,11375,11376,11377,3961,4961,11378,11379, //11280\n11380,11381,11382,11383,11384,11385,11386,11387,11388,11389,11390,11391,11392,11393,11394,11395, //11296\n11396,11397,4192,11398,11399,11400,11401,11402,11403,11404,11405,11406,11407,11408,11409,11410, //11312\n11411,4962,11412,11413,11414,11415,11416,11417,11418,11419,11420,11421,11422,11423,11424,11425, //11328\n11426,11427,11428,11429,11430,11431,11432,11433,11434,11435,11436,11437,11438,11439,11440,11441, //11344\n11442,11443,11444,11445,11446,11447,11448,11449,11450,11451,11452,11453,11454,11455,11456,11457, //11360\n11458,11459,11460,11461,11462,11463,11464,11465,11466,11467,11468,11469,4963,11470,11471,4491, //11376\n11472,11473,11474,11475,4964,11476,11477,11478,11479,11480,11481,11482,11483,11484,11485,11486, //11392\n11487,11488,11489,11490,11491,11492,4965,11493,11494,11495,11496,11497,11498,11499,11500,11501, //11408\n11502,11503,11504,11505,11506,11507,11508,11509,11510,11511,11512,11513,11514,11515,11516,11517, //11424\n11518,11519,11520,11521,11522,11523,11524,11525,11526,11527,11528,11529,3962,11530,11531,11532, //11440\n11533,11534,11535,11536,11537,11538,11539,11540,11541,11542,11543,11544,11545,11546,11547,11548, //11456\n11549,11550,11551,11552,11553,11554,11555,11556,11557,11558,11559,11560,11561,11562,11563,11564, //11472\n4193,4194,11565,11566,11567,11568,11569,11570,11571,11572,11573,11574,11575,11576,11577,11578, //11488\n11579,11580,11581,11582,11583,11584,11585,11586,11587,11588,11589,11590,11591,4966,4195,11592, //11504\n11593,11594,11595,11596,11597,11598,11599,11600,11601,11602,11603,11604,3090,11605,11606,11607, //11520\n11608,11609,11610,4967,11611,11612,11613,11614,11615,11616,11617,11618,11619,11620,11621,11622, //11536\n11623,11624,11625,11626,11627,11628,11629,11630,11631,11632,11633,11634,11635,11636,11637,11638, //11552\n11639,11640,11641,11642,11643,11644,11645,11646,11647,11648,11649,11650,11651,11652,11653,11654, //11568\n11655,11656,11657,11658,11659,11660,11661,11662,11663,11664,11665,11666,11667,11668,11669,11670, //11584\n11671,11672,11673,11674,4968,11675,11676,11677,11678,11679,11680,11681,11682,11683,11684,11685, //11600\n11686,11687,11688,11689,11690,11691,11692,11693,3809,11694,11695,11696,11697,11698,11699,11700, //11616\n11701,11702,11703,11704,11705,11706,11707,11708,11709,11710,11711,11712,11713,11714,11715,11716, //11632\n11717,11718,3553,11719,11720,11721,11722,11723,11724,11725,11726,11727,11728,11729,11730,4969, //11648\n11731,11732,11733,11734,11735,11736,11737,11738,11739,11740,4492,11741,11742,11743,11744,11745, //11664\n11746,11747,11748,11749,11750,11751,11752,4970,11753,11754,11755,11756,11757,11758,11759,11760, //11680\n11761,11762,11763,11764,11765,11766,11767,11768,11769,11770,11771,11772,11773,11774,11775,11776, //11696\n11777,11778,11779,11780,11781,11782,11783,11784,11785,11786,11787,11788,11789,11790,4971,11791, //11712\n11792,11793,11794,11795,11796,11797,4972,11798,11799,11800,11801,11802,11803,11804,11805,11806, //11728\n11807,11808,11809,11810,4973,11811,11812,11813,11814,11815,11816,11817,11818,11819,11820,11821, //11744\n11822,11823,11824,11825,11826,11827,11828,11829,11830,11831,11832,11833,11834,3680,3810,11835, //11760\n11836,4974,11837,11838,11839,11840,11841,11842,11843,11844,11845,11846,11847,11848,11849,11850, //11776\n11851,11852,11853,11854,11855,11856,11857,11858,11859,11860,11861,11862,11863,11864,11865,11866, //11792\n11867,11868,11869,11870,11871,11872,11873,11874,11875,11876,11877,11878,11879,11880,11881,11882, //11808\n11883,11884,4493,11885,11886,11887,11888,11889,11890,11891,11892,11893,11894,11895,11896,11897, //11824\n11898,11899,11900,11901,11902,11903,11904,11905,11906,11907,11908,11909,11910,11911,11912,11913, //11840\n11914,11915,4975,11916,11917,11918,11919,11920,11921,11922,11923,11924,11925,11926,11927,11928, //11856\n11929,11930,11931,11932,11933,11934,11935,11936,11937,11938,11939,11940,11941,11942,11943,11944, //11872\n11945,11946,11947,11948,11949,4976,11950,11951,11952,11953,11954,11955,11956,11957,11958,11959, //11888\n11960,11961,11962,11963,11964,11965,11966,11967,11968,11969,11970,11971,11972,11973,11974,11975, //11904\n11976,11977,11978,11979,11980,11981,11982,11983,11984,11985,11986,11987,4196,11988,11989,11990, //11920\n11991,11992,4977,11993,11994,11995,11996,11997,11998,11999,12000,12001,12002,12003,12004,12005, //11936\n12006,12007,12008,12009,12010,12011,12012,12013,12014,12015,12016,12017,12018,12019,12020,12021, //11952\n12022,12023,12024,12025,12026,12027,12028,12029,12030,12031,12032,12033,12034,12035,12036,12037, //11968\n12038,12039,12040,12041,12042,12043,12044,12045,12046,12047,12048,12049,12050,12051,12052,12053, //11984\n12054,12055,12056,12057,12058,12059,12060,12061,4978,12062,12063,12064,12065,12066,12067,12068, //12000\n12069,12070,12071,12072,12073,12074,12075,12076,12077,12078,12079,12080,12081,12082,12083,12084, //12016\n12085,12086,12087,12088,12089,12090,12091,12092,12093,12094,12095,12096,12097,12098,12099,12100, //12032\n12101,12102,12103,12104,12105,12106,12107,12108,12109,12110,12111,12112,12113,12114,12115,12116, //12048\n12117,12118,12119,12120,12121,12122,12123,4979,12124,12125,12126,12127,12128,4197,12129,12130, //12064\n12131,12132,12133,12134,12135,12136,12137,12138,12139,12140,12141,12142,12143,12144,12145,12146, //12080\n12147,12148,12149,12150,12151,12152,12153,12154,4980,12155,12156,12157,12158,12159,12160,4494, //12096\n12161,12162,12163,12164,3811,12165,12166,12167,12168,12169,4495,12170,12171,4496,12172,12173, //12112\n12174,12175,12176,3812,12177,12178,12179,12180,12181,12182,12183,12184,12185,12186,12187,12188, //12128\n12189,12190,12191,12192,12193,12194,12195,12196,12197,12198,12199,12200,12201,12202,12203,12204, //12144\n12205,12206,12207,12208,12209,12210,12211,12212,12213,12214,12215,12216,12217,12218,12219,12220, //12160\n12221,4981,12222,12223,12224,12225,12226,12227,12228,12229,12230,12231,12232,12233,12234,12235, //12176\n4982,12236,12237,12238,12239,12240,12241,12242,12243,12244,12245,4983,12246,12247,12248,12249, //12192\n4984,12250,12251,12252,12253,12254,12255,12256,12257,12258,12259,12260,12261,12262,12263,12264, //12208\n4985,12265,4497,12266,12267,12268,12269,12270,12271,12272,12273,12274,12275,12276,12277,12278, //12224\n12279,12280,12281,12282,12283,12284,12285,12286,12287,4986,12288,12289,12290,12291,12292,12293, //12240\n12294,12295,12296,2473,12297,12298,12299,12300,12301,12302,12303,12304,12305,12306,12307,12308, //12256\n12309,12310,12311,12312,12313,12314,12315,12316,12317,12318,12319,3963,12320,12321,12322,12323, //12272\n12324,12325,12326,12327,12328,12329,12330,12331,12332,4987,12333,12334,12335,12336,12337,12338, //12288\n12339,12340,12341,12342,12343,12344,12345,12346,12347,12348,12349,12350,12351,12352,12353,12354, //12304\n12355,12356,12357,12358,12359,3964,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369, //12320\n12370,3965,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384, //12336\n12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400, //12352\n12401,12402,12403,12404,12405,12406,12407,12408,4988,12409,12410,12411,12412,12413,12414,12415, //12368\n12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431, //12384\n12432,12433,12434,12435,12436,12437,12438,3554,12439,12440,12441,12442,12443,12444,12445,12446, //12400\n12447,12448,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462, //12416\n12463,12464,4989,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477, //12432\n12478,12479,12480,4990,12481,12482,12483,12484,12485,12486,12487,12488,12489,4498,12490,12491, //12448\n12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507, //12464\n12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523, //12480\n12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,12535,12536,12537,12538,12539, //12496\n12540,12541,12542,12543,12544,12545,12546,12547,12548,12549,12550,12551,4991,12552,12553,12554, //12512\n12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570, //12528\n12571,12572,12573,12574,12575,12576,12577,12578,3036,12579,12580,12581,12582,12583,3966,12584, //12544\n12585,12586,12587,12588,12589,12590,12591,12592,12593,12594,12595,12596,12597,12598,12599,12600, //12560\n12601,12602,12603,12604,12605,12606,12607,12608,12609,12610,12611,12612,12613,12614,12615,12616, //12576\n12617,12618,12619,12620,12621,12622,12623,12624,12625,12626,12627,12628,12629,12630,12631,12632, //12592\n12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643,12644,12645,12646,4499,12647, //12608\n12648,12649,12650,12651,12652,12653,12654,12655,12656,12657,12658,12659,12660,12661,12662,12663, //12624\n12664,12665,12666,12667,12668,12669,12670,12671,12672,12673,12674,12675,12676,12677,12678,12679, //12640\n12680,12681,12682,12683,12684,12685,12686,12687,12688,12689,12690,12691,12692,12693,12694,12695, //12656\n12696,12697,12698,4992,12699,12700,12701,12702,12703,12704,12705,12706,12707,12708,12709,12710, //12672\n12711,12712,12713,12714,12715,12716,12717,12718,12719,12720,12721,12722,12723,12724,12725,12726, //12688\n12727,12728,12729,12730,12731,12732,12733,12734,12735,12736,12737,12738,12739,12740,12741,12742, //12704\n12743,12744,12745,12746,12747,12748,12749,12750,12751,12752,12753,12754,12755,12756,12757,12758, //12720\n12759,12760,12761,12762,12763,12764,12765,12766,12767,12768,12769,12770,12771,12772,12773,12774, //12736\n12775,12776,12777,12778,4993,2175,12779,12780,12781,12782,12783,12784,12785,12786,4500,12787, //12752\n12788,12789,12790,12791,12792,12793,12794,12795,12796,12797,12798,12799,12800,12801,12802,12803, //12768\n12804,12805,12806,12807,12808,12809,12810,12811,12812,12813,12814,12815,12816,12817,12818,12819, //12784\n12820,12821,12822,12823,12824,12825,12826,4198,3967,12827,12828,12829,12830,12831,12832,12833, //12800\n12834,12835,12836,12837,12838,12839,12840,12841,12842,12843,12844,12845,12846,12847,12848,12849, //12816\n12850,12851,12852,12853,12854,12855,12856,12857,12858,12859,12860,12861,4199,12862,12863,12864, //12832\n12865,12866,12867,12868,12869,12870,12871,12872,12873,12874,12875,12876,12877,12878,12879,12880, //12848\n12881,12882,12883,12884,12885,12886,12887,4501,12888,12889,12890,12891,12892,12893,12894,12895, //12864\n12896,12897,12898,12899,12900,12901,12902,12903,12904,12905,12906,12907,12908,12909,12910,12911, //12880\n12912,4994,12913,12914,12915,12916,12917,12918,12919,12920,12921,12922,12923,12924,12925,12926, //12896\n12927,12928,12929,12930,12931,12932,12933,12934,12935,12936,12937,12938,12939,12940,12941,12942, //12912\n12943,12944,12945,12946,12947,12948,12949,12950,12951,12952,12953,12954,12955,12956,1772,12957, //12928\n12958,12959,12960,12961,12962,12963,12964,12965,12966,12967,12968,12969,12970,12971,12972,12973, //12944\n12974,12975,12976,12977,12978,12979,12980,12981,12982,12983,12984,12985,12986,12987,12988,12989, //12960\n12990,12991,12992,12993,12994,12995,12996,12997,4502,12998,4503,12999,13000,13001,13002,13003, //12976\n4504,13004,13005,13006,13007,13008,13009,13010,13011,13012,13013,13014,13015,13016,13017,13018, //12992\n13019,13020,13021,13022,13023,13024,13025,13026,13027,13028,13029,3449,13030,13031,13032,13033, //13008\n13034,13035,13036,13037,13038,13039,13040,13041,13042,13043,13044,13045,13046,13047,13048,13049, //13024\n13050,13051,13052,13053,13054,13055,13056,13057,13058,13059,13060,13061,13062,13063,13064,13065, //13040\n13066,13067,13068,13069,13070,13071,13072,13073,13074,13075,13076,13077,13078,13079,13080,13081, //13056\n13082,13083,13084,13085,13086,13087,13088,13089,13090,13091,13092,13093,13094,13095,13096,13097, //13072\n13098,13099,13100,13101,13102,13103,13104,13105,13106,13107,13108,13109,13110,13111,13112,13113, //13088\n13114,13115,13116,13117,13118,3968,13119,4995,13120,13121,13122,13123,13124,13125,13126,13127, //13104\n4505,13128,13129,13130,13131,13132,13133,13134,4996,4506,13135,13136,13137,13138,13139,4997, //13120\n13140,13141,13142,13143,13144,13145,13146,13147,13148,13149,13150,13151,13152,13153,13154,13155, //13136\n13156,13157,13158,13159,4998,13160,13161,13162,13163,13164,13165,13166,13167,13168,13169,13170, //13152\n13171,13172,13173,13174,13175,13176,4999,13177,13178,13179,13180,13181,13182,13183,13184,13185, //13168\n13186,13187,13188,13189,13190,13191,13192,13193,13194,13195,13196,13197,13198,13199,13200,13201, //13184\n13202,13203,13204,13205,13206,5000,13207,13208,13209,13210,13211,13212,13213,13214,13215,13216, //13200\n13217,13218,13219,13220,13221,13222,13223,13224,13225,13226,13227,4200,5001,13228,13229,13230, //13216\n13231,13232,13233,13234,13235,13236,13237,13238,13239,13240,3969,13241,13242,13243,13244,3970, //13232\n13245,13246,13247,13248,13249,13250,13251,13252,13253,13254,13255,13256,13257,13258,13259,13260, //13248\n13261,13262,13263,13264,13265,13266,13267,13268,3450,13269,13270,13271,13272,13273,13274,13275, //13264\n13276,5002,13277,13278,13279,13280,13281,13282,13283,13284,13285,13286,13287,13288,13289,13290, //13280\n13291,13292,13293,13294,13295,13296,13297,13298,13299,13300,13301,13302,3813,13303,13304,13305, //13296\n13306,13307,13308,13309,13310,13311,13312,13313,13314,13315,13316,13317,13318,13319,13320,13321, //13312\n13322,13323,13324,13325,13326,13327,13328,4507,13329,13330,13331,13332,13333,13334,13335,13336, //13328\n13337,13338,13339,13340,13341,5003,13342,13343,13344,13345,13346,13347,13348,13349,13350,13351, //13344\n13352,13353,13354,13355,13356,13357,13358,13359,13360,13361,13362,13363,13364,13365,13366,13367, //13360\n5004,13368,13369,13370,13371,13372,13373,13374,13375,13376,13377,13378,13379,13380,13381,13382, //13376\n13383,13384,13385,13386,13387,13388,13389,13390,13391,13392,13393,13394,13395,13396,13397,13398, //13392\n13399,13400,13401,13402,13403,13404,13405,13406,13407,13408,13409,13410,13411,13412,13413,13414, //13408\n13415,13416,13417,13418,13419,13420,13421,13422,13423,13424,13425,13426,13427,13428,13429,13430, //13424\n13431,13432,4508,13433,13434,13435,4201,13436,13437,13438,13439,13440,13441,13442,13443,13444, //13440\n13445,13446,13447,13448,13449,13450,13451,13452,13453,13454,13455,13456,13457,5005,13458,13459, //13456\n13460,13461,13462,13463,13464,13465,13466,13467,13468,13469,13470,4509,13471,13472,13473,13474, //13472\n13475,13476,13477,13478,13479,13480,13481,13482,13483,13484,13485,13486,13487,13488,13489,13490, //13488\n13491,13492,13493,13494,13495,13496,13497,13498,13499,13500,13501,13502,13503,13504,13505,13506, //13504\n13507,13508,13509,13510,13511,13512,13513,13514,13515,13516,13517,13518,13519,13520,13521,13522, //13520\n13523,13524,13525,13526,13527,13528,13529,13530,13531,13532,13533,13534,13535,13536,13537,13538, //13536\n13539,13540,13541,13542,13543,13544,13545,13546,13547,13548,13549,13550,13551,13552,13553,13554, //13552\n13555,13556,13557,13558,13559,13560,13561,13562,13563,13564,13565,13566,13567,13568,13569,13570, //13568\n13571,13572,13573,13574,13575,13576,13577,13578,13579,13580,13581,13582,13583,13584,13585,13586, //13584\n13587,13588,13589,13590,13591,13592,13593,13594,13595,13596,13597,13598,13599,13600,13601,13602, //13600\n13603,13604,13605,13606,13607,13608,13609,13610,13611,13612,13613,13614,13615,13616,13617,13618, //13616\n13619,13620,13621,13622,13623,13624,13625,13626,13627,13628,13629,13630,13631,13632,13633,13634, //13632\n13635,13636,13637,13638,13639,13640,13641,13642,5006,13643,13644,13645,13646,13647,13648,13649, //13648\n13650,13651,5007,13652,13653,13654,13655,13656,13657,13658,13659,13660,13661,13662,13663,13664, //13664\n13665,13666,13667,13668,13669,13670,13671,13672,13673,13674,13675,13676,13677,13678,13679,13680, //13680\n13681,13682,13683,13684,13685,13686,13687,13688,13689,13690,13691,13692,13693,13694,13695,13696, //13696\n13697,13698,13699,13700,13701,13702,13703,13704,13705,13706,13707,13708,13709,13710,13711,13712, //13712\n13713,13714,13715,13716,13717,13718,13719,13720,13721,13722,13723,13724,13725,13726,13727,13728, //13728\n13729,13730,13731,13732,13733,13734,13735,13736,13737,13738,13739,13740,13741,13742,13743,13744, //13744\n13745,13746,13747,13748,13749,13750,13751,13752,13753,13754,13755,13756,13757,13758,13759,13760, //13760\n13761,13762,13763,13764,13765,13766,13767,13768,13769,13770,13771,13772,13773,13774,3273,13775, //13776\n13776,13777,13778,13779,13780,13781,13782,13783,13784,13785,13786,13787,13788,13789,13790,13791, //13792\n13792,13793,13794,13795,13796,13797,13798,13799,13800,13801,13802,13803,13804,13805,13806,13807, //13808\n13808,13809,13810,13811,13812,13813,13814,13815,13816,13817,13818,13819,13820,13821,13822,13823, //13824\n13824,13825,13826,13827,13828,13829,13830,13831,13832,13833,13834,13835,13836,13837,13838,13839, //13840\n13840,13841,13842,13843,13844,13845,13846,13847,13848,13849,13850,13851,13852,13853,13854,13855, //13856\n13856,13857,13858,13859,13860,13861,13862,13863,13864,13865,13866,13867,13868,13869,13870,13871, //13872\n13872,13873,13874,13875,13876,13877,13878,13879,13880,13881,13882,13883,13884,13885,13886,13887, //13888\n13888,13889,13890,13891,13892,13893,13894,13895,13896,13897,13898,13899,13900,13901,13902,13903, //13904\n13904,13905,13906,13907,13908,13909,13910,13911,13912,13913,13914,13915,13916,13917,13918,13919, //13920\n13920,13921,13922,13923,13924,13925,13926,13927,13928,13929,13930,13931,13932,13933,13934,13935, //13936\n13936,13937,13938,13939,13940,13941,13942,13943,13944,13945,13946,13947,13948,13949,13950,13951, //13952\n13952,13953,13954,13955,13956,13957,13958,13959,13960,13961,13962,13963,13964,13965,13966,13967, //13968\n13968,13969,13970,13971,13972, //13973\n****************************************************************************************/\n};\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/tables/EUCKRFreq.tab",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n//Sampling from about 20M text materials include literature and computer technology\n\n/******************************************************************************\n * 128  --> 0.79\n * 256  --> 0.92\n * 512  --> 0.986\n * 1024 --> 0.99944\n * 2048 --> 0.99999\n *\n * Idea Distribution Ratio = 0.98653 / (1-0.98653) = 73.24\n * Random Distribution Ration = 512 / (2350-512) = 0.279.\n * \n * Typical Distribution Ratio  \n *****************************************************************************/\n\n#define EUCKR_TYPICAL_DISTRIBUTION_RATIO (float)0.99\n\n#define EUCKR_TABLE_SIZE  2352\n\n//Char to FreqOrder table , \nconstexpr PRInt16 EUCKRCharToFreqOrder[] =\n{\n  13, 130, 120,1396, 481,1719,1720, 328, 609, 212,1721, 707, 400, 299,1722,  87,\n1397,1723, 104, 536,1117,1203,1724,1267, 685,1268, 508,1725,1726,1727,1728,1398,\n1399,1729,1730,1731, 141, 621, 326,1057, 368,1732, 267, 488,  20,1733,1269,1734,\n 945,1400,1735,  47, 904,1270,1736,1737, 773, 248,1738, 409, 313, 786, 429,1739,\n 116, 987, 813,1401, 683,  75,1204, 145,1740,1741,1742,1743,  16, 847, 667, 622,\n 708,1744,1745,1746, 966, 787, 304, 129,1747,  60, 820, 123, 676,1748,1749,1750,\n1751, 617,1752, 626,1753,1754,1755,1756, 653,1757,1758,1759,1760,1761,1762, 856,\n 344,1763,1764,1765,1766,  89, 401, 418, 806, 905, 848,1767,1768,1769, 946,1205,\n 709,1770,1118,1771, 241,1772,1773,1774,1271,1775, 569,1776, 999,1777,1778,1779,\n1780, 337, 751,1058,  28, 628, 254,1781, 177, 906, 270, 349, 891,1079,1782,  19,\n1783, 379,1784, 315,1785, 629, 754,1402, 559,1786, 636, 203,1206,1787, 710, 567,\n1788, 935, 814,1789,1790,1207, 766, 528,1791,1792,1208,1793,1794,1795,1796,1797,\n1403,1798,1799, 533,1059,1404,1405,1156,1406, 936, 884,1080,1800, 351,1801,1802,\n1803,1804,1805, 801,1806,1807,1808,1119,1809,1157, 714, 474,1407,1810, 298, 899,\n 885,1811,1120, 802,1158,1812, 892,1813,1814,1408, 659,1815,1816,1121,1817,1818,\n1819,1820,1821,1822, 319,1823, 594, 545,1824, 815, 937,1209,1825,1826, 573,1409,\n1022,1827,1210,1828,1829,1830,1831,1832,1833, 556, 722, 807,1122,1060,1834, 697,\n1835, 900, 557, 715,1836,1410, 540,1411, 752,1159, 294, 597,1211, 976, 803, 770,\n1412,1837,1838,  39, 794,1413, 358,1839, 371, 925,1840, 453, 661, 788, 531, 723,\n 544,1023,1081, 869,  91,1841, 392, 430, 790, 602,1414, 677,1082, 457,1415,1416,\n1842,1843, 475, 327,1024,1417, 795, 121,1844, 733, 403,1418,1845,1846,1847, 300,\n 119, 711,1212, 627,1848,1272, 207,1849,1850, 796,1213, 382,1851, 519,1852,1083,\n 893,1853,1854,1855, 367, 809, 487, 671,1856, 663,1857,1858, 956, 471, 306, 857,\n1859,1860,1160,1084,1861,1862,1863,1864,1865,1061,1866,1867,1868,1869,1870,1871,\n 282,  96, 574,1872, 502,1085,1873,1214,1874, 907,1875,1876, 827, 977,1419,1420,\n1421, 268,1877,1422,1878,1879,1880, 308,1881,   2, 537,1882,1883,1215,1884,1885,\n 127, 791,1886,1273,1423,1887,  34, 336, 404, 643,1888, 571, 654, 894, 840,1889,\n   0, 886,1274, 122, 575, 260, 908, 938,1890,1275, 410, 316,1891,1892, 100,1893,\n1894,1123,  48,1161,1124,1025,1895, 633, 901,1276,1896,1897, 115, 816,1898, 317,\n1899, 694,1900, 909, 734,1424, 572, 866,1425, 691,  85, 524,1010, 543, 394, 841,\n1901,1902,1903,1026,1904,1905,1906,1907,1908,1909,  30, 451, 651, 988, 310,1910,\n1911,1426, 810,1216,  93,1912,1913,1277,1217,1914, 858, 759,  45,  58, 181, 610,\n 269,1915,1916, 131,1062, 551, 443,1000, 821,1427, 957, 895,1086,1917,1918, 375,\n1919, 359,1920, 687,1921, 822,1922, 293,1923,1924,  40, 662, 118, 692,  29, 939,\n 887, 640, 482, 174,1925,  69,1162, 728,1428, 910,1926,1278,1218,1279, 386, 870,\n 217, 854,1163, 823,1927,1928,1929,1930, 834,1931,  78,1932, 859,1933,1063,1934,\n1935,1936,1937, 438,1164, 208, 595,1938,1939,1940,1941,1219,1125,1942, 280, 888,\n1429,1430,1220,1431,1943,1944,1945,1946,1947,1280, 150, 510,1432,1948,1949,1950,\n1951,1952,1953,1954,1011,1087,1955,1433,1043,1956, 881,1957, 614, 958,1064,1065,\n1221,1958, 638,1001, 860, 967, 896,1434, 989, 492, 553,1281,1165,1959,1282,1002,\n1283,1222,1960,1961,1962,1963,  36, 383, 228, 753, 247, 454,1964, 876, 678,1965,\n1966,1284, 126, 464, 490, 835, 136, 672, 529, 940,1088,1435, 473,1967,1968, 467,\n  50, 390, 227, 587, 279, 378, 598, 792, 968, 240, 151, 160, 849, 882,1126,1285,\n 639,1044, 133, 140, 288, 360, 811, 563,1027, 561, 142, 523,1969,1970,1971,   7,\n 103, 296, 439, 407, 506, 634, 990,1972,1973,1974,1975, 645,1976,1977,1978,1979,\n1980,1981, 236,1982,1436,1983,1984,1089, 192, 828, 618, 518,1166, 333,1127,1985,\n 818,1223,1986,1987,1988,1989,1990,1991,1992,1993, 342,1128,1286, 746, 842,1994,\n1995, 560, 223,1287,  98,   8, 189, 650, 978,1288,1996,1437,1997,  17, 345, 250,\n 423, 277, 234, 512, 226,  97, 289,  42, 167,1998, 201,1999,2000, 843, 836, 824,\n 532, 338, 783,1090, 182, 576, 436,1438,1439, 527, 500,2001, 947, 889,2002,2003,\n2004,2005, 262, 600, 314, 447,2006, 547,2007, 693, 738,1129,2008,  71,1440, 745,\n 619, 688,2009, 829,2010,2011, 147,2012,  33, 948,2013,2014,  74, 224,2015,  61,\n 191, 918, 399, 637,2016,1028,1130, 257, 902,2017,2018,2019,2020,2021,2022,2023,\n2024,2025,2026, 837,2027,2028,2029,2030, 179, 874, 591,  52, 724, 246,2031,2032,\n2033,2034,1167, 969,2035,1289, 630, 605, 911,1091,1168,2036,2037,2038,1441, 912,\n2039, 623,2040,2041, 253,1169,1290,2042,1442, 146, 620, 611, 577, 433,2043,1224,\n 719,1170, 959, 440, 437, 534,  84, 388, 480,1131, 159, 220, 198, 679,2044,1012,\n 819,1066,1443, 113,1225, 194, 318,1003,1029,2045,2046,2047,2048,1067,2049,2050,\n2051,2052,2053,  59, 913, 112,2054, 632,2055, 455, 144, 739,1291,2056, 273, 681,\n 499,2057, 448,2058,2059, 760,2060,2061, 970, 384, 169, 245,1132,2062,2063, 414,\n1444,2064,2065,  41, 235,2066, 157, 252, 877, 568, 919, 789, 580,2067, 725,2068,\n2069,1292,2070,2071,1445,2072,1446,2073,2074,  55, 588,  66,1447, 271,1092,2075,\n1226,2076, 960,1013, 372,2077,2078,2079,2080,2081,1293,2082,2083,2084,2085, 850,\n2086,2087,2088,2089,2090, 186,2091,1068, 180,2092,2093,2094, 109,1227, 522, 606,\n2095, 867,1448,1093, 991,1171, 926, 353,1133,2096, 581,2097,2098,2099,1294,1449,\n1450,2100, 596,1172,1014,1228,2101,1451,1295,1173,1229,2102,2103,1296,1134,1452,\n 949,1135,2104,2105,1094,1453,1454,1455,2106,1095,2107,2108,2109,2110,2111,2112,\n2113,2114,2115,2116,2117, 804,2118,2119,1230,1231, 805,1456, 405,1136,2120,2121,\n2122,2123,2124, 720, 701,1297, 992,1457, 927,1004,2125,2126,2127,2128,2129,2130,\n  22, 417,2131, 303,2132, 385,2133, 971, 520, 513,2134,1174,  73,1096, 231, 274,\n 962,1458, 673,2135,1459,2136, 152,1137,2137,2138,2139,2140,1005,1138,1460,1139,\n2141,2142,2143,2144,  11, 374, 844,2145, 154,1232,  46,1461,2146, 838, 830, 721,\n1233, 106,2147,  90, 428, 462, 578, 566,1175, 352,2148,2149, 538,1234, 124,1298,\n2150,1462, 761, 565,2151, 686,2152, 649,2153,  72, 173,2154, 460, 415,2155,1463,\n2156,1235, 305,2157,2158,2159,2160,2161,2162, 579,2163,2164,2165,2166,2167, 747,\n2168,2169,2170,2171,1464, 669,2172,2173,2174,2175,2176,1465,2177,  23, 530, 285,\n2178, 335, 729,2179, 397,2180,2181,2182,1030,2183,2184, 698,2185,2186, 325,2187,\n2188, 369,2189, 799,1097,1015, 348,2190,1069, 680,2191, 851,1466,2192,2193,  10,\n2194, 613, 424,2195, 979, 108, 449, 589,  27, 172,  81,1031,  80, 774, 281, 350,\n1032, 525, 301, 582,1176,2196, 674,1045,2197,2198,1467, 730, 762,2199,2200,2201,\n2202,1468,2203, 993,2204,2205, 266,1070, 963,1140,2206,2207,2208, 664,1098, 972,\n2209,2210,2211,1177,1469,1470, 871,2212,2213,2214,2215,2216,1471,2217,2218,2219,\n2220,2221,2222,2223,2224,2225,2226,2227,1472,1236,2228,2229,2230,2231,2232,2233,\n2234,2235,1299,2236,2237, 200,2238, 477, 373,2239,2240, 731, 825, 777,2241,2242,\n2243, 521, 486, 548,2244,2245,2246,1473,1300,  53, 549, 137, 875,  76, 158,2247,\n1301,1474, 469, 396,1016, 278, 712,2248, 321, 442, 503, 767, 744, 941,1237,1178,\n1475,2249,  82, 178,1141,1179, 973,2250,1302,2251, 297,2252,2253, 570,2254,2255,\n2256,  18, 450, 206,2257, 290, 292,1142,2258, 511, 162,  99, 346, 164, 735,2259,\n1476,1477,   4, 554, 343, 798,1099,2260,1100,2261,  43, 171,1303, 139, 215,2262,\n2263, 717, 775,2264,1033, 322, 216,2265, 831,2266, 149,2267,1304,2268,2269, 702,\n1238, 135, 845, 347, 309,2270, 484,2271, 878, 655, 238,1006,1478,2272,  67,2273,\n 295,2274,2275, 461,2276, 478, 942, 412,2277,1034,2278,2279,2280, 265,2281, 541,\n2282,2283,2284,2285,2286,  70, 852,1071,2287,2288,2289,2290,  21,  56, 509, 117,\n 432,2291,2292, 331, 980, 552,1101, 148, 284, 105, 393,1180,1239, 755,2293, 187,\n2294,1046,1479,2295, 340,2296,  63,1047, 230,2297,2298,1305, 763,1306, 101, 800,\n 808, 494,2299,2300,2301, 903,2302,  37,1072,  14,   5,2303,  79, 675,2304, 312,\n2305,2306,2307,2308,2309,1480,   6,1307,2310,2311,2312,   1, 470,  35,  24, 229,\n2313, 695, 210,  86, 778,  15, 784, 592, 779,  32,  77, 855, 964,2314, 259,2315,\n 501, 380,2316,2317,  83, 981, 153, 689,1308,1481,1482,1483,2318,2319, 716,1484,\n2320,2321,2322,2323,2324,2325,1485,2326,2327, 128,  57,  68, 261,1048, 211, 170,\n1240,  31,2328,  51, 435, 742,2329,2330,2331, 635,2332, 264, 456,2333,2334,2335,\n 425,2336,1486, 143, 507, 263, 943,2337, 363, 920,1487, 256,1488,1102, 243, 601,\n1489,2338,2339,2340,2341,2342,2343,2344, 861,2345,2346,2347,2348,2349,2350, 395,\n2351,1490,1491,  62, 535, 166, 225,2352,2353, 668, 419,1241, 138, 604, 928,2354,\n1181,2355,1492,1493,2356,2357,2358,1143,2359, 696,2360, 387, 307,1309, 682, 476,\n2361,2362, 332,  12, 222, 156,2363, 232,2364, 641, 276, 656, 517,1494,1495,1035,\n 416, 736,1496,2365,1017, 586,2366,2367,2368,1497,2369, 242,2370,2371,2372,1498,\n2373, 965, 713,2374,2375,2376,2377, 740, 982,1499, 944,1500,1007,2378,2379,1310,\n1501,2380,2381,2382, 785, 329,2383,2384,1502,2385,2386,2387, 932,2388,1503,2389,\n2390,2391,2392,1242,2393,2394,2395,2396,2397, 994, 950,2398,2399,2400,2401,1504,\n1311,2402,2403,2404,2405,1049, 749,2406,2407, 853, 718,1144,1312,2408,1182,1505,\n2409,2410, 255, 516, 479, 564, 550, 214,1506,1507,1313, 413, 239, 444, 339,1145,\n1036,1508,1509,1314,1037,1510,1315,2411,1511,2412,2413,2414, 176, 703, 497, 624,\n 593, 921, 302,2415, 341, 165,1103,1512,2416,1513,2417,2418,2419, 376,2420, 700,\n2421,2422,2423, 258, 768,1316,2424,1183,2425, 995, 608,2426,2427,2428,2429, 221,\n2430,2431,2432,2433,2434,2435,2436,2437, 195, 323, 726, 188, 897, 983,1317, 377,\n 644,1050, 879,2438, 452,2439,2440,2441,2442,2443,2444, 914,2445,2446,2447,2448,\n 915, 489,2449,1514,1184,2450,2451, 515,  64, 427, 495,2452, 583,2453, 483, 485,\n1038, 562, 213,1515, 748, 666,2454,2455,2456,2457, 334,2458, 780, 996,1008, 705,\n1243,2459,2460,2461,2462,2463, 114,2464, 493,1146, 366, 163,1516, 961,1104,2465,\n 291,2466,1318,1105,2467,1517, 365,2468, 355, 951,1244,2469,1319,2470, 631,2471,\n2472, 218,1320, 364, 320, 756,1518,1519,1321,1520,1322,2473,2474,2475,2476, 997,\n2477,2478,2479,2480, 665,1185,2481, 916,1521,2482,2483,2484, 584, 684,2485,2486,\n 797,2487,1051,1186,2488,2489,2490,1522,2491,2492, 370,2493,1039,1187,  65,2494,\n 434, 205, 463,1188,2495, 125, 812, 391, 402, 826, 699, 286, 398, 155, 781, 771,\n 585,2496, 590, 505,1073,2497, 599, 244, 219, 917,1018, 952, 646,1523,2498,1323,\n2499,2500,  49, 984, 354, 741,2501, 625,2502,1324,2503,1019, 190, 357, 757, 491,\n  95, 782, 868,2504,2505,2506,2507,2508,2509, 134,1524,1074, 422,1525, 898,2510,\n 161,2511,2512,2513,2514, 769,2515,1526,2516,2517, 411,1325,2518, 472,1527,2519,\n2520,2521,2522,2523,2524, 985,2525,2526,2527,2528,2529,2530, 764,2531,1245,2532,\n2533,  25, 204, 311,2534, 496,2535,1052,2536,2537,2538,2539,2540,2541,2542, 199,\n 704, 504, 468, 758, 657,1528, 196,  44, 839,1246, 272, 750,2543, 765, 862,2544,\n2545,1326,2546, 132, 615, 933,2547, 732,2548,2549,2550,1189,1529,2551, 283,1247,\n1053, 607, 929,2552,2553,2554, 930, 183, 872, 616,1040,1147,2555,1148,1020, 441,\n 249,1075,2556,2557,2558, 466, 743,2559,2560,2561,  92, 514, 426, 420, 526,2562,\n2563,2564,2565,2566,2567,2568, 185,2569,2570,2571,2572, 776,1530, 658,2573, 362,\n2574, 361, 922,1076, 793,2575,2576,2577,2578,2579,2580,1531, 251,2581,2582,2583,\n2584,1532,  54, 612, 237,1327,2585,2586, 275, 408, 647, 111,2587,1533,1106, 465,\n   3, 458,   9,  38,2588, 107, 110, 890, 209,  26, 737, 498,2589,1534,2590, 431,\n 202,  88,1535, 356, 287,1107, 660,1149,2591, 381,1536, 986,1150, 445,1248,1151,\n 974,2592,2593, 846,2594, 446, 953, 184,1249,1250, 727,2595, 923, 193, 883,2596,\n2597,2598, 102, 324, 539, 817,2599, 421,1041,2600, 832,2601,  94, 175, 197, 406,\n2602, 459,2603,2604,2605,2606,2607, 330, 555,2608,2609,2610, 706,1108, 389,2611,\n2612,2613,2614, 233,2615, 833, 558, 931, 954,1251,2616,2617,1537, 546,2618,2619,\n1009,2620,2621,2622,1538, 690,1328,2623, 955,2624,1539,2625,2626, 772,2627,2628,\n2629,2630,2631, 924, 648, 863, 603,2632,2633, 934,1540, 864, 865,2634, 642,1042,\n 670,1190,2635,2636,2637,2638, 168,2639, 652, 873, 542,1054,1541,2640,2641,2642,  //512, 256\n\n/*************************************************************************************** \n *Everything below is of no interest for detection purpose\t\t\t\t\t\t\t   *\n ***************************************************************************************\n\n2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,\n2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,\n2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,\n2691,2692,2693,2694,2695,2696,2697,2698,2699,1542, 880,2700,2701,2702,2703,2704,\n2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,\n2721,2722,2723,2724,2725,1543,2726,2727,2728,2729,2730,2731,2732,1544,2733,2734,\n2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,\n2751,2752,2753,2754,1545,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,\n2766,1546,2767,1547,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,\n2780,2781,2782,2783,2784,2785,2786,1548,2787,2788,2789,1109,2790,2791,2792,2793,\n2794,2795,2796,2797,2798,2799,2800,2801,2802,2803,2804,2805,2806,2807,2808,2809,\n2810,2811,2812,1329,2813,2814,2815,2816,2817,2818,2819,2820,2821,2822,2823,2824,\n2825,2826,2827,2828,2829,2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2840,\n2841,2842,2843,2844,2845,2846,2847,2848,2849,2850,2851,2852,2853,2854,2855,2856,\n1549,2857,2858,2859,2860,1550,2861,2862,1551,2863,2864,2865,2866,2867,2868,2869,\n2870,2871,2872,2873,2874,1110,1330,2875,2876,2877,2878,2879,2880,2881,2882,2883,\n2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,\n2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,\n2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,1331,\n2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,2942,2943,1552,2944,2945,\n2946,2947,2948,2949,2950,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,\n2962,2963,2964,1252,2965,2966,2967,2968,2969,2970,2971,2972,2973,2974,2975,2976,\n2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,2989,2990,2991,2992,\n2993,2994,2995,2996,2997,2998,2999,3000,3001,3002,3003,3004,3005,3006,3007,3008,\n3009,3010,3011,3012,1553,3013,3014,3015,3016,3017,1554,3018,1332,3019,3020,3021,\n3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,\n3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,1555,3051,3052,\n3053,1556,1557,3054,3055,3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,\n3067,1558,3068,3069,3070,3071,3072,3073,3074,3075,3076,1559,3077,3078,3079,3080,\n3081,3082,3083,1253,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,\n3096,3097,3098,3099,3100,3101,3102,3103,3104,3105,3106,3107,3108,1152,3109,3110,\n3111,3112,3113,1560,3114,3115,3116,3117,1111,3118,3119,3120,3121,3122,3123,3124,\n3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,\n3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,3156,\n3157,3158,3159,3160,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,\n3173,3174,3175,3176,1333,3177,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,\n3188,3189,1561,3190,3191,1334,3192,3193,3194,3195,3196,3197,3198,3199,3200,3201,\n3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3213,3214,3215,3216,3217,\n3218,3219,3220,3221,3222,3223,3224,3225,3226,3227,3228,3229,3230,3231,3232,3233,\n3234,1562,3235,3236,3237,3238,3239,3240,3241,3242,3243,3244,3245,3246,3247,3248,\n3249,3250,3251,3252,3253,3254,3255,3256,3257,3258,3259,3260,3261,3262,3263,3264,\n3265,3266,3267,3268,3269,3270,3271,3272,3273,3274,3275,3276,3277,1563,3278,3279,\n3280,3281,3282,3283,3284,3285,3286,3287,3288,3289,3290,3291,3292,3293,3294,3295,\n3296,3297,3298,3299,3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,\n3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,3327,\n3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,\n3344,3345,3346,3347,3348,3349,3350,3351,3352,3353,3354,3355,3356,3357,3358,3359,\n3360,3361,3362,3363,3364,1335,3365,3366,3367,3368,3369,3370,3371,3372,3373,3374,\n3375,3376,3377,3378,3379,3380,3381,3382,3383,3384,3385,3386,3387,1336,3388,3389,\n3390,3391,3392,3393,3394,3395,3396,3397,3398,3399,3400,3401,3402,3403,3404,3405,\n3406,3407,3408,3409,3410,3411,3412,3413,3414,1337,3415,3416,3417,3418,3419,1338,\n3420,3421,3422,1564,1565,3423,3424,3425,3426,3427,3428,3429,3430,3431,1254,3432,\n3433,3434,1339,3435,3436,3437,3438,3439,1566,3440,3441,3442,3443,3444,3445,3446,\n3447,3448,3449,3450,3451,3452,3453,3454,1255,3455,3456,3457,3458,3459,1567,1191,\n3460,1568,1569,3461,3462,3463,1570,3464,3465,3466,3467,3468,1571,3469,3470,3471,\n3472,3473,1572,3474,3475,3476,3477,3478,3479,3480,3481,3482,3483,3484,3485,3486,\n1340,3487,3488,3489,3490,3491,3492,1021,3493,3494,3495,3496,3497,3498,1573,3499,\n1341,3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3510,3511,1342,3512,3513,\n3514,3515,3516,1574,1343,3517,3518,3519,1575,3520,1576,3521,3522,3523,3524,3525,\n3526,3527,3528,3529,3530,3531,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,\n3542,3543,3544,3545,3546,3547,3548,3549,3550,3551,3552,3553,3554,3555,3556,3557,\n3558,3559,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573,\n3574,3575,3576,3577,3578,3579,3580,1577,3581,3582,1578,3583,3584,3585,3586,3587,\n3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,\n3604,1579,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,\n3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,1580,3630,3631,1581,3632,\n3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,3645,3646,3647,3648,\n3649,3650,3651,3652,3653,3654,3655,3656,1582,3657,3658,3659,3660,3661,3662,3663,\n3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,3676,3677,3678,3679,\n3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3690,3691,3692,3693,3694,3695,\n3696,3697,3698,3699,3700,1192,3701,3702,3703,3704,1256,3705,3706,3707,3708,1583,\n1257,3709,3710,3711,3712,3713,3714,3715,3716,1584,3717,3718,3719,3720,3721,3722,\n3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,\n3739,3740,3741,3742,3743,3744,3745,1344,3746,3747,3748,3749,3750,3751,3752,3753,\n3754,3755,3756,1585,3757,3758,3759,3760,3761,3762,3763,3764,3765,3766,1586,3767,\n3768,3769,3770,3771,3772,3773,3774,3775,3776,3777,3778,1345,3779,3780,3781,3782,\n3783,3784,3785,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,1346,1587,3796,\n3797,1588,3798,3799,3800,3801,3802,3803,3804,3805,3806,1347,3807,3808,3809,3810,\n3811,1589,3812,3813,3814,3815,3816,3817,3818,3819,3820,3821,1590,3822,3823,1591,\n1348,3824,3825,3826,3827,3828,3829,3830,1592,3831,3832,1593,3833,3834,3835,3836,\n3837,3838,3839,3840,3841,3842,3843,3844,1349,3845,3846,3847,3848,3849,3850,3851,\n3852,3853,3854,3855,3856,3857,3858,1594,3859,3860,3861,3862,3863,3864,3865,3866,\n3867,3868,3869,1595,3870,3871,3872,3873,1596,3874,3875,3876,3877,3878,3879,3880,\n3881,3882,3883,3884,3885,3886,1597,3887,3888,3889,3890,3891,3892,3893,3894,3895,\n1598,3896,3897,3898,1599,1600,3899,1350,3900,1351,3901,3902,1352,3903,3904,3905,\n3906,3907,3908,3909,3910,3911,3912,3913,3914,3915,3916,3917,3918,3919,3920,3921,\n3922,3923,3924,1258,3925,3926,3927,3928,3929,3930,3931,1193,3932,1601,3933,3934,\n3935,3936,3937,3938,3939,3940,3941,3942,3943,1602,3944,3945,3946,3947,3948,1603,\n3949,3950,3951,3952,3953,3954,3955,3956,3957,3958,3959,3960,3961,3962,3963,3964,\n3965,1604,3966,3967,3968,3969,3970,3971,3972,3973,3974,3975,3976,3977,1353,3978,\n3979,3980,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,1354,3992,3993,\n3994,3995,3996,3997,3998,3999,4000,4001,4002,4003,4004,4005,4006,4007,4008,4009,\n4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,1355,4024,\n4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,\n1605,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,\n4056,4057,4058,4059,4060,1606,4061,4062,4063,4064,1607,4065,4066,4067,4068,4069,\n4070,4071,4072,4073,4074,4075,4076,1194,4077,4078,1608,4079,4080,4081,4082,4083,\n4084,4085,4086,4087,1609,4088,4089,4090,4091,4092,4093,4094,4095,4096,4097,4098,\n4099,4100,4101,4102,4103,4104,4105,4106,4107,4108,1259,4109,4110,4111,4112,4113,\n4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124,1195,4125,4126,4127,1610,\n4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,1356,4138,4139,4140,4141,4142,\n4143,4144,1611,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154,4155,4156,4157,\n4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,\n4174,4175,4176,4177,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,\n4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,4200,4201,4202,4203,4204,4205,\n4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4217,4218,4219,1612,4220,\n4221,4222,4223,4224,4225,4226,4227,1357,4228,1613,4229,4230,4231,4232,4233,4234,\n4235,4236,4237,4238,4239,4240,4241,4242,4243,1614,4244,4245,4246,4247,4248,4249,\n4250,4251,4252,4253,4254,4255,4256,4257,4258,4259,4260,4261,4262,4263,4264,4265,\n4266,4267,4268,4269,4270,1196,1358,4271,4272,4273,4274,4275,4276,4277,4278,4279,\n4280,4281,4282,4283,4284,4285,4286,4287,1615,4288,4289,4290,4291,4292,4293,4294,\n4295,4296,4297,4298,4299,4300,4301,4302,4303,4304,4305,4306,4307,4308,4309,4310,\n4311,4312,4313,4314,4315,4316,4317,4318,4319,4320,4321,4322,4323,4324,4325,4326,\n4327,4328,4329,4330,4331,4332,4333,4334,1616,4335,4336,4337,4338,4339,4340,4341,\n4342,4343,4344,4345,4346,4347,4348,4349,4350,4351,4352,4353,4354,4355,4356,4357,\n4358,4359,4360,1617,4361,4362,4363,4364,4365,1618,4366,4367,4368,4369,4370,4371,\n4372,4373,4374,4375,4376,4377,4378,4379,4380,4381,4382,4383,4384,4385,4386,4387,\n4388,4389,4390,4391,4392,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,\n4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415,4416,1619,4417,4418,\n4419,4420,4421,4422,4423,4424,4425,1112,4426,4427,4428,4429,4430,1620,4431,4432,\n4433,4434,4435,4436,4437,4438,4439,4440,4441,4442,1260,1261,4443,4444,4445,4446,\n4447,4448,4449,4450,4451,4452,4453,4454,4455,1359,4456,4457,4458,4459,4460,4461,\n4462,4463,4464,4465,1621,4466,4467,4468,4469,4470,4471,4472,4473,4474,4475,4476,\n4477,4478,4479,4480,4481,4482,4483,4484,4485,4486,4487,4488,4489,1055,4490,4491,\n4492,4493,4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,\n4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,1622,4519,4520,4521,1623,\n4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,1360,4536,\n4537,4538,4539,4540,4541,4542,4543, 975,4544,4545,4546,4547,4548,4549,4550,4551,\n4552,4553,4554,4555,4556,4557,4558,4559,4560,4561,4562,4563,4564,4565,4566,4567,\n4568,4569,4570,4571,1624,4572,4573,4574,4575,4576,1625,4577,4578,4579,4580,4581,\n4582,4583,4584,1626,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,1627,\n4596,4597,4598,4599,4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,\n4612,4613,4614,4615,1628,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,\n4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,\n4643,4644,4645,4646,4647,4648,4649,1361,4650,4651,4652,4653,4654,4655,4656,4657,\n4658,4659,4660,4661,1362,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,\n4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,1629,4683,4684,4685,4686,4687,\n1630,4688,4689,4690,4691,1153,4692,4693,4694,1113,4695,4696,4697,4698,4699,4700,\n4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,1197,4712,4713,4714,4715,\n4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,\n4732,4733,4734,4735,1631,4736,1632,4737,4738,4739,4740,4741,4742,4743,4744,1633,\n4745,4746,4747,4748,4749,1262,4750,4751,4752,4753,4754,1363,4755,4756,4757,4758,\n4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,1634,4769,4770,4771,4772,4773,\n4774,4775,4776,4777,4778,1635,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,\n4789,1636,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,\n4804,4805,4806,1637,4807,4808,4809,1638,4810,4811,4812,4813,4814,4815,4816,4817,\n4818,1639,4819,4820,4821,4822,4823,4824,4825,4826,4827,4828,4829,4830,4831,4832,\n4833,1077,4834,4835,4836,4837,4838,4839,4840,4841,4842,4843,4844,4845,4846,4847,\n4848,4849,4850,4851,4852,4853,4854,4855,4856,4857,4858,4859,4860,4861,4862,4863,\n4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,\n4880,4881,4882,4883,1640,4884,4885,1641,4886,4887,4888,4889,4890,4891,4892,4893,\n4894,4895,4896,4897,4898,4899,4900,4901,4902,4903,4904,4905,4906,4907,4908,4909,\n4910,4911,1642,4912,4913,4914,1364,4915,4916,4917,4918,4919,4920,4921,4922,4923,\n4924,4925,4926,4927,4928,4929,4930,4931,1643,4932,4933,4934,4935,4936,4937,4938,\n4939,4940,4941,4942,4943,4944,4945,4946,4947,4948,4949,4950,4951,4952,4953,4954,\n4955,4956,4957,4958,4959,4960,4961,4962,4963,4964,4965,4966,4967,4968,4969,4970,\n4971,4972,4973,4974,4975,4976,4977,4978,4979,4980,1644,4981,4982,4983,4984,1645,\n4985,4986,1646,4987,4988,4989,4990,4991,4992,4993,4994,4995,4996,4997,4998,4999,\n5000,5001,5002,5003,5004,5005,1647,5006,1648,5007,5008,5009,5010,5011,5012,1078,\n5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5024,5025,5026,5027,5028,\n1365,5029,5030,5031,5032,5033,5034,5035,5036,5037,5038,5039,1649,5040,5041,5042,\n5043,5044,5045,1366,5046,5047,5048,5049,5050,5051,5052,5053,5054,5055,1650,5056,\n5057,5058,5059,5060,5061,5062,5063,5064,5065,5066,5067,5068,5069,5070,5071,5072,\n5073,5074,5075,5076,5077,1651,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,\n5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,\n5104,5105,5106,5107,5108,5109,5110,1652,5111,5112,5113,5114,5115,5116,5117,5118,\n1367,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,1653,5130,5131,5132,\n5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,\n5149,1368,5150,1654,5151,1369,5152,5153,5154,5155,5156,5157,5158,5159,5160,5161,\n5162,5163,5164,5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,5176,5177,\n5178,1370,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5189,5190,5191,5192,\n5193,5194,5195,5196,5197,5198,1655,5199,5200,5201,5202,1656,5203,5204,5205,5206,\n1371,5207,1372,5208,5209,5210,5211,1373,5212,5213,1374,5214,5215,5216,5217,5218,\n5219,5220,5221,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,\n5235,5236,5237,5238,5239,5240,5241,5242,5243,5244,5245,5246,5247,1657,5248,5249,\n5250,5251,1658,1263,5252,5253,5254,5255,5256,1375,5257,5258,5259,5260,5261,5262,\n5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,\n5279,5280,5281,5282,5283,1659,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,\n5294,5295,5296,5297,5298,5299,5300,1660,5301,5302,5303,5304,5305,5306,5307,5308,\n5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,1376,5322,5323,\n5324,5325,5326,5327,5328,5329,5330,5331,5332,5333,1198,5334,5335,5336,5337,5338,\n5339,5340,5341,5342,5343,1661,5344,5345,5346,5347,5348,5349,5350,5351,5352,5353,\n5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,\n5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,5382,5383,5384,5385,\n5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,1264,5399,5400,\n5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,1662,5413,5414,5415,\n5416,1663,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,\n5431,5432,5433,5434,5435,5436,5437,5438,1664,5439,5440,5441,5442,5443,5444,5445,\n5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,\n5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,\n5478,1154,5479,5480,5481,5482,5483,5484,5485,1665,5486,5487,5488,5489,5490,5491,\n5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,\n5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,\n5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,\n5540,5541,5542,5543,5544,5545,5546,5547,5548,1377,5549,5550,5551,5552,5553,5554,\n5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,\n1114,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,\n5586,5587,5588,5589,5590,5591,5592,1378,5593,5594,5595,5596,5597,5598,5599,5600,\n5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,1379,5615,\n5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,\n5632,5633,5634,1380,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,\n5647,5648,5649,1381,1056,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,\n1666,5661,5662,5663,5664,5665,5666,5667,5668,1667,5669,1668,5670,5671,5672,5673,\n5674,5675,5676,5677,5678,1155,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,\n5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,1669,5699,5700,5701,5702,5703,\n5704,5705,1670,5706,5707,5708,5709,5710,1671,5711,5712,5713,5714,1382,5715,5716,\n5717,5718,5719,5720,5721,5722,5723,5724,5725,1672,5726,5727,1673,1674,5728,5729,\n5730,5731,5732,5733,5734,5735,5736,1675,5737,5738,5739,5740,5741,5742,5743,5744,\n1676,5745,5746,5747,5748,5749,5750,5751,1383,5752,5753,5754,5755,5756,5757,5758,\n5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,1677,5769,5770,5771,5772,5773,\n1678,5774,5775,5776, 998,5777,5778,5779,5780,5781,5782,5783,5784,5785,1384,5786,\n5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,1679,5801,\n5802,5803,1115,1116,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,\n5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,\n5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,\n5848,5849,5850,5851,5852,5853,5854,5855,1680,5856,5857,5858,5859,5860,5861,5862,\n5863,5864,1681,5865,5866,5867,1682,5868,5869,5870,5871,5872,5873,5874,5875,5876,\n5877,5878,5879,1683,5880,1684,5881,5882,5883,5884,1685,5885,5886,5887,5888,5889,\n5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,\n5906,5907,1686,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,\n5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,1687,\n5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,\n5952,1688,1689,5953,1199,5954,5955,5956,5957,5958,5959,5960,5961,1690,5962,5963,\n5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,\n5980,5981,1385,5982,1386,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,\n5994,5995,5996,5997,5998,5999,6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,\n6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,\n6026,6027,1265,6028,6029,1691,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,\n6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,\n6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,\n6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,1692,6085,6086,\n6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,\n6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,\n6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,1693,6132,6133,\n6134,6135,6136,1694,6137,6138,6139,6140,6141,1695,6142,6143,6144,6145,6146,6147,\n6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,\n6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,\n6180,6181,6182,6183,6184,6185,1696,6186,6187,6188,6189,6190,6191,6192,6193,6194,\n6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,\n6211,6212,6213,6214,6215,6216,6217,6218,6219,1697,6220,6221,6222,6223,6224,6225,\n6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,\n6242,6243,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,1698,6254,6255,6256,\n6257,6258,6259,6260,6261,6262,6263,1200,6264,6265,6266,6267,6268,6269,6270,6271,  //1024\n6272,6273,6274,6275,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,6286,6287,\n6288,6289,6290,6291,6292,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,1699,\n6303,6304,1700,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,\n6318,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,\n6334,6335,6336,6337,6338,6339,1701,6340,6341,6342,6343,6344,1387,6345,6346,6347,\n6348,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,\n6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,\n6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,\n6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,\n6412,6413,1702,6414,6415,6416,6417,6418,6419,6420,6421,6422,1703,6423,6424,6425,\n6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,1704,6439,6440,\n6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,\n6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,\n6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,\n6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503,1266,\n6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,\n6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,\n6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,\n1705,1706,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,\n6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,\n6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,\n6598,6599,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,\n6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,\n6630,6631,6632,6633,6634,6635,6636,6637,1388,6638,6639,6640,6641,6642,6643,6644,\n1707,6645,6646,6647,6648,6649,6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,\n6660,6661,6662,6663,1708,6664,6665,6666,6667,6668,6669,6670,6671,6672,6673,6674,\n1201,6675,6676,6677,6678,6679,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,\n6690,6691,6692,6693,6694,6695,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,\n6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,\n6722,6723,6724,6725,1389,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,\n1390,1709,6737,6738,6739,6740,6741,6742,1710,6743,6744,6745,6746,1391,6747,6748,\n6749,6750,6751,6752,6753,6754,6755,6756,6757,1392,6758,6759,6760,6761,6762,6763,\n6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,\n6780,1202,6781,6782,6783,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,\n6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,1711,\n6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,\n6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,1393,6837,6838,6839,6840,\n6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855,6856,\n6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,\n6873,6874,6875,6876,6877,6878,6879,6880,6881,6882,6883,6884,6885,6886,6887,6888,\n6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,1712,6903,\n6904,6905,6906,6907,6908,6909,6910,1713,6911,6912,6913,6914,6915,6916,6917,6918,\n6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,\n6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,6950,\n6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,\n6967,6968,6969,6970,6971,6972,6973,6974,1714,6975,6976,6977,6978,6979,6980,6981,\n6982,6983,6984,6985,6986,6987,6988,1394,6989,6990,6991,6992,6993,6994,6995,6996,\n6997,6998,6999,7000,1715,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,\n7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,\n7028,1716,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7042,\n7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,\n7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,\n7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,\n7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,\n7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,\n7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,\n7139,7140,7141,7142,7143,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,\n7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,\n7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,\n7187,7188,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,\n7203,7204,7205,7206,7207,1395,7208,7209,7210,7211,7212,7213,1717,7214,7215,7216,\n7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,\n7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,\n7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,\n7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,\n7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,\n7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,\n7313,1718,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,\n7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,\n7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,\n7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,\n7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,7389,7390,7391,\n7392,7393,7394,7395,7396,7397,7398,7399,7400,7401,7402,7403,7404,7405,7406,7407,\n7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,\n7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,\n7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,7450,7451,7452,7453,7454,7455,\n7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,\n7472,7473,7474,7475,7476,7477,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,\n7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,7503,\n7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,\n7520,7521,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,\n7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,7550,7551,\n7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,\n7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,\n7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,\n7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,\n7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,\n7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,\n7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,\n7664,7665,7666,7667,7668,7669,7670,7671,7672,7673,7674,7675,7676,7677,7678,7679,\n7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690,7691,7692,7693,7694,7695,\n7696,7697,7698,7699,7700,7701,7702,7703,7704,7705,7706,7707,7708,7709,7710,7711,\n7712,7713,7714,7715,7716,7717,7718,7719,7720,7721,7722,7723,7724,7725,7726,7727,\n7728,7729,7730,7731,7732,7733,7734,7735,7736,7737,7738,7739,7740,7741,7742,7743,\n7744,7745,7746,7747,7748,7749,7750,7751,7752,7753,7754,7755,7756,7757,7758,7759,\n7760,7761,7762,7763,7764,7765,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,\n7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,\n7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,7806,7807,\n7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,\n7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,\n7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,\n7856,7857,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,\n7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,\n7888,7889,7890,7891,7892,7893,7894,7895,7896,7897,7898,7899,7900,7901,7902,7903,\n7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,\n7920,7921,7922,7923,7924,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,\n7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,\n7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,\n7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,7983,\n7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,7997,7998,7999,\n8000,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,\n8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,\n8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047,\n8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,\n8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,\n8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,\n8096,8097,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,\n8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,\n8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,\n8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,\n8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,\n8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,\n8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,\n8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,\n8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,\n8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,\n8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,\n8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,\n8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,\n8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,\n8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,\n8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,\n8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,\n8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,\n8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,\n8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,\n8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,\n8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,\n8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,\n8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,\n8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,\n8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,\n8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,\n8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,\n8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,\n8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,\n8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,\n8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,\n8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,\n8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,\n8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,\n8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,\n8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,\n8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,\n8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,\n8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,\n8736,8737,8738,8739,8740,8741\n****************************************************************************************/\n};\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/tables/EUCTWFreq.tab",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n// EUCTW frequency table\n// Converted from big5 work \n// by Taiwan's Mandarin Promotion Council \n// <http://www.edu.tw:81/mandr/>\n\n\n/******************************************************************************\n * 128  --> 0.42261\n * 256  --> 0.57851\n * 512  --> 0.74851\n * 1024 --> 0.89384\n * 2048 --> 0.97583\n *\n * Idea Distribution Ratio = 0.74851/(1-0.74851) =2.98\n * Random Distribution Ration = 512/(5401-512)=0.105\n * \n * Typical Distribution Ratio about 25% of Ideal one, still much higher than RDR\n *****************************************************************************/\n\n#define EUCTW_TYPICAL_DISTRIBUTION_RATIO (float)0.75\n\n//Char to FreqOrder table , \n//#define EUCTW_TABLE_SIZE  8102\n#define EUCTW_TABLE_SIZE  5376\n\nconstexpr PRInt16 EUCTWCharToFreqOrder[] =\n{\n   1,1800,1506, 255,1431, 198,   9,  82,   6,7310, 177, 202,3615,1256,2808, 110, // 2742\n3735,  33,3241, 261,  76,  44,2113,  16,2931,2184,1176, 659,3868,  26,3404,2643, // 2758\n1198,3869,3313,4060, 410,2211, 302, 590, 361,1963,   8, 204,  58,4296,7311,1931, // 2774\n  63,7312,7313, 317,1614,  75, 222, 159,4061,2412,1480,7314,3500,3068, 224,2809, // 2790\n3616,   3,  10,3870,1471,  29,2774,1135,2852,1939, 873, 130,3242,1123, 312,7315, // 2806\n4297,2051, 507, 252, 682,7316, 142,1914, 124, 206,2932,  34,3501,3173,  64, 604, // 2822\n7317,2494,1976,1977, 155,1990, 645, 641,1606,7318,3405, 337,  72, 406,7319,  80, // 2838\n 630, 238,3174,1509, 263, 939,1092,2644, 756,1440,1094,3406, 449,  69,2969, 591, // 2854\n 179,2095, 471, 115,2034,1843,  60,  50,2970, 134, 806,1868, 734,2035,3407, 180, // 2870\n 995,1607, 156, 537,2893, 688,7320, 319,1305, 779,2144, 514,2374, 298,4298, 359, // 2886\n2495,  90,2707,1338, 663,  11, 906,1099,2545,  20,2436, 182, 532,1716,7321, 732, // 2902\n1376,4062,1311,1420,3175,  25,2312,1056, 113, 399, 382,1949, 242,3408,2467, 529, // 2918\n3243, 475,1447,3617,7322, 117,  21, 656, 810,1297,2295,2329,3502,7323, 126,4063, // 2934\n 706, 456, 150, 613,4299,  71,1118,2036,4064, 145,3069,  85, 835, 486,2114,1246, // 2950\n1426, 428, 727,1285,1015, 800, 106, 623, 303,1281,7324,2127,2354, 347,3736, 221, // 2966\n3503,3110,7325,1955,1153,4065,  83, 296,1199,3070, 192, 624,  93,7326, 822,1897, // 2982\n2810,3111, 795,2064, 991,1554,1542,1592,  27,  43,2853, 859, 139,1456, 860,4300, // 2998\n 437, 712,3871, 164,2392,3112, 695, 211,3017,2096, 195,3872,1608,3504,3505,3618, // 3014\n3873, 234, 811,2971,2097,3874,2229,1441,3506,1615,2375, 668,2076,1638, 305, 228, // 3030\n1664,4301, 467, 415,7327, 262,2098,1593, 239, 108, 300, 200,1033, 512,1247,2077, // 3046\n7328,7329,2173,3176,3619,2673, 593, 845,1062,3244,  88,1723,2037,3875,1950, 212, // 3062\n 266, 152, 149, 468,1898,4066,4302,  77, 187,7330,3018,  37,   5,2972,7331,3876, // 3078\n7332,7333,  39,2517,4303,2894,3177,2078,  55, 148,  74,4304, 545, 483,1474,1029, // 3094\n1665, 217,1869,1531,3113,1104,2645,4067,  24, 172,3507, 900,3877,3508,3509,4305, // 3110\n  32,1408,2811,1312, 329, 487,2355,2247,2708, 784,2674,   4,3019,3314,1427,1788, // 3126\n 188, 109, 499,7334,3620,1717,1789, 888,1217,3020,4306,7335,3510,7336,3315,1520, // 3142\n3621,3878, 196,1034, 775,7337,7338, 929,1815, 249, 439,  38,7339,1063,7340, 794, // 3158\n3879,1435,2296,  46, 178,3245,2065,7341,2376,7342, 214,1709,4307, 804,  35, 707, // 3174\n 324,3622,1601,2546, 140, 459,4068,7343,7344,1365, 839, 272, 978,2257,2572,3409, // 3190\n2128,1363,3623,1423, 697, 100,3071,  48,  70,1231, 495,3114,2193,7345,1294,7346, // 3206\n2079, 462, 586,1042,3246, 853, 256, 988, 185,2377,3410,1698, 434,1084,7347,3411, // 3222\n 314,2615,2775,4308,2330,2331, 569,2280, 637,1816,2518, 757,1162,1878,1616,3412, // 3238\n 287,1577,2115, 768,4309,1671,2854,3511,2519,1321,3737, 909,2413,7348,4069, 933, // 3254\n3738,7349,2052,2356,1222,4310, 765,2414,1322, 786,4311,7350,1919,1462,1677,2895, // 3270\n1699,7351,4312,1424,2437,3115,3624,2590,3316,1774,1940,3413,3880,4070, 309,1369, // 3286\n1130,2812, 364,2230,1653,1299,3881,3512,3882,3883,2646, 525,1085,3021, 902,2000, // 3302\n1475, 964,4313, 421,1844,1415,1057,2281, 940,1364,3116, 376,4314,4315,1381,   7, // 3318\n2520, 983,2378, 336,1710,2675,1845, 321,3414, 559,1131,3022,2742,1808,1132,1313, // 3334\n 265,1481,1857,7352, 352,1203,2813,3247, 167,1089, 420,2814, 776, 792,1724,3513, // 3350\n4071,2438,3248,7353,4072,7354, 446, 229, 333,2743, 901,3739,1200,1557,4316,2647, // 3366\n1920, 395,2744,2676,3740,4073,1835, 125, 916,3178,2616,4317,7355,7356,3741,7357, // 3382\n7358,7359,4318,3117,3625,1133,2547,1757,3415,1510,2313,1409,3514,7360,2145, 438, // 3398\n2591,2896,2379,3317,1068, 958,3023, 461, 311,2855,2677,4074,1915,3179,4075,1978, // 3414\n 383, 750,2745,2617,4076, 274, 539, 385,1278,1442,7361,1154,1964, 384, 561, 210, // 3430\n  98,1295,2548,3515,7362,1711,2415,1482,3416,3884,2897,1257, 129,7363,3742, 642, // 3446\n 523,2776,2777,2648,7364, 141,2231,1333,  68, 176, 441, 876, 907,4077, 603,2592, // 3462\n 710, 171,3417, 404, 549,  18,3118,2393,1410,3626,1666,7365,3516,4319,2898,4320, // 3478\n7366,2973, 368,7367, 146, 366,  99, 871,3627,1543, 748, 807,1586,1185,  22,2258, // 3494\n 379,3743,3180,7368,3181, 505,1941,2618,1991,1382,2314,7369, 380,2357, 218, 702, // 3510\n1817,1248,3418,3024,3517,3318,3249,7370,2974,3628, 930,3250,3744,7371,  59,7372, // 3526\n 585, 601,4078, 497,3419,1112,1314,4321,1801,7373,1223,1472,2174,7374, 749,1836, // 3542\n 690,1899,3745,1772,3885,1476, 429,1043,1790,2232,2116, 917,4079, 447,1086,1629, // 3558\n7375, 556,7376,7377,2020,1654, 844,1090, 105, 550, 966,1758,2815,1008,1782, 686, // 3574\n1095,7378,2282, 793,1602,7379,3518,2593,4322,4080,2933,2297,4323,3746, 980,2496, // 3590\n 544, 353, 527,4324, 908,2678,2899,7380, 381,2619,1942,1348,7381,1341,1252, 560, // 3606\n3072,7382,3420,2856,7383,2053, 973, 886,2080, 143,4325,7384,7385, 157,3886, 496, // 3622\n4081,  57, 840, 540,2038,4326,4327,3421,2117,1445, 970,2259,1748,1965,2081,4082, // 3638\n3119,1234,1775,3251,2816,3629, 773,1206,2129,1066,2039,1326,3887,1738,1725,4083, // 3654\n 279,3120,  51,1544,2594, 423,1578,2130,2066, 173,4328,1879,7386,7387,1583, 264, // 3670\n 610,3630,4329,2439, 280, 154,7388,7389,7390,1739, 338,1282,3073, 693,2857,1411, // 3686\n1074,3747,2440,7391,4330,7392,7393,1240, 952,2394,7394,2900,1538,2679, 685,1483, // 3702\n4084,2468,1436, 953,4085,2054,4331, 671,2395,  79,4086,2441,3252, 608, 567,2680, // 3718\n3422,4087,4088,1691, 393,1261,1791,2396,7395,4332,7396,7397,7398,7399,1383,1672, // 3734\n3748,3182,1464, 522,1119, 661,1150, 216, 675,4333,3888,1432,3519, 609,4334,2681, // 3750\n2397,7400,7401,7402,4089,3025,   0,7403,2469, 315, 231,2442, 301,3319,4335,2380, // 3766\n7404, 233,4090,3631,1818,4336,4337,7405,  96,1776,1315,2082,7406, 257,7407,1809, // 3782\n3632,2709,1139,1819,4091,2021,1124,2163,2778,1777,2649,7408,3074, 363,1655,3183, // 3798\n7409,2975,7410,7411,7412,3889,1567,3890, 718, 103,3184, 849,1443, 341,3320,2934, // 3814\n1484,7413,1712, 127,  67, 339,4092,2398, 679,1412, 821,7414,7415, 834, 738, 351, // 3830\n2976,2146, 846, 235,1497,1880, 418,1992,3749,2710, 186,1100,2147,2746,3520,1545, // 3846\n1355,2935,2858,1377, 583,3891,4093,2573,2977,7416,1298,3633,1078,2549,3634,2358, // 3862\n  78,3750,3751, 267,1289,2099,2001,1594,4094, 348, 369,1274,2194,2175,1837,4338, // 3878\n1820,2817,3635,2747,2283,2002,4339,2936,2748, 144,3321, 882,4340,3892,2749,3423, // 3894\n4341,2901,7417,4095,1726, 320,7418,3893,3026, 788,2978,7419,2818,1773,1327,2859, // 3910\n3894,2819,7420,1306,4342,2003,1700,3752,3521,2359,2650, 787,2022, 506, 824,3636, // 3926\n 534, 323,4343,1044,3322,2023,1900, 946,3424,7421,1778,1500,1678,7422,1881,4344, // 3942\n 165, 243,4345,3637,2521, 123, 683,4096, 764,4346,  36,3895,1792, 589,2902, 816, // 3958\n 626,1667,3027,2233,1639,1555,1622,3753,3896,7423,3897,2860,1370,1228,1932, 891, // 3974\n2083,2903, 304,4097,7424, 292,2979,2711,3522, 691,2100,4098,1115,4347, 118, 662, // 3990\n7425, 611,1156, 854,2381,1316,2861,   2, 386, 515,2904,7426,7427,3253, 868,2234, // 4006\n1486, 855,2651, 785,2212,3028,7428,1040,3185,3523,7429,3121, 448,7430,1525,7431, // 4022\n2164,4348,7432,3754,7433,4099,2820,3524,3122, 503, 818,3898,3123,1568, 814, 676, // 4038\n1444, 306,1749,7434,3755,1416,1030, 197,1428, 805,2821,1501,4349,7435,7436,7437, // 4054\n1993,7438,4350,7439,7440,2195,  13,2779,3638,2980,3124,1229,1916,7441,3756,2131, // 4070\n7442,4100,4351,2399,3525,7443,2213,1511,1727,1120,7444,7445, 646,3757,2443, 307, // 4086\n7446,7447,1595,3186,7448,7449,7450,3639,1113,1356,3899,1465,2522,2523,7451, 519, // 4102\n7452, 128,2132,  92,2284,1979,7453,3900,1512, 342,3125,2196,7454,2780,2214,1980, // 4118\n3323,7455, 290,1656,1317, 789, 827,2360,7456,3758,4352, 562, 581,3901,7457, 401, // 4134\n4353,2248,  94,4354,1399,2781,7458,1463,2024,4355,3187,1943,7459, 828,1105,4101, // 4150\n1262,1394,7460,4102, 605,4356,7461,1783,2862,7462,2822, 819,2101, 578,2197,2937, // 4166\n7463,1502, 436,3254,4103,3255,2823,3902,2905,3425,3426,7464,2712,2315,7465,7466, // 4182\n2332,2067,  23,4357, 193, 826,3759,2102, 699,1630,4104,3075, 390,1793,1064,3526, // 4198\n7467,1579,3076,3077,1400,7468,4105,1838,1640,2863,7469,4358,4359, 137,4106, 598, // 4214\n3078,1966, 780, 104, 974,2938,7470, 278, 899, 253, 402, 572, 504, 493,1339,7471, // 4230\n3903,1275,4360,2574,2550,7472,3640,3029,3079,2249, 565,1334,2713, 863,  41,7473, // 4246\n7474,4361,7475,1657,2333,  19, 463,2750,4107, 606,7476,2981,3256,1087,2084,1323, // 4262\n2652,2982,7477,1631,1623,1750,4108,2682,7478,2864, 791,2714,2653,2334, 232,2416, // 4278\n7479,2983,1498,7480,2654,2620, 755,1366,3641,3257,3126,2025,1609, 119,1917,3427, // 4294\n 862,1026,4109,7481,3904,3760,4362,3905,4363,2260,1951,2470,7482,1125, 817,4110, // 4310\n4111,3906,1513,1766,2040,1487,4112,3030,3258,2824,3761,3127,7483,7484,1507,7485, // 4326\n2683, 733,  40,1632,1106,2865, 345,4113, 841,2524, 230,4364,2984,1846,3259,3428, // 4342\n7486,1263, 986,3429,7487, 735, 879, 254,1137, 857, 622,1300,1180,1388,1562,3907, // 4358\n3908,2939, 967,2751,2655,1349, 592,2133,1692,3324,2985,1994,4114,1679,3909,1901, // 4374\n2185,7488, 739,3642,2715,1296,1290,7489,4115,2198,2199,1921,1563,2595,2551,1870, // 4390\n2752,2986,7490, 435,7491, 343,1108, 596,  17,1751,4365,2235,3430,3643,7492,4366, // 4406\n 294,3527,2940,1693, 477, 979, 281,2041,3528, 643,2042,3644,2621,2782,2261,1031, // 4422\n2335,2134,2298,3529,4367, 367,1249,2552,7493,3530,7494,4368,1283,3325,2004, 240, // 4438\n1762,3326,4369,4370, 836,1069,3128, 474,7495,2148,2525, 268,3531,7496,3188,1521, // 4454\n1284,7497,1658,1546,4116,7498,3532,3533,7499,4117,3327,2684,1685,4118, 961,1673, // 4470\n2622, 190,2005,2200,3762,4371,4372,7500, 570,2497,3645,1490,7501,4373,2623,3260, // 4486\n1956,4374, 584,1514, 396,1045,1944,7502,4375,1967,2444,7503,7504,4376,3910, 619, // 4502\n7505,3129,3261, 215,2006,2783,2553,3189,4377,3190,4378, 763,4119,3763,4379,7506, // 4518\n7507,1957,1767,2941,3328,3646,1174, 452,1477,4380,3329,3130,7508,2825,1253,2382, // 4534\n2186,1091,2285,4120, 492,7509, 638,1169,1824,2135,1752,3911, 648, 926,1021,1324, // 4550\n4381, 520,4382, 997, 847,1007, 892,4383,3764,2262,1871,3647,7510,2400,1784,4384, // 4566\n1952,2942,3080,3191,1728,4121,2043,3648,4385,2007,1701,3131,1551,  30,2263,4122, // 4582\n7511,2026,4386,3534,7512, 501,7513,4123, 594,3431,2165,1821,3535,3432,3536,3192, // 4598\n 829,2826,4124,7514,1680,3132,1225,4125,7515,3262,4387,4126,3133,2336,7516,4388, // 4614\n4127,7517,3912,3913,7518,1847,2383,2596,3330,7519,4389, 374,3914, 652,4128,4129, // 4630\n 375,1140, 798,7520,7521,7522,2361,4390,2264, 546,1659, 138,3031,2445,4391,7523, // 4646\n2250, 612,1848, 910, 796,3765,1740,1371, 825,3766,3767,7524,2906,2554,7525, 692, // 4662\n 444,3032,2624, 801,4392,4130,7526,1491, 244,1053,3033,4131,4132, 340,7527,3915, // 4678\n1041,2987, 293,1168,  87,1357,7528,1539, 959,7529,2236, 721, 694,4133,3768, 219, // 4694\n1478, 644,1417,3331,2656,1413,1401,1335,1389,3916,7530,7531,2988,2362,3134,1825, // 4710\n 730,1515, 184,2827,  66,4393,7532,1660,2943, 246,3332, 378,1457, 226,3433, 975, // 4726\n3917,2944,1264,3537, 674, 696,7533, 163,7534,1141,2417,2166, 713,3538,3333,4394, // 4742\n3918,7535,7536,1186,  15,7537,1079,1070,7538,1522,3193,3539, 276,1050,2716, 758, // 4758\n1126, 653,2945,3263,7539,2337, 889,3540,3919,3081,2989, 903,1250,4395,3920,3434, // 4774\n3541,1342,1681,1718, 766,3264, 286,  89,2946,3649,7540,1713,7541,2597,3334,2990, // 4790\n7542,2947,2215,3194,2866,7543,4396,2498,2526, 181, 387,1075,3921, 731,2187,3335, // 4806\n7544,3265, 310, 313,3435,2299, 770,4134,  54,3034, 189,4397,3082,3769,3922,7545, // 4822\n1230,1617,1849, 355,3542,4135,4398,3336, 111,4136,3650,1350,3135,3436,3035,4137, // 4838\n2149,3266,3543,7546,2784,3923,3924,2991, 722,2008,7547,1071, 247,1207,2338,2471, // 4854\n1378,4399,2009, 864,1437,1214,4400, 373,3770,1142,2216, 667,4401, 442,2753,2555, // 4870\n3771,3925,1968,4138,3267,1839, 837, 170,1107, 934,1336,1882,7548,7549,2118,4139, // 4886\n2828, 743,1569,7550,4402,4140, 582,2384,1418,3437,7551,1802,7552, 357,1395,1729, // 4902\n3651,3268,2418,1564,2237,7553,3083,3772,1633,4403,1114,2085,4141,1532,7554, 482, // 4918\n2446,4404,7555,7556,1492, 833,1466,7557,2717,3544,1641,2829,7558,1526,1272,3652, // 4934\n4142,1686,1794, 416,2556,1902,1953,1803,7559,3773,2785,3774,1159,2316,7560,2867, // 4950\n4405,1610,1584,3036,2419,2754, 443,3269,1163,3136,7561,7562,3926,7563,4143,2499, // 4966\n3037,4406,3927,3137,2103,1647,3545,2010,1872,4144,7564,4145, 431,3438,7565, 250, // 4982\n  97,  81,4146,7566,1648,1850,1558, 160, 848,7567, 866, 740,1694,7568,2201,2830, // 4998\n3195,4147,4407,3653,1687, 950,2472, 426, 469,3196,3654,3655,3928,7569,7570,1188, // 5014\n 424,1995, 861,3546,4148,3775,2202,2685, 168,1235,3547,4149,7571,2086,1674,4408, // 5030\n3337,3270, 220,2557,1009,7572,3776, 670,2992, 332,1208, 717,7573,7574,3548,2447, // 5046\n3929,3338,7575, 513,7576,1209,2868,3339,3138,4409,1080,7577,7578,7579,7580,2527, // 5062\n3656,3549, 815,1587,3930,3931,7581,3550,3439,3777,1254,4410,1328,3038,1390,3932, // 5078\n1741,3933,3778,3934,7582, 236,3779,2448,3271,7583,7584,3657,3780,1273,3781,4411, // 5094\n7585, 308,7586,4412, 245,4413,1851,2473,1307,2575, 430, 715,2136,2449,7587, 270, // 5110\n 199,2869,3935,7588,3551,2718,1753, 761,1754, 725,1661,1840,4414,3440,3658,7589, // 5126\n7590, 587,  14,3272, 227,2598, 326, 480,2265, 943,2755,3552, 291, 650,1883,7591, // 5142\n1702,1226, 102,1547,  62,3441, 904,4415,3442,1164,4150,7592,7593,1224,1548,2756, // 5158\n 391, 498,1493,7594,1386,1419,7595,2055,1177,4416, 813, 880,1081,2363, 566,1145, // 5174\n4417,2286,1001,1035,2558,2599,2238, 394,1286,7596,7597,2068,7598,  86,1494,1730, // 5190\n3936, 491,1588, 745, 897,2948, 843,3340,3937,2757,2870,3273,1768, 998,2217,2069, // 5206\n 397,1826,1195,1969,3659,2993,3341, 284,7599,3782,2500,2137,2119,1903,7600,3938, // 5222\n2150,3939,4151,1036,3443,1904, 114,2559,4152, 209,1527,7601,7602,2949,2831,2625, // 5238\n2385,2719,3139, 812,2560,7603,3274,7604,1559, 737,1884,3660,1210, 885,  28,2686, // 5254\n3553,3783,7605,4153,1004,1779,4418,7606, 346,1981,2218,2687,4419,3784,1742, 797, // 5270\n1642,3940,1933,1072,1384,2151, 896,3941,3275,3661,3197,2871,3554,7607,2561,1958, // 5286\n4420,2450,1785,7608,7609,7610,3942,4154,1005,1308,3662,4155,2720,4421,4422,1528, // 5302\n2600, 161,1178,4156,1982, 987,4423,1101,4157, 631,3943,1157,3198,2420,1343,1241, // 5318\n1016,2239,2562, 372, 877,2339,2501,1160, 555,1934, 911,3944,7611, 466,1170, 169, // 5334\n1051,2907,2688,3663,2474,2994,1182,2011,2563,1251,2626,7612, 992,2340,3444,1540, // 5350\n2721,1201,2070,2401,1996,2475,7613,4424, 528,1922,2188,1503,1873,1570,2364,3342, // 5366\n3276,7614, 557,1073,7615,1827,3445,2087,2266,3140,3039,3084, 767,3085,2786,4425, // 5382\n1006,4158,4426,2341,1267,2176,3664,3199, 778,3945,3200,2722,1597,2657,7616,4427, // 5398\n7617,3446,7618,7619,7620,3277,2689,1433,3278, 131,  95,1504,3946, 723,4159,3141, // 5414\n1841,3555,2758,2189,3947,2027,2104,3665,7621,2995,3948,1218,7622,3343,3201,3949, // 5430\n4160,2576, 248,1634,3785, 912,7623,2832,3666,3040,3786, 654,  53,7624,2996,7625, // 5446\n1688,4428, 777,3447,1032,3950,1425,7626, 191, 820,2120,2833, 971,4429, 931,3202, // 5462\n 135, 664, 783,3787,1997, 772,2908,1935,3951,3788,4430,2909,3203, 282,2723, 640, // 5478\n1372,3448,1127, 922, 325,3344,7627,7628, 711,2044,7629,7630,3952,2219,2787,1936, // 5494\n3953,3345,2220,2251,3789,2300,7631,4431,3790,1258,3279,3954,3204,2138,2950,3955, // 5510\n3956,7632,2221, 258,3205,4432, 101,1227,7633,3280,1755,7634,1391,3281,7635,2910, // 5526\n2056, 893,7636,7637,7638,1402,4161,2342,7639,7640,3206,3556,7641,7642, 878,1325, // 5542\n1780,2788,4433, 259,1385,2577, 744,1183,2267,4434,7643,3957,2502,7644, 684,1024, // 5558\n4162,7645, 472,3557,3449,1165,3282,3958,3959, 322,2152, 881, 455,1695,1152,1340, // 5574\n 660, 554,2153,4435,1058,4436,4163, 830,1065,3346,3960,4437,1923,7646,1703,1918, // 5590\n7647, 932,2268, 122,7648,4438, 947, 677,7649,3791,2627, 297,1905,1924,2269,4439, // 5606\n2317,3283,7650,7651,4164,7652,4165,  84,4166, 112, 989,7653, 547,1059,3961, 701, // 5622\n3558,1019,7654,4167,7655,3450, 942, 639, 457,2301,2451, 993,2951, 407, 851, 494, // 5638\n4440,3347, 927,7656,1237,7657,2421,3348, 573,4168, 680, 921,2911,1279,1874, 285, // 5654\n 790,1448,1983, 719,2167,7658,7659,4441,3962,3963,1649,7660,1541, 563,7661,1077, // 5670\n7662,3349,3041,3451, 511,2997,3964,3965,3667,3966,1268,2564,3350,3207,4442,4443, // 5686\n7663, 535,1048,1276,1189,2912,2028,3142,1438,1373,2834,2952,1134,2012,7664,4169, // 5702\n1238,2578,3086,1259,7665, 700,7666,2953,3143,3668,4170,7667,4171,1146,1875,1906, // 5718\n4444,2601,3967, 781,2422, 132,1589, 203, 147, 273,2789,2402, 898,1786,2154,3968, // 5734\n3969,7668,3792,2790,7669,7670,4445,4446,7671,3208,7672,1635,3793, 965,7673,1804, // 5750\n2690,1516,3559,1121,1082,1329,3284,3970,1449,3794,  65,1128,2835,2913,2759,1590, // 5766\n3795,7674,7675,  12,2658,  45, 976,2579,3144,4447, 517,2528,1013,1037,3209,7676, // 5782\n3796,2836,7677,3797,7678,3452,7679,2602, 614,1998,2318,3798,3087,2724,2628,7680, // 5798\n2580,4172, 599,1269,7681,1810,3669,7682,2691,3088, 759,1060, 489,1805,3351,3285, // 5814\n1358,7683,7684,2386,1387,1215,2629,2252, 490,7685,7686,4173,1759,2387,2343,7687, // 5830\n4448,3799,1907,3971,2630,1806,3210,4449,3453,3286,2760,2344, 874,7688,7689,3454, // 5846\n3670,1858,  91,2914,3671,3042,3800,4450,7690,3145,3972,2659,7691,3455,1202,1403, // 5862\n3801,2954,2529,1517,2503,4451,3456,2504,7692,4452,7693,2692,1885,1495,1731,3973, // 5878\n2365,4453,7694,2029,7695,7696,3974,2693,1216, 237,2581,4174,2319,3975,3802,4454, // 5894\n4455,2694,3560,3457, 445,4456,7697,7698,7699,7700,2761,  61,3976,3672,1822,3977, // 5910\n7701, 687,2045, 935, 925, 405,2660, 703,1096,1859,2725,4457,3978,1876,1367,2695, // 5926\n3352, 918,2105,1781,2476, 334,3287,1611,1093,4458, 564,3146,3458,3673,3353, 945, // 5942\n2631,2057,4459,7702,1925, 872,4175,7703,3459,2696,3089, 349,4176,3674,3979,4460, // 5958\n3803,4177,3675,2155,3980,4461,4462,4178,4463,2403,2046, 782,3981, 400, 251,4179, // 5974\n1624,7704,7705, 277,3676, 299,1265, 476,1191,3804,2121,4180,4181,1109, 205,7706, // 5990\n2582,1000,2156,3561,1860,7707,7708,7709,4464,7710,4465,2565, 107,2477,2157,3982, // 6006\n3460,3147,7711,1533, 541,1301, 158, 753,4182,2872,3562,7712,1696, 370,1088,4183, // 6022\n4466,3563, 579, 327, 440, 162,2240, 269,1937,1374,3461, 968,3043,  56,1396,3090, // 6038\n2106,3288,3354,7713,1926,2158,4467,2998,7714,3564,7715,7716,3677,4468,2478,7717, // 6054\n2791,7718,1650,4469,7719,2603,7720,7721,3983,2661,3355,1149,3356,3984,3805,3985, // 6070\n7722,1076,  49,7723, 951,3211,3289,3290, 450,2837, 920,7724,1811,2792,2366,4184, // 6086\n1908,1138,2367,3806,3462,7725,3212,4470,1909,1147,1518,2423,4471,3807,7726,4472, // 6102\n2388,2604, 260,1795,3213,7727,7728,3808,3291, 708,7729,3565,1704,7730,3566,1351, // 6118\n1618,3357,2999,1886, 944,4185,3358,4186,3044,3359,4187,7731,3678, 422, 413,1714, // 6134\n3292, 500,2058,2345,4188,2479,7732,1344,1910, 954,7733,1668,7734,7735,3986,2404, // 6150\n4189,3567,3809,4190,7736,2302,1318,2505,3091, 133,3092,2873,4473, 629,  31,2838, // 6166\n2697,3810,4474, 850, 949,4475,3987,2955,1732,2088,4191,1496,1852,7737,3988, 620, // 6182\n3214, 981,1242,3679,3360,1619,3680,1643,3293,2139,2452,1970,1719,3463,2168,7738, // 6198\n3215,7739,7740,3361,1828,7741,1277,4476,1565,2047,7742,1636,3568,3093,7743, 869, // 6214\n2839, 655,3811,3812,3094,3989,3000,3813,1310,3569,4477,7744,7745,7746,1733, 558, // 6230\n4478,3681, 335,1549,3045,1756,4192,3682,1945,3464,1829,1291,1192, 470,2726,2107, // 6246\n2793, 913,1054,3990,7747,1027,7748,3046,3991,4479, 982,2662,3362,3148,3465,3216, // 6262\n3217,1946,2794,7749, 571,4480,7750,1830,7751,3570,2583,1523,2424,7752,2089, 984, // 6278\n4481,3683,1959,7753,3684, 852, 923,2795,3466,3685, 969,1519, 999,2048,2320,1705, // 6294\n7754,3095, 615,1662, 151, 597,3992,2405,2321,1049, 275,4482,3686,4193, 568,3687, // 6310\n3571,2480,4194,3688,7755,2425,2270, 409,3218,7756,1566,2874,3467,1002, 769,2840, // 6326\n 194,2090,3149,3689,2222,3294,4195, 628,1505,7757,7758,1763,2177,3001,3993, 521, // 6342\n1161,2584,1787,2203,2406,4483,3994,1625,4196,4197, 412,  42,3096, 464,7759,2632, // 6358\n4484,3363,1760,1571,2875,3468,2530,1219,2204,3814,2633,2140,2368,4485,4486,3295, // 6374\n1651,3364,3572,7760,7761,3573,2481,3469,7762,3690,7763,7764,2271,2091, 460,7765, // 6390\n4487,7766,3002, 962, 588,3574, 289,3219,2634,1116,  52,7767,3047,1796,7768,7769, // 6406\n7770,1467,7771,1598,1143,3691,4198,1984,1734,1067,4488,1280,3365, 465,4489,1572, // 6422\n 510,7772,1927,2241,1812,1644,3575,7773,4490,3692,7774,7775,2663,1573,1534,7776, // 6438\n7777,4199, 536,1807,1761,3470,3815,3150,2635,7778,7779,7780,4491,3471,2915,1911, // 6454\n2796,7781,3296,1122, 377,3220,7782, 360,7783,7784,4200,1529, 551,7785,2059,3693, // 6470\n1769,2426,7786,2916,4201,3297,3097,2322,2108,2030,4492,1404, 136,1468,1479, 672, // 6486\n1171,3221,2303, 271,3151,7787,2762,7788,2049, 678,2727, 865,1947,4493,7789,2013, // 6502\n3995,2956,7790,2728,2223,1397,3048,3694,4494,4495,1735,2917,3366,3576,7791,3816, // 6518\n 509,2841,2453,2876,3817,7792,7793,3152,3153,4496,4202,2531,4497,2304,1166,1010, // 6534\n 552, 681,1887,7794,7795,2957,2958,3996,1287,1596,1861,3154, 358, 453, 736, 175, // 6550\n 478,1117, 905,1167,1097,7796,1853,1530,7797,1706,7798,2178,3472,2287,3695,3473, // 6566\n3577,4203,2092,4204,7799,3367,1193,2482,4205,1458,2190,2205,1862,1888,1421,3298, // 6582\n2918,3049,2179,3474, 595,2122,7800,3997,7801,7802,4206,1707,2636, 223,3696,1359, // 6598\n 751,3098, 183,3475,7803,2797,3003, 419,2369, 633, 704,3818,2389, 241,7804,7805, // 6614\n7806, 838,3004,3697,2272,2763,2454,3819,1938,2050,3998,1309,3099,2242,1181,7807, // 6630\n1136,2206,3820,2370,1446,4207,2305,4498,7808,7809,4208,1055,2605, 484,3698,7810, // 6646\n3999, 625,4209,2273,3368,1499,4210,4000,7811,4001,4211,3222,2274,2275,3476,7812, // 6662\n7813,2764, 808,2606,3699,3369,4002,4212,3100,2532, 526,3370,3821,4213, 955,7814, // 6678\n1620,4214,2637,2427,7815,1429,3700,1669,1831, 994, 928,7816,3578,1260,7817,7818, // 6694\n7819,1948,2288, 741,2919,1626,4215,2729,2455, 867,1184, 362,3371,1392,7820,7821, // 6710\n4003,4216,1770,1736,3223,2920,4499,4500,1928,2698,1459,1158,7822,3050,3372,2877, // 6726\n1292,1929,2506,2842,3701,1985,1187,2071,2014,2607,4217,7823,2566,2507,2169,3702, // 6742\n2483,3299,7824,3703,4501,7825,7826, 666,1003,3005,1022,3579,4218,7827,4502,1813, // 6758\n2253, 574,3822,1603, 295,1535, 705,3823,4219, 283, 858, 417,7828,7829,3224,4503, // 6774\n4504,3051,1220,1889,1046,2276,2456,4004,1393,1599, 689,2567, 388,4220,7830,2484, // 6790\n 802,7831,2798,3824,2060,1405,2254,7832,4505,3825,2109,1052,1345,3225,1585,7833, // 6806\n 809,7834,7835,7836, 575,2730,3477, 956,1552,1469,1144,2323,7837,2324,1560,2457, // 6822\n3580,3226,4005, 616,2207,3155,2180,2289,7838,1832,7839,3478,4506,7840,1319,3704, // 6838\n3705,1211,3581,1023,3227,1293,2799,7841,7842,7843,3826, 607,2306,3827, 762,2878, // 6854\n1439,4221,1360,7844,1485,3052,7845,4507,1038,4222,1450,2061,2638,4223,1379,4508, // 6870\n2585,7846,7847,4224,1352,1414,2325,2921,1172,7848,7849,3828,3829,7850,1797,1451, // 6886\n7851,7852,7853,7854,2922,4006,4007,2485,2346, 411,4008,4009,3582,3300,3101,4509, // 6902\n1561,2664,1452,4010,1375,7855,7856,  47,2959, 316,7857,1406,1591,2923,3156,7858, // 6918\n1025,2141,3102,3157, 354,2731, 884,2224,4225,2407, 508,3706, 726,3583, 996,2428, // 6934\n3584, 729,7859, 392,2191,1453,4011,4510,3707,7860,7861,2458,3585,2608,1675,2800, // 6950\n 919,2347,2960,2348,1270,4511,4012,  73,7862,7863, 647,7864,3228,2843,2255,1550, // 6966\n1346,3006,7865,1332, 883,3479,7866,7867,7868,7869,3301,2765,7870,1212, 831,1347, // 6982\n4226,4512,2326,3830,1863,3053, 720,3831,4513,4514,3832,7871,4227,7872,7873,4515, // 6998\n7874,7875,1798,4516,3708,2609,4517,3586,1645,2371,7876,7877,2924, 669,2208,2665, // 7014\n2429,7878,2879,7879,7880,1028,3229,7881,4228,2408,7882,2256,1353,7883,7884,4518, // 7030\n3158, 518,7885,4013,7886,4229,1960,7887,2142,4230,7888,7889,3007,2349,2350,3833, // 7046\n 516,1833,1454,4014,2699,4231,4519,2225,2610,1971,1129,3587,7890,2766,7891,2961, // 7062\n1422, 577,1470,3008,1524,3373,7892,7893, 432,4232,3054,3480,7894,2586,1455,2508, // 7078\n2226,1972,1175,7895,1020,2732,4015,3481,4520,7896,2733,7897,1743,1361,3055,3482, // 7094\n2639,4016,4233,4521,2290, 895, 924,4234,2170, 331,2243,3056, 166,1627,3057,1098, // 7110\n7898,1232,2880,2227,3374,4522, 657, 403,1196,2372, 542,3709,3375,1600,4235,3483, // 7126\n7899,4523,2767,3230, 576, 530,1362,7900,4524,2533,2666,3710,4017,7901, 842,3834, // 7142\n7902,2801,2031,1014,4018, 213,2700,3376, 665, 621,4236,7903,3711,2925,2430,7904, // 7158\n2431,3302,3588,3377,7905,4237,2534,4238,4525,3589,1682,4239,3484,1380,7906, 724, // 7174\n2277, 600,1670,7907,1337,1233,4526,3103,2244,7908,1621,4527,7909, 651,4240,7910, // 7190\n1612,4241,2611,7911,2844,7912,2734,2307,3058,7913, 716,2459,3059, 174,1255,2701, // 7206\n4019,3590, 548,1320,1398, 728,4020,1574,7914,1890,1197,3060,4021,7915,3061,3062, // 7222\n3712,3591,3713, 747,7916, 635,4242,4528,7917,7918,7919,4243,7920,7921,4529,7922, // 7238\n3378,4530,2432, 451,7923,3714,2535,2072,4244,2735,4245,4022,7924,1764,4531,7925, // 7254\n4246, 350,7926,2278,2390,2486,7927,4247,4023,2245,1434,4024, 488,4532, 458,4248, // 7270\n4025,3715, 771,1330,2391,3835,2568,3159,2159,2409,1553,2667,3160,4249,7928,2487, // 7286\n2881,2612,1720,2702,4250,3379,4533,7929,2536,4251,7930,3231,4252,2768,7931,2015, // 7302\n2736,7932,1155,1017,3716,3836,7933,3303,2308, 201,1864,4253,1430,7934,4026,7935, // 7318\n7936,7937,7938,7939,4254,1604,7940, 414,1865, 371,2587,4534,4535,3485,2016,3104, // 7334\n4536,1708, 960,4255, 887, 389,2171,1536,1663,1721,7941,2228,4027,2351,2926,1580, // 7350\n7942,7943,7944,1744,7945,2537,4537,4538,7946,4539,7947,2073,7948,7949,3592,3380, // 7366\n2882,4256,7950,4257,2640,3381,2802, 673,2703,2460, 709,3486,4028,3593,4258,7951, // 7382\n1148, 502, 634,7952,7953,1204,4540,3594,1575,4541,2613,3717,7954,3718,3105, 948, // 7398\n3232, 121,1745,3837,1110,7955,4259,3063,2509,3009,4029,3719,1151,1771,3838,1488, // 7414\n4030,1986,7956,2433,3487,7957,7958,2093,7959,4260,3839,1213,1407,2803, 531,2737, // 7430\n2538,3233,1011,1537,7960,2769,4261,3106,1061,7961,3720,3721,1866,2883,7962,2017, // 7446\n 120,4262,4263,2062,3595,3234,2309,3840,2668,3382,1954,4542,7963,7964,3488,1047, // 7462\n2704,1266,7965,1368,4543,2845, 649,3383,3841,2539,2738,1102,2846,2669,7966,7967, // 7478\n1999,7968,1111,3596,2962,7969,2488,3842,3597,2804,1854,3384,3722,7970,7971,3385, // 7494\n2410,2884,3304,3235,3598,7972,2569,7973,3599,2805,4031,1460, 856,7974,3600,7975, // 7510\n2885,2963,7976,2886,3843,7977,4264, 632,2510, 875,3844,1697,3845,2291,7978,7979, // 7526\n4544,3010,1239, 580,4545,4265,7980, 914, 936,2074,1190,4032,1039,2123,7981,7982, // 7542\n7983,3386,1473,7984,1354,4266,3846,7985,2172,3064,4033, 915,3305,4267,4268,3306, // 7558\n1605,1834,7986,2739, 398,3601,4269,3847,4034, 328,1912,2847,4035,3848,1331,4270, // 7574\n3011, 937,4271,7987,3602,4036,4037,3387,2160,4546,3388, 524, 742, 538,3065,1012, // 7590\n7988,7989,3849,2461,7990, 658,1103, 225,3850,7991,7992,4547,7993,4548,7994,3236, // 7606\n1243,7995,4038, 963,2246,4549,7996,2705,3603,3161,7997,7998,2588,2327,7999,4550, // 7622\n8000,8001,8002,3489,3307, 957,3389,2540,2032,1930,2927,2462, 870,2018,3604,1746, // 7638\n2770,2771,2434,2463,8003,3851,8004,3723,3107,3724,3490,3390,3725,8005,1179,3066, // 7654\n8006,3162,2373,4272,3726,2541,3163,3108,2740,4039,8007,3391,1556,2542,2292, 977, // 7670\n2887,2033,4040,1205,3392,8008,1765,3393,3164,2124,1271,1689, 714,4551,3491,8009, // 7686\n2328,3852, 533,4273,3605,2181, 617,8010,2464,3308,3492,2310,8011,8012,3165,8013, // 7702\n8014,3853,1987, 618, 427,2641,3493,3394,8015,8016,1244,1690,8017,2806,4274,4552, // 7718\n8018,3494,8019,8020,2279,1576, 473,3606,4275,3395, 972,8021,3607,8022,3067,8023, // 7734\n8024,4553,4554,8025,3727,4041,4042,8026, 153,4555, 356,8027,1891,2888,4276,2143, // 7750\n 408, 803,2352,8028,3854,8029,4277,1646,2570,2511,4556,4557,3855,8030,3856,4278, // 7766\n8031,2411,3396, 752,8032,8033,1961,2964,8034, 746,3012,2465,8035,4279,3728, 698, // 7782\n4558,1892,4280,3608,2543,4559,3609,3857,8036,3166,3397,8037,1823,1302,4043,2706, // 7798\n3858,1973,4281,8038,4282,3167, 823,1303,1288,1236,2848,3495,4044,3398, 774,3859, // 7814\n8039,1581,4560,1304,2849,3860,4561,8040,2435,2161,1083,3237,4283,4045,4284, 344, // 7830\n1173, 288,2311, 454,1683,8041,8042,1461,4562,4046,2589,8043,8044,4563, 985, 894, // 7846\n8045,3399,3168,8046,1913,2928,3729,1988,8047,2110,1974,8048,4047,8049,2571,1194, // 7862\n 425,8050,4564,3169,1245,3730,4285,8051,8052,2850,8053, 636,4565,1855,3861, 760, // 7878\n1799,8054,4286,2209,1508,4566,4048,1893,1684,2293,8055,8056,8057,4287,4288,2210, // 7894\n 479,8058,8059, 832,8060,4049,2489,8061,2965,2490,3731, 990,3109, 627,1814,2642, // 7910\n4289,1582,4290,2125,2111,3496,4567,8062, 799,4291,3170,8063,4568,2112,1737,3013, // 7926\n1018, 543, 754,4292,3309,1676,4569,4570,4050,8064,1489,8065,3497,8066,2614,2889, // 7942\n4051,8067,8068,2966,8069,8070,8071,8072,3171,4571,4572,2182,1722,8073,3238,3239, // 7958\n1842,3610,1715, 481, 365,1975,1856,8074,8075,1962,2491,4573,8076,2126,3611,3240, // 7974\n 433,1894,2063,2075,8077, 602,2741,8078,8079,8080,8081,8082,3014,1628,3400,8083, // 7990\n3172,4574,4052,2890,4575,2512,8084,2544,2772,8085,8086,8087,3310,4576,2891,8088, // 8006\n4577,8089,2851,4578,4579,1221,2967,4053,2513,8090,8091,8092,1867,1989,8093,8094, // 8022\n8095,1895,8096,8097,4580,1896,4054, 318,8098,2094,4055,4293,8099,8100, 485,8101, // 8038\n 938,3862, 553,2670, 116,8102,3863,3612,8103,3498,2671,2773,3401,3311,2807,8104, // 8054\n3613,2929,4056,1747,2930,2968,8105,8106, 207,8107,8108,2672,4581,2514,8109,3015, // 8070\n 890,3614,3864,8110,1877,3732,3402,8111,2183,2353,3403,1652,8112,8113,8114, 941, // 8086\n2294, 208,3499,4057,2019, 330,4294,3865,2892,2492,3733,4295,8115,8116,8117,8118, // 8102\n\n/*************************************************************************************** \n *Everything below is of no interest for detection purpose\t\t\t\t\t\t\t   *\n ***************************************************************************************\n\n2515,1613,4582,8119,3312,3866,2516,8120,4058,8121,1637,4059,2466,4583,3867,8122, // 8118\n2493,3016,3734,8123,8124,2192,8125,8126,2162,8127,8128,8129,8130,8131,8132,8133, // 8134\n8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149, // 8150\n8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165, // 8166\n8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181, // 8182\n8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197, // 8198\n8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213, // 8214\n8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229, // 8230\n8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245, // 8246\n8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261, // 8262\n8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277, // 8278\n8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8290,8291,8292,8293, // 8294\n8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309, // 8310\n8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325, // 8326\n8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341, // 8342\n8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357, // 8358\n8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373, // 8374\n8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389, // 8390\n8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405, // 8406\n8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421, // 8422\n8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8435,8436,8437, // 8438\n8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453, // 8454\n8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469, // 8470\n8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8480,8481,8482,8483,8484,8485, // 8486\n8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501, // 8502\n8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517, // 8518\n8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533, // 8534\n8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549, // 8550\n8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,8565, // 8566\n8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,8576,8577,8578,8579,8580,8581, // 8582\n8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597, // 8598\n8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613, // 8614\n8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8626,8627,8628,8629, // 8630\n8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645, // 8646\n8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661, // 8662\n8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677, // 8678\n8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693, // 8694\n8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709, // 8710\n8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725, // 8726\n8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741, // 8742\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //13973\n****************************************************************************************/\n};\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/tables/GB18030Freq.tab",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n//GB18030 most frequently used character table\n\n\n//Char to FreqOrder table , from hz6763\n\n/******************************************************************************\n * 512  --> 0.79  -- 0.79\n * 1024 --> 0.92  -- 0.13\n * 2048 --> 0.98  -- 0.06\n * 6768 --> 1.00  -- 0.02\n *\n * Idea Distribution Ratio = 0.79135/(1-0.79135) = 3.79\n * Random Distribution Ration = 512 / (3755 - 512) = 0.157\n * \n * Typical Distribution Ratio about 25% of Ideal one, still much higher that RDR\n *****************************************************************************/\n\n#define GB18030_TYPICAL_DISTRIBUTION_RATIO (float)0.79\n\n#define GB18030_TABLE_SIZE  3760\n\nconstexpr PRInt16 GB18030CharToFreqOrder[] =\n{\n1671, 749,1443,2364,3924,3807,2330,3921,1704,3463,2691,1511,1515, 572,3191,2205,\n2361, 224,2558, 479,1711, 963,3162, 440,4060,1905,2966,2947,3580,2647,3961,3842,\n2204, 869,4207, 970,2678,5626,2944,2956,1479,4048, 514,3595, 588,1346,2820,3409,\n 249,4088,1746,1873,2047,1774, 581,1813, 358,1174,3590,1014,1561,4844,2245, 670,\n1636,3112, 889,1286, 953, 556,2327,3060,1290,3141, 613, 185,3477,1367, 850,3820,\n1715,2428,2642,2303,2732,3041,2562,2648,3566,3946,1349, 388,3098,2091,1360,3585,\n 152,1687,1539, 738,1559,  59,1232,2925,2267,1388,1249,1741,1679,2960, 151,1566,\n1125,1352,4271, 924,4296, 385,3166,4459, 310,1245,2850,  70,3285,2729,3534,3575,\n2398,3298,3466,1960,2265, 217,3647, 864,1909,2084,4401,2773,1010,3269,5152, 853,\n3051,3121,1244,4251,1895, 364,1499,1540,2313,1180,3655,2268, 562, 715,2417,3061,\n 544, 336,3768,2380,1752,4075, 950, 280,2425,4382, 183,2759,3272, 333,4297,2155,\n1688,2356,1444,1039,4540, 736,1177,3349,2443,2368,2144,2225, 565, 196,1482,3406,\n 927,1335,4147, 692, 878,1311,1653,3911,3622,1378,4200,1840,2969,3149,2126,1816,\n2534,1546,2393,2760, 737,2494,  13, 447, 245,2747,  38,2765,2129,2589,1079, 606,\n 360, 471,3755,2890, 404, 848, 699,1785,1236, 370,2221,1023,3746,2074,2026,2023,\n2388,1581,2119, 812,1141,3091,2536,1519, 804,2053, 406,1596,1090, 784, 548,4414,\n1806,2264,2936,1100, 343,4114,5096, 622,3358, 743,3668,1510,1626,5020,3567,2513,\n3195,4115,5627,2489,2991,  24,2065,2697,1087,2719,  48,1634, 315,  68, 985,2052,\n 198,2239,1347,1107,1439, 597,2366,2172, 871,3307, 919,2487,2790,1867, 236,2570,\n1413,3794, 906,3365,3381,1701,1982,1818,1524,2924,1205, 616,2586,2072,2004, 575,\n 253,3099,  32,1365,1182, 197,1714,2454,1201, 554,3388,3224,2748, 756,2587, 250,\n2567,1507,1517,3529,1922,2761,2337,3416,1961,1677,2452,2238,3153, 615, 911,1506,\n1474,2495,1265,1906,2749,3756,3280,2161, 898,2714,1759,3450,2243,2444, 563,  26,\n3286,2266,3769,3344,2707,3677, 611,1402, 531,1028,2871,4548,1375, 261,2948, 835,\n1190,4134, 353, 840,2684,1900,3082,1435,2109,1207,1674, 329,1872,2781,4055,2686,\n2104, 608,3318,2423,2957,2768,1108,3739,3512,3271,3985,2203,1771,3520,1418,2054,\n1681,1153, 225,1627,2929, 162,2050,2511,3687,1954, 124,1859,2431,1684,3032,2894,\n 585,4805,3969,2869,2704,2088,2032,2095,3656,2635,4362,2209, 256, 518,2042,2105,\n3777,3657, 643,2298,1148,1779, 190, 989,3544, 414,  11,2135,2063,2979,1471, 403,\n3678, 126, 770,1563, 671,2499,3216,2877, 600,1179, 307,2805,4937,1268,1297,2694,\n 252,4032,1448,1494,1331,1394, 127,2256, 222,1647,1035,1481,3056,1915,1048, 873,\n3651, 210,  33,1608,2516, 200,1520, 415, 102,   0,3389,1287, 817,  91,3299,2940,\n 836,1814, 549,2197,1396,1669,2987,3582,2297,2848,4528,1070, 687,  20,1819, 121,\n1552,1364,1461,1968,2617,3540,2824,2083, 177, 948,4938,2291, 110,4549,2066, 648,\n3359,1755,2110,2114,4642,4845,1693,3937,3308,1257,1869,2123, 208,1804,3159,2992,\n2531,2549,3361,2418,1350,2347,2800,2568,1291,2036,2680,  72, 842,1990, 212,1233,\n1154,1586,  75,2027,3410,4900,1823,1337,2710,2676, 728,2810,1522,3026,4995, 157,\n 755,1050,4022, 710, 785,1936,2194,2085,1406,2777,2400, 150,1250,4049,1206, 807,\n1910, 534, 529,3309,1721,1660, 274,  39,2827, 661,2670,1578, 925,3248,3815,1094,\n4278,4901,4252,  41,1150,3747,2572,2227,4501,3658,4902,3813,3357,3617,2884,2258,\n 887, 538,4187,3199,1294,2439,3042,2329,2343,2497,1255, 107, 543,1527, 521,3478,\n3568, 194,5062,  15, 961,3870,1241,1192,2664,  66,5215,3260,2111,1295,1127,2152,\n3805,4135, 901,1164,1976, 398,1278, 530,1460, 748, 904,1054,1966,1426,  53,2909,\n 509, 523,2279,1534, 536,1019, 239,1685, 460,2353, 673,1065,2401,3600,4298,2272,\n1272,2363, 284,1753,3679,4064,1695,  81, 815,2677,2757,2731,1386, 859, 500,4221,\n2190,2566, 757,1006,2519,2068,1166,1455, 337,2654,3203,1863,1682,1914,3025,1252,\n1409,1366, 847, 714,2834,2038,3209, 964,2970,1901, 885,2553,1078,1756,3049, 301,\n1572,3326, 688,2130,1996,2429,1805,1648,2930,3421,2750,3652,3088, 262,1158,1254,\n 389,1641,1812, 526,1719, 923,2073,1073,1902, 468, 489,4625,1140, 857,2375,3070,\n3319,2863, 380, 116,1328,2693,1161,2244, 273,1212,1884,2769,3011,1775,1142, 461,\n3066,1200,2147,2212, 790, 702,2695,4222,1601,1058, 434,2338,5153,3640,  67,2360,\n4099,2502, 618,3472,1329, 416,1132, 830,2782,1807,2653,3211,3510,1662, 192,2124,\n 296,3979,1739,1611,3684,  23, 118, 324, 446,1239,1225, 293,2520,3814,3795,2535,\n3116,  17,1074, 467,2692,2201, 387,2922,  45,1326,3055,1645,3659,2817, 958, 243,\n1903,2320,1339,2825,1784,3289, 356, 576, 865,2315,2381,3377,3916,1088,3122,1713,\n1655, 935, 628,4689,1034,1327, 441, 800, 720, 894,1979,2183,1528,5289,2702,1071,\n4046,3572,2399,1571,3281,  79, 761,1103, 327, 134, 758,1899,1371,1615, 879, 442,\n 215,2605,2579, 173,2048,2485,1057,2975,3317,1097,2253,3801,4263,1403,1650,2946,\n 814,4968,3487,1548,2644,1567,1285,   2, 295,2636,  97, 946,3576, 832, 141,4257,\n3273, 760,3821,3521,3156,2607, 949,1024,1733,1516,1803,1920,2125,2283,2665,3180,\n1501,2064,3560,2171,1592, 803,3518,1416, 732,3897,4258,1363,1362,2458, 119,1427,\n 602,1525,2608,1605,1639,3175, 694,3064,  10, 465,  76,2000,4846,4208, 444,3781,\n1619,3353,2206,1273,3796, 740,2483, 320,1723,2377,3660,2619,1359,1137,1762,1724,\n2345,2842,1850,1862, 912, 821,1866, 612,2625,1735,2573,3369,1093, 844,  89, 937,\n 930,1424,3564,2413,2972,1004,3046,3019,2011, 711,3171,1452,4178, 428, 801,1943,\n 432, 445,2811, 206,4136,1472, 730, 349,  73, 397,2802,2547, 998,1637,1167, 789,\n 396,3217, 154,1218, 716,1120,1780,2819,4826,1931,3334,3762,2139,1215,2627, 552,\n3664,3628,3232,1405,2383,3111,1356,2652,3577,3320,3101,1703, 640,1045,1370,1246,\n4996, 371,1575,2436,1621,2210, 984,4033,1734,2638,  16,4529, 663,2755,3255,1451,\n3917,2257,1253,1955,2234,1263,2951, 214,1229, 617, 485, 359,1831,1969, 473,2310,\n 750,2058, 165,  80,2864,2419, 361,4344,2416,2479,1134, 796,3726,1266,2943, 860,\n2715, 938, 390,2734,1313,1384, 248, 202, 877,1064,2854, 522,3907, 279,1602, 297,\n2357, 395,3740, 137,2075, 944,4089,2584,1267,3802,  62,1533,2285, 178, 176, 780,\n2440, 201,3707, 590, 478,1560,4354,2117,1075,  30,  74,4643,4004,1635,1441,2745,\n 776,2596, 238,1077,1692,1912,2844, 605, 499,1742,3947, 241,3053, 980,1749, 936,\n2640,4511,2582, 515,1543,2162,5322,2892,2993, 890,2148,1924, 665,1827,3581,1032,\n 968,3163, 339,1044,1896, 270, 583,1791,1720,4367,1194,3488,3669,  43,2523,1657,\n 163,2167, 290,1209,1622,3378, 550, 634,2508,2510, 695,2634,2384,2512,1476,1414,\n 220,1469,2341,2138,2852,3183,2900,4939,2865,3502,1211,3680, 854,3227,1299,2976,\n3172, 186,2998,1459, 443,1067,3251,1495, 321,1932,3054, 909, 753,1410,1828, 436,\n2441,1119,1587,3164,2186,1258, 227, 231,1425,1890,3200,3942, 247, 959, 725,5254,\n2741, 577,2158,2079, 929, 120, 174, 838,2813, 591,1115, 417,2024,  40,3240,1536,\n1037, 291,4151,2354, 632,1298,2406,2500,3535,1825,1846,3451, 205,1171, 345,4238,\n  18,1163, 811, 685,2208,1217, 425,1312,1508,1175,4308,2552,1033, 587,1381,3059,\n2984,3482, 340,1316,4023,3972, 792,3176, 519, 777,4690, 918, 933,4130,2981,3741,\n  90,3360,2911,2200,5184,4550, 609,3079,2030, 272,3379,2736, 363,3881,1130,1447,\n 286, 779, 357,1169,3350,3137,1630,1220,2687,2391, 747,1277,3688,2618,2682,2601,\n1156,3196,5290,4034,3102,1689,3596,3128, 874, 219,2783, 798, 508,1843,2461, 269,\n1658,1776,1392,1913,2983,3287,2866,2159,2372, 829,4076,  46,4253,2873,1889,1894,\n 915,1834,1631,2181,2318, 298, 664,2818,3555,2735, 954,3228,3117, 527,3511,2173,\n 681,2712,3033,2247,2346,3467,1652, 155,2164,3382, 113,1994, 450, 899, 494, 994,\n1237,2958,1875,2336,1926,3727, 545,1577,1550, 633,3473, 204,1305,3072,2410,1956,\n2471, 707,2134, 841,2195,2196,2663,3843,1026,4940, 990,3252,4997, 368,1092, 437,\n3212,3258,1933,1829, 675,2977,2893, 412, 943,3723,4644,3294,3283,2230,2373,5154,\n2389,2241,2661,2323,1404,2524, 593, 787, 677,3008,1275,2059, 438,2709,2609,2240,\n2269,2246,1446,  36,1568,1373,3892,1574,2301,1456,3962, 693,2276,5216,2035,1143,\n2720,1919,1797,1811,2763,4137,2597,1830,1699,1488,1198,2090, 424,1694, 312,3634,\n3390,4179,3335,2252,1214, 561,1059,3243,2295,2561, 975,5155,2321,2751,3772, 472,\n1537,3282,3398,1047,2077,2348,2878,1323,3340,3076, 690,2906,  51, 369, 170,3541,\n1060,2187,2688,3670,2541,1083,1683, 928,3918, 459, 109,4427, 599,3744,4286, 143,\n2101,2730,2490,  82,1588,3036,2121, 281,1860, 477,4035,1238,2812,3020,2716,3312,\n1530,2188,2055,1317, 843, 636,1808,1173,3495, 649, 181,1002, 147,3641,1159,2414,\n3750,2289,2795, 813,3123,2610,1136,4368,   5,3391,4541,2174, 420, 429,1728, 754,\n1228,2115,2219, 347,2223,2733, 735,1518,3003,2355,3134,1764,3948,3329,1888,2424,\n1001,1234,1972,3321,3363,1672,1021,1450,1584, 226, 765, 655,2526,3404,3244,2302,\n3665, 731, 594,2184, 319,1576, 621, 658,2656,4299,2099,3864,1279,2071,2598,2739,\n 795,3086,3699,3908,1707,2352,2402,1382,3136,2475,1465,4847,3496,3865,1085,3004,\n2591,1084, 213,2287,1963,3565,2250, 822, 793,4574,3187,1772,1789,3050, 595,1484,\n1959,2770,1080,2650, 456, 422,2996, 940,3322,4328,4345,3092,2742, 965,2784, 739,\n4124, 952,1358,2498,2949,2565, 332,2698,2378, 660,2260,2473,4194,3856,2919, 535,\n1260,2651,1208,1428,1300,1949,1303,2942, 433,2455,2450,1251,1946, 614,1269, 641,\n1306,1810,2737,3078,2912, 564,2365,1419,1415,1497,4460,2367,2185,1379,3005,1307,\n3218,2175,1897,3063, 682,1157,4040,4005,1712,1160,1941,1399, 394, 402,2952,1573,\n1151,2986,2404, 862, 299,2033,1489,3006, 346, 171,2886,3401,1726,2932, 168,2533,\n  47,2507,1030,3735,1145,3370,1395,1318,1579,3609,4560,2857,4116,1457,2529,1965,\n 504,1036,2690,2988,2405, 745,5871, 849,2397,2056,3081, 863,2359,3857,2096,  99,\n1397,1769,2300,4428,1643,3455,1978,1757,3718,1440,  35,4879,3742,1296,4228,2280,\n 160,5063,1599,2013, 166, 520,3479,1646,3345,3012, 490,1937,1545,1264,2182,2505,\n1096,1188,1369,1436,2421,1667,2792,2460,1270,2122, 727,3167,2143, 806,1706,1012,\n1800,3037, 960,2218,1882, 805, 139,2456,1139,1521, 851,1052,3093,3089, 342,2039,\n 744,5097,1468,1502,1585,2087, 223, 939, 326,2140,2577, 892,2481,1623,4077, 982,\n3708, 135,2131,  87,2503,3114,2326,1106, 876,1616, 547,2997,2831,2093,3441,4530,\n4314,   9,3256,4229,4148, 659,1462,1986,1710,2046,2913,2231,4090,4880,5255,3392,\n3274,1368,3689,4645,1477, 705,3384,3635,1068,1529,2941,1458,3782,1509, 100,1656,\n2548, 718,2339, 408,1590,2780,3548,1838,4117,3719,1345,3530, 717,3442,2778,3220,\n2898,1892,4590,3614,3371,2043,1998,1224,3483, 891, 635, 584,2559,3355, 733,1766,\n1729,1172,3789,1891,2307, 781,2982,2271,1957,1580,5773,2633,2005,4195,3097,1535,\n3213,1189,1934,5693,3262, 586,3118,1324,1598, 517,1564,2217,1868,1893,4445,3728,\n2703,3139,1526,1787,1992,3882,2875,1549,1199,1056,2224,1904,2711,5098,4287, 338,\n1993,3129,3489,2689,1809,2815,1997, 957,1855,3898,2550,3275,3057,1105,1319, 627,\n1505,1911,1883,3526, 698,3629,3456,1833,1431, 746,  77,1261,2017,2296,1977,1885,\n 125,1334,1600, 525,1798,1109,2222,1470,1945, 559,2236,1186,3443,2476,1929,1411,\n2411,3135,1777,3372,2621,1841,1613,3229, 668,1430,1839,2643,2916, 195,1989,2671,\n2358,1387, 629,3205,2293,5256,4439, 123,1310, 888,1879,4300,3021,3605,1003,1162,\n3192,2910,2010, 140,2395,2859,  55,1082,2012,2901, 662, 419,2081,1438, 680,2774,\n4654,3912,1620,1731,1625,5035,4065,2328, 512,1344, 802,5443,2163,2311,2537, 524,\n3399,  98,1155,2103,1918,2606,3925,2816,1393,2465,1504,3773,2177,3963,1478,4346,\n 180,1113,4655,3461,2028,1698, 833,2696,1235,1322,1594,4408,3623,3013,3225,2040,\n3022, 541,2881, 607,3632,2029,1665,1219, 639,1385,1686,1099,2803,3231,1938,3188,\n2858, 427, 676,2772,1168,2025, 454,3253,2486,3556, 230,1950, 580, 791,1991,1280,\n1086,1974,2034, 630, 257,3338,2788,4903,1017,  86,4790, 966,2789,1995,1696,1131,\n 259,3095,4188,1308, 179,1463,5257, 289,4107,1248,  42,3413,1725,2288, 896,1947,\n 774,4474,4254, 604,3430,4264, 392,2514,2588, 452, 237,1408,3018, 988,4531,1970,\n3034,3310, 540,2370,1562,1288,2990, 502,4765,1147,   4,1853,2708, 207, 294,2814,\n4078,2902,2509, 684,  34,3105,3532,2551, 644, 709,2801,2344, 573,1727,3573,3557,\n2021,1081,3100,4315,2100,3681, 199,2263,1837,2385, 146,3484,1195,2776,3949, 997,\n1939,3973,1008,1091,1202,1962,1847,1149,4209,5444,1076, 493, 117,5400,2521, 972,\n1490,2934,1796,4542,2374,1512,2933,2657, 413,2888,1135,2762,2314,2156,1355,2369,\n 766,2007,2527,2170,3124,2491,2593,2632,4757,2437, 234,3125,3591,1898,1750,1376,\n1942,3468,3138, 570,2127,2145,3276,4131, 962, 132,1445,4196,  19, 941,3624,3480,\n3366,1973,1374,4461,3431,2629, 283,2415,2275, 808,2887,3620,2112,2563,1353,3610,\n 955,1089,3103,1053,  96,  88,4097, 823,3808,1583, 399, 292,4091,3313, 421,1128,\n 642,4006, 903,2539,1877,2082, 596,  29,4066,1790, 722,2157, 130, 995,1569, 769,\n1485, 464, 513,2213, 288,1923,1101,2453,4316, 133, 486,2445,  50, 625, 487,2207,\n  57, 423, 481,2962, 159,3729,1558, 491, 303, 482, 501, 240,2837, 112,3648,2392,\n1783, 362,   8,3433,3422, 610,2793,3277,1390,1284,1654,  21,3823, 734, 367, 623,\n 193, 287, 374,1009,1483, 816, 476, 313,2255,2340,1262,2150,2899,1146,2581, 782,\n2116,1659,2018,1880, 255,3586,3314,1110,2867,2137,2564, 986,2767,5185,2006, 650,\n 158, 926, 762, 881,3157,2717,2362,3587, 306,3690,3245,1542,3077,2427,1691,2478,\n2118,2985,3490,2438, 539,2305, 983, 129,1754, 355,4201,2386, 827,2923, 104,1773,\n2838,2771, 411,2905,3919, 376, 767, 122,1114, 828,2422,1817,3506, 266,3460,1007,\n1609,4998, 945,2612,4429,2274, 726,1247,1964,2914,2199,2070,4002,4108, 657,3323,\n1422, 579, 455,2764,4737,1222,2895,1670, 824,1223,1487,2525, 558, 861,3080, 598,\n2659,2515,1967, 752,2583,2376,2214,4180, 977, 704,2464,4999,2622,4109,1210,2961,\n 819,1541, 142,2284,  44, 418, 457,1126,3730,4347,4626,1644,1876,3671,1864, 302,\n1063,5694, 624, 723,1984,3745,1314,1676,2488,1610,1449,3558,3569,2166,2098, 409,\n1011,2325,3704,2306, 818,1732,1383,1824,1844,3757, 999,2705,3497,1216,1423,2683,\n2426,2954,2501,2726,2229,1475,2554,5064,1971,1794,1666,2014,1343, 783, 724, 191,\n2434,1354,2220,5065,1763,2752,2472,4152, 131, 175,2885,3434,  92,1466,4920,2616,\n3871,3872,3866, 128,1551,1632, 669,1854,3682,4691,4125,1230, 188,2973,3290,1302,\n1213, 560,3266, 917, 763,3909,3249,1760, 868,1958, 764,1782,2097, 145,2277,3774,\n4462,  64,1491,3062, 971,2132,3606,2442, 221,1226,1617, 218, 323,1185,3207,3147,\n 571, 619,1473,1005,1744,2281, 449,1887,2396,3685, 275, 375,3816,1743,3844,3731,\n 845,1983,2350,4210,1377, 773, 967,3499,3052,3743,2725,4007,1697,1022,3943,1464,\n3264,2855,2722,1952,1029,2839,2467,  84,4383,2215, 820,1391,2015,2448,3672, 377,\n1948,2168, 797,2545,3536,2578,2645,  94,2874,1678, 405,1259,3071, 771, 546,1315,\n 470,1243,3083, 895,2468, 981, 969,2037, 846,4181, 653,1276,2928,  14,2594, 557,\n3007,2474, 156, 902,1338,1740,2574, 537,2518, 973,2282,2216,2433,1928, 138,2903,\n1293,2631,1612, 646,3457, 839,2935, 111, 496,2191,2847, 589,3186, 149,3994,2060,\n4031,2641,4067,3145,1870,  37,3597,2136,1025,2051,3009,3383,3549,1121,1016,3261,\n1301, 251,2446,2599,2153, 872,3246, 637, 334,3705, 831, 884, 921,3065,3140,4092,\n2198,1944, 246,2964, 108,2045,1152,1921,2308,1031, 203,3173,4170,1907,3890, 810,\n1401,2003,1690, 506, 647,1242,2828,1761,1649,3208,2249,1589,3709,2931,5156,1708,\n 498, 666,2613, 834,3817,1231, 184,2851,1124, 883,3197,2261,3710,1765,1553,2658,\n1178,2639,2351,  93,1193, 942,2538,2141,4402, 235,1821, 870,1591,2192,1709,1871,\n3341,1618,4126,2595,2334, 603, 651,  69, 701, 268,2662,3411,2555,1380,1606, 503,\n 448, 254,2371,2646, 574,1187,2309,1770, 322,2235,1292,1801, 305, 566,1133, 229,\n2067,2057, 706, 167, 483,2002,2672,3295,1820,3561,3067, 316, 378,2746,3452,1112,\n 136,1981, 507,1651,2917,1117, 285,4591, 182,2580,3522,1304, 335,3303,1835,2504,\n1795,1792,2248, 674,1018,2106,2449,1857,2292,2845, 976,3047,1781,2600,2727,1389,\n1281,  52,3152, 153, 265,3950, 672,3485,3951,4463, 430,1183, 365, 278,2169,  27,\n1407,1336,2304, 209,1340,1730,2202,1852,2403,2883, 979,1737,1062, 631,2829,2542,\n3876,2592, 825,2086,2226,3048,3625, 352,1417,3724, 542, 991, 431,1351,3938,1861,\n2294, 826,1361,2927,3142,3503,1738, 463,2462,2723, 582,1916,1595,2808, 400,3845,\n3891,2868,3621,2254,  58,2492,1123, 910,2160,2614,1372,1603,1196,1072,3385,1700,\n3267,1980, 696, 480,2430, 920, 799,1570,2920,1951,2041,4047,2540,1321,4223,2469,\n3562,2228,1271,2602, 401,2833,3351,2575,5157, 907,2312,1256, 410, 263,3507,1582,\n 996, 678,1849,2316,1480, 908,3545,2237, 703,2322, 667,1826,2849,1531,2604,2999,\n2407,3146,2151,2630,1786,3711, 469,3542, 497,3899,2409, 858, 837,4446,3393,1274,\n 786, 620,1845,2001,3311, 484, 308,3367,1204,1815,3691,2332,1532,2557,1842,2020,\n2724,1927,2333,4440, 567,  22,1673,2728,4475,1987,1858,1144,1597, 101,1832,3601,\n  12, 974,3783,4391, 951,1412,   1,3720, 453,4608,4041, 528,1041,1027,3230,2628,\n1129, 875,1051,3291,1203,2262,1069,2860,2799,2149,2615,3278, 144,1758,3040,  31,\n 475,1680, 366,2685,3184, 311,1642,4008,2466,5036,1593,1493,2809, 216,1420,1668,\n 233, 304,2128,3284, 232,1429,1768,1040,2008,3407,2740,2967,2543, 242,2133, 778,\n1565,2022,2620, 505,2189,2756,1098,2273, 372,1614, 708, 553,2846,2094,2278, 169,\n3626,2835,4161, 228,2674,3165, 809,1454,1309, 466,1705,1095, 900,3423, 880,2667,\n3751,5258,2317,3109,2571,4317,2766,1503,1342, 866,4447,1118,  63,2076, 314,1881,\n1348,1061, 172, 978,3515,1747, 532, 511,3970,   6, 601, 905,2699,3300,1751, 276,\n1467,3725,2668,  65,4239,2544,2779,2556,1604, 578,2451,1802, 992,2331,2624,1320,\n3446, 713,1513,1013, 103,2786,2447,1661, 886,1702, 916, 654,3574,2031,1556, 751,\n2178,2821,2179,1498,1538,2176, 271, 914,2251,2080,1325, 638,1953,2937,3877,2432,\n2754,  95,3265,1716, 260,1227,4083, 775, 106,1357,3254, 426,1607, 555,2480, 772,\n1985, 244,2546, 474, 495,1046,2611,1851,2061,  71,2089,1675,2590, 742,3758,2843,\n3222,1433, 267,2180,2576,2826,2233,2092,3913,2435, 956,1745,3075, 856,2113,1116,\n 451,   3,1988,2896,1398, 993,2463,1878,2049,1341,2718,2721,2870,2108, 712,2904,\n4363,2753,2324, 277,2872,2349,2649, 384, 987, 435, 691,3000, 922, 164,3939, 652,\n1500,1184,4153,2482,3373,2165,4848,2335,3775,3508,3154,2806,2830,1554,2102,1664,\n2530,1434,2408, 893,1547,2623,3447,2832,2242,2532,3169,2856,3223,2078,  49,3770,\n3469, 462, 318, 656,2259,3250,3069, 679,1629,2758, 344,1138,1104,3120,1836,1283,\n3115,2154,1437,4448, 934, 759,1999, 794,2862,1038, 533,2560,1722,2342, 855,2626,\n1197,1663,4476,3127,  85,4240,2528,  25,1111,1181,3673, 407,3470,4561,2679,2713,\n 768,1925,2841,3986,1544,1165, 932, 373,1240,2146,1930,2673, 721,4766, 354,4333,\n 391,2963, 187,  61,3364,1442,1102, 330,1940,1767, 341,3809,4118, 393,2496,2062,\n2211, 105, 331, 300, 439, 913,1332, 626, 379,3304,1557, 328, 689,3952, 309,1555,\n 931, 317,2517,3027, 325, 569, 686,2107,3084,  60,1042,1333,2794, 264,3177,4014,\n1628, 258,3712,   7,4464,1176,1043,1778, 683, 114,1975,  78,1492, 383,1886, 510,\n 386, 645,5291,2891,2069,3305,4138,3867,2939,2603,2493,1935,1066,1848,3588,1015,\n1282,1289,4609, 697,1453,3044,2666,3611,1856,2412,  54, 719,1330, 568,3778,2459,\n1748, 788, 492, 551,1191,1000, 488,3394,3763, 282,1799, 348,2016,1523,3155,2390,\n1049, 382,2019,1788,1170, 729,2968,3523, 897,3926,2785,2938,3292, 350,2319,3238,\n1718,1717,2655,3453,3143,4465, 161,2889,2980,2009,1421,  56,1908,1640,2387,2232,\n1917,1874,2477,4921, 148,  83,3438, 592,4245,2882,1822,1055, 741, 115,1496,1624,\n 381,1638,4592,1020, 516,3214, 458, 947,4575,1432, 211,1514,2926,1865,2142, 189,\n 852,1221,1400,1486, 882,2299,4036, 351,  28,1122, 700,6479,6480,6481,6482,6483,  //last 512\n\n/*************************************************************************************** \n *Everything below is of no interest for detection purpose\t\t\t\t\t\t\t   *\n ***************************************************************************************\n\n5508,6484,3900,3414,3974,4441,4024,3537,4037,5628,5099,3633,6485,3148,6486,3636,\n5509,3257,5510,5973,5445,5872,4941,4403,3174,4627,5873,6276,2286,4230,5446,5874,\n5122,6102,6103,4162,5447,5123,5323,4849,6277,3980,3851,5066,4246,5774,5067,6278,\n3001,2807,5695,3346,5775,5974,5158,5448,6487,5975,5976,5776,3598,6279,5696,4806,\n4211,4154,6280,6488,6489,6490,6281,4212,5037,3374,4171,6491,4562,4807,4722,4827,\n5977,6104,4532,4079,5159,5324,5160,4404,3858,5359,5875,3975,4288,4610,3486,4512,\n5325,3893,5360,6282,6283,5560,2522,4231,5978,5186,5449,2569,3878,6284,5401,3578,\n4415,6285,4656,5124,5979,2506,4247,4449,3219,3417,4334,4969,4329,6492,4576,4828,\n4172,4416,4829,5402,6286,3927,3852,5361,4369,4830,4477,4867,5876,4173,6493,6105,\n4657,6287,6106,5877,5450,6494,4155,4868,5451,3700,5629,4384,6288,6289,5878,3189,\n4881,6107,6290,6495,4513,6496,4692,4515,4723,5100,3356,6497,6291,3810,4080,5561,\n3570,4430,5980,6498,4355,5697,6499,4724,6108,6109,3764,4050,5038,5879,4093,3226,\n6292,5068,5217,4693,3342,5630,3504,4831,4377,4466,4309,5698,4431,5777,6293,5778,\n4272,3706,6110,5326,3752,4676,5327,4273,5403,4767,5631,6500,5699,5880,3475,5039,\n6294,5562,5125,4348,4301,4482,4068,5126,4593,5700,3380,3462,5981,5563,3824,5404,\n4970,5511,3825,4738,6295,6501,5452,4516,6111,5881,5564,6502,6296,5982,6503,4213,\n4163,3454,6504,6112,4009,4450,6113,4658,6297,6114,3035,6505,6115,3995,4904,4739,\n4563,4942,4110,5040,3661,3928,5362,3674,6506,5292,3612,4791,5565,4149,5983,5328,\n5259,5021,4725,4577,4564,4517,4364,6298,5405,4578,5260,4594,4156,4157,5453,3592,\n3491,6507,5127,5512,4709,4922,5984,5701,4726,4289,6508,4015,6116,5128,4628,3424,\n4241,5779,6299,4905,6509,6510,5454,5702,5780,6300,4365,4923,3971,6511,5161,3270,\n3158,5985,4100, 867,5129,5703,6117,5363,3695,3301,5513,4467,6118,6512,5455,4232,\n4242,4629,6513,3959,4478,6514,5514,5329,5986,4850,5162,5566,3846,4694,6119,5456,\n4869,5781,3779,6301,5704,5987,5515,4710,6302,5882,6120,4392,5364,5705,6515,6121,\n6516,6517,3736,5988,5457,5989,4695,2457,5883,4551,5782,6303,6304,6305,5130,4971,\n6122,5163,6123,4870,3263,5365,3150,4871,6518,6306,5783,5069,5706,3513,3498,4409,\n5330,5632,5366,5458,5459,3991,5990,4502,3324,5991,5784,3696,4518,5633,4119,6519,\n4630,5634,4417,5707,4832,5992,3418,6124,5993,5567,4768,5218,6520,4595,3458,5367,\n6125,5635,6126,4202,6521,4740,4924,6307,3981,4069,4385,6308,3883,2675,4051,3834,\n4302,4483,5568,5994,4972,4101,5368,6309,5164,5884,3922,6127,6522,6523,5261,5460,\n5187,4164,5219,3538,5516,4111,3524,5995,6310,6311,5369,3181,3386,2484,5188,3464,\n5569,3627,5708,6524,5406,5165,4677,4492,6312,4872,4851,5885,4468,5996,6313,5709,\n5710,6128,2470,5886,6314,5293,4882,5785,3325,5461,5101,6129,5711,5786,6525,4906,\n6526,6527,4418,5887,5712,4808,2907,3701,5713,5888,6528,3765,5636,5331,6529,6530,\n3593,5889,3637,4943,3692,5714,5787,4925,6315,6130,5462,4405,6131,6132,6316,5262,\n6531,6532,5715,3859,5716,5070,4696,5102,3929,5788,3987,4792,5997,6533,6534,3920,\n4809,5000,5998,6535,2974,5370,6317,5189,5263,5717,3826,6536,3953,5001,4883,3190,\n5463,5890,4973,5999,4741,6133,6134,3607,5570,6000,4711,3362,3630,4552,5041,6318,\n6001,2950,2953,5637,4646,5371,4944,6002,2044,4120,3429,6319,6537,5103,4833,6538,\n6539,4884,4647,3884,6003,6004,4758,3835,5220,5789,4565,5407,6540,6135,5294,4697,\n4852,6320,6321,3206,4907,6541,6322,4945,6542,6136,6543,6323,6005,4631,3519,6544,\n5891,6545,5464,3784,5221,6546,5571,4659,6547,6324,6137,5190,6548,3853,6549,4016,\n4834,3954,6138,5332,3827,4017,3210,3546,4469,5408,5718,3505,4648,5790,5131,5638,\n5791,5465,4727,4318,6325,6326,5792,4553,4010,4698,3439,4974,3638,4335,3085,6006,\n5104,5042,5166,5892,5572,6327,4356,4519,5222,5573,5333,5793,5043,6550,5639,5071,\n4503,6328,6139,6551,6140,3914,3901,5372,6007,5640,4728,4793,3976,3836,4885,6552,\n4127,6553,4451,4102,5002,6554,3686,5105,6555,5191,5072,5295,4611,5794,5296,6556,\n5893,5264,5894,4975,5466,5265,4699,4976,4370,4056,3492,5044,4886,6557,5795,4432,\n4769,4357,5467,3940,4660,4290,6141,4484,4770,4661,3992,6329,4025,4662,5022,4632,\n4835,4070,5297,4663,4596,5574,5132,5409,5895,6142,4504,5192,4664,5796,5896,3885,\n5575,5797,5023,4810,5798,3732,5223,4712,5298,4084,5334,5468,6143,4052,4053,4336,\n4977,4794,6558,5335,4908,5576,5224,4233,5024,4128,5469,5225,4873,6008,5045,4729,\n4742,4633,3675,4597,6559,5897,5133,5577,5003,5641,5719,6330,6560,3017,2382,3854,\n4406,4811,6331,4393,3964,4946,6561,2420,3722,6562,4926,4378,3247,1736,4442,6332,\n5134,6333,5226,3996,2918,5470,4319,4003,4598,4743,4744,4485,3785,3902,5167,5004,\n5373,4394,5898,6144,4874,1793,3997,6334,4085,4214,5106,5642,4909,5799,6009,4419,\n4189,3330,5899,4165,4420,5299,5720,5227,3347,6145,4081,6335,2876,3930,6146,3293,\n3786,3910,3998,5900,5300,5578,2840,6563,5901,5579,6147,3531,5374,6564,6565,5580,\n4759,5375,6566,6148,3559,5643,6336,6010,5517,6337,6338,5721,5902,3873,6011,6339,\n6567,5518,3868,3649,5722,6568,4771,4947,6569,6149,4812,6570,2853,5471,6340,6341,\n5644,4795,6342,6012,5723,6343,5724,6013,4349,6344,3160,6150,5193,4599,4514,4493,\n5168,4320,6345,4927,3666,4745,5169,5903,5005,4928,6346,5725,6014,4730,4203,5046,\n4948,3395,5170,6015,4150,6016,5726,5519,6347,5047,3550,6151,6348,4197,4310,5904,\n6571,5581,2965,6152,4978,3960,4291,5135,6572,5301,5727,4129,4026,5905,4853,5728,\n5472,6153,6349,4533,2700,4505,5336,4678,3583,5073,2994,4486,3043,4554,5520,6350,\n6017,5800,4487,6351,3931,4103,5376,6352,4011,4321,4311,4190,5136,6018,3988,3233,\n4350,5906,5645,4198,6573,5107,3432,4191,3435,5582,6574,4139,5410,6353,5411,3944,\n5583,5074,3198,6575,6354,4358,6576,5302,4600,5584,5194,5412,6577,6578,5585,5413,\n5303,4248,5414,3879,4433,6579,4479,5025,4854,5415,6355,4760,4772,3683,2978,4700,\n3797,4452,3965,3932,3721,4910,5801,6580,5195,3551,5907,3221,3471,3029,6019,3999,\n5908,5909,5266,5267,3444,3023,3828,3170,4796,5646,4979,4259,6356,5647,5337,3694,\n6357,5648,5338,4520,4322,5802,3031,3759,4071,6020,5586,4836,4386,5048,6581,3571,\n4679,4174,4949,6154,4813,3787,3402,3822,3958,3215,3552,5268,4387,3933,4950,4359,\n6021,5910,5075,3579,6358,4234,4566,5521,6359,3613,5049,6022,5911,3375,3702,3178,\n4911,5339,4521,6582,6583,4395,3087,3811,5377,6023,6360,6155,4027,5171,5649,4421,\n4249,2804,6584,2270,6585,4000,4235,3045,6156,5137,5729,4140,4312,3886,6361,4330,\n6157,4215,6158,3500,3676,4929,4331,3713,4930,5912,4265,3776,3368,5587,4470,4855,\n3038,4980,3631,6159,6160,4132,4680,6161,6362,3923,4379,5588,4255,6586,4121,6587,\n6363,4649,6364,3288,4773,4774,6162,6024,6365,3543,6588,4274,3107,3737,5050,5803,\n4797,4522,5589,5051,5730,3714,4887,5378,4001,4523,6163,5026,5522,4701,4175,2791,\n3760,6589,5473,4224,4133,3847,4814,4815,4775,3259,5416,6590,2738,6164,6025,5304,\n3733,5076,5650,4816,5590,6591,6165,6592,3934,5269,6593,3396,5340,6594,5804,3445,\n3602,4042,4488,5731,5732,3525,5591,4601,5196,6166,6026,5172,3642,4612,3202,4506,\n4798,6366,3818,5108,4303,5138,5139,4776,3332,4304,2915,3415,4434,5077,5109,4856,\n2879,5305,4817,6595,5913,3104,3144,3903,4634,5341,3133,5110,5651,5805,6167,4057,\n5592,2945,4371,5593,6596,3474,4182,6367,6597,6168,4507,4279,6598,2822,6599,4777,\n4713,5594,3829,6169,3887,5417,6170,3653,5474,6368,4216,2971,5228,3790,4579,6369,\n5733,6600,6601,4951,4746,4555,6602,5418,5475,6027,3400,4665,5806,6171,4799,6028,\n5052,6172,3343,4800,4747,5006,6370,4556,4217,5476,4396,5229,5379,5477,3839,5914,\n5652,5807,4714,3068,4635,5808,6173,5342,4192,5078,5419,5523,5734,6174,4557,6175,\n4602,6371,6176,6603,5809,6372,5735,4260,3869,5111,5230,6029,5112,6177,3126,4681,\n5524,5915,2706,3563,4748,3130,6178,4018,5525,6604,6605,5478,4012,4837,6606,4534,\n4193,5810,4857,3615,5479,6030,4082,3697,3539,4086,5270,3662,4508,4931,5916,4912,\n5811,5027,3888,6607,4397,3527,3302,3798,2775,2921,2637,3966,4122,4388,4028,4054,\n1633,4858,5079,3024,5007,3982,3412,5736,6608,3426,3236,5595,3030,6179,3427,3336,\n3279,3110,6373,3874,3039,5080,5917,5140,4489,3119,6374,5812,3405,4494,6031,4666,\n4141,6180,4166,6032,5813,4981,6609,5081,4422,4982,4112,3915,5653,3296,3983,6375,\n4266,4410,5654,6610,6181,3436,5082,6611,5380,6033,3819,5596,4535,5231,5306,5113,\n6612,4952,5918,4275,3113,6613,6376,6182,6183,5814,3073,4731,4838,5008,3831,6614,\n4888,3090,3848,4280,5526,5232,3014,5655,5009,5737,5420,5527,6615,5815,5343,5173,\n5381,4818,6616,3151,4953,6617,5738,2796,3204,4360,2989,4281,5739,5174,5421,5197,\n3132,5141,3849,5142,5528,5083,3799,3904,4839,5480,2880,4495,3448,6377,6184,5271,\n5919,3771,3193,6034,6035,5920,5010,6036,5597,6037,6378,6038,3106,5422,6618,5423,\n5424,4142,6619,4889,5084,4890,4313,5740,6620,3437,5175,5307,5816,4199,5198,5529,\n5817,5199,5656,4913,5028,5344,3850,6185,2955,5272,5011,5818,4567,4580,5029,5921,\n3616,5233,6621,6622,6186,4176,6039,6379,6380,3352,5200,5273,2908,5598,5234,3837,\n5308,6623,6624,5819,4496,4323,5309,5201,6625,6626,4983,3194,3838,4167,5530,5922,\n5274,6381,6382,3860,3861,5599,3333,4292,4509,6383,3553,5481,5820,5531,4778,6187,\n3955,3956,4324,4389,4218,3945,4325,3397,2681,5923,4779,5085,4019,5482,4891,5382,\n5383,6040,4682,3425,5275,4094,6627,5310,3015,5483,5657,4398,5924,3168,4819,6628,\n5925,6629,5532,4932,4613,6041,6630,4636,6384,4780,4204,5658,4423,5821,3989,4683,\n5822,6385,4954,6631,5345,6188,5425,5012,5384,3894,6386,4490,4104,6632,5741,5053,\n6633,5823,5926,5659,5660,5927,6634,5235,5742,5824,4840,4933,4820,6387,4859,5928,\n4955,6388,4143,3584,5825,5346,5013,6635,5661,6389,5014,5484,5743,4337,5176,5662,\n6390,2836,6391,3268,6392,6636,6042,5236,6637,4158,6638,5744,5663,4471,5347,3663,\n4123,5143,4293,3895,6639,6640,5311,5929,5826,3800,6189,6393,6190,5664,5348,3554,\n3594,4749,4603,6641,5385,4801,6043,5827,4183,6642,5312,5426,4761,6394,5665,6191,\n4715,2669,6643,6644,5533,3185,5427,5086,5930,5931,5386,6192,6044,6645,4781,4013,\n5745,4282,4435,5534,4390,4267,6045,5746,4984,6046,2743,6193,3501,4087,5485,5932,\n5428,4184,4095,5747,4061,5054,3058,3862,5933,5600,6646,5144,3618,6395,3131,5055,\n5313,6396,4650,4956,3855,6194,3896,5202,4985,4029,4225,6195,6647,5828,5486,5829,\n3589,3002,6648,6397,4782,5276,6649,6196,6650,4105,3803,4043,5237,5830,6398,4096,\n3643,6399,3528,6651,4453,3315,4637,6652,3984,6197,5535,3182,3339,6653,3096,2660,\n6400,6654,3449,5934,4250,4236,6047,6401,5831,6655,5487,3753,4062,5832,6198,6199,\n6656,3766,6657,3403,4667,6048,6658,4338,2897,5833,3880,2797,3780,4326,6659,5748,\n5015,6660,5387,4351,5601,4411,6661,3654,4424,5935,4339,4072,5277,4568,5536,6402,\n6662,5238,6663,5349,5203,6200,5204,6201,5145,4536,5016,5056,4762,5834,4399,4957,\n6202,6403,5666,5749,6664,4340,6665,5936,5177,5667,6666,6667,3459,4668,6404,6668,\n6669,4543,6203,6670,4276,6405,4480,5537,6671,4614,5205,5668,6672,3348,2193,4763,\n6406,6204,5937,5602,4177,5669,3419,6673,4020,6205,4443,4569,5388,3715,3639,6407,\n6049,4058,6206,6674,5938,4544,6050,4185,4294,4841,4651,4615,5488,6207,6408,6051,\n5178,3241,3509,5835,6208,4958,5836,4341,5489,5278,6209,2823,5538,5350,5206,5429,\n6675,4638,4875,4073,3516,4684,4914,4860,5939,5603,5389,6052,5057,3237,5490,3791,\n6676,6409,6677,4821,4915,4106,5351,5058,4243,5539,4244,5604,4842,4916,5239,3028,\n3716,5837,5114,5605,5390,5940,5430,6210,4332,6678,5540,4732,3667,3840,6053,4305,\n3408,5670,5541,6410,2744,5240,5750,6679,3234,5606,6680,5607,5671,3608,4283,4159,\n4400,5352,4783,6681,6411,6682,4491,4802,6211,6412,5941,6413,6414,5542,5751,6683,\n4669,3734,5942,6684,6415,5943,5059,3328,4670,4144,4268,6685,6686,6687,6688,4372,\n3603,6689,5944,5491,4373,3440,6416,5543,4784,4822,5608,3792,4616,5838,5672,3514,\n5391,6417,4892,6690,4639,6691,6054,5673,5839,6055,6692,6056,5392,6212,4038,5544,\n5674,4497,6057,6693,5840,4284,5675,4021,4545,5609,6418,4454,6419,6213,4113,4472,\n5314,3738,5087,5279,4074,5610,4959,4063,3179,4750,6058,6420,6214,3476,4498,4716,\n5431,4960,4685,6215,5241,6694,6421,6216,6695,5841,5945,6422,3748,5946,5179,3905,\n5752,5545,5947,4374,6217,4455,6423,4412,6218,4803,5353,6696,3832,5280,6219,4327,\n4702,6220,6221,6059,4652,5432,6424,3749,4751,6425,5753,4986,5393,4917,5948,5030,\n5754,4861,4733,6426,4703,6697,6222,4671,5949,4546,4961,5180,6223,5031,3316,5281,\n6698,4862,4295,4934,5207,3644,6427,5842,5950,6428,6429,4570,5843,5282,6430,6224,\n5088,3239,6060,6699,5844,5755,6061,6431,2701,5546,6432,5115,5676,4039,3993,3327,\n4752,4425,5315,6433,3941,6434,5677,4617,4604,3074,4581,6225,5433,6435,6226,6062,\n4823,5756,5116,6227,3717,5678,4717,5845,6436,5679,5846,6063,5847,6064,3977,3354,\n6437,3863,5117,6228,5547,5394,4499,4524,6229,4605,6230,4306,4500,6700,5951,6065,\n3693,5952,5089,4366,4918,6701,6231,5548,6232,6702,6438,4704,5434,6703,6704,5953,\n4168,6705,5680,3420,6706,5242,4407,6066,3812,5757,5090,5954,4672,4525,3481,5681,\n4618,5395,5354,5316,5955,6439,4962,6707,4526,6440,3465,4673,6067,6441,5682,6708,\n5435,5492,5758,5683,4619,4571,4674,4804,4893,4686,5493,4753,6233,6068,4269,6442,\n6234,5032,4705,5146,5243,5208,5848,6235,6443,4963,5033,4640,4226,6236,5849,3387,\n6444,6445,4436,4437,5850,4843,5494,4785,4894,6709,4361,6710,5091,5956,3331,6237,\n4987,5549,6069,6711,4342,3517,4473,5317,6070,6712,6071,4706,6446,5017,5355,6713,\n6714,4988,5436,6447,4734,5759,6715,4735,4547,4456,4754,6448,5851,6449,6450,3547,\n5852,5318,6451,6452,5092,4205,6716,6238,4620,4219,5611,6239,6072,4481,5760,5957,\n5958,4059,6240,6453,4227,4537,6241,5761,4030,4186,5244,5209,3761,4457,4876,3337,\n5495,5181,6242,5959,5319,5612,5684,5853,3493,5854,6073,4169,5613,5147,4895,6074,\n5210,6717,5182,6718,3830,6243,2798,3841,6075,6244,5855,5614,3604,4606,5496,5685,\n5118,5356,6719,6454,5960,5357,5961,6720,4145,3935,4621,5119,5962,4261,6721,6455,\n4786,5963,4375,4582,6245,6246,6247,6076,5437,4877,5856,3376,4380,6248,4160,6722,\n5148,6456,5211,6457,6723,4718,6458,6724,6249,5358,4044,3297,6459,6250,5857,5615,\n5497,5245,6460,5498,6725,6251,6252,5550,3793,5499,2959,5396,6461,6462,4572,5093,\n5500,5964,3806,4146,6463,4426,5762,5858,6077,6253,4755,3967,4220,5965,6254,4989,\n5501,6464,4352,6726,6078,4764,2290,5246,3906,5438,5283,3767,4964,2861,5763,5094,\n6255,6256,4622,5616,5859,5860,4707,6727,4285,4708,4824,5617,6257,5551,4787,5212,\n4965,4935,4687,6465,6728,6466,5686,6079,3494,4413,2995,5247,5966,5618,6729,5967,\n5764,5765,5687,5502,6730,6731,6080,5397,6467,4990,6258,6732,4538,5060,5619,6733,\n4719,5688,5439,5018,5149,5284,5503,6734,6081,4607,6259,5120,3645,5861,4583,6260,\n4584,4675,5620,4098,5440,6261,4863,2379,3306,4585,5552,5689,4586,5285,6735,4864,\n6736,5286,6082,6737,4623,3010,4788,4381,4558,5621,4587,4896,3698,3161,5248,4353,\n4045,6262,3754,5183,4588,6738,6263,6739,6740,5622,3936,6741,6468,6742,6264,5095,\n6469,4991,5968,6743,4992,6744,6083,4897,6745,4256,5766,4307,3108,3968,4444,5287,\n3889,4343,6084,4510,6085,4559,6086,4898,5969,6746,5623,5061,4919,5249,5250,5504,\n5441,6265,5320,4878,3242,5862,5251,3428,6087,6747,4237,5624,5442,6266,5553,4539,\n6748,2585,3533,5398,4262,6088,5150,4736,4438,6089,6267,5505,4966,6749,6268,6750,\n6269,5288,5554,3650,6090,6091,4624,6092,5690,6751,5863,4270,5691,4277,5555,5864,\n6752,5692,4720,4865,6470,5151,4688,4825,6753,3094,6754,6471,3235,4653,6755,5213,\n5399,6756,3201,4589,5865,4967,6472,5866,6473,5019,3016,6757,5321,4756,3957,4573,\n6093,4993,5767,4721,6474,6758,5625,6759,4458,6475,6270,6760,5556,4994,5214,5252,\n6271,3875,5768,6094,5034,5506,4376,5769,6761,2120,6476,5253,5770,6762,5771,5970,\n3990,5971,5557,5558,5772,6477,6095,2787,4641,5972,5121,6096,6097,6272,6763,3703,\n5867,5507,6273,4206,6274,4789,6098,6764,3619,3646,3833,3804,2394,3788,4936,3978,\n4866,4899,6099,6100,5559,6478,6765,3599,5868,6101,5869,5870,6275,6766,4527,6767,\n*******************************************************************************/\n};\n\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/tables/GB2312Freq.tab",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n//////////////////////////////////////////////////////////////////////////\n//////////////////////////////////////////////////////////////////////////\n//\n// TODO: until we don't have a better solution, we use GB18030's Table here\n//\n//////////////////////////////////////////////////////////////////////////\n//////////////////////////////////////////////////////////////////////////\n\n\n//GB2312 most frequently used character table\n\n//Char to FreqOrder table , from hz6763\n\n/******************************************************************************\n * 512  --> 0.79  -- 0.79\n * 1024 --> 0.92  -- 0.13\n * 2048 --> 0.98  -- 0.06\n * 6768 --> 1.00  -- 0.02\n *\n * Idea Distribution Ratio = 0.79135/(1-0.79135) = 3.79\n * Random Distribution Ration = 512 / (3755 - 512) = 0.157\n * \n * Typical Distribution Ratio about 25% of Ideal one, still much higher that RDR\n *****************************************************************************/\n\n#define GB2312_TYPICAL_DISTRIBUTION_RATIO (float)0.79\n\n#define GB2312_TABLE_SIZE  3760\n\nconstexpr PRInt16 GB2312CharToFreqOrder[] =\n{\n1671, 749,1443,2364,3924,3807,2330,3921,1704,3463,2691,1511,1515, 572,3191,2205,\n2361, 224,2558, 479,1711, 963,3162, 440,4060,1905,2966,2947,3580,2647,3961,3842,\n2204, 869,4207, 970,2678,5626,2944,2956,1479,4048, 514,3595, 588,1346,2820,3409,\n 249,4088,1746,1873,2047,1774, 581,1813, 358,1174,3590,1014,1561,4844,2245, 670,\n1636,3112, 889,1286, 953, 556,2327,3060,1290,3141, 613, 185,3477,1367, 850,3820,\n1715,2428,2642,2303,2732,3041,2562,2648,3566,3946,1349, 388,3098,2091,1360,3585,\n 152,1687,1539, 738,1559,  59,1232,2925,2267,1388,1249,1741,1679,2960, 151,1566,\n1125,1352,4271, 924,4296, 385,3166,4459, 310,1245,2850,  70,3285,2729,3534,3575,\n2398,3298,3466,1960,2265, 217,3647, 864,1909,2084,4401,2773,1010,3269,5152, 853,\n3051,3121,1244,4251,1895, 364,1499,1540,2313,1180,3655,2268, 562, 715,2417,3061,\n 544, 336,3768,2380,1752,4075, 950, 280,2425,4382, 183,2759,3272, 333,4297,2155,\n1688,2356,1444,1039,4540, 736,1177,3349,2443,2368,2144,2225, 565, 196,1482,3406,\n 927,1335,4147, 692, 878,1311,1653,3911,3622,1378,4200,1840,2969,3149,2126,1816,\n2534,1546,2393,2760, 737,2494,  13, 447, 245,2747,  38,2765,2129,2589,1079, 606,\n 360, 471,3755,2890, 404, 848, 699,1785,1236, 370,2221,1023,3746,2074,2026,2023,\n2388,1581,2119, 812,1141,3091,2536,1519, 804,2053, 406,1596,1090, 784, 548,4414,\n1806,2264,2936,1100, 343,4114,5096, 622,3358, 743,3668,1510,1626,5020,3567,2513,\n3195,4115,5627,2489,2991,  24,2065,2697,1087,2719,  48,1634, 315,  68, 985,2052,\n 198,2239,1347,1107,1439, 597,2366,2172, 871,3307, 919,2487,2790,1867, 236,2570,\n1413,3794, 906,3365,3381,1701,1982,1818,1524,2924,1205, 616,2586,2072,2004, 575,\n 253,3099,  32,1365,1182, 197,1714,2454,1201, 554,3388,3224,2748, 756,2587, 250,\n2567,1507,1517,3529,1922,2761,2337,3416,1961,1677,2452,2238,3153, 615, 911,1506,\n1474,2495,1265,1906,2749,3756,3280,2161, 898,2714,1759,3450,2243,2444, 563,  26,\n3286,2266,3769,3344,2707,3677, 611,1402, 531,1028,2871,4548,1375, 261,2948, 835,\n1190,4134, 353, 840,2684,1900,3082,1435,2109,1207,1674, 329,1872,2781,4055,2686,\n2104, 608,3318,2423,2957,2768,1108,3739,3512,3271,3985,2203,1771,3520,1418,2054,\n1681,1153, 225,1627,2929, 162,2050,2511,3687,1954, 124,1859,2431,1684,3032,2894,\n 585,4805,3969,2869,2704,2088,2032,2095,3656,2635,4362,2209, 256, 518,2042,2105,\n3777,3657, 643,2298,1148,1779, 190, 989,3544, 414,  11,2135,2063,2979,1471, 403,\n3678, 126, 770,1563, 671,2499,3216,2877, 600,1179, 307,2805,4937,1268,1297,2694,\n 252,4032,1448,1494,1331,1394, 127,2256, 222,1647,1035,1481,3056,1915,1048, 873,\n3651, 210,  33,1608,2516, 200,1520, 415, 102,   0,3389,1287, 817,  91,3299,2940,\n 836,1814, 549,2197,1396,1669,2987,3582,2297,2848,4528,1070, 687,  20,1819, 121,\n1552,1364,1461,1968,2617,3540,2824,2083, 177, 948,4938,2291, 110,4549,2066, 648,\n3359,1755,2110,2114,4642,4845,1693,3937,3308,1257,1869,2123, 208,1804,3159,2992,\n2531,2549,3361,2418,1350,2347,2800,2568,1291,2036,2680,  72, 842,1990, 212,1233,\n1154,1586,  75,2027,3410,4900,1823,1337,2710,2676, 728,2810,1522,3026,4995, 157,\n 755,1050,4022, 710, 785,1936,2194,2085,1406,2777,2400, 150,1250,4049,1206, 807,\n1910, 534, 529,3309,1721,1660, 274,  39,2827, 661,2670,1578, 925,3248,3815,1094,\n4278,4901,4252,  41,1150,3747,2572,2227,4501,3658,4902,3813,3357,3617,2884,2258,\n 887, 538,4187,3199,1294,2439,3042,2329,2343,2497,1255, 107, 543,1527, 521,3478,\n3568, 194,5062,  15, 961,3870,1241,1192,2664,  66,5215,3260,2111,1295,1127,2152,\n3805,4135, 901,1164,1976, 398,1278, 530,1460, 748, 904,1054,1966,1426,  53,2909,\n 509, 523,2279,1534, 536,1019, 239,1685, 460,2353, 673,1065,2401,3600,4298,2272,\n1272,2363, 284,1753,3679,4064,1695,  81, 815,2677,2757,2731,1386, 859, 500,4221,\n2190,2566, 757,1006,2519,2068,1166,1455, 337,2654,3203,1863,1682,1914,3025,1252,\n1409,1366, 847, 714,2834,2038,3209, 964,2970,1901, 885,2553,1078,1756,3049, 301,\n1572,3326, 688,2130,1996,2429,1805,1648,2930,3421,2750,3652,3088, 262,1158,1254,\n 389,1641,1812, 526,1719, 923,2073,1073,1902, 468, 489,4625,1140, 857,2375,3070,\n3319,2863, 380, 116,1328,2693,1161,2244, 273,1212,1884,2769,3011,1775,1142, 461,\n3066,1200,2147,2212, 790, 702,2695,4222,1601,1058, 434,2338,5153,3640,  67,2360,\n4099,2502, 618,3472,1329, 416,1132, 830,2782,1807,2653,3211,3510,1662, 192,2124,\n 296,3979,1739,1611,3684,  23, 118, 324, 446,1239,1225, 293,2520,3814,3795,2535,\n3116,  17,1074, 467,2692,2201, 387,2922,  45,1326,3055,1645,3659,2817, 958, 243,\n1903,2320,1339,2825,1784,3289, 356, 576, 865,2315,2381,3377,3916,1088,3122,1713,\n1655, 935, 628,4689,1034,1327, 441, 800, 720, 894,1979,2183,1528,5289,2702,1071,\n4046,3572,2399,1571,3281,  79, 761,1103, 327, 134, 758,1899,1371,1615, 879, 442,\n 215,2605,2579, 173,2048,2485,1057,2975,3317,1097,2253,3801,4263,1403,1650,2946,\n 814,4968,3487,1548,2644,1567,1285,   2, 295,2636,  97, 946,3576, 832, 141,4257,\n3273, 760,3821,3521,3156,2607, 949,1024,1733,1516,1803,1920,2125,2283,2665,3180,\n1501,2064,3560,2171,1592, 803,3518,1416, 732,3897,4258,1363,1362,2458, 119,1427,\n 602,1525,2608,1605,1639,3175, 694,3064,  10, 465,  76,2000,4846,4208, 444,3781,\n1619,3353,2206,1273,3796, 740,2483, 320,1723,2377,3660,2619,1359,1137,1762,1724,\n2345,2842,1850,1862, 912, 821,1866, 612,2625,1735,2573,3369,1093, 844,  89, 937,\n 930,1424,3564,2413,2972,1004,3046,3019,2011, 711,3171,1452,4178, 428, 801,1943,\n 432, 445,2811, 206,4136,1472, 730, 349,  73, 397,2802,2547, 998,1637,1167, 789,\n 396,3217, 154,1218, 716,1120,1780,2819,4826,1931,3334,3762,2139,1215,2627, 552,\n3664,3628,3232,1405,2383,3111,1356,2652,3577,3320,3101,1703, 640,1045,1370,1246,\n4996, 371,1575,2436,1621,2210, 984,4033,1734,2638,  16,4529, 663,2755,3255,1451,\n3917,2257,1253,1955,2234,1263,2951, 214,1229, 617, 485, 359,1831,1969, 473,2310,\n 750,2058, 165,  80,2864,2419, 361,4344,2416,2479,1134, 796,3726,1266,2943, 860,\n2715, 938, 390,2734,1313,1384, 248, 202, 877,1064,2854, 522,3907, 279,1602, 297,\n2357, 395,3740, 137,2075, 944,4089,2584,1267,3802,  62,1533,2285, 178, 176, 780,\n2440, 201,3707, 590, 478,1560,4354,2117,1075,  30,  74,4643,4004,1635,1441,2745,\n 776,2596, 238,1077,1692,1912,2844, 605, 499,1742,3947, 241,3053, 980,1749, 936,\n2640,4511,2582, 515,1543,2162,5322,2892,2993, 890,2148,1924, 665,1827,3581,1032,\n 968,3163, 339,1044,1896, 270, 583,1791,1720,4367,1194,3488,3669,  43,2523,1657,\n 163,2167, 290,1209,1622,3378, 550, 634,2508,2510, 695,2634,2384,2512,1476,1414,\n 220,1469,2341,2138,2852,3183,2900,4939,2865,3502,1211,3680, 854,3227,1299,2976,\n3172, 186,2998,1459, 443,1067,3251,1495, 321,1932,3054, 909, 753,1410,1828, 436,\n2441,1119,1587,3164,2186,1258, 227, 231,1425,1890,3200,3942, 247, 959, 725,5254,\n2741, 577,2158,2079, 929, 120, 174, 838,2813, 591,1115, 417,2024,  40,3240,1536,\n1037, 291,4151,2354, 632,1298,2406,2500,3535,1825,1846,3451, 205,1171, 345,4238,\n  18,1163, 811, 685,2208,1217, 425,1312,1508,1175,4308,2552,1033, 587,1381,3059,\n2984,3482, 340,1316,4023,3972, 792,3176, 519, 777,4690, 918, 933,4130,2981,3741,\n  90,3360,2911,2200,5184,4550, 609,3079,2030, 272,3379,2736, 363,3881,1130,1447,\n 286, 779, 357,1169,3350,3137,1630,1220,2687,2391, 747,1277,3688,2618,2682,2601,\n1156,3196,5290,4034,3102,1689,3596,3128, 874, 219,2783, 798, 508,1843,2461, 269,\n1658,1776,1392,1913,2983,3287,2866,2159,2372, 829,4076,  46,4253,2873,1889,1894,\n 915,1834,1631,2181,2318, 298, 664,2818,3555,2735, 954,3228,3117, 527,3511,2173,\n 681,2712,3033,2247,2346,3467,1652, 155,2164,3382, 113,1994, 450, 899, 494, 994,\n1237,2958,1875,2336,1926,3727, 545,1577,1550, 633,3473, 204,1305,3072,2410,1956,\n2471, 707,2134, 841,2195,2196,2663,3843,1026,4940, 990,3252,4997, 368,1092, 437,\n3212,3258,1933,1829, 675,2977,2893, 412, 943,3723,4644,3294,3283,2230,2373,5154,\n2389,2241,2661,2323,1404,2524, 593, 787, 677,3008,1275,2059, 438,2709,2609,2240,\n2269,2246,1446,  36,1568,1373,3892,1574,2301,1456,3962, 693,2276,5216,2035,1143,\n2720,1919,1797,1811,2763,4137,2597,1830,1699,1488,1198,2090, 424,1694, 312,3634,\n3390,4179,3335,2252,1214, 561,1059,3243,2295,2561, 975,5155,2321,2751,3772, 472,\n1537,3282,3398,1047,2077,2348,2878,1323,3340,3076, 690,2906,  51, 369, 170,3541,\n1060,2187,2688,3670,2541,1083,1683, 928,3918, 459, 109,4427, 599,3744,4286, 143,\n2101,2730,2490,  82,1588,3036,2121, 281,1860, 477,4035,1238,2812,3020,2716,3312,\n1530,2188,2055,1317, 843, 636,1808,1173,3495, 649, 181,1002, 147,3641,1159,2414,\n3750,2289,2795, 813,3123,2610,1136,4368,   5,3391,4541,2174, 420, 429,1728, 754,\n1228,2115,2219, 347,2223,2733, 735,1518,3003,2355,3134,1764,3948,3329,1888,2424,\n1001,1234,1972,3321,3363,1672,1021,1450,1584, 226, 765, 655,2526,3404,3244,2302,\n3665, 731, 594,2184, 319,1576, 621, 658,2656,4299,2099,3864,1279,2071,2598,2739,\n 795,3086,3699,3908,1707,2352,2402,1382,3136,2475,1465,4847,3496,3865,1085,3004,\n2591,1084, 213,2287,1963,3565,2250, 822, 793,4574,3187,1772,1789,3050, 595,1484,\n1959,2770,1080,2650, 456, 422,2996, 940,3322,4328,4345,3092,2742, 965,2784, 739,\n4124, 952,1358,2498,2949,2565, 332,2698,2378, 660,2260,2473,4194,3856,2919, 535,\n1260,2651,1208,1428,1300,1949,1303,2942, 433,2455,2450,1251,1946, 614,1269, 641,\n1306,1810,2737,3078,2912, 564,2365,1419,1415,1497,4460,2367,2185,1379,3005,1307,\n3218,2175,1897,3063, 682,1157,4040,4005,1712,1160,1941,1399, 394, 402,2952,1573,\n1151,2986,2404, 862, 299,2033,1489,3006, 346, 171,2886,3401,1726,2932, 168,2533,\n  47,2507,1030,3735,1145,3370,1395,1318,1579,3609,4560,2857,4116,1457,2529,1965,\n 504,1036,2690,2988,2405, 745,5871, 849,2397,2056,3081, 863,2359,3857,2096,  99,\n1397,1769,2300,4428,1643,3455,1978,1757,3718,1440,  35,4879,3742,1296,4228,2280,\n 160,5063,1599,2013, 166, 520,3479,1646,3345,3012, 490,1937,1545,1264,2182,2505,\n1096,1188,1369,1436,2421,1667,2792,2460,1270,2122, 727,3167,2143, 806,1706,1012,\n1800,3037, 960,2218,1882, 805, 139,2456,1139,1521, 851,1052,3093,3089, 342,2039,\n 744,5097,1468,1502,1585,2087, 223, 939, 326,2140,2577, 892,2481,1623,4077, 982,\n3708, 135,2131,  87,2503,3114,2326,1106, 876,1616, 547,2997,2831,2093,3441,4530,\n4314,   9,3256,4229,4148, 659,1462,1986,1710,2046,2913,2231,4090,4880,5255,3392,\n3274,1368,3689,4645,1477, 705,3384,3635,1068,1529,2941,1458,3782,1509, 100,1656,\n2548, 718,2339, 408,1590,2780,3548,1838,4117,3719,1345,3530, 717,3442,2778,3220,\n2898,1892,4590,3614,3371,2043,1998,1224,3483, 891, 635, 584,2559,3355, 733,1766,\n1729,1172,3789,1891,2307, 781,2982,2271,1957,1580,5773,2633,2005,4195,3097,1535,\n3213,1189,1934,5693,3262, 586,3118,1324,1598, 517,1564,2217,1868,1893,4445,3728,\n2703,3139,1526,1787,1992,3882,2875,1549,1199,1056,2224,1904,2711,5098,4287, 338,\n1993,3129,3489,2689,1809,2815,1997, 957,1855,3898,2550,3275,3057,1105,1319, 627,\n1505,1911,1883,3526, 698,3629,3456,1833,1431, 746,  77,1261,2017,2296,1977,1885,\n 125,1334,1600, 525,1798,1109,2222,1470,1945, 559,2236,1186,3443,2476,1929,1411,\n2411,3135,1777,3372,2621,1841,1613,3229, 668,1430,1839,2643,2916, 195,1989,2671,\n2358,1387, 629,3205,2293,5256,4439, 123,1310, 888,1879,4300,3021,3605,1003,1162,\n3192,2910,2010, 140,2395,2859,  55,1082,2012,2901, 662, 419,2081,1438, 680,2774,\n4654,3912,1620,1731,1625,5035,4065,2328, 512,1344, 802,5443,2163,2311,2537, 524,\n3399,  98,1155,2103,1918,2606,3925,2816,1393,2465,1504,3773,2177,3963,1478,4346,\n 180,1113,4655,3461,2028,1698, 833,2696,1235,1322,1594,4408,3623,3013,3225,2040,\n3022, 541,2881, 607,3632,2029,1665,1219, 639,1385,1686,1099,2803,3231,1938,3188,\n2858, 427, 676,2772,1168,2025, 454,3253,2486,3556, 230,1950, 580, 791,1991,1280,\n1086,1974,2034, 630, 257,3338,2788,4903,1017,  86,4790, 966,2789,1995,1696,1131,\n 259,3095,4188,1308, 179,1463,5257, 289,4107,1248,  42,3413,1725,2288, 896,1947,\n 774,4474,4254, 604,3430,4264, 392,2514,2588, 452, 237,1408,3018, 988,4531,1970,\n3034,3310, 540,2370,1562,1288,2990, 502,4765,1147,   4,1853,2708, 207, 294,2814,\n4078,2902,2509, 684,  34,3105,3532,2551, 644, 709,2801,2344, 573,1727,3573,3557,\n2021,1081,3100,4315,2100,3681, 199,2263,1837,2385, 146,3484,1195,2776,3949, 997,\n1939,3973,1008,1091,1202,1962,1847,1149,4209,5444,1076, 493, 117,5400,2521, 972,\n1490,2934,1796,4542,2374,1512,2933,2657, 413,2888,1135,2762,2314,2156,1355,2369,\n 766,2007,2527,2170,3124,2491,2593,2632,4757,2437, 234,3125,3591,1898,1750,1376,\n1942,3468,3138, 570,2127,2145,3276,4131, 962, 132,1445,4196,  19, 941,3624,3480,\n3366,1973,1374,4461,3431,2629, 283,2415,2275, 808,2887,3620,2112,2563,1353,3610,\n 955,1089,3103,1053,  96,  88,4097, 823,3808,1583, 399, 292,4091,3313, 421,1128,\n 642,4006, 903,2539,1877,2082, 596,  29,4066,1790, 722,2157, 130, 995,1569, 769,\n1485, 464, 513,2213, 288,1923,1101,2453,4316, 133, 486,2445,  50, 625, 487,2207,\n  57, 423, 481,2962, 159,3729,1558, 491, 303, 482, 501, 240,2837, 112,3648,2392,\n1783, 362,   8,3433,3422, 610,2793,3277,1390,1284,1654,  21,3823, 734, 367, 623,\n 193, 287, 374,1009,1483, 816, 476, 313,2255,2340,1262,2150,2899,1146,2581, 782,\n2116,1659,2018,1880, 255,3586,3314,1110,2867,2137,2564, 986,2767,5185,2006, 650,\n 158, 926, 762, 881,3157,2717,2362,3587, 306,3690,3245,1542,3077,2427,1691,2478,\n2118,2985,3490,2438, 539,2305, 983, 129,1754, 355,4201,2386, 827,2923, 104,1773,\n2838,2771, 411,2905,3919, 376, 767, 122,1114, 828,2422,1817,3506, 266,3460,1007,\n1609,4998, 945,2612,4429,2274, 726,1247,1964,2914,2199,2070,4002,4108, 657,3323,\n1422, 579, 455,2764,4737,1222,2895,1670, 824,1223,1487,2525, 558, 861,3080, 598,\n2659,2515,1967, 752,2583,2376,2214,4180, 977, 704,2464,4999,2622,4109,1210,2961,\n 819,1541, 142,2284,  44, 418, 457,1126,3730,4347,4626,1644,1876,3671,1864, 302,\n1063,5694, 624, 723,1984,3745,1314,1676,2488,1610,1449,3558,3569,2166,2098, 409,\n1011,2325,3704,2306, 818,1732,1383,1824,1844,3757, 999,2705,3497,1216,1423,2683,\n2426,2954,2501,2726,2229,1475,2554,5064,1971,1794,1666,2014,1343, 783, 724, 191,\n2434,1354,2220,5065,1763,2752,2472,4152, 131, 175,2885,3434,  92,1466,4920,2616,\n3871,3872,3866, 128,1551,1632, 669,1854,3682,4691,4125,1230, 188,2973,3290,1302,\n1213, 560,3266, 917, 763,3909,3249,1760, 868,1958, 764,1782,2097, 145,2277,3774,\n4462,  64,1491,3062, 971,2132,3606,2442, 221,1226,1617, 218, 323,1185,3207,3147,\n 571, 619,1473,1005,1744,2281, 449,1887,2396,3685, 275, 375,3816,1743,3844,3731,\n 845,1983,2350,4210,1377, 773, 967,3499,3052,3743,2725,4007,1697,1022,3943,1464,\n3264,2855,2722,1952,1029,2839,2467,  84,4383,2215, 820,1391,2015,2448,3672, 377,\n1948,2168, 797,2545,3536,2578,2645,  94,2874,1678, 405,1259,3071, 771, 546,1315,\n 470,1243,3083, 895,2468, 981, 969,2037, 846,4181, 653,1276,2928,  14,2594, 557,\n3007,2474, 156, 902,1338,1740,2574, 537,2518, 973,2282,2216,2433,1928, 138,2903,\n1293,2631,1612, 646,3457, 839,2935, 111, 496,2191,2847, 589,3186, 149,3994,2060,\n4031,2641,4067,3145,1870,  37,3597,2136,1025,2051,3009,3383,3549,1121,1016,3261,\n1301, 251,2446,2599,2153, 872,3246, 637, 334,3705, 831, 884, 921,3065,3140,4092,\n2198,1944, 246,2964, 108,2045,1152,1921,2308,1031, 203,3173,4170,1907,3890, 810,\n1401,2003,1690, 506, 647,1242,2828,1761,1649,3208,2249,1589,3709,2931,5156,1708,\n 498, 666,2613, 834,3817,1231, 184,2851,1124, 883,3197,2261,3710,1765,1553,2658,\n1178,2639,2351,  93,1193, 942,2538,2141,4402, 235,1821, 870,1591,2192,1709,1871,\n3341,1618,4126,2595,2334, 603, 651,  69, 701, 268,2662,3411,2555,1380,1606, 503,\n 448, 254,2371,2646, 574,1187,2309,1770, 322,2235,1292,1801, 305, 566,1133, 229,\n2067,2057, 706, 167, 483,2002,2672,3295,1820,3561,3067, 316, 378,2746,3452,1112,\n 136,1981, 507,1651,2917,1117, 285,4591, 182,2580,3522,1304, 335,3303,1835,2504,\n1795,1792,2248, 674,1018,2106,2449,1857,2292,2845, 976,3047,1781,2600,2727,1389,\n1281,  52,3152, 153, 265,3950, 672,3485,3951,4463, 430,1183, 365, 278,2169,  27,\n1407,1336,2304, 209,1340,1730,2202,1852,2403,2883, 979,1737,1062, 631,2829,2542,\n3876,2592, 825,2086,2226,3048,3625, 352,1417,3724, 542, 991, 431,1351,3938,1861,\n2294, 826,1361,2927,3142,3503,1738, 463,2462,2723, 582,1916,1595,2808, 400,3845,\n3891,2868,3621,2254,  58,2492,1123, 910,2160,2614,1372,1603,1196,1072,3385,1700,\n3267,1980, 696, 480,2430, 920, 799,1570,2920,1951,2041,4047,2540,1321,4223,2469,\n3562,2228,1271,2602, 401,2833,3351,2575,5157, 907,2312,1256, 410, 263,3507,1582,\n 996, 678,1849,2316,1480, 908,3545,2237, 703,2322, 667,1826,2849,1531,2604,2999,\n2407,3146,2151,2630,1786,3711, 469,3542, 497,3899,2409, 858, 837,4446,3393,1274,\n 786, 620,1845,2001,3311, 484, 308,3367,1204,1815,3691,2332,1532,2557,1842,2020,\n2724,1927,2333,4440, 567,  22,1673,2728,4475,1987,1858,1144,1597, 101,1832,3601,\n  12, 974,3783,4391, 951,1412,   1,3720, 453,4608,4041, 528,1041,1027,3230,2628,\n1129, 875,1051,3291,1203,2262,1069,2860,2799,2149,2615,3278, 144,1758,3040,  31,\n 475,1680, 366,2685,3184, 311,1642,4008,2466,5036,1593,1493,2809, 216,1420,1668,\n 233, 304,2128,3284, 232,1429,1768,1040,2008,3407,2740,2967,2543, 242,2133, 778,\n1565,2022,2620, 505,2189,2756,1098,2273, 372,1614, 708, 553,2846,2094,2278, 169,\n3626,2835,4161, 228,2674,3165, 809,1454,1309, 466,1705,1095, 900,3423, 880,2667,\n3751,5258,2317,3109,2571,4317,2766,1503,1342, 866,4447,1118,  63,2076, 314,1881,\n1348,1061, 172, 978,3515,1747, 532, 511,3970,   6, 601, 905,2699,3300,1751, 276,\n1467,3725,2668,  65,4239,2544,2779,2556,1604, 578,2451,1802, 992,2331,2624,1320,\n3446, 713,1513,1013, 103,2786,2447,1661, 886,1702, 916, 654,3574,2031,1556, 751,\n2178,2821,2179,1498,1538,2176, 271, 914,2251,2080,1325, 638,1953,2937,3877,2432,\n2754,  95,3265,1716, 260,1227,4083, 775, 106,1357,3254, 426,1607, 555,2480, 772,\n1985, 244,2546, 474, 495,1046,2611,1851,2061,  71,2089,1675,2590, 742,3758,2843,\n3222,1433, 267,2180,2576,2826,2233,2092,3913,2435, 956,1745,3075, 856,2113,1116,\n 451,   3,1988,2896,1398, 993,2463,1878,2049,1341,2718,2721,2870,2108, 712,2904,\n4363,2753,2324, 277,2872,2349,2649, 384, 987, 435, 691,3000, 922, 164,3939, 652,\n1500,1184,4153,2482,3373,2165,4848,2335,3775,3508,3154,2806,2830,1554,2102,1664,\n2530,1434,2408, 893,1547,2623,3447,2832,2242,2532,3169,2856,3223,2078,  49,3770,\n3469, 462, 318, 656,2259,3250,3069, 679,1629,2758, 344,1138,1104,3120,1836,1283,\n3115,2154,1437,4448, 934, 759,1999, 794,2862,1038, 533,2560,1722,2342, 855,2626,\n1197,1663,4476,3127,  85,4240,2528,  25,1111,1181,3673, 407,3470,4561,2679,2713,\n 768,1925,2841,3986,1544,1165, 932, 373,1240,2146,1930,2673, 721,4766, 354,4333,\n 391,2963, 187,  61,3364,1442,1102, 330,1940,1767, 341,3809,4118, 393,2496,2062,\n2211, 105, 331, 300, 439, 913,1332, 626, 379,3304,1557, 328, 689,3952, 309,1555,\n 931, 317,2517,3027, 325, 569, 686,2107,3084,  60,1042,1333,2794, 264,3177,4014,\n1628, 258,3712,   7,4464,1176,1043,1778, 683, 114,1975,  78,1492, 383,1886, 510,\n 386, 645,5291,2891,2069,3305,4138,3867,2939,2603,2493,1935,1066,1848,3588,1015,\n1282,1289,4609, 697,1453,3044,2666,3611,1856,2412,  54, 719,1330, 568,3778,2459,\n1748, 788, 492, 551,1191,1000, 488,3394,3763, 282,1799, 348,2016,1523,3155,2390,\n1049, 382,2019,1788,1170, 729,2968,3523, 897,3926,2785,2938,3292, 350,2319,3238,\n1718,1717,2655,3453,3143,4465, 161,2889,2980,2009,1421,  56,1908,1640,2387,2232,\n1917,1874,2477,4921, 148,  83,3438, 592,4245,2882,1822,1055, 741, 115,1496,1624,\n 381,1638,4592,1020, 516,3214, 458, 947,4575,1432, 211,1514,2926,1865,2142, 189,\n 852,1221,1400,1486, 882,2299,4036, 351,  28,1122, 700,6479,6480,6481,6482,6483,  //last 512\n\n/*************************************************************************************** \n *Everything below is of no interest for detection purpose\t\t\t\t\t\t\t   *\n ***************************************************************************************\n\n5508,6484,3900,3414,3974,4441,4024,3537,4037,5628,5099,3633,6485,3148,6486,3636,\n5509,3257,5510,5973,5445,5872,4941,4403,3174,4627,5873,6276,2286,4230,5446,5874,\n5122,6102,6103,4162,5447,5123,5323,4849,6277,3980,3851,5066,4246,5774,5067,6278,\n3001,2807,5695,3346,5775,5974,5158,5448,6487,5975,5976,5776,3598,6279,5696,4806,\n4211,4154,6280,6488,6489,6490,6281,4212,5037,3374,4171,6491,4562,4807,4722,4827,\n5977,6104,4532,4079,5159,5324,5160,4404,3858,5359,5875,3975,4288,4610,3486,4512,\n5325,3893,5360,6282,6283,5560,2522,4231,5978,5186,5449,2569,3878,6284,5401,3578,\n4415,6285,4656,5124,5979,2506,4247,4449,3219,3417,4334,4969,4329,6492,4576,4828,\n4172,4416,4829,5402,6286,3927,3852,5361,4369,4830,4477,4867,5876,4173,6493,6105,\n4657,6287,6106,5877,5450,6494,4155,4868,5451,3700,5629,4384,6288,6289,5878,3189,\n4881,6107,6290,6495,4513,6496,4692,4515,4723,5100,3356,6497,6291,3810,4080,5561,\n3570,4430,5980,6498,4355,5697,6499,4724,6108,6109,3764,4050,5038,5879,4093,3226,\n6292,5068,5217,4693,3342,5630,3504,4831,4377,4466,4309,5698,4431,5777,6293,5778,\n4272,3706,6110,5326,3752,4676,5327,4273,5403,4767,5631,6500,5699,5880,3475,5039,\n6294,5562,5125,4348,4301,4482,4068,5126,4593,5700,3380,3462,5981,5563,3824,5404,\n4970,5511,3825,4738,6295,6501,5452,4516,6111,5881,5564,6502,6296,5982,6503,4213,\n4163,3454,6504,6112,4009,4450,6113,4658,6297,6114,3035,6505,6115,3995,4904,4739,\n4563,4942,4110,5040,3661,3928,5362,3674,6506,5292,3612,4791,5565,4149,5983,5328,\n5259,5021,4725,4577,4564,4517,4364,6298,5405,4578,5260,4594,4156,4157,5453,3592,\n3491,6507,5127,5512,4709,4922,5984,5701,4726,4289,6508,4015,6116,5128,4628,3424,\n4241,5779,6299,4905,6509,6510,5454,5702,5780,6300,4365,4923,3971,6511,5161,3270,\n3158,5985,4100, 867,5129,5703,6117,5363,3695,3301,5513,4467,6118,6512,5455,4232,\n4242,4629,6513,3959,4478,6514,5514,5329,5986,4850,5162,5566,3846,4694,6119,5456,\n4869,5781,3779,6301,5704,5987,5515,4710,6302,5882,6120,4392,5364,5705,6515,6121,\n6516,6517,3736,5988,5457,5989,4695,2457,5883,4551,5782,6303,6304,6305,5130,4971,\n6122,5163,6123,4870,3263,5365,3150,4871,6518,6306,5783,5069,5706,3513,3498,4409,\n5330,5632,5366,5458,5459,3991,5990,4502,3324,5991,5784,3696,4518,5633,4119,6519,\n4630,5634,4417,5707,4832,5992,3418,6124,5993,5567,4768,5218,6520,4595,3458,5367,\n6125,5635,6126,4202,6521,4740,4924,6307,3981,4069,4385,6308,3883,2675,4051,3834,\n4302,4483,5568,5994,4972,4101,5368,6309,5164,5884,3922,6127,6522,6523,5261,5460,\n5187,4164,5219,3538,5516,4111,3524,5995,6310,6311,5369,3181,3386,2484,5188,3464,\n5569,3627,5708,6524,5406,5165,4677,4492,6312,4872,4851,5885,4468,5996,6313,5709,\n5710,6128,2470,5886,6314,5293,4882,5785,3325,5461,5101,6129,5711,5786,6525,4906,\n6526,6527,4418,5887,5712,4808,2907,3701,5713,5888,6528,3765,5636,5331,6529,6530,\n3593,5889,3637,4943,3692,5714,5787,4925,6315,6130,5462,4405,6131,6132,6316,5262,\n6531,6532,5715,3859,5716,5070,4696,5102,3929,5788,3987,4792,5997,6533,6534,3920,\n4809,5000,5998,6535,2974,5370,6317,5189,5263,5717,3826,6536,3953,5001,4883,3190,\n5463,5890,4973,5999,4741,6133,6134,3607,5570,6000,4711,3362,3630,4552,5041,6318,\n6001,2950,2953,5637,4646,5371,4944,6002,2044,4120,3429,6319,6537,5103,4833,6538,\n6539,4884,4647,3884,6003,6004,4758,3835,5220,5789,4565,5407,6540,6135,5294,4697,\n4852,6320,6321,3206,4907,6541,6322,4945,6542,6136,6543,6323,6005,4631,3519,6544,\n5891,6545,5464,3784,5221,6546,5571,4659,6547,6324,6137,5190,6548,3853,6549,4016,\n4834,3954,6138,5332,3827,4017,3210,3546,4469,5408,5718,3505,4648,5790,5131,5638,\n5791,5465,4727,4318,6325,6326,5792,4553,4010,4698,3439,4974,3638,4335,3085,6006,\n5104,5042,5166,5892,5572,6327,4356,4519,5222,5573,5333,5793,5043,6550,5639,5071,\n4503,6328,6139,6551,6140,3914,3901,5372,6007,5640,4728,4793,3976,3836,4885,6552,\n4127,6553,4451,4102,5002,6554,3686,5105,6555,5191,5072,5295,4611,5794,5296,6556,\n5893,5264,5894,4975,5466,5265,4699,4976,4370,4056,3492,5044,4886,6557,5795,4432,\n4769,4357,5467,3940,4660,4290,6141,4484,4770,4661,3992,6329,4025,4662,5022,4632,\n4835,4070,5297,4663,4596,5574,5132,5409,5895,6142,4504,5192,4664,5796,5896,3885,\n5575,5797,5023,4810,5798,3732,5223,4712,5298,4084,5334,5468,6143,4052,4053,4336,\n4977,4794,6558,5335,4908,5576,5224,4233,5024,4128,5469,5225,4873,6008,5045,4729,\n4742,4633,3675,4597,6559,5897,5133,5577,5003,5641,5719,6330,6560,3017,2382,3854,\n4406,4811,6331,4393,3964,4946,6561,2420,3722,6562,4926,4378,3247,1736,4442,6332,\n5134,6333,5226,3996,2918,5470,4319,4003,4598,4743,4744,4485,3785,3902,5167,5004,\n5373,4394,5898,6144,4874,1793,3997,6334,4085,4214,5106,5642,4909,5799,6009,4419,\n4189,3330,5899,4165,4420,5299,5720,5227,3347,6145,4081,6335,2876,3930,6146,3293,\n3786,3910,3998,5900,5300,5578,2840,6563,5901,5579,6147,3531,5374,6564,6565,5580,\n4759,5375,6566,6148,3559,5643,6336,6010,5517,6337,6338,5721,5902,3873,6011,6339,\n6567,5518,3868,3649,5722,6568,4771,4947,6569,6149,4812,6570,2853,5471,6340,6341,\n5644,4795,6342,6012,5723,6343,5724,6013,4349,6344,3160,6150,5193,4599,4514,4493,\n5168,4320,6345,4927,3666,4745,5169,5903,5005,4928,6346,5725,6014,4730,4203,5046,\n4948,3395,5170,6015,4150,6016,5726,5519,6347,5047,3550,6151,6348,4197,4310,5904,\n6571,5581,2965,6152,4978,3960,4291,5135,6572,5301,5727,4129,4026,5905,4853,5728,\n5472,6153,6349,4533,2700,4505,5336,4678,3583,5073,2994,4486,3043,4554,5520,6350,\n6017,5800,4487,6351,3931,4103,5376,6352,4011,4321,4311,4190,5136,6018,3988,3233,\n4350,5906,5645,4198,6573,5107,3432,4191,3435,5582,6574,4139,5410,6353,5411,3944,\n5583,5074,3198,6575,6354,4358,6576,5302,4600,5584,5194,5412,6577,6578,5585,5413,\n5303,4248,5414,3879,4433,6579,4479,5025,4854,5415,6355,4760,4772,3683,2978,4700,\n3797,4452,3965,3932,3721,4910,5801,6580,5195,3551,5907,3221,3471,3029,6019,3999,\n5908,5909,5266,5267,3444,3023,3828,3170,4796,5646,4979,4259,6356,5647,5337,3694,\n6357,5648,5338,4520,4322,5802,3031,3759,4071,6020,5586,4836,4386,5048,6581,3571,\n4679,4174,4949,6154,4813,3787,3402,3822,3958,3215,3552,5268,4387,3933,4950,4359,\n6021,5910,5075,3579,6358,4234,4566,5521,6359,3613,5049,6022,5911,3375,3702,3178,\n4911,5339,4521,6582,6583,4395,3087,3811,5377,6023,6360,6155,4027,5171,5649,4421,\n4249,2804,6584,2270,6585,4000,4235,3045,6156,5137,5729,4140,4312,3886,6361,4330,\n6157,4215,6158,3500,3676,4929,4331,3713,4930,5912,4265,3776,3368,5587,4470,4855,\n3038,4980,3631,6159,6160,4132,4680,6161,6362,3923,4379,5588,4255,6586,4121,6587,\n6363,4649,6364,3288,4773,4774,6162,6024,6365,3543,6588,4274,3107,3737,5050,5803,\n4797,4522,5589,5051,5730,3714,4887,5378,4001,4523,6163,5026,5522,4701,4175,2791,\n3760,6589,5473,4224,4133,3847,4814,4815,4775,3259,5416,6590,2738,6164,6025,5304,\n3733,5076,5650,4816,5590,6591,6165,6592,3934,5269,6593,3396,5340,6594,5804,3445,\n3602,4042,4488,5731,5732,3525,5591,4601,5196,6166,6026,5172,3642,4612,3202,4506,\n4798,6366,3818,5108,4303,5138,5139,4776,3332,4304,2915,3415,4434,5077,5109,4856,\n2879,5305,4817,6595,5913,3104,3144,3903,4634,5341,3133,5110,5651,5805,6167,4057,\n5592,2945,4371,5593,6596,3474,4182,6367,6597,6168,4507,4279,6598,2822,6599,4777,\n4713,5594,3829,6169,3887,5417,6170,3653,5474,6368,4216,2971,5228,3790,4579,6369,\n5733,6600,6601,4951,4746,4555,6602,5418,5475,6027,3400,4665,5806,6171,4799,6028,\n5052,6172,3343,4800,4747,5006,6370,4556,4217,5476,4396,5229,5379,5477,3839,5914,\n5652,5807,4714,3068,4635,5808,6173,5342,4192,5078,5419,5523,5734,6174,4557,6175,\n4602,6371,6176,6603,5809,6372,5735,4260,3869,5111,5230,6029,5112,6177,3126,4681,\n5524,5915,2706,3563,4748,3130,6178,4018,5525,6604,6605,5478,4012,4837,6606,4534,\n4193,5810,4857,3615,5479,6030,4082,3697,3539,4086,5270,3662,4508,4931,5916,4912,\n5811,5027,3888,6607,4397,3527,3302,3798,2775,2921,2637,3966,4122,4388,4028,4054,\n1633,4858,5079,3024,5007,3982,3412,5736,6608,3426,3236,5595,3030,6179,3427,3336,\n3279,3110,6373,3874,3039,5080,5917,5140,4489,3119,6374,5812,3405,4494,6031,4666,\n4141,6180,4166,6032,5813,4981,6609,5081,4422,4982,4112,3915,5653,3296,3983,6375,\n4266,4410,5654,6610,6181,3436,5082,6611,5380,6033,3819,5596,4535,5231,5306,5113,\n6612,4952,5918,4275,3113,6613,6376,6182,6183,5814,3073,4731,4838,5008,3831,6614,\n4888,3090,3848,4280,5526,5232,3014,5655,5009,5737,5420,5527,6615,5815,5343,5173,\n5381,4818,6616,3151,4953,6617,5738,2796,3204,4360,2989,4281,5739,5174,5421,5197,\n3132,5141,3849,5142,5528,5083,3799,3904,4839,5480,2880,4495,3448,6377,6184,5271,\n5919,3771,3193,6034,6035,5920,5010,6036,5597,6037,6378,6038,3106,5422,6618,5423,\n5424,4142,6619,4889,5084,4890,4313,5740,6620,3437,5175,5307,5816,4199,5198,5529,\n5817,5199,5656,4913,5028,5344,3850,6185,2955,5272,5011,5818,4567,4580,5029,5921,\n3616,5233,6621,6622,6186,4176,6039,6379,6380,3352,5200,5273,2908,5598,5234,3837,\n5308,6623,6624,5819,4496,4323,5309,5201,6625,6626,4983,3194,3838,4167,5530,5922,\n5274,6381,6382,3860,3861,5599,3333,4292,4509,6383,3553,5481,5820,5531,4778,6187,\n3955,3956,4324,4389,4218,3945,4325,3397,2681,5923,4779,5085,4019,5482,4891,5382,\n5383,6040,4682,3425,5275,4094,6627,5310,3015,5483,5657,4398,5924,3168,4819,6628,\n5925,6629,5532,4932,4613,6041,6630,4636,6384,4780,4204,5658,4423,5821,3989,4683,\n5822,6385,4954,6631,5345,6188,5425,5012,5384,3894,6386,4490,4104,6632,5741,5053,\n6633,5823,5926,5659,5660,5927,6634,5235,5742,5824,4840,4933,4820,6387,4859,5928,\n4955,6388,4143,3584,5825,5346,5013,6635,5661,6389,5014,5484,5743,4337,5176,5662,\n6390,2836,6391,3268,6392,6636,6042,5236,6637,4158,6638,5744,5663,4471,5347,3663,\n4123,5143,4293,3895,6639,6640,5311,5929,5826,3800,6189,6393,6190,5664,5348,3554,\n3594,4749,4603,6641,5385,4801,6043,5827,4183,6642,5312,5426,4761,6394,5665,6191,\n4715,2669,6643,6644,5533,3185,5427,5086,5930,5931,5386,6192,6044,6645,4781,4013,\n5745,4282,4435,5534,4390,4267,6045,5746,4984,6046,2743,6193,3501,4087,5485,5932,\n5428,4184,4095,5747,4061,5054,3058,3862,5933,5600,6646,5144,3618,6395,3131,5055,\n5313,6396,4650,4956,3855,6194,3896,5202,4985,4029,4225,6195,6647,5828,5486,5829,\n3589,3002,6648,6397,4782,5276,6649,6196,6650,4105,3803,4043,5237,5830,6398,4096,\n3643,6399,3528,6651,4453,3315,4637,6652,3984,6197,5535,3182,3339,6653,3096,2660,\n6400,6654,3449,5934,4250,4236,6047,6401,5831,6655,5487,3753,4062,5832,6198,6199,\n6656,3766,6657,3403,4667,6048,6658,4338,2897,5833,3880,2797,3780,4326,6659,5748,\n5015,6660,5387,4351,5601,4411,6661,3654,4424,5935,4339,4072,5277,4568,5536,6402,\n6662,5238,6663,5349,5203,6200,5204,6201,5145,4536,5016,5056,4762,5834,4399,4957,\n6202,6403,5666,5749,6664,4340,6665,5936,5177,5667,6666,6667,3459,4668,6404,6668,\n6669,4543,6203,6670,4276,6405,4480,5537,6671,4614,5205,5668,6672,3348,2193,4763,\n6406,6204,5937,5602,4177,5669,3419,6673,4020,6205,4443,4569,5388,3715,3639,6407,\n6049,4058,6206,6674,5938,4544,6050,4185,4294,4841,4651,4615,5488,6207,6408,6051,\n5178,3241,3509,5835,6208,4958,5836,4341,5489,5278,6209,2823,5538,5350,5206,5429,\n6675,4638,4875,4073,3516,4684,4914,4860,5939,5603,5389,6052,5057,3237,5490,3791,\n6676,6409,6677,4821,4915,4106,5351,5058,4243,5539,4244,5604,4842,4916,5239,3028,\n3716,5837,5114,5605,5390,5940,5430,6210,4332,6678,5540,4732,3667,3840,6053,4305,\n3408,5670,5541,6410,2744,5240,5750,6679,3234,5606,6680,5607,5671,3608,4283,4159,\n4400,5352,4783,6681,6411,6682,4491,4802,6211,6412,5941,6413,6414,5542,5751,6683,\n4669,3734,5942,6684,6415,5943,5059,3328,4670,4144,4268,6685,6686,6687,6688,4372,\n3603,6689,5944,5491,4373,3440,6416,5543,4784,4822,5608,3792,4616,5838,5672,3514,\n5391,6417,4892,6690,4639,6691,6054,5673,5839,6055,6692,6056,5392,6212,4038,5544,\n5674,4497,6057,6693,5840,4284,5675,4021,4545,5609,6418,4454,6419,6213,4113,4472,\n5314,3738,5087,5279,4074,5610,4959,4063,3179,4750,6058,6420,6214,3476,4498,4716,\n5431,4960,4685,6215,5241,6694,6421,6216,6695,5841,5945,6422,3748,5946,5179,3905,\n5752,5545,5947,4374,6217,4455,6423,4412,6218,4803,5353,6696,3832,5280,6219,4327,\n4702,6220,6221,6059,4652,5432,6424,3749,4751,6425,5753,4986,5393,4917,5948,5030,\n5754,4861,4733,6426,4703,6697,6222,4671,5949,4546,4961,5180,6223,5031,3316,5281,\n6698,4862,4295,4934,5207,3644,6427,5842,5950,6428,6429,4570,5843,5282,6430,6224,\n5088,3239,6060,6699,5844,5755,6061,6431,2701,5546,6432,5115,5676,4039,3993,3327,\n4752,4425,5315,6433,3941,6434,5677,4617,4604,3074,4581,6225,5433,6435,6226,6062,\n4823,5756,5116,6227,3717,5678,4717,5845,6436,5679,5846,6063,5847,6064,3977,3354,\n6437,3863,5117,6228,5547,5394,4499,4524,6229,4605,6230,4306,4500,6700,5951,6065,\n3693,5952,5089,4366,4918,6701,6231,5548,6232,6702,6438,4704,5434,6703,6704,5953,\n4168,6705,5680,3420,6706,5242,4407,6066,3812,5757,5090,5954,4672,4525,3481,5681,\n4618,5395,5354,5316,5955,6439,4962,6707,4526,6440,3465,4673,6067,6441,5682,6708,\n5435,5492,5758,5683,4619,4571,4674,4804,4893,4686,5493,4753,6233,6068,4269,6442,\n6234,5032,4705,5146,5243,5208,5848,6235,6443,4963,5033,4640,4226,6236,5849,3387,\n6444,6445,4436,4437,5850,4843,5494,4785,4894,6709,4361,6710,5091,5956,3331,6237,\n4987,5549,6069,6711,4342,3517,4473,5317,6070,6712,6071,4706,6446,5017,5355,6713,\n6714,4988,5436,6447,4734,5759,6715,4735,4547,4456,4754,6448,5851,6449,6450,3547,\n5852,5318,6451,6452,5092,4205,6716,6238,4620,4219,5611,6239,6072,4481,5760,5957,\n5958,4059,6240,6453,4227,4537,6241,5761,4030,4186,5244,5209,3761,4457,4876,3337,\n5495,5181,6242,5959,5319,5612,5684,5853,3493,5854,6073,4169,5613,5147,4895,6074,\n5210,6717,5182,6718,3830,6243,2798,3841,6075,6244,5855,5614,3604,4606,5496,5685,\n5118,5356,6719,6454,5960,5357,5961,6720,4145,3935,4621,5119,5962,4261,6721,6455,\n4786,5963,4375,4582,6245,6246,6247,6076,5437,4877,5856,3376,4380,6248,4160,6722,\n5148,6456,5211,6457,6723,4718,6458,6724,6249,5358,4044,3297,6459,6250,5857,5615,\n5497,5245,6460,5498,6725,6251,6252,5550,3793,5499,2959,5396,6461,6462,4572,5093,\n5500,5964,3806,4146,6463,4426,5762,5858,6077,6253,4755,3967,4220,5965,6254,4989,\n5501,6464,4352,6726,6078,4764,2290,5246,3906,5438,5283,3767,4964,2861,5763,5094,\n6255,6256,4622,5616,5859,5860,4707,6727,4285,4708,4824,5617,6257,5551,4787,5212,\n4965,4935,4687,6465,6728,6466,5686,6079,3494,4413,2995,5247,5966,5618,6729,5967,\n5764,5765,5687,5502,6730,6731,6080,5397,6467,4990,6258,6732,4538,5060,5619,6733,\n4719,5688,5439,5018,5149,5284,5503,6734,6081,4607,6259,5120,3645,5861,4583,6260,\n4584,4675,5620,4098,5440,6261,4863,2379,3306,4585,5552,5689,4586,5285,6735,4864,\n6736,5286,6082,6737,4623,3010,4788,4381,4558,5621,4587,4896,3698,3161,5248,4353,\n4045,6262,3754,5183,4588,6738,6263,6739,6740,5622,3936,6741,6468,6742,6264,5095,\n6469,4991,5968,6743,4992,6744,6083,4897,6745,4256,5766,4307,3108,3968,4444,5287,\n3889,4343,6084,4510,6085,4559,6086,4898,5969,6746,5623,5061,4919,5249,5250,5504,\n5441,6265,5320,4878,3242,5862,5251,3428,6087,6747,4237,5624,5442,6266,5553,4539,\n6748,2585,3533,5398,4262,6088,5150,4736,4438,6089,6267,5505,4966,6749,6268,6750,\n6269,5288,5554,3650,6090,6091,4624,6092,5690,6751,5863,4270,5691,4277,5555,5864,\n6752,5692,4720,4865,6470,5151,4688,4825,6753,3094,6754,6471,3235,4653,6755,5213,\n5399,6756,3201,4589,5865,4967,6472,5866,6473,5019,3016,6757,5321,4756,3957,4573,\n6093,4993,5767,4721,6474,6758,5625,6759,4458,6475,6270,6760,5556,4994,5214,5252,\n6271,3875,5768,6094,5034,5506,4376,5769,6761,2120,6476,5253,5770,6762,5771,5970,\n3990,5971,5557,5558,5772,6477,6095,2787,4641,5972,5121,6096,6097,6272,6763,3703,\n5867,5507,6273,4206,6274,4789,6098,6764,3619,3646,3833,3804,2394,3788,4936,3978,\n4866,4899,6099,6100,5559,6478,6765,3599,5868,6101,5869,5870,6275,6766,4527,6767,\n*******************************************************************************/\n};\n\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/tables/JISFreq.tab",
    "content": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n//Sampling from about 20M text materials include literature and computer technology\n\n// Japanese frequency table, applied to both S-JIS and EUC-JP\n//They are sorted in order. \n\n/******************************************************************************\n * 128  --> 0.77094\n * 256  --> 0.85710\n * 512  --> 0.92635\n * 1024 --> 0.97130\n * 2048 --> 0.99431\n *\n * Idea Distribution Ratio = 0.92635 / (1-0.92635) = 12.58\n * Random Distribution Ration = 512 / (2965+62+83+86-512) = 0.191\n * \n * Typical Distribution Ratio, 25% of IDR \n *****************************************************************************/\n\n#define JIS_TYPICAL_DISTRIBUTION_RATIO (float)0.93\n\n\n//Char to FreqOrder table , \n#define JIS_TABLE_SIZE  4368\n\nconstexpr PRInt16 JISCharToFreqOrder[] =\n{\n  40,   1,   6, 182, 152, 180, 295,2127, 285, 381,3295,4304,3068,4606,3165,3510, //   16\n3511,1822,2785,4607,1193,2226,5070,4608, 171,2996,1247,  18, 179,5071, 856,1661, //   32\n1262,5072, 619, 127,3431,3512,3230,1899,1700, 232, 228,1294,1298, 284, 283,2041, //   48\n2042,1061,1062,  48,  49,  44,  45, 433, 434,1040,1041, 996, 787,2997,1255,4305, //   64\n2108,4609,1684,1648,5073,5074,5075,5076,5077,5078,3687,5079,4610,5080,3927,3928, //   80\n5081,3296,3432, 290,2285,1471,2187,5082,2580,2825,1303,2140,1739,1445,2691,3375, //   96\n1691,3297,4306,4307,4611, 452,3376,1182,2713,3688,3069,4308,5083,5084,5085,5086, //  112\n5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102, //  128\n5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,4097,5113,5114,5115,5116,5117, //  144\n5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133, //  160\n5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149, //  176\n5150,5151,5152,4612,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164, //  192\n5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,1472, 598, 618, 820,1205, //  208\n1309,1412,1858,1307,1692,5176,5177,5178,5179,5180,5181,5182,1142,1452,1234,1172, //  224\n1875,2043,2149,1793,1382,2973, 925,2404,1067,1241, 960,1377,2935,1491, 919,1217, //  240\n1865,2030,1406,1499,2749,4098,5183,5184,5185,5186,5187,5188,2561,4099,3117,1804, //  256\n2049,3689,4309,3513,1663,5189,3166,3118,3298,1587,1561,3433,5190,3119,1625,2998, //  272\n3299,4613,1766,3690,2786,4614,5191,5192,5193,5194,2161,  26,3377,   2,3929,  20, //  288\n3691,  47,4100,  50,  17,  16,  35, 268,  27, 243,  42, 155,  24, 154,  29, 184, //  304\n   4,  91,  14,  92,  53, 396,  33, 289,   9,  37,  64, 620,  21,  39, 321,   5, //  320\n  12,  11,  52,  13,   3, 208, 138,   0,   7,  60, 526, 141, 151,1069, 181, 275, //  336\n1591,  83, 132,1475, 126, 331, 829,  15,  69, 160,  59,  22, 157,  55,1079, 312, //  352\n 109,  38,  23,  25,  10,  19,  79,5195,  61, 382,1124,   8,  30,5196,5197,5198, //  368\n5199,5200,5201,5202,5203,5204,5205,5206,  89,  62,  74,  34,2416, 112, 139, 196, //  384\n 271, 149,  84, 607, 131, 765,  46,  88, 153, 683,  76, 874, 101, 258,  57,  80, //  400\n  32, 364, 121,1508, 169,1547,  68, 235, 145,2999,  41, 360,3027,  70,  63,  31, //  416\n  43, 259, 262,1383,  99, 533, 194,  66,  93, 846, 217, 192,  56, 106,  58, 565, //  432\n 280, 272, 311, 256, 146,  82, 308,  71, 100, 128, 214, 655, 110, 261, 104,1140, //  448\n  54,  51,  36,  87,  67,3070, 185,2618,2936,2020,  28,1066,2390,2059,5207,5208, //  464\n5209,5210,5211,5212,5213,5214,5215,5216,4615,5217,5218,5219,5220,5221,5222,5223, //  480\n5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,3514,5237,5238, //  496\n5239,5240,5241,5242,5243,5244,2297,2031,4616,4310,3692,5245,3071,5246,3598,5247, //  512\n4617,3231,3515,5248,4101,4311,4618,3808,4312,4102,5249,4103,4104,3599,5250,5251, //  528\n5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267, //  544\n5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283, //  560\n5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299, //  576\n5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315, //  592\n5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331, //  608\n5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347, //  624\n5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363, //  640\n5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379, //  656\n5380,5381, 363, 642,2787,2878,2788,2789,2316,3232,2317,3434,2011, 165,1942,3930, //  672\n3931,3932,3933,5382,4619,5383,4620,5384,5385,5386,5387,5388,5389,5390,5391,5392, //  688\n5393,5394,5395,5396,5397,5398,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408, //  704\n5409,5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424, //  720\n5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440, //  736\n5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456, //  752\n5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472, //  768\n5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488, //  784\n5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504, //  800\n5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520, //  816\n5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536, //  832\n5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,5550,5551,5552, //  848\n5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568, //  864\n5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584, //  880\n5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,5600, //  896\n5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616, //  912\n5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632, //  928\n5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648, //  944\n5649,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664, //  960\n5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680, //  976\n5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696, //  992\n5697,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712, // 1008\n5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728, // 1024\n5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744, // 1040\n5745,5746,5747,5748,5749,5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760, // 1056\n5761,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776, // 1072\n5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792, // 1088\n5793,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5806,5807,5808, // 1104\n5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824, // 1120\n5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840, // 1136\n5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856, // 1152\n5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872, // 1168\n5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888, // 1184\n5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904, // 1200\n5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920, // 1216\n5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936, // 1232\n5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952, // 1248\n5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968, // 1264\n5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984, // 1280\n5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6000, // 1296\n6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016, // 1312\n6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032, // 1328\n6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048, // 1344\n6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064, // 1360\n6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080, // 1376\n6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096, // 1392\n6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112, // 1408\n6113,6114,2044,2060,4621, 997,1235, 473,1186,4622, 920,3378,6115,6116, 379,1108, // 1424\n4313,2657,2735,3934,6117,3809, 636,3233, 573,1026,3693,3435,2974,3300,2298,4105, // 1440\n 854,2937,2463, 393,2581,2417, 539, 752,1280,2750,2480, 140,1161, 440, 708,1569, // 1456\n 665,2497,1746,1291,1523,3000, 164,1603, 847,1331, 537,1997, 486, 508,1693,2418, // 1472\n1970,2227, 878,1220, 299,1030, 969, 652,2751, 624,1137,3301,2619,  65,3302,2045, // 1488\n1761,1859,3120,1930,3694,3516, 663,1767, 852, 835,3695, 269, 767,2826,2339,1305, // 1504\n 896,1150, 770,1616,6118, 506,1502,2075,1012,2519, 775,2520,2975,2340,2938,4314, // 1520\n3028,2086,1224,1943,2286,6119,3072,4315,2240,1273,1987,3935,1557, 175, 597, 985, // 1536\n3517,2419,2521,1416,3029, 585, 938,1931,1007,1052,1932,1685,6120,3379,4316,4623, // 1552\n 804, 599,3121,1333,2128,2539,1159,1554,2032,3810, 687,2033,2904, 952, 675,1467, // 1568\n3436,6121,2241,1096,1786,2440,1543,1924, 980,1813,2228, 781,2692,1879, 728,1918, // 1584\n3696,4624, 548,1950,4625,1809,1088,1356,3303,2522,1944, 502, 972, 373, 513,2827, // 1600\n 586,2377,2391,1003,1976,1631,6122,2464,1084, 648,1776,4626,2141, 324, 962,2012, // 1616\n2177,2076,1384, 742,2178,1448,1173,1810, 222, 102, 301, 445, 125,2420, 662,2498, // 1632\n 277, 200,1476,1165,1068, 224,2562,1378,1446, 450,1880, 659, 791, 582,4627,2939, // 1648\n3936,1516,1274, 555,2099,3697,1020,1389,1526,3380,1762,1723,1787,2229, 412,2114, // 1664\n1900,2392,3518, 512,2597, 427,1925,2341,3122,1653,1686,2465,2499, 697, 330, 273, // 1680\n 380,2162, 951, 832, 780, 991,1301,3073, 965,2270,3519, 668,2523,2636,1286, 535, // 1696\n1407, 518, 671, 957,2658,2378, 267, 611,2197,3030,6123, 248,2299, 967,1799,2356, // 1712\n 850,1418,3437,1876,1256,1480,2828,1718,6124,6125,1755,1664,2405,6126,4628,2879, // 1728\n2829, 499,2179, 676,4629, 557,2329,2214,2090, 325,3234, 464, 811,3001, 992,2342, // 1744\n2481,1232,1469, 303,2242, 466,1070,2163, 603,1777,2091,4630,2752,4631,2714, 322, // 1760\n2659,1964,1768, 481,2188,1463,2330,2857,3600,2092,3031,2421,4632,2318,2070,1849, // 1776\n2598,4633,1302,2254,1668,1701,2422,3811,2905,3032,3123,2046,4106,1763,1694,4634, // 1792\n1604, 943,1724,1454, 917, 868,2215,1169,2940, 552,1145,1800,1228,1823,1955, 316, // 1808\n1080,2510, 361,1807,2830,4107,2660,3381,1346,1423,1134,4108,6127, 541,1263,1229, // 1824\n1148,2540, 545, 465,1833,2880,3438,1901,3074,2482, 816,3937, 713,1788,2500, 122, // 1840\n1575, 195,1451,2501,1111,6128, 859, 374,1225,2243,2483,4317, 390,1033,3439,3075, // 1856\n2524,1687, 266, 793,1440,2599, 946, 779, 802, 507, 897,1081, 528,2189,1292, 711, // 1872\n1866,1725,1167,1640, 753, 398,2661,1053, 246, 348,4318, 137,1024,3440,1600,2077, // 1888\n2129, 825,4319, 698, 238, 521, 187,2300,1157,2423,1641,1605,1464,1610,1097,2541, // 1904\n1260,1436, 759,2255,1814,2150, 705,3235, 409,2563,3304, 561,3033,2005,2564, 726, // 1920\n1956,2343,3698,4109, 949,3812,3813,3520,1669, 653,1379,2525, 881,2198, 632,2256, // 1936\n1027, 778,1074, 733,1957, 514,1481,2466, 554,2180, 702,3938,1606,1017,1398,6129, // 1952\n1380,3521, 921, 993,1313, 594, 449,1489,1617,1166, 768,1426,1360, 495,1794,3601, // 1968\n1177,3602,1170,4320,2344, 476, 425,3167,4635,3168,1424, 401,2662,1171,3382,1998, // 1984\n1089,4110, 477,3169, 474,6130,1909, 596,2831,1842, 494, 693,1051,1028,1207,3076, // 2000\n 606,2115, 727,2790,1473,1115, 743,3522, 630, 805,1532,4321,2021, 366,1057, 838, // 2016\n 684,1114,2142,4322,2050,1492,1892,1808,2271,3814,2424,1971,1447,1373,3305,1090, // 2032\n1536,3939,3523,3306,1455,2199, 336, 369,2331,1035, 584,2393, 902, 718,2600,6131, // 2048\n2753, 463,2151,1149,1611,2467, 715,1308,3124,1268, 343,1413,3236,1517,1347,2663, // 2064\n2093,3940,2022,1131,1553,2100,2941,1427,3441,2942,1323,2484,6132,1980, 872,2368, // 2080\n2441,2943, 320,2369,2116,1082, 679,1933,3941,2791,3815, 625,1143,2023, 422,2200, // 2096\n3816,6133, 730,1695, 356,2257,1626,2301,2858,2637,1627,1778, 937, 883,2906,2693, // 2112\n3002,1769,1086, 400,1063,1325,3307,2792,4111,3077, 456,2345,1046, 747,6134,1524, // 2128\n 884,1094,3383,1474,2164,1059, 974,1688,2181,2258,1047, 345,1665,1187, 358, 875, // 2144\n3170, 305, 660,3524,2190,1334,1135,3171,1540,1649,2542,1527, 927, 968,2793, 885, // 2160\n1972,1850, 482, 500,2638,1218,1109,1085,2543,1654,2034, 876,  78,2287,1482,1277, // 2176\n 861,1675,1083,1779, 724,2754, 454, 397,1132,1612,2332, 893, 672,1237, 257,2259, // 2192\n2370, 135,3384, 337,2244, 547, 352, 340, 709,2485,1400, 788,1138,2511, 540, 772, // 2208\n1682,2260,2272,2544,2013,1843,1902,4636,1999,1562,2288,4637,2201,1403,1533, 407, // 2224\n 576,3308,1254,2071, 978,3385, 170, 136,1201,3125,2664,3172,2394, 213, 912, 873, // 2240\n3603,1713,2202, 699,3604,3699, 813,3442, 493, 531,1054, 468,2907,1483, 304, 281, // 2256\n4112,1726,1252,2094, 339,2319,2130,2639, 756,1563,2944, 748, 571,2976,1588,2425, // 2272\n2715,1851,1460,2426,1528,1392,1973,3237, 288,3309, 685,3386, 296, 892,2716,2216, // 2288\n1570,2245, 722,1747,2217, 905,3238,1103,6135,1893,1441,1965, 251,1805,2371,3700, // 2304\n2601,1919,1078,  75,2182,1509,1592,1270,2640,4638,2152,6136,3310,3817, 524, 706, // 2320\n1075, 292,3818,1756,2602, 317,  98,3173,3605,3525,1844,2218,3819,2502, 814, 567, // 2336\n 385,2908,1534,6137, 534,1642,3239, 797,6138,1670,1529, 953,4323, 188,1071, 538, // 2352\n 178, 729,3240,2109,1226,1374,2000,2357,2977, 731,2468,1116,2014,2051,6139,1261, // 2368\n1593, 803,2859,2736,3443, 556, 682, 823,1541,6140,1369,2289,1706,2794, 845, 462, // 2384\n2603,2665,1361, 387, 162,2358,1740, 739,1770,1720,1304,1401,3241,1049, 627,1571, // 2400\n2427,3526,1877,3942,1852,1500, 431,1910,1503, 677, 297,2795, 286,1433,1038,1198, // 2416\n2290,1133,1596,4113,4639,2469,1510,1484,3943,6141,2442, 108, 712,4640,2372, 866, // 2432\n3701,2755,3242,1348, 834,1945,1408,3527,2395,3243,1811, 824, 994,1179,2110,1548, // 2448\n1453, 790,3003, 690,4324,4325,2832,2909,3820,1860,3821, 225,1748, 310, 346,1780, // 2464\n2470, 821,1993,2717,2796, 828, 877,3528,2860,2471,1702,2165,2910,2486,1789, 453, // 2480\n 359,2291,1676,  73,1164,1461,1127,3311, 421, 604, 314,1037, 589, 116,2487, 737, // 2496\n 837,1180, 111, 244, 735,6142,2261,1861,1362, 986, 523, 418, 581,2666,3822, 103, // 2512\n 855, 503,1414,1867,2488,1091, 657,1597, 979, 605,1316,4641,1021,2443,2078,2001, // 2528\n1209,  96, 587,2166,1032, 260,1072,2153, 173,  94, 226,3244, 819,2006,4642,4114, // 2544\n2203, 231,1744, 782,  97,2667, 786,3387, 887, 391, 442,2219,4326,1425,6143,2694, // 2560\n 633,1544,1202, 483,2015, 592,2052,1958,2472,1655, 419, 129,4327,3444,3312,1714, // 2576\n1257,3078,4328,1518,1098, 865,1310,1019,1885,1512,1734, 469,2444, 148, 773, 436, // 2592\n1815,1868,1128,1055,4329,1245,2756,3445,2154,1934,1039,4643, 579,1238, 932,2320, // 2608\n 353, 205, 801, 115,2428, 944,2321,1881, 399,2565,1211, 678, 766,3944, 335,2101, // 2624\n1459,1781,1402,3945,2737,2131,1010, 844, 981,1326,1013, 550,1816,1545,2620,1335, // 2640\n1008, 371,2881, 936,1419,1613,3529,1456,1395,2273,1834,2604,1317,2738,2503, 416, // 2656\n1643,4330, 806,1126, 229, 591,3946,1314,1981,1576,1837,1666, 347,1790, 977,3313, // 2672\n 764,2861,1853, 688,2429,1920,1462,  77, 595, 415,2002,3034, 798,1192,4115,6144, // 2688\n2978,4331,3035,2695,2582,2072,2566, 430,2430,1727, 842,1396,3947,3702, 613, 377, // 2704\n 278, 236,1417,3388,3314,3174, 757,1869, 107,3530,6145,1194, 623,2262, 207,1253, // 2720\n2167,3446,3948, 492,1117,1935, 536,1838,2757,1246,4332, 696,2095,2406,1393,1572, // 2736\n3175,1782, 583, 190, 253,1390,2230, 830,3126,3389, 934,3245,1703,1749,2979,1870, // 2752\n2545,1656,2204, 869,2346,4116,3176,1817, 496,1764,4644, 942,1504, 404,1903,1122, // 2768\n1580,3606,2945,1022, 515, 372,1735, 955,2431,3036,6146,2797,1110,2302,2798, 617, // 2784\n6147, 441, 762,1771,3447,3607,3608,1904, 840,3037,  86, 939,1385, 572,1370,2445, // 2800\n1336, 114,3703, 898, 294, 203,3315, 703,1583,2274, 429, 961,4333,1854,1951,3390, // 2816\n2373,3704,4334,1318,1381, 966,1911,2322,1006,1155, 309, 989, 458,2718,1795,1372, // 2832\n1203, 252,1689,1363,3177, 517,1936, 168,1490, 562, 193,3823,1042,4117,1835, 551, // 2848\n 470,4645, 395, 489,3448,1871,1465,2583,2641, 417,1493, 279,1295, 511,1236,1119, // 2864\n  72,1231,1982,1812,3004, 871,1564, 984,3449,1667,2696,2096,4646,2347,2833,1673, // 2880\n3609, 695,3246,2668, 807,1183,4647, 890, 388,2333,1801,1457,2911,1765,1477,1031, // 2896\n3316,3317,1278,3391,2799,2292,2526, 163,3450,4335,2669,1404,1802,6148,2323,2407, // 2912\n1584,1728,1494,1824,1269, 298, 909,3318,1034,1632, 375, 776,1683,2061, 291, 210, // 2928\n1123, 809,1249,1002,2642,3038, 206,1011,2132, 144, 975, 882,1565, 342, 667, 754, // 2944\n1442,2143,1299,2303,2062, 447, 626,2205,1221,2739,2912,1144,1214,2206,2584, 760, // 2960\n1715, 614, 950,1281,2670,2621, 810, 577,1287,2546,4648, 242,2168, 250,2643, 691, // 2976\n 123,2644, 647, 313,1029, 689,1357,2946,1650, 216, 771,1339,1306, 808,2063, 549, // 2992\n 913,1371,2913,2914,6149,1466,1092,1174,1196,1311,2605,2396,1783,1796,3079, 406, // 3008\n2671,2117,3949,4649, 487,1825,2220,6150,2915, 448,2348,1073,6151,2397,1707, 130, // 3024\n 900,1598, 329, 176,1959,2527,1620,6152,2275,4336,3319,1983,2191,3705,3610,2155, // 3040\n3706,1912,1513,1614,6153,1988, 646, 392,2304,1589,3320,3039,1826,1239,1352,1340, // 3056\n2916, 505,2567,1709,1437,2408,2547, 906,6154,2672, 384,1458,1594,1100,1329, 710, // 3072\n 423,3531,2064,2231,2622,1989,2673,1087,1882, 333, 841,3005,1296,2882,2379, 580, // 3088\n1937,1827,1293,2585, 601, 574, 249,1772,4118,2079,1120, 645, 901,1176,1690, 795, // 3104\n2207, 478,1434, 516,1190,1530, 761,2080, 930,1264, 355, 435,1552, 644,1791, 987, // 3120\n 220,1364,1163,1121,1538, 306,2169,1327,1222, 546,2645, 218, 241, 610,1704,3321, // 3136\n1984,1839,1966,2528, 451,6155,2586,3707,2568, 907,3178, 254,2947, 186,1845,4650, // 3152\n 745, 432,1757, 428,1633, 888,2246,2221,2489,3611,2118,1258,1265, 956,3127,1784, // 3168\n4337,2490, 319, 510, 119, 457,3612, 274,2035,2007,4651,1409,3128, 970,2758, 590, // 3184\n2800, 661,2247,4652,2008,3950,1420,1549,3080,3322,3951,1651,1375,2111, 485,2491, // 3200\n1429,1156,6156,2548,2183,1495, 831,1840,2529,2446, 501,1657, 307,1894,3247,1341, // 3216\n 666, 899,2156,1539,2549,1559, 886, 349,2208,3081,2305,1736,3824,2170,2759,1014, // 3232\n1913,1386, 542,1397,2948, 490, 368, 716, 362, 159, 282,2569,1129,1658,1288,1750, // 3248\n2674, 276, 649,2016, 751,1496, 658,1818,1284,1862,2209,2087,2512,3451, 622,2834, // 3264\n 376, 117,1060,2053,1208,1721,1101,1443, 247,1250,3179,1792,3952,2760,2398,3953, // 3280\n6157,2144,3708, 446,2432,1151,2570,3452,2447,2761,2835,1210,2448,3082, 424,2222, // 3296\n1251,2449,2119,2836, 504,1581,4338, 602, 817, 857,3825,2349,2306, 357,3826,1470, // 3312\n1883,2883, 255, 958, 929,2917,3248, 302,4653,1050,1271,1751,2307,1952,1430,2697, // 3328\n2719,2359, 354,3180, 777, 158,2036,4339,1659,4340,4654,2308,2949,2248,1146,2232, // 3344\n3532,2720,1696,2623,3827,6158,3129,1550,2698,1485,1297,1428, 637, 931,2721,2145, // 3360\n 914,2550,2587,  81,2450, 612, 827,2646,1242,4655,1118,2884, 472,1855,3181,3533, // 3376\n3534, 569,1353,2699,1244,1758,2588,4119,2009,2762,2171,3709,1312,1531,6159,1152, // 3392\n1938, 134,1830, 471,3710,2276,1112,1535,3323,3453,3535, 982,1337,2950, 488, 826, // 3408\n 674,1058,1628,4120,2017, 522,2399, 211, 568,1367,3454, 350, 293,1872,1139,3249, // 3424\n1399,1946,3006,1300,2360,3324, 588, 736,6160,2606, 744, 669,3536,3828,6161,1358, // 3440\n 199, 723, 848, 933, 851,1939,1505,1514,1338,1618,1831,4656,1634,3613, 443,2740, // 3456\n3829, 717,1947, 491,1914,6162,2551,1542,4121,1025,6163,1099,1223, 198,3040,2722, // 3472\n 370, 410,1905,2589, 998,1248,3182,2380, 519,1449,4122,1710, 947, 928,1153,4341, // 3488\n2277, 344,2624,1511, 615, 105, 161,1212,1076,1960,3130,2054,1926,1175,1906,2473, // 3504\n 414,1873,2801,6164,2309, 315,1319,3325, 318,2018,2146,2157, 963, 631, 223,4342, // 3520\n4343,2675, 479,3711,1197,2625,3712,2676,2361,6165,4344,4123,6166,2451,3183,1886, // 3536\n2184,1674,1330,1711,1635,1506, 799, 219,3250,3083,3954,1677,3713,3326,2081,3614, // 3552\n1652,2073,4657,1147,3041,1752, 643,1961, 147,1974,3955,6167,1716,2037, 918,3007, // 3568\n1994, 120,1537, 118, 609,3184,4345, 740,3455,1219, 332,1615,3830,6168,1621,2980, // 3584\n1582, 783, 212, 553,2350,3714,1349,2433,2082,4124, 889,6169,2310,1275,1410, 973, // 3600\n 166,1320,3456,1797,1215,3185,2885,1846,2590,2763,4658, 629, 822,3008, 763, 940, // 3616\n1990,2862, 439,2409,1566,1240,1622, 926,1282,1907,2764, 654,2210,1607, 327,1130, // 3632\n3956,1678,1623,6170,2434,2192, 686, 608,3831,3715, 903,3957,3042,6171,2741,1522, // 3648\n1915,1105,1555,2552,1359, 323,3251,4346,3457, 738,1354,2553,2311,2334,1828,2003, // 3664\n3832,1753,2351,1227,6172,1887,4125,1478,6173,2410,1874,1712,1847, 520,1204,2607, // 3680\n 264,4659, 836,2677,2102, 600,4660,3833,2278,3084,6174,4347,3615,1342, 640, 532, // 3696\n 543,2608,1888,2400,2591,1009,4348,1497, 341,1737,3616,2723,1394, 529,3252,1321, // 3712\n 983,4661,1515,2120, 971,2592, 924, 287,1662,3186,4349,2700,4350,1519, 908,1948, // 3728\n2452, 156, 796,1629,1486,2223,2055, 694,4126,1259,1036,3392,1213,2249,2742,1889, // 3744\n1230,3958,1015, 910, 408, 559,3617,4662, 746, 725, 935,4663,3959,3009,1289, 563, // 3760\n 867,4664,3960,1567,2981,2038,2626, 988,2263,2381,4351, 143,2374, 704,1895,6175, // 3776\n1188,3716,2088, 673,3085,2362,4352, 484,1608,1921,2765,2918, 215, 904,3618,3537, // 3792\n 894, 509, 976,3043,2701,3961,4353,2837,2982, 498,6176,6177,1102,3538,1332,3393, // 3808\n1487,1636,1637, 233, 245,3962, 383, 650, 995,3044, 460,1520,1206,2352, 749,3327, // 3824\n 530, 700, 389,1438,1560,1773,3963,2264, 719,2951,2724,3834, 870,1832,1644,1000, // 3840\n 839,2474,3717, 197,1630,3394, 365,2886,3964,1285,2133, 734, 922, 818,1106, 732, // 3856\n 480,2083,1774,3458, 923,2279,1350, 221,3086,  85,2233,2234,3835,1585,3010,2147, // 3872\n1387,1705,2382,1619,2475, 133, 239,2802,1991,1016,2084,2383, 411,2838,1113, 651, // 3888\n1985,1160,3328, 990,1863,3087,1048,1276,2647, 265,2627,1599,3253,2056, 150, 638, // 3904\n2019, 656, 853, 326,1479, 680,1439,4354,1001,1759, 413,3459,3395,2492,1431, 459, // 3920\n4355,1125,3329,2265,1953,1450,2065,2863, 849, 351,2678,3131,3254,3255,1104,1577, // 3936\n 227,1351,1645,2453,2193,1421,2887, 812,2121, 634,  95,2435, 201,2312,4665,1646, // 3952\n1671,2743,1601,2554,2702,2648,2280,1315,1366,2089,3132,1573,3718,3965,1729,1189, // 3968\n 328,2679,1077,1940,1136, 558,1283, 964,1195, 621,2074,1199,1743,3460,3619,1896, // 3984\n1916,1890,3836,2952,1154,2112,1064, 862, 378,3011,2066,2113,2803,1568,2839,6178, // 4000\n3088,2919,1941,1660,2004,1992,2194, 142, 707,1590,1708,1624,1922,1023,1836,1233, // 4016\n1004,2313, 789, 741,3620,6179,1609,2411,1200,4127,3719,3720,4666,2057,3721, 593, // 4032\n2840, 367,2920,1878,6180,3461,1521, 628,1168, 692,2211,2649, 300, 720,2067,2571, // 4048\n2953,3396, 959,2504,3966,3539,3462,1977, 701,6181, 954,1043, 800, 681, 183,3722, // 4064\n1803,1730,3540,4128,2103, 815,2314, 174, 467, 230,2454,1093,2134, 755,3541,3397, // 4080\n1141,1162,6182,1738,2039, 270,3256,2513,1005,1647,2185,3837, 858,1679,1897,1719, // 4096\n2954,2324,1806, 402, 670, 167,4129,1498,2158,2104, 750,6183, 915, 189,1680,1551, // 4112\n 455,4356,1501,2455, 405,1095,2955, 338,1586,1266,1819, 570, 641,1324, 237,1556, // 4128\n2650,1388,3723,6184,1368,2384,1343,1978,3089,2436, 879,3724, 792,1191, 758,3012, // 4144\n1411,2135,1322,4357, 240,4667,1848,3725,1574,6185, 420,3045,1546,1391, 714,4358, // 4160\n1967, 941,1864, 863, 664, 426, 560,1731,2680,1785,2864,1949,2363, 403,3330,1415, // 4176\n1279,2136,1697,2335, 204, 721,2097,3838,  90,6186,2085,2505, 191,3967, 124,2148, // 4192\n1376,1798,1178,1107,1898,1405, 860,4359,1243,1272,2375,2983,1558,2456,1638, 113, // 4208\n3621, 578,1923,2609, 880, 386,4130, 784,2186,2266,1422,2956,2172,1722, 497, 263, // 4224\n2514,1267,2412,2610, 177,2703,3542, 774,1927,1344, 616,1432,1595,1018, 172,4360, // 4240\n2325, 911,4361, 438,1468,3622, 794,3968,2024,2173,1681,1829,2957, 945, 895,3090, // 4256\n 575,2212,2476, 475,2401,2681, 785,2744,1745,2293,2555,1975,3133,2865, 394,4668, // 4272\n3839, 635,4131, 639, 202,1507,2195,2766,1345,1435,2572,3726,1908,1184,1181,2457, // 4288\n3727,3134,4362, 843,2611, 437, 916,4669, 234, 769,1884,3046,3047,3623, 833,6187, // 4304\n1639,2250,2402,1355,1185,2010,2047, 999, 525,1732,1290,1488,2612, 948,1578,3728, // 4320\n2413,2477,1216,2725,2159, 334,3840,1328,3624,2921,1525,4132, 564,1056, 891,4363, // 4336\n1444,1698,2385,2251,3729,1365,2281,2235,1717,6188, 864,3841,2515, 444, 527,2767, // 4352\n2922,3625, 544, 461,6189, 566, 209,2437,3398,2098,1065,2068,3331,3626,3257,2137, // 4368  //last 512\n\n/*************************************************************************************** \n *Everything below is of no interest for detection purpose\t\t\t\t\t\t\t   *\n ***************************************************************************************\n\n2138,2122,3730,2888,1995,1820,1044,6190,6191,6192,6193,6194,6195,6196,6197,6198, // 4384\n6199,6200,6201,6202,6203,6204,6205,4670,6206,6207,6208,6209,6210,6211,6212,6213, // 4400\n6214,6215,6216,6217,6218,6219,6220,6221,6222,6223,6224,6225,6226,6227,6228,6229, // 4416\n6230,6231,6232,6233,6234,6235,6236,6237,3187,6238,6239,3969,6240,6241,6242,6243, // 4432\n6244,4671,6245,6246,4672,6247,6248,4133,6249,6250,4364,6251,2923,2556,2613,4673, // 4448\n4365,3970,6252,6253,6254,6255,4674,6256,6257,6258,2768,2353,4366,4675,4676,3188, // 4464\n4367,3463,6259,4134,4677,4678,6260,2267,6261,3842,3332,4368,3543,6262,6263,6264, // 4480\n3013,1954,1928,4135,4679,6265,6266,2478,3091,6267,4680,4369,6268,6269,1699,6270, // 4496\n3544,4136,4681,6271,4137,6272,4370,2804,6273,6274,2593,3971,3972,4682,6275,2236, // 4512\n4683,6276,6277,4684,6278,6279,4138,3973,4685,6280,6281,3258,6282,6283,6284,6285, // 4528\n3974,4686,2841,3975,6286,6287,3545,6288,6289,4139,4687,4140,6290,4141,6291,4142, // 4544\n6292,6293,3333,6294,6295,6296,4371,6297,3399,6298,6299,4372,3976,6300,6301,6302, // 4560\n4373,6303,6304,3843,3731,6305,4688,4374,6306,6307,3259,2294,6308,3732,2530,4143, // 4576\n6309,4689,6310,6311,6312,3048,6313,6314,4690,3733,2237,6315,6316,2282,3334,6317, // 4592\n6318,3844,6319,6320,4691,6321,3400,4692,6322,4693,6323,3049,6324,4375,6325,3977, // 4608\n6326,6327,6328,3546,6329,4694,3335,6330,4695,4696,6331,6332,6333,6334,4376,3978, // 4624\n6335,4697,3979,4144,6336,3980,4698,6337,6338,6339,6340,6341,4699,4700,4701,6342, // 4640\n6343,4702,6344,6345,4703,6346,6347,4704,6348,4705,4706,3135,6349,4707,6350,4708, // 4656\n6351,4377,6352,4709,3734,4145,6353,2506,4710,3189,6354,3050,4711,3981,6355,3547, // 4672\n3014,4146,4378,3735,2651,3845,3260,3136,2224,1986,6356,3401,6357,4712,2594,3627, // 4688\n3137,2573,3736,3982,4713,3628,4714,4715,2682,3629,4716,6358,3630,4379,3631,6359, // 4704\n6360,6361,3983,6362,6363,6364,6365,4147,3846,4717,6366,6367,3737,2842,6368,4718, // 4720\n2628,6369,3261,6370,2386,6371,6372,3738,3984,4719,3464,4720,3402,6373,2924,3336, // 4736\n4148,2866,6374,2805,3262,4380,2704,2069,2531,3138,2806,2984,6375,2769,6376,4721, // 4752\n4722,3403,6377,6378,3548,6379,6380,2705,3092,1979,4149,2629,3337,2889,6381,3338, // 4768\n4150,2557,3339,4381,6382,3190,3263,3739,6383,4151,4723,4152,2558,2574,3404,3191, // 4784\n6384,6385,4153,6386,4724,4382,6387,6388,4383,6389,6390,4154,6391,4725,3985,6392, // 4800\n3847,4155,6393,6394,6395,6396,6397,3465,6398,4384,6399,6400,6401,6402,6403,6404, // 4816\n4156,6405,6406,6407,6408,2123,6409,6410,2326,3192,4726,6411,6412,6413,6414,4385, // 4832\n4157,6415,6416,4158,6417,3093,3848,6418,3986,6419,6420,3849,6421,6422,6423,4159, // 4848\n6424,6425,4160,6426,3740,6427,6428,6429,6430,3987,6431,4727,6432,2238,6433,6434, // 4864\n4386,3988,6435,6436,3632,6437,6438,2843,6439,6440,6441,6442,3633,6443,2958,6444, // 4880\n6445,3466,6446,2364,4387,3850,6447,4388,2959,3340,6448,3851,6449,4728,6450,6451, // 4896\n3264,4729,6452,3193,6453,4389,4390,2706,3341,4730,6454,3139,6455,3194,6456,3051, // 4912\n2124,3852,1602,4391,4161,3853,1158,3854,4162,3989,4392,3990,4731,4732,4393,2040, // 4928\n4163,4394,3265,6457,2807,3467,3855,6458,6459,6460,3991,3468,4733,4734,6461,3140, // 4944\n2960,6462,4735,6463,6464,6465,6466,4736,4737,4738,4739,6467,6468,4164,2403,3856, // 4960\n6469,6470,2770,2844,6471,4740,6472,6473,6474,6475,6476,6477,6478,3195,6479,4741, // 4976\n4395,6480,2867,6481,4742,2808,6482,2493,4165,6483,6484,6485,6486,2295,4743,6487, // 4992\n6488,6489,3634,6490,6491,6492,6493,6494,6495,6496,2985,4744,6497,6498,4745,6499, // 5008\n6500,2925,3141,4166,6501,6502,4746,6503,6504,4747,6505,6506,6507,2890,6508,6509, // 5024\n6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,3469,4167,6520,6521,6522,4748, // 5040\n4396,3741,4397,4749,4398,3342,2125,4750,6523,4751,4752,4753,3052,6524,2961,4168, // 5056\n6525,4754,6526,4755,4399,2926,4169,6527,3857,6528,4400,4170,6529,4171,6530,6531, // 5072\n2595,6532,6533,6534,6535,3635,6536,6537,6538,6539,6540,6541,6542,4756,6543,6544, // 5088\n6545,6546,6547,6548,4401,6549,6550,6551,6552,4402,3405,4757,4403,6553,6554,6555, // 5104\n4172,3742,6556,6557,6558,3992,3636,6559,6560,3053,2726,6561,3549,4173,3054,4404, // 5120\n6562,6563,3993,4405,3266,3550,2809,4406,6564,6565,6566,4758,4759,6567,3743,6568, // 5136\n4760,3744,4761,3470,6569,6570,6571,4407,6572,3745,4174,6573,4175,2810,4176,3196, // 5152\n4762,6574,4177,6575,6576,2494,2891,3551,6577,6578,3471,6579,4408,6580,3015,3197, // 5168\n6581,3343,2532,3994,3858,6582,3094,3406,4409,6583,2892,4178,4763,4410,3016,4411, // 5184\n6584,3995,3142,3017,2683,6585,4179,6586,6587,4764,4412,6588,6589,4413,6590,2986, // 5200\n6591,2962,3552,6592,2963,3472,6593,6594,4180,4765,6595,6596,2225,3267,4414,6597, // 5216\n3407,3637,4766,6598,6599,3198,6600,4415,6601,3859,3199,6602,3473,4767,2811,4416, // 5232\n1856,3268,3200,2575,3996,3997,3201,4417,6603,3095,2927,6604,3143,6605,2268,6606, // 5248\n3998,3860,3096,2771,6607,6608,3638,2495,4768,6609,3861,6610,3269,2745,4769,4181, // 5264\n3553,6611,2845,3270,6612,6613,6614,3862,6615,6616,4770,4771,6617,3474,3999,4418, // 5280\n4419,6618,3639,3344,6619,4772,4182,6620,2126,6621,6622,6623,4420,4773,6624,3018, // 5296\n6625,4774,3554,6626,4183,2025,3746,6627,4184,2707,6628,4421,4422,3097,1775,4185, // 5312\n3555,6629,6630,2868,6631,6632,4423,6633,6634,4424,2414,2533,2928,6635,4186,2387, // 5328\n6636,4775,6637,4187,6638,1891,4425,3202,3203,6639,6640,4776,6641,3345,6642,6643, // 5344\n3640,6644,3475,3346,3641,4000,6645,3144,6646,3098,2812,4188,3642,3204,6647,3863, // 5360\n3476,6648,3864,6649,4426,4001,6650,6651,6652,2576,6653,4189,4777,6654,6655,6656, // 5376\n2846,6657,3477,3205,4002,6658,4003,6659,3347,2252,6660,6661,6662,4778,6663,6664, // 5392\n6665,6666,6667,6668,6669,4779,4780,2048,6670,3478,3099,6671,3556,3747,4004,6672, // 5408\n6673,6674,3145,4005,3748,6675,6676,6677,6678,6679,3408,6680,6681,6682,6683,3206, // 5424\n3207,6684,6685,4781,4427,6686,4782,4783,4784,6687,6688,6689,4190,6690,6691,3479, // 5440\n6692,2746,6693,4428,6694,6695,6696,6697,6698,6699,4785,6700,6701,3208,2727,6702, // 5456\n3146,6703,6704,3409,2196,6705,4429,6706,6707,6708,2534,1996,6709,6710,6711,2747, // 5472\n6712,6713,6714,4786,3643,6715,4430,4431,6716,3557,6717,4432,4433,6718,6719,6720, // 5488\n6721,3749,6722,4006,4787,6723,6724,3644,4788,4434,6725,6726,4789,2772,6727,6728, // 5504\n6729,6730,6731,2708,3865,2813,4435,6732,6733,4790,4791,3480,6734,6735,6736,6737, // 5520\n4436,3348,6738,3410,4007,6739,6740,4008,6741,6742,4792,3411,4191,6743,6744,6745, // 5536\n6746,6747,3866,6748,3750,6749,6750,6751,6752,6753,6754,6755,3867,6756,4009,6757, // 5552\n4793,4794,6758,2814,2987,6759,6760,6761,4437,6762,6763,6764,6765,3645,6766,6767, // 5568\n3481,4192,6768,3751,6769,6770,2174,6771,3868,3752,6772,6773,6774,4193,4795,4438, // 5584\n3558,4796,4439,6775,4797,6776,6777,4798,6778,4799,3559,4800,6779,6780,6781,3482, // 5600\n6782,2893,6783,6784,4194,4801,4010,6785,6786,4440,6787,4011,6788,6789,6790,6791, // 5616\n6792,6793,4802,6794,6795,6796,4012,6797,6798,6799,6800,3349,4803,3483,6801,4804, // 5632\n4195,6802,4013,6803,6804,4196,6805,4014,4015,6806,2847,3271,2848,6807,3484,6808, // 5648\n6809,6810,4441,6811,4442,4197,4443,3272,4805,6812,3412,4016,1579,6813,6814,4017, // 5664\n6815,3869,6816,2964,6817,4806,6818,6819,4018,3646,6820,6821,4807,4019,4020,6822, // 5680\n6823,3560,6824,6825,4021,4444,6826,4198,6827,6828,4445,6829,6830,4199,4808,6831, // 5696\n6832,6833,3870,3019,2458,6834,3753,3413,3350,6835,4809,3871,4810,3561,4446,6836, // 5712\n6837,4447,4811,4812,6838,2459,4448,6839,4449,6840,6841,4022,3872,6842,4813,4814, // 5728\n6843,6844,4815,4200,4201,4202,6845,4023,6846,6847,4450,3562,3873,6848,6849,4816, // 5744\n4817,6850,4451,4818,2139,6851,3563,6852,6853,3351,6854,6855,3352,4024,2709,3414, // 5760\n4203,4452,6856,4204,6857,6858,3874,3875,6859,6860,4819,6861,6862,6863,6864,4453, // 5776\n3647,6865,6866,4820,6867,6868,6869,6870,4454,6871,2869,6872,6873,4821,6874,3754, // 5792\n6875,4822,4205,6876,6877,6878,3648,4206,4455,6879,4823,6880,4824,3876,6881,3055, // 5808\n4207,6882,3415,6883,6884,6885,4208,4209,6886,4210,3353,6887,3354,3564,3209,3485, // 5824\n2652,6888,2728,6889,3210,3755,6890,4025,4456,6891,4825,6892,6893,6894,6895,4211, // 5840\n6896,6897,6898,4826,6899,6900,4212,6901,4827,6902,2773,3565,6903,4828,6904,6905, // 5856\n6906,6907,3649,3650,6908,2849,3566,6909,3567,3100,6910,6911,6912,6913,6914,6915, // 5872\n4026,6916,3355,4829,3056,4457,3756,6917,3651,6918,4213,3652,2870,6919,4458,6920, // 5888\n2438,6921,6922,3757,2774,4830,6923,3356,4831,4832,6924,4833,4459,3653,2507,6925, // 5904\n4834,2535,6926,6927,3273,4027,3147,6928,3568,6929,6930,6931,4460,6932,3877,4461, // 5920\n2729,3654,6933,6934,6935,6936,2175,4835,2630,4214,4028,4462,4836,4215,6937,3148, // 5936\n4216,4463,4837,4838,4217,6938,6939,2850,4839,6940,4464,6941,6942,6943,4840,6944, // 5952\n4218,3274,4465,6945,6946,2710,6947,4841,4466,6948,6949,2894,6950,6951,4842,6952, // 5968\n4219,3057,2871,6953,6954,6955,6956,4467,6957,2711,6958,6959,6960,3275,3101,4843, // 5984\n6961,3357,3569,6962,4844,6963,6964,4468,4845,3570,6965,3102,4846,3758,6966,4847, // 6000\n3878,4848,4849,4029,6967,2929,3879,4850,4851,6968,6969,1733,6970,4220,6971,6972, // 6016\n6973,6974,6975,6976,4852,6977,6978,6979,6980,6981,6982,3759,6983,6984,6985,3486, // 6032\n3487,6986,3488,3416,6987,6988,6989,6990,6991,6992,6993,6994,6995,6996,6997,4853, // 6048\n6998,6999,4030,7000,7001,3211,7002,7003,4221,7004,7005,3571,4031,7006,3572,7007, // 6064\n2614,4854,2577,7008,7009,2965,3655,3656,4855,2775,3489,3880,4222,4856,3881,4032, // 6080\n3882,3657,2730,3490,4857,7010,3149,7011,4469,4858,2496,3491,4859,2283,7012,7013, // 6096\n7014,2365,4860,4470,7015,7016,3760,7017,7018,4223,1917,7019,7020,7021,4471,7022, // 6112\n2776,4472,7023,7024,7025,7026,4033,7027,3573,4224,4861,4034,4862,7028,7029,1929, // 6128\n3883,4035,7030,4473,3058,7031,2536,3761,3884,7032,4036,7033,2966,2895,1968,4474, // 6144\n3276,4225,3417,3492,4226,2105,7034,7035,1754,2596,3762,4227,4863,4475,3763,4864, // 6160\n3764,2615,2777,3103,3765,3658,3418,4865,2296,3766,2815,7036,7037,7038,3574,2872, // 6176\n3277,4476,7039,4037,4477,7040,7041,4038,7042,7043,7044,7045,7046,7047,2537,7048, // 6192\n7049,7050,7051,7052,7053,7054,4478,7055,7056,3767,3659,4228,3575,7057,7058,4229, // 6208\n7059,7060,7061,3660,7062,3212,7063,3885,4039,2460,7064,7065,7066,7067,7068,7069, // 6224\n7070,7071,7072,7073,7074,4866,3768,4867,7075,7076,7077,7078,4868,3358,3278,2653, // 6240\n7079,7080,4479,3886,7081,7082,4869,7083,7084,7085,7086,7087,7088,2538,7089,7090, // 6256\n7091,4040,3150,3769,4870,4041,2896,3359,4230,2930,7092,3279,7093,2967,4480,3213, // 6272\n4481,3661,7094,7095,7096,7097,7098,7099,7100,7101,7102,2461,3770,7103,7104,4231, // 6288\n3151,7105,7106,7107,4042,3662,7108,7109,4871,3663,4872,4043,3059,7110,7111,7112, // 6304\n3493,2988,7113,4873,7114,7115,7116,3771,4874,7117,7118,4232,4875,7119,3576,2336, // 6320\n4876,7120,4233,3419,4044,4877,4878,4482,4483,4879,4484,4234,7121,3772,4880,1045, // 6336\n3280,3664,4881,4882,7122,7123,7124,7125,4883,7126,2778,7127,4485,4486,7128,4884, // 6352\n3214,3887,7129,7130,3215,7131,4885,4045,7132,7133,4046,7134,7135,7136,7137,7138, // 6368\n7139,7140,7141,7142,7143,4235,7144,4886,7145,7146,7147,4887,7148,7149,7150,4487, // 6384\n4047,4488,7151,7152,4888,4048,2989,3888,7153,3665,7154,4049,7155,7156,7157,7158, // 6400\n7159,7160,2931,4889,4890,4489,7161,2631,3889,4236,2779,7162,7163,4891,7164,3060, // 6416\n7165,1672,4892,7166,4893,4237,3281,4894,7167,7168,3666,7169,3494,7170,7171,4050, // 6432\n7172,7173,3104,3360,3420,4490,4051,2684,4052,7174,4053,7175,7176,7177,2253,4054, // 6448\n7178,7179,4895,7180,3152,3890,3153,4491,3216,7181,7182,7183,2968,4238,4492,4055, // 6464\n7184,2990,7185,2479,7186,7187,4493,7188,7189,7190,7191,7192,4896,7193,4897,2969, // 6480\n4494,4898,7194,3495,7195,7196,4899,4495,7197,3105,2731,7198,4900,7199,7200,7201, // 6496\n4056,7202,3361,7203,7204,4496,4901,4902,7205,4497,7206,7207,2315,4903,7208,4904, // 6512\n7209,4905,2851,7210,7211,3577,7212,3578,4906,7213,4057,3667,4907,7214,4058,2354, // 6528\n3891,2376,3217,3773,7215,7216,7217,7218,7219,4498,7220,4908,3282,2685,7221,3496, // 6544\n4909,2632,3154,4910,7222,2337,7223,4911,7224,7225,7226,4912,4913,3283,4239,4499, // 6560\n7227,2816,7228,7229,7230,7231,7232,7233,7234,4914,4500,4501,7235,7236,7237,2686, // 6576\n7238,4915,7239,2897,4502,7240,4503,7241,2516,7242,4504,3362,3218,7243,7244,7245, // 6592\n4916,7246,7247,4505,3363,7248,7249,7250,7251,3774,4506,7252,7253,4917,7254,7255, // 6608\n3284,2991,4918,4919,3219,3892,4920,3106,3497,4921,7256,7257,7258,4922,7259,4923, // 6624\n3364,4507,4508,4059,7260,4240,3498,7261,7262,4924,7263,2992,3893,4060,3220,7264, // 6640\n7265,7266,7267,7268,7269,4509,3775,7270,2817,7271,4061,4925,4510,3776,7272,4241, // 6656\n4511,3285,7273,7274,3499,7275,7276,7277,4062,4512,4926,7278,3107,3894,7279,7280, // 6672\n4927,7281,4513,7282,7283,3668,7284,7285,4242,4514,4243,7286,2058,4515,4928,4929, // 6688\n4516,7287,3286,4244,7288,4517,7289,7290,7291,3669,7292,7293,4930,4931,4932,2355, // 6704\n4933,7294,2633,4518,7295,4245,7296,7297,4519,7298,7299,4520,4521,4934,7300,4246, // 6720\n4522,7301,7302,7303,3579,7304,4247,4935,7305,4936,7306,7307,7308,7309,3777,7310, // 6736\n4523,7311,7312,7313,4248,3580,7314,4524,3778,4249,7315,3581,7316,3287,7317,3221, // 6752\n7318,4937,7319,7320,7321,7322,7323,7324,4938,4939,7325,4525,7326,7327,7328,4063, // 6768\n7329,7330,4940,7331,7332,4941,7333,4526,7334,3500,2780,1741,4942,2026,1742,7335, // 6784\n7336,3582,4527,2388,7337,7338,7339,4528,7340,4250,4943,7341,7342,7343,4944,7344, // 6800\n7345,7346,3020,7347,4945,7348,7349,7350,7351,3895,7352,3896,4064,3897,7353,7354, // 6816\n7355,4251,7356,7357,3898,7358,3779,7359,3780,3288,7360,7361,4529,7362,4946,4530, // 6832\n2027,7363,3899,4531,4947,3222,3583,7364,4948,7365,7366,7367,7368,4949,3501,4950, // 6848\n3781,4951,4532,7369,2517,4952,4252,4953,3155,7370,4954,4955,4253,2518,4533,7371, // 6864\n7372,2712,4254,7373,7374,7375,3670,4956,3671,7376,2389,3502,4065,7377,2338,7378, // 6880\n7379,7380,7381,3061,7382,4957,7383,7384,7385,7386,4958,4534,7387,7388,2993,7389, // 6896\n3062,7390,4959,7391,7392,7393,4960,3108,4961,7394,4535,7395,4962,3421,4536,7396, // 6912\n4963,7397,4964,1857,7398,4965,7399,7400,2176,3584,4966,7401,7402,3422,4537,3900, // 6928\n3585,7403,3782,7404,2852,7405,7406,7407,4538,3783,2654,3423,4967,4539,7408,3784, // 6944\n3586,2853,4540,4541,7409,3901,7410,3902,7411,7412,3785,3109,2327,3903,7413,7414, // 6960\n2970,4066,2932,7415,7416,7417,3904,3672,3424,7418,4542,4543,4544,7419,4968,7420, // 6976\n7421,4255,7422,7423,7424,7425,7426,4067,7427,3673,3365,4545,7428,3110,2559,3674, // 6992\n7429,7430,3156,7431,7432,3503,7433,3425,4546,7434,3063,2873,7435,3223,4969,4547, // 7008\n4548,2898,4256,4068,7436,4069,3587,3786,2933,3787,4257,4970,4971,3788,7437,4972, // 7024\n3064,7438,4549,7439,7440,7441,7442,7443,4973,3905,7444,2874,7445,7446,7447,7448, // 7040\n3021,7449,4550,3906,3588,4974,7450,7451,3789,3675,7452,2578,7453,4070,7454,7455, // 7056\n7456,4258,3676,7457,4975,7458,4976,4259,3790,3504,2634,4977,3677,4551,4260,7459, // 7072\n7460,7461,7462,3907,4261,4978,7463,7464,7465,7466,4979,4980,7467,7468,2213,4262, // 7088\n7469,7470,7471,3678,4981,7472,2439,7473,4263,3224,3289,7474,3908,2415,4982,7475, // 7104\n4264,7476,4983,2655,7477,7478,2732,4552,2854,2875,7479,7480,4265,7481,4553,4984, // 7120\n7482,7483,4266,7484,3679,3366,3680,2818,2781,2782,3367,3589,4554,3065,7485,4071, // 7136\n2899,7486,7487,3157,2462,4072,4555,4073,4985,4986,3111,4267,2687,3368,4556,4074, // 7152\n3791,4268,7488,3909,2783,7489,2656,1962,3158,4557,4987,1963,3159,3160,7490,3112, // 7168\n4988,4989,3022,4990,4991,3792,2855,7491,7492,2971,4558,7493,7494,4992,7495,7496, // 7184\n7497,7498,4993,7499,3426,4559,4994,7500,3681,4560,4269,4270,3910,7501,4075,4995, // 7200\n4271,7502,7503,4076,7504,4996,7505,3225,4997,4272,4077,2819,3023,7506,7507,2733, // 7216\n4561,7508,4562,7509,3369,3793,7510,3590,2508,7511,7512,4273,3113,2994,2616,7513, // 7232\n7514,7515,7516,7517,7518,2820,3911,4078,2748,7519,7520,4563,4998,7521,7522,7523, // 7248\n7524,4999,4274,7525,4564,3682,2239,4079,4565,7526,7527,7528,7529,5000,7530,7531, // 7264\n5001,4275,3794,7532,7533,7534,3066,5002,4566,3161,7535,7536,4080,7537,3162,7538, // 7280\n7539,4567,7540,7541,7542,7543,7544,7545,5003,7546,4568,7547,7548,7549,7550,7551, // 7296\n7552,7553,7554,7555,7556,5004,7557,7558,7559,5005,7560,3795,7561,4569,7562,7563, // 7312\n7564,2821,3796,4276,4277,4081,7565,2876,7566,5006,7567,7568,2900,7569,3797,3912, // 7328\n7570,7571,7572,4278,7573,7574,7575,5007,7576,7577,5008,7578,7579,4279,2934,7580, // 7344\n7581,5009,7582,4570,7583,4280,7584,7585,7586,4571,4572,3913,7587,4573,3505,7588, // 7360\n5010,7589,7590,7591,7592,3798,4574,7593,7594,5011,7595,4281,7596,7597,7598,4282, // 7376\n5012,7599,7600,5013,3163,7601,5014,7602,3914,7603,7604,2734,4575,4576,4577,7605, // 7392\n7606,7607,7608,7609,3506,5015,4578,7610,4082,7611,2822,2901,2579,3683,3024,4579, // 7408\n3507,7612,4580,7613,3226,3799,5016,7614,7615,7616,7617,7618,7619,7620,2995,3290, // 7424\n7621,4083,7622,5017,7623,7624,7625,7626,7627,4581,3915,7628,3291,7629,5018,7630, // 7440\n7631,7632,7633,4084,7634,7635,3427,3800,7636,7637,4582,7638,5019,4583,5020,7639, // 7456\n3916,7640,3801,5021,4584,4283,7641,7642,3428,3591,2269,7643,2617,7644,4585,3592, // 7472\n7645,4586,2902,7646,7647,3227,5022,7648,4587,7649,4284,7650,7651,7652,4588,2284, // 7488\n7653,5023,7654,7655,7656,4589,5024,3802,7657,7658,5025,3508,4590,7659,7660,7661, // 7504\n1969,5026,7662,7663,3684,1821,2688,7664,2028,2509,4285,7665,2823,1841,7666,2689, // 7520\n3114,7667,3917,4085,2160,5027,5028,2972,7668,5029,7669,7670,7671,3593,4086,7672, // 7536\n4591,4087,5030,3803,7673,7674,7675,7676,7677,7678,7679,4286,2366,4592,4593,3067, // 7552\n2328,7680,7681,4594,3594,3918,2029,4287,7682,5031,3919,3370,4288,4595,2856,7683, // 7568\n3509,7684,7685,5032,5033,7686,7687,3804,2784,7688,7689,7690,7691,3371,7692,7693, // 7584\n2877,5034,7694,7695,3920,4289,4088,7696,7697,7698,5035,7699,5036,4290,5037,5038, // 7600\n5039,7700,7701,7702,5040,5041,3228,7703,1760,7704,5042,3229,4596,2106,4089,7705, // 7616\n4597,2824,5043,2107,3372,7706,4291,4090,5044,7707,4091,7708,5045,3025,3805,4598, // 7632\n4292,4293,4294,3373,7709,4599,7710,5046,7711,7712,5047,5048,3806,7713,7714,7715, // 7648\n5049,7716,7717,7718,7719,4600,5050,7720,7721,7722,5051,7723,4295,3429,7724,7725, // 7664\n7726,7727,3921,7728,3292,5052,4092,7729,7730,7731,7732,7733,7734,7735,5053,5054, // 7680\n7736,7737,7738,7739,3922,3685,7740,7741,7742,7743,2635,5055,7744,5056,4601,7745, // 7696\n7746,2560,7747,7748,7749,7750,3923,7751,7752,7753,7754,7755,4296,2903,7756,7757, // 7712\n7758,7759,7760,3924,7761,5057,4297,7762,7763,5058,4298,7764,4093,7765,7766,5059, // 7728\n3925,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,3595,7777,4299,5060,4094, // 7744\n7778,3293,5061,7779,7780,4300,7781,7782,4602,7783,3596,7784,7785,3430,2367,7786, // 7760\n3164,5062,5063,4301,7787,7788,4095,5064,5065,7789,3374,3115,7790,7791,7792,7793, // 7776\n7794,7795,7796,3597,4603,7797,7798,3686,3116,3807,5066,7799,7800,5067,7801,7802, // 7792\n4604,4302,5068,4303,4096,7803,7804,3294,7805,7806,5069,4605,2690,7807,3026,7808, // 7808\n7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824, // 7824\n7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840, // 7840\n7841,7842,7843,7844,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,7856, // 7856\n7857,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872, // 7872\n7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888, // 7888\n7889,7890,7891,7892,7893,7894,7895,7896,7897,7898,7899,7900,7901,7902,7903,7904, // 7904\n7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,7920, // 7920\n7921,7922,7923,7924,3926,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935, // 7936\n7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951, // 7952\n7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967, // 7968\n7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,7983, // 7984\n7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,7997,7998,7999, // 8000\n8000,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015, // 8016\n8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031, // 8032\n8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047, // 8048\n8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063, // 8064\n8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079, // 8080\n8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095, // 8096\n8096,8097,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111, // 8112\n8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127, // 8128\n8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143, // 8144\n8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159, // 8160\n8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175, // 8176\n8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191, // 8192\n8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207, // 8208\n8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223, // 8224\n8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239, // 8240\n8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255, // 8256\n8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271, // 8272\n****************************************************************************************/\n\n};\n\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/tools/CMakeLists.txt",
    "content": "set(\n\tUCHARDET_SOURCES\n\tuchardet.cpp\n)\n\ninclude(CheckSymbolExists)\n\ncheck_symbol_exists(getopt_long \"getopt.h\" HAVE_GETOPT_LONG)\n\n# On Windows with MSVC, `getopt_long` is not available by default.\n# But some third-party libraries can be used. For example, in `vcpkg`,\n# we can find a port named `getopt-win32`.\nif (NOT HAVE_GETOPT_LONG)\n    find_path(GETOPT_INCLUDE_DIR NAMES getopt.h)\n    find_library(GETOPT_LIBRARY NAMES getopt)\nendif (NOT HAVE_GETOPT_LONG)\n\nset(UCHARDET_BINARY uchardet)\n\nadd_executable(\n\t${UCHARDET_BINARY}\n\t${UCHARDET_SOURCES}\n)\n\nif (GETOPT_INCLUDE_DIR AND GETOPT_LIBRARY)\n    target_include_directories(${UCHARDET_BINARY} PRIVATE ${GETOPT_INCLUDE_DIR})\n    target_link_libraries(${UCHARDET_BINARY} PRIVATE ${GETOPT_LIBRARY})\nendif (GETOPT_INCLUDE_DIR AND GETOPT_LIBRARY)\n\ntarget_link_libraries(\n\t${UCHARDET_BINARY}\n\t${UCHARDET_LIBRARY}\n)\n\ninstall(\n\tTARGETS\n\t\t${UCHARDET_BINARY}\n\tEXPORT\n\t\tUchardetTargets\n\tRUNTIME DESTINATION\n\t\t${CMAKE_INSTALL_BINDIR}\n)\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/tools/uchardet.cpp",
    "content": "/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          BYVoid <byvoid.kcp@gmail.com>\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n#include \"../uchardet.h\"\n#include <cstdio>\n#include <cstring>\n#include <cstdlib>\n#include <getopt.h>\n#include <iostream>\n#include <stdio.h>\n\n#ifndef VERSION\n#define VERSION \"Unknown\"\n#endif\n#define BUFFER_SIZE 65536\n\nchar buffer[BUFFER_SIZE];\n\nvoid detect(FILE * fp)\n{\n    uchardet_t handle = uchardet_new();\n\n    while (!feof(fp))\n    {\n        size_t len = fread(buffer, 1, BUFFER_SIZE, fp);\n        int retval = uchardet_handle_data(handle, buffer, len);\n        if (retval == HANDLE_DATA_RESULT_ERROR)\n        {\n            fprintf(stderr, \"Handle data error.\\n\");\n            exit(1);\n        }\n    }\n    uchardet_data_end(handle);\n\n    const char * charset = uchardet_get_charset(handle);\n    float confidence = uchardet_get_confidence(handle);\n    if (*charset)\n    \tprintf(\"{ encoding=%s, confidence=%f }\\n\", charset, confidence);\n\telse\n\t\tprintf(\"unknown\\n\");\n\t\n    uchardet_delete(handle);\n}\n\nvoid show_version()\n{\n    printf(\"\\n\");\n    printf(\"uchardet Command Line Tool\\n\");\n    printf(\"Version %s\\n\", VERSION);\n    printf(\"\\n\");\n    printf(\"Authors: %s\\n\", \"BYVoid, Jehan\");\n    printf(\"Bug Report: %s\\n\", \"https://gitlab.freedesktop.org/uchardet/uchardet/-/issues\");\n    printf(\"\\n\");\n}\n\nvoid show_usage()\n{\n    show_version();\n    printf(\"Usage:\\n\");\n    printf(\" uchardet [Options] [File]...\\n\");\n    printf(\"\\n\");\n    printf(\"Options:\\n\");\n    printf(\" -v, --version         Print version and build information.\\n\");\n    printf(\" -h, --help            Print this help.\\n\");\n    printf(\"\\n\");\n}\n\nint main(int argc, char ** argv)\n{\n    static struct option longopts[] =\n    {\n        { \"version\", no_argument, NULL, 'v' },\n        { \"help\", no_argument, NULL, 'h' },\n        { 0, 0, 0, 0 },\n    };\n    bool end_options = false;\n\n    static int oc;\n    while((oc = getopt_long(argc, argv, \"vh\", longopts, NULL)) != -1)\n    {\n        switch (oc)\n        {\n        case 'v':\n            show_version();\n            return 0;\n        case 'h':\n            show_usage();\n            return 0;\n        case '?':\n            printf(\"Please use %s --help.\\n\", argv[0]);\n            return 1;\n        }\n    }\n\n    FILE * f = stdin;\n    int error_seen = 0;\n    if (argc < 2 ||\n        (argc == 2 && strcmp(argv[1], \"--\") == 0))\n    {\n        // No file arg, use stdin by default\n        detect(f);\n    }\n    for (int i = 1; i < argc; i++)\n    {\n        const char *filename = argv[i];\n\n        if (! end_options && strcmp(filename, \"--\") == 0)\n        {\n            end_options = true;\n            continue;\n        }\n\n        f = fopen(filename, \"r\");\n        if (f == NULL)\n        {\n            perror(filename);\n            error_seen = 1;\n            continue;\n        }\n        if (argc > 2)\n        {\n            printf(\"%s: \", filename);\n        }\n        detect(f);\n    }\n\n    return error_seen;\n}\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/uchardet.cpp",
    "content": "﻿/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          BYVoid <byvoid.kcp@gmail.com>\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n#include \"uchardet.h\"\n#include <string.h>\n#include <stdlib.h>\n#include \"nscore.h\"\n#include \"nsUniversalDetector.h\"\n\nclass HandleUniversalDetector : public nsUniversalDetector\n{\nprotected:\n    char* m_charset;\n    float m_confidence;\npublic:\n    HandleUniversalDetector()\n      : nsUniversalDetector(NS_FILTER_ALL)\n      , m_charset(nullptr)\n      , m_confidence(0.0f)\n    {\n    }\n\n    virtual ~HandleUniversalDetector()\n    {\n        if (m_charset) {\n            free(m_charset);\n            m_confidence = 0.0;\n        }\n    }\n\n    void Report(const char* charset, float confidence) override\n    {\n        if (m_charset) {\n            free(m_charset);\n        }\n        m_charset = strdup(charset);\n        m_confidence = confidence;\n    }\n\n    void Reset() override\n    {\n        nsUniversalDetector::Reset();\n        if (m_charset) {\n            free(m_charset);\n        }\n        m_charset = strdup(\"\");\n        m_confidence = 0.0;\n    }\n\n    const char* GetCharset() const\n    {\n        return m_charset ? m_charset : \"\";\n    }\n\n    float GetConfidence() const {\n        return m_confidence;\n    }\n\n    PRBool HasDone() const {\n        return mDone;\n    }\n};\n\nuchardet_t uchardet_new(void)\n{\n    return reinterpret_cast<uchardet_t>(new HandleUniversalDetector());\n}\n\nvoid uchardet_delete(uchardet_t ud)\n{\n    delete reinterpret_cast<HandleUniversalDetector*>(ud);\n}\n\nint uchardet_handle_data(uchardet_t ud, const char * data, size_t len)\n{\n    nsresult const ret = reinterpret_cast<HandleUniversalDetector*>(ud)->HandleData(data, (PRUint32)len);\n    if (ret == NS_ERROR_OUT_OF_MEMORY) {\n        return HANDLE_DATA_RESULT_ERROR;\n    }\n\n    if (reinterpret_cast<HandleUniversalDetector*>(ud)->HasDone()) {\n        return HANDLE_DATA_RESULT_DETECTED;\n    }\n\n    return HANDLE_DATA_RESULT_NEED_MORE_DATA;\n}\n\nvoid uchardet_data_end(uchardet_t ud)\n{\n    reinterpret_cast<HandleUniversalDetector*>(ud)->DataEnd();\n}\n\nvoid uchardet_reset(uchardet_t ud)\n{\n    reinterpret_cast<HandleUniversalDetector*>(ud)->Reset();\n}\n\nconst char* uchardet_get_charset(uchardet_t ud)\n{\n    return reinterpret_cast<HandleUniversalDetector*>(ud)->GetCharset();\n}\n\nfloat uchardet_get_confidence(uchardet_t ud)\n{\n    return reinterpret_cast<HandleUniversalDetector*>(ud)->GetConfidence();\n}\n"
  },
  {
    "path": "third_party/uchardet/uchardet/src/uchardet.h",
    "content": "/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Universal charset detector code.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 2001\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *          BYVoid <byvoid.kcp@gmail.com>\n *          Jehan <jehan at girinstud.io>\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n#ifndef UCHARDET_H___\n#define UCHARDET_H___\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include <stddef.h>\n\n/**\n * A handle for a uchardet encoding detector.\n */\ntypedef struct uchardet * uchardet_t;\n\n/**\n * Create an encoding detector.\n * @return an instance of uchardet_t.\n */\nuchardet_t uchardet_new(void);\n\n/**\n * Delete an encoding detector.\n * @param ud [in] the uchardet_t handle to delete.\n */\nvoid uchardet_delete(uchardet_t ud);\n\n#define HANDLE_DATA_RESULT_ERROR -1\n#define HANDLE_DATA_RESULT_DETECTED 0\n#define HANDLE_DATA_RESULT_NEED_MORE_DATA 1\n\n/**\n * Feed data to an encoding detector.\n * The detector is able to shortcut processing when it reaches certainty\n * for an encoding, so you should not worry about limiting input data.\n * As far as you should be concerned: the more the better.\n *\n * @param ud [in] handle of an instance of uchardet\n * @param data [in] data\n * @param len [in] number of byte of data\n * @return non-zero number on failure.\n */\nint uchardet_handle_data(uchardet_t ud, const char * data, size_t len);\n\n/**\n * Notify an end of data to an encoding detector.\n * @param ud [in] handle of an instance of uchardet\n */\nvoid uchardet_data_end(uchardet_t ud);\n\n/**\n * Reset an encoding detector.\n * @param ud [in] handle of an instance of uchardet\n */\nvoid uchardet_reset(uchardet_t ud);\n\n/**\n * Get an iconv-compatible name of the encoding that was detected.\n * @param ud [in] handle of an instance of uchardet\n * @return name of charset on success and \"\" on failure.\n */\nconst char * uchardet_get_charset(uchardet_t ud);\n\nfloat uchardet_get_confidence(uchardet_t ud);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/uchardet/uchardet/uchardet.doap",
    "content": "<Project xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n         xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"\n         xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"\n         xmlns:gnome=\"http://api.gnome.org/doap-extensions#\"\n         xmlns=\"http://usefulinc.com/ns/doap#\">\n\n  <name xml:lang=\"en\">uchardet</name>\n\n  <shortdesc xml:lang=\"en\">Universal Charset Detector</shortdesc>\n\n  <description xml:lang=\"en\">\n      uchardet is an encoding detector library, which takes a sequence of bytes\n      in an unknown character encoding without any additional information, and\n      attempts to determine the encoding of the text. Returned encoding names\n      are iconv-compatible.\n\n      uchardet started as a C language binding of the original C++\n      implementation of the universal charset detection library by Mozilla. It\n      can now detect more charsets, and more reliably than the original\n      implementation.\n  </description>\n  <description xml:lang=\"fr\">\n      uchardet est une bibliothèque de détection de codage, prenant une séquence\n      d'octets en entrée, représentant un texte, et tente d'en déterminer le\n      codage. Le nom du codage retourné est compatible iconv.\n\n      uchardet était originellement un binding en C de l'implémentation\n      originelle en C++ par Mozilla. L'implémentation actuelle peut détecter\n      plus de codages de caractères que l'originale.\n  </description>\n\n  <homepage rdf:resource=\"https://www.freedesktop.org/wiki/Software/uchardet/\" />\n\n  <download-page rdf:resource=\"https://www.freedesktop.org/software/uchardet/releases/\" />\n\n  <bug-database rdf:resource=\"https://bugs.freedesktop.org/enter_bug.cgi?product=uchardet\" />\n\n  <programming-language>C</programming-language>\n  <programming-language>C++</programming-language>\n  <programming-language>Python</programming-language>\n\n  <maintainer>\n    <foaf:Person>\n      <foaf:name>Jehan</foaf:name>\n      <gnome:userid>jehanp</gnome:userid>\n    </foaf:Person>\n  </maintainer>\n\n<!-- TODO: generate MAINTAINERS from this file -->\n\n</Project>\n"
  },
  {
    "path": "third_party/uchardet/uchardet/uchardet.pc.in",
    "content": "libdir=@CMAKE_INSTALL_FULL_LIBDIR@\nincludedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@\n\nName: uchardet\nDescription: An encoding detector library ported from Mozilla\nVersion: @UCHARDET_VERSION@\nRequires:\nLibs: -L${libdir} -luchardet\nLibs.private: -lstdc++\nCflags: -I${includedir}/uchardet\n"
  },
  {
    "path": "third_party/uchardet/version.txt",
    "content": "2018.09.27"
  },
  {
    "path": "vcpkg.json",
    "content": "{\n  \"dependencies\": [\n    \"icu\",\n    \"nlohmann-json\",\n    \"gtest\",\n    \"fmt\",\n    {\n\t\t\"name\": \"imgui\",\n\t\t\"features\": [\n\t\t\t\"glfw-binding\",\n\t\t\t\"win32-binding\",\n\t\t\t\"opengl3-binding\",\n\t\t\t\"freetype\",\n\t\t\t\"wchar32\"\n\t\t]\n\t},\n\t\"spdlog\",\n\t\"bshoshany-thread-pool\",\n\t\"boost-thread\"\n  ],\n  \"builtin-baseline\": \"9b5cb8e554487f3edb5d50b80188883846f81e14\"\n}"
  }
]